Commit 1534c01e authored by liyuanhong's avatar liyuanhong

修改了M500模拟器疲劳驾驶报错的问题

parent 02214250
{"time": {"dateTime": "2020-06-16 15:57:51", "date": "2020-06-16", "time": "15:57:51"}, "curDayTravel": {"todayTotalMilleage": 581, "todayTotalOil": 56, "todayTotalTime": 35, "theMilleage": 581, "theOil": 56, "theTime": 35}, "travelData": {"totalMilleage": 7602, "totalOil": 657, "totalTime": 463}, "event": {"threeRapid": {"totalRapidlyAccelerate": 6, "totalSharpSlowdown": 5, "totalSharpTurn": 0}}} {"time": {"dateTime": "2020-06-17 11:04:45", "date": "2020-06-17", "time": "11:04:45"}, "curDayTravel": {"todayTotalMilleage": 30521, "todayTotalOil": 2966, "todayTotalTime": 1837, "theMilleage": 1584, "theOil": 144, "theTime": 96}, "travelData": {"totalMilleage": 38123, "totalOil": 3623, "totalTime": 2300}, "event": {"threeRapid": {"totalRapidlyAccelerate": 11, "totalSharpSlowdown": 10, "totalSharpTurn": 0}}}
\ No newline at end of file \ No newline at end of file
{"time": {"dateTime": "2020-06-16 09:52:28", "date": "2020-06-16", "time": "09:52:28"}, "curDayTravel": {"todayTotalMilleage": 15591, "todayTotalOil": 1431, "todayTotalTime": 944, "theMilleage": 2241, "theOil": 216, "theTime": 135}, "travelData": {"totalMilleage": 92297, "totalOil": 8325, "totalTime": 5669}} {"time": {"dateTime": "2020-06-17 09:52:48", "date": "2020-06-17", "time": "09:52:48"}, "curDayTravel": {"todayTotalMilleage": 16423, "todayTotalOil": 1588, "todayTotalTime": 989, "theMilleage": 2129, "theOil": 194, "theTime": 129}, "travelData": {"totalMilleage": 108720, "totalOil": 9913, "totalTime": 6658}}
\ No newline at end of file \ No newline at end of file
{"time": {"dateTime": "2020-06-16 13:13:58", "date": "2020-06-16", "time": "13:13:58"}, "curDayTravel": {"todayTotalMilleage": 11869, "todayTotalOil": 1144, "todayTotalTime": 715, "theMilleage": 3403, "theOil": 328, "theTime": 205}, "travelData": {"totalMilleage": 391566, "totalOil": 36681, "totalTime": 23315}, "event": {"threeRapid": {"totalRapidlyAccelerate": 24, "totalSharpSlowdown": 20, "totalSharpTurn": 21}}} {"time": {"dateTime": "2020-06-18 09:52:18", "date": "2020-06-18", "time": "09:52:18"}, "curDayTravel": {"todayTotalMilleage": 20967, "todayTotalOil": 1842, "todayTotalTime": 1275, "theMilleage": 996, "theOil": 96, "theTime": 60}, "travelData": {"totalMilleage": 448537, "totalOil": 41857, "totalTime": 26768}, "event": {"threeRapid": {"totalRapidlyAccelerate": 33, "totalSharpSlowdown": 23, "totalSharpTurn": 26}}}
\ No newline at end of file \ No newline at end of file
...@@ -300,7 +300,7 @@ class EventReport_protocol(ProtocolBase): ...@@ -300,7 +300,7 @@ class EventReport_protocol(ProtocolBase):
data = data + "0027" + self.int2hexStringByBytes(int((len(theData) / 2)), 2) + theData data = data + "0027" + self.int2hexStringByBytes(int((len(theData) / 2)), 2) + theData
if ("0028" in eventData.keys()): #疲劳驾驶告警 if ("0028" in eventData.keys()): #疲劳驾驶告警
eventObj = EventClass() eventObj = EventClass()
theData = eventObj.collisionAlarmExtraInfo(int(eventData["0028"]["alarmType"]), theData = eventObj.tiredDrivingAlarm(int(eventData["0028"]["alarmType"]),
int(eventData["0028"]["durTime"]),) int(eventData["0028"]["durTime"]),)
data = data + "0028" + self.int2hexStringByBytes(int((len(theData) / 2)), 2) + theData data = data + "0028" + self.int2hexStringByBytes(int((len(theData) / 2)), 2) + theData
if ("0036" in eventData.keys()): #低档高速报警 if ("0036" in eventData.keys()): #低档高速报警
......
...@@ -1041,7 +1041,7 @@ def sendOverSpeedAlarmEvent(): ...@@ -1041,7 +1041,7 @@ def sendOverSpeedAlarmEvent():
obj = EventReport_protocol(data=jdata) obj = EventReport_protocol(data=jdata)
gpsData = service.genGPSData2() gpsData = service.genGPSData2()
obj.setGPSPkg(gpsData) obj.setGPSPkg(gpsData)
obj.setEventType("004A") obj.setEventType("0027")
msg = obj.generateEventMsg() msg = obj.generateEventMsg()
service.serviceSendMsg(msg, "超速告警事件") service.serviceSendMsg(msg, "超速告警事件")
service.setSn(service.getSn() + 1) service.setSn(service.getSn() + 1)
...@@ -1088,7 +1088,7 @@ def sendTiredDrivingAlarmEvent(): ...@@ -1088,7 +1088,7 @@ def sendTiredDrivingAlarmEvent():
obj = EventReport_protocol(data=jdata) obj = EventReport_protocol(data=jdata)
gpsData = service.genGPSData2() gpsData = service.genGPSData2()
obj.setGPSPkg(gpsData) obj.setGPSPkg(gpsData)
obj.setEventType("004A") obj.setEventType("0028")
msg = obj.generateEventMsg() msg = obj.generateEventMsg()
service.serviceSendMsg(msg, "疲劳驾驶告警事件") service.serviceSendMsg(msg, "疲劳驾驶告警事件")
service.setSn(service.getSn() + 1) service.setSn(service.getSn() + 1)
......
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