9p fix#19
This commit is contained in:
parent
04f780ae54
commit
a2e6f2f011
@ -15,7 +15,10 @@ if __name__ == "__main__":
|
|||||||
if len (sys.argv) < 2:
|
if len (sys.argv) < 2:
|
||||||
print "Usage : convert_db.py [path/to/GenAppli]"
|
print "Usage : convert_db.py [path/to/GenAppli]"
|
||||||
exit ()
|
exit ()
|
||||||
|
|
||||||
|
if not os.path.exists('./cache'):
|
||||||
|
os.makedirs('./cache')
|
||||||
|
|
||||||
inputpath = sys.argv[1]
|
inputpath = sys.argv[1]
|
||||||
ecudir = os.path.join (inputpath, "EcuRenault")
|
ecudir = os.path.join (inputpath, "EcuRenault")
|
||||||
vehicledir = os.path.join (inputpath, "Vehicles")
|
vehicledir = os.path.join (inputpath, "Vehicles")
|
||||||
|
@ -929,7 +929,7 @@ class DDTLauncher():
|
|||||||
''' save responces from all 21xx, 22xxxx commands '''
|
''' save responces from all 21xx, 22xxxx commands '''
|
||||||
|
|
||||||
self.pdlg = tk.Toplevel()
|
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.geometry("256x100")
|
||||||
self.pdlg.title("Saving dump")
|
self.pdlg.title("Saving dump")
|
||||||
self.pdlg.configure(background="#d9d9d9")
|
self.pdlg.configure(background="#d9d9d9")
|
||||||
@ -1135,7 +1135,7 @@ class DDTLauncher():
|
|||||||
return
|
return
|
||||||
|
|
||||||
self.ecudlg = tk.Toplevel()
|
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")
|
#ecudlg.geometry("256x256")
|
||||||
self.ecudlg.title("Ecu settings")
|
self.ecudlg.title("Ecu settings")
|
||||||
self.ecudlg.configure(background="#d9d9d9")
|
self.ecudlg.configure(background="#d9d9d9")
|
||||||
|
@ -183,7 +183,7 @@ class DDTScreen (tk.Frame):
|
|||||||
else:
|
else:
|
||||||
self.root = tk.Tk()
|
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.overrideredirect(True)
|
||||||
self.root.geometry ("1024x768")
|
self.root.geometry ("1024x768")
|
||||||
tk.Frame.__init__ (self, self.root)
|
tk.Frame.__init__ (self, self.root)
|
||||||
|
@ -164,7 +164,8 @@ class Port:
|
|||||||
self.hdr.setblocking (True)
|
self.hdr.setblocking (True)
|
||||||
except:
|
except:
|
||||||
print " \n\nERROR: Can not connect to WiFi ELM\n\n"
|
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':
|
elif mod_globals.os == 'android' and portName == 'bt':
|
||||||
self.portType = 2
|
self.portType = 2
|
||||||
self.droid = android.Android ()
|
self.droid = android.Android ()
|
||||||
@ -511,7 +512,7 @@ class ELM:
|
|||||||
error_can = 0
|
error_can = 0
|
||||||
|
|
||||||
response_time = 0
|
response_time = 0
|
||||||
|
|
||||||
buff = ""
|
buff = ""
|
||||||
currentprotocol = ""
|
currentprotocol = ""
|
||||||
currentsubprotocol = ""
|
currentsubprotocol = ""
|
||||||
@ -1499,7 +1500,13 @@ class ELM:
|
|||||||
Fn = len (raw_command) # Number of frames
|
Fn = len (raw_command) # Number of frames
|
||||||
|
|
||||||
if Fn > 1 or len(raw_command[0])>15: # set elm timeout to 300ms for first response
|
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:
|
while Fc < Fn:
|
||||||
|
|
||||||
@ -1723,13 +1730,15 @@ class ELM:
|
|||||||
self.error_rx += 1
|
self.error_rx += 1
|
||||||
if "CAN ERROR" in self.buff:
|
if "CAN ERROR" in self.buff:
|
||||||
self.error_can += 1
|
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
|
# save responce to log
|
||||||
if self.lf != 0:
|
if self.lf != 0:
|
||||||
# tm = str(time.time())
|
# 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 ()
|
self.lf.flush ()
|
||||||
|
|
||||||
return self.buff
|
return self.buff
|
||||||
|
Loading…
x
Reference in New Issue
Block a user