Commit 1e08c824 authored by liyuanhong's avatar liyuanhong

M500模拟器增加了时间差功能

parent 80d037dc
{"time": {"dateTime": "2020-06-18 09:52:18", "date": "2020-06-18", "time": "09:52:18"}, "curDayTravel": {"todayTotalMilleage": 24370, "todayTotalOil": 2170, "todayTotalTime": 1480, "theMilleage": 415, "theOil": 40, "theTime": 25}, "travelData": {"totalMilleage": 451940, "totalOil": 42185, "totalTime": 26973}, "event": {"threeRapid": {"totalRapidlyAccelerate": 33, "totalSharpSlowdown": 23, "totalSharpTurn": 26}}}
\ No newline at end of file
{"time": {"dateTime": "2020-06-18 09:52:18", "date": "2020-06-18", "time": "09:52:18"}, "curDayTravel": {"todayTotalMilleage": 25532, "todayTotalOil": 2282, "todayTotalTime": 1550, "theMilleage": 1162, "theOil": 112, "theTime": 70}, "travelData": {"totalMilleage": 453102, "totalOil": 42297, "totalTime": 27043}, "event": {"threeRapid": {"totalRapidlyAccelerate": 33, "totalSharpSlowdown": 23, "totalSharpTurn": 26}}}
\ No newline at end of file
......@@ -480,7 +480,7 @@ class ProtocolSimulaterService():
elif self.GPSValid == 0:
gpsObj.setGpsValid(0)
gpsObj.setDirectionAngle(self.getDirAngle())
timeS = int(time.time()) - 8 * 3600
timeS = int(time.time()) - 8 * 3600 + int(self.data["timeDif"])
timeArray = time.localtime(timeS)
UTCTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
gpsObj.setUTCTime(UTCTime)
......@@ -500,7 +500,7 @@ class ProtocolSimulaterService():
elif self.GPSValid == 0:
gpsObj.setGpsValid(0)
gpsObj.setDirectionAngle(self.getDirAngle())
timeS = int(time.time()) - 8 * 3600
timeS = int(time.time()) - 8 * 3600 + int(self.data["timeDif"])
timeArray = time.localtime(timeS)
UTCTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
gpsObj.setUTCTime(UTCTime)
......@@ -520,7 +520,7 @@ class ProtocolSimulaterService():
elif self.GPSValid == 0:
gpsObj.setGpsValid(0)
gpsObj.setDirectionAngle(self.getDirAngle())
timeS = int(time.time()) - 8 * 3600
timeS = int(time.time()) - 8 * 3600 + int(self.data["timeDif"])
timeArray = time.localtime(timeS)
UTCTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
gpsObj.setUTCTime(UTCTime)
......@@ -532,7 +532,7 @@ class ProtocolSimulaterService():
def genOBDMsg(self,fireStatus=1,ACCStatus=0,engineSpeed=300,speed=0,meterMileage=6000, \
totailMileage=600,totalOilExpend=30,totalRunTime=10):
OBDObj = OBDReport_CAN_protocol(DEV_ID=self.carId,WATER_CODE=self.sn)
timeS = int(time.time()) - 8 * 3600
timeS = int(time.time()) - 8 * 3600 + int(self.data["timeDif"])
timeArray = time.localtime(timeS)
UTCTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
OBDObj.setInfoTime(UTCTime)
......
......@@ -46,6 +46,7 @@
<span style="display:none;"><label>消息流水号:</label><input id="WATER_CODE" style="width:60px;" type="text" class="form-control" value="1"></span>
<span><label>上报间隔(秒):</label><input id="durTime" style="width:60px;" type="text" class="form-control" value="5"></span>
<span><label>设置超时时间:</label><input style="width:80px;" id="timeout" type="text" class="form-control" value="36000"></span>
<span><label title="可填入正负数,表示发送的报文时间与当前的时间差距">报文时间差(秒):</label><input style="width:80px;" id="timeDif" type="text" class="form-control" value="0"></span>
</div>
<div style="display: block; width: 100%; border-width: 1px; border-style: solid; border-color: darkgray; border-radius: 10px; padding: 2px; margin-top: 5px;">
<h5><b>多人在线状态面板:</b></h5>
......@@ -214,10 +215,12 @@ function getPageData(){
var WATER_CODE = $("#WATER_CODE").val()
var durTime = $("#durTime").val()
var timeout = $("#timeout").val()
var timeDif = $("#timeDif").val()
data["carId"] = carId
data["WATER_CODE"] = WATER_CODE
data["durTime"] = durTime
data["timeout"] = timeout
data["timeDif"] = timeDif
//会话session数据
data["session"] = {}
var sessionId = $("#curSession").val()
......
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