9p fix#19

This commit is contained in:
shrlnm 2019-05-13 20:52:48 +03:00
parent 04f780ae54
commit a2e6f2f011
4 changed files with 23 additions and 11 deletions

View File

@ -16,6 +16,9 @@ if __name__ == "__main__":
print "Usage : convert_db.py [path/to/GenAppli]"
exit ()
if not os.path.exists('./cache'):
os.makedirs('./cache')
inputpath = sys.argv[1]
ecudir = os.path.join (inputpath, "EcuRenault")
vehicledir = os.path.join (inputpath, "Vehicles")

View File

@ -929,7 +929,7 @@ class DDTLauncher():
''' save responces from all 21xx, 22xxxx commands '''
self.pdlg = tk.Toplevel()
self.pdlg.option_add ('*Dialog.msg.font', 'Courier New 12')
self.pdlg.option_add ('*Dialog.msg.font', 'Courier\ New 12')
self.pdlg.geometry("256x100")
self.pdlg.title("Saving dump")
self.pdlg.configure(background="#d9d9d9")
@ -1135,7 +1135,7 @@ class DDTLauncher():
return
self.ecudlg = tk.Toplevel()
self.ecudlg.option_add ('*Dialog.msg.font', 'Courier New 12')
self.ecudlg.option_add ('*Dialog.msg.font', 'Courier\ New 12')
#ecudlg.geometry("256x256")
self.ecudlg.title("Ecu settings")
self.ecudlg.configure(background="#d9d9d9")

View File

@ -183,7 +183,7 @@ class DDTScreen (tk.Frame):
else:
self.root = tk.Tk()
self.root.option_add ('*Dialog.msg.font', 'Courier New 12')
self.root.option_add ('*Dialog.msg.font', 'Courier\ New 12')
# self.root.overrideredirect(True)
self.root.geometry ("1024x768")
tk.Frame.__init__ (self, self.root)

View File

@ -164,7 +164,8 @@ class Port:
self.hdr.setblocking (True)
except:
print " \n\nERROR: Can not connect to WiFi ELM\n\n"
pass
mod_globals.opt_demo = True
sys.exit()
elif mod_globals.os == 'android' and portName == 'bt':
self.portType = 2
self.droid = android.Android ()
@ -1499,7 +1500,13 @@ class ELM:
Fn = len (raw_command) # Number of frames
if Fn > 1 or len(raw_command[0])>15: # set elm timeout to 300ms for first response
self.send_raw('ATST4B')
# corrected timeout RT * 1000ms / 4ms / 2 (on a half of RT)
corr_tout = int( 75 - (self.response_time * 125) )
if corr_tout > 0x20:
cmdTxt = 'ATST' + hex(corr_tout)[-2:].zfill(2)
self.send_raw(cmdTxt)
else: # it seems too long roundtrip
self.send_raw('ATST20')
while Fc < Fn:
@ -1724,12 +1731,14 @@ class ELM:
if "CAN ERROR" in self.buff:
self.error_can += 1
self.response_time = ((self.response_time * 9) + (tc - tb)) / 10
roundtrip = tc - tb
self.response_time = ((self.response_time * 9) + roundtrip) / 10
# save responce to log
if self.lf != 0:
# tm = str(time.time())
self.lf.write ("<[" + str (round (tc - tb, 3)) + "]" + self.buff + "\n")
self.lf.write ("<[" + str (round (roundtrip, 3)) + "]" + self.buff + "\n")
self.lf.flush ()
return self.buff