Commit 0add8537 authored by liyuanhong's avatar liyuanhong

车安优模拟器仪表里程渝总里程保持一致

parent 4cdf08f0
......@@ -332,9 +332,10 @@ class MessageSimulaterService():
self.OBDdata["extraInfo"]["EB"]["6709"] = self.OBDdata["extraInfo"]["EB"]["6709"] + self.sendDur # 总运行时间
plusMilleage = plusMilleage + int(self.sendDur * (speed * 1000 / 3600))
plusMilleage2 = int(self.sendDur * (speed * 1000 / 3600))
self.OBDdata["extraInfo"]["01"]["extra_01"] = self.OBDdata["extraInfo"]["01"]["extra_01"] + int(plusMilleage / 100) # 总里程
# OBD 累计里程,如果有该字段,则里程的计算方式使用该字段,如果没有,里程计算方式使用的是总里程字段
self.OBDdata["extraInfo"]["EB"]["670b"] = self.OBDdata["extraInfo"]["EB"]["670b"] + int(plusMilleage2)
self.OBDdata["extraInfo"]["01"]["extra_01"] = self.OBDdata["extraInfo"]["01"]["extra_01"] + int(plusMilleage / 100) # 总里程(附加信息)
# OBD 累计里程,如果有该字段,则里程的计算方式使用该字段,如果没有,里程计算方式使用的是附加信息里得到总里程字段
self.OBDdata["extraInfo"]["EB"]["670b"] = self.OBDdata["extraInfo"]["EB"]["670b"] + int(plusMilleage2) # 总里程(OBD信息,默认使用)
self.OBDdata["extraInfo"]["EB"]["6708"] = int((self.OBDdata["extraInfo"]["EB"]["670b"] + int(plusMilleage2)) / 1000) # 仪表里程
plusMilleage = plusMilleage - int(plusMilleage / 100) * 100
obdObj = Location_msg()
obdMsg = obdObj.generateMsg_GUI(self.OBDdata)
......@@ -396,8 +397,9 @@ class MessageSimulaterService():
plusMilleage = plusMilleage + int(self.sendDur * (speed * 1000 / 3600))
plusMilleage2 = int(self.sendDur * (speed * 1000 / 3600))
self.OBDdata["extraInfo"]["01"]["extra_01"] = self.OBDdata["extraInfo"]["01"]["extra_01"] + int(plusMilleage / 100) # 总里程
# OBD 累计里程,如果有该字段,则里程的计算方式使用该字段,如果没有,里程计算方式使用的是总里程字段
self.OBDdata["extraInfo"]["EB"]["670b"] = self.OBDdata["extraInfo"]["EB"]["670b"] + int(plusMilleage2)
# OBD 累计里程,如果有该字段,则里程的计算方式使用该字段,如果没有,里程计算方式使用的是附加信息里得到总里程字段
self.OBDdata["extraInfo"]["EB"]["670b"] = self.OBDdata["extraInfo"]["EB"]["670b"] + int(plusMilleage2) # 总里程(OBD信息,默认使用)
self.OBDdata["extraInfo"]["EB"]["6708"] = int((self.OBDdata["extraInfo"]["EB"]["670b"] + int(plusMilleage2)) / 1000) # 仪表里程
plusMilleage = plusMilleage - int(plusMilleage / 100) * 100
obdObj = Location_msg()
obdMsg = obdObj.generateMsg_GUI(self.OBDdata)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment