Commit 7f57f1dd authored by liyuanhong's avatar liyuanhong

修改了总里程不对的问题

parent 33c4c36b
{"time": {"dateTime": "2020-04-20 15:57:07", "date": "2020-04-20", "time": "15:57:07"}, "curDayTravel": {"todayTotalMilleage": 686578, "todayTotalOil": 2422, "todayTotalTime": 1153, "theMilleage": 760393, "theOil": 2818, "theTime": 1333}, "travelData": {"totalMilleage": 930102, "totalOil": 3343, "totalTime": 1654}}
\ No newline at end of file
{"time": {"dateTime": "2020-04-21 09:49:19", "date": "2020-04-21", "time": "09:49:19"}, "curDayTravel": {"todayTotalMilleage": 10758, "todayTotalOil": 210, "todayTotalTime": 105, "theMilleage": 10758, "theOil": 210, "theTime": 105}, "travelData": {"totalMilleage": 10758, "totalOil": 210, "totalTime": 105}}
\ No newline at end of file
......@@ -177,7 +177,8 @@ class AutoCarService():
self.carDataObj.setTodayTotalMilleage(self.carData["curDayTravel"]["todayTotalMilleage"] + self.OBDdata["totailMileage"] - self.OBDdataOri["totailMileage"])
self.carDataObj.setTheMilleage(self.carData["curDayTravel"]["theMilleage"] + self.OBDdata["totailMileage"] -self.OBDdataOri["totailMileage"])
self.carDataObj.setTotalMilleage(self.carData["travelData"]["totalMilleage"] + self.OBDdata["totailMileage"] -self.OBDdataOri["totailMileage"])
self.OBDdataOri["totailMilleage"] = self.OBDdata["totailMileage"]
temp = self.OBDdata["totailMileage"]
self.OBDdataOri["totailMileage"] = temp
self.carDataObj.setTodayTodayTotalOil(self.carData["curDayTravel"]["todayTotalOil"] + self.OBDdata["totalOilExpen"] - self.OBDdataOri["totalOilExpen"])
self.carDataObj.setTheOil(self.carData["curDayTravel"]["theOil"] + self.OBDdata["totalOilExpen"] - self.OBDdataOri["totalOilExpen"])
self.carDataObj.setTotalOil(self.carData["travelData"]["totalOil"] + self.OBDdata["totalOilExpen"] - self.OBDdataOri["totalOilExpen"])
......@@ -432,6 +433,13 @@ class AutoCarService():
with open(path, "w", encoding='utf-8') as fi:
fi.write(data)
#临时定义的一个测试函数
def testOpenfile(self):
with open("data/protocolTools/carData/" + self.carId + ".json", "r", encoding="utf-8") as fi:
content = fi.read()
conJson = json.loads(content)
return conJson
########################################################
......
[2020-04-20 18:02:05] 建立了连接
[2020-04-20 18:02:05] 进行了登录操作
[2020-04-20 18:02:05] 发送了版本信息
[2020-04-20 18:02:06] 当前设置了GPS轨迹:1_sample(短).json
[2020-04-20 18:02:06] 发送了点火事件
[2020-04-20 18:02:08] 纬度:29.569133 经度:106.586571
[2020-04-20 18:02:09] 纬度:29.569215 经度:106.586935
[2020-04-20 18:02:10] 纬度:29.569215 经度:106.587114
[2020-04-20 18:02:11] 纬度:29.569231 经度:106.587424
[2020-04-20 18:02:12] 纬度:29.569278 经度:106.587685
[2020-04-20 18:02:13] 纬度:29.569298 经度:106.587981
[2020-04-20 18:02:14] 纬度:29.569341 经度:106.588098
[2020-04-20 18:02:15] 纬度:29.569392 经度:106.588287
[2020-04-20 18:02:17] 纬度:29.569439 经度:106.588435
[2020-04-20 18:02:18] 纬度:29.569506 经度:106.588565
[2020-04-20 18:02:19] 纬度:29.569565 经度:106.588646
[2020-04-20 18:02:20] 纬度:29.569651 经度:106.588763
[2020-04-20 18:02:21] 纬度:29.569745 经度:106.588884
[2020-04-20 18:02:22] 纬度:29.569832 经度:106.589073
[2020-04-20 18:02:23] 纬度:29.569977 经度:106.589374
[2020-04-20 18:02:24] 纬度:29.570114 经度:106.589688
[2020-04-20 18:02:25] 纬度:29.570228 经度:106.589993
[2020-04-20 18:02:27] 纬度:29.570271 经度:106.590146
[2020-04-20 18:02:28] 纬度:29.570291 经度:106.590357
[2020-04-20 18:02:29] 纬度:29.570264 经度:106.590573
[2020-04-20 18:02:30] 纬度:29.570248 经度:106.590802
[2020-04-20 18:02:31] 纬度:29.570205 经度:106.59095
[2020-04-20 18:02:32] 纬度:29.570256 经度:106.59108
[2020-04-20 18:02:33] 纬度:29.570421 经度:106.591273
[2020-04-20 18:02:34] 纬度:29.570578 经度:106.591507
[2020-04-20 18:02:35] 纬度:29.570703 经度:106.591673
[2020-04-20 18:02:37] 纬度:29.570774 经度:106.591772
[2020-04-20 18:02:38] 纬度:29.570943 经度:106.591974
[2020-04-20 18:02:39] 纬度:29.57108 经度:106.592145
[2020-04-20 18:02:40] 纬度:29.571261 经度:106.592342
[2020-04-20 18:02:41] 纬度:29.571332 经度:106.592383
[2020-04-20 18:02:42] 纬度:29.571493 经度:106.592527
[2020-04-20 18:02:43] 纬度:29.571642 经度:106.592679
[2020-04-20 18:02:44] 纬度:29.571748 经度:106.592765
[2020-04-20 18:02:45] 纬度:29.571834 经度:106.592877
[2020-04-20 18:02:47] 纬度:29.571901 经度:106.593007
[2020-04-20 18:02:48] 纬度:29.571936 经度:106.593182
[2020-04-20 18:02:49] 纬度:29.571936 经度:106.593308
[2020-04-20 18:02:50] 纬度:29.571874 经度:106.593407
[2020-04-20 18:02:51] 纬度:29.571815 经度:106.593591
[2020-04-20 18:02:52] 纬度:29.571795 经度:106.593784
[2020-04-20 18:02:53] 纬度:29.571862 经度:106.593847
[2020-04-20 18:02:54] 发送了熄火事件:
[2020-04-20 18:02:54] 执行了停止行驶服务
[2020-04-20 18:02:54] gps轨迹跑完,自动停止行驶!
------------------------------------------------------------------------
[2020-04-20 18:02:54] 请稍后120秒,正在切换轨迹行驶...
[2020-04-20 18:04:54] 本次车机模拟程序跑完(间隔时间产生的时间用完)........
[2020-04-21 10:51:16] 建立了连接
[2020-04-21 10:51:16] 进行了登录操作
[2020-04-21 10:51:17] 发送了版本信息
[2020-04-21 10:51:17] 当前设置了GPS轨迹:1_sample(短).json
[2020-04-21 10:51:18] 发送了点火事件
[2020-04-21 10:51:20] 纬度:29.569133 经度:106.586571
[2020-04-21 10:51:21] 纬度:29.569215 经度:106.586935
[2020-04-21 10:51:22] 纬度:29.569215 经度:106.587114
[2020-04-21 10:51:23] 纬度:29.569231 经度:106.587424
[2020-04-21 10:51:24] 纬度:29.569278 经度:106.587685
......@@ -8,10 +8,10 @@ def startSimulaterService():
autoCarObj.setHost("10.100.12.32") # 设置主机地址
autoCarObj.setPort(9008) # 设置端口号
autoCarObj.setCarId("M202003060520") #设置车机号
autoCarObj.setSendDur(5) # 设置发送消息的间隔时间
autoCarObj.setSendDur(1) # 设置发送消息的间隔时间
autoCarObj.setTimeout(30) # 设置socket超时时间
autoCarObj.setChangeGPSLineTime(1 * 10 * 60) # 设置跑完一条轨迹后,进入下一条轨迹的时间(请设置至少大于4分钟的时间)
autoCarObj.setServiceTime(12 * 60 * 60) # 设置整个服务的持续时间
autoCarObj.setChangeGPSLineTime(1 * 2 * 60) # 设置跑完一条轨迹后,进入下一条轨迹的时间(请设置至少大于4分钟的时间)
autoCarObj.setServiceTime(1 * 4 * 60) # 设置整个服务的持续时间
autoCarObj.setOilExpend(10) # 设置1L 油跑多少公里
autoCarObj.setSpeed(80) #设置车速,每小时多少公里
......
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