Commit ea75492f authored by liyuanhong's avatar liyuanhong

M500模拟器修改了轨迹跑完熄火失败的bug2

parent cec2ac78
...@@ -536,9 +536,14 @@ class ProtocolSimulaterService(): ...@@ -536,9 +536,14 @@ class ProtocolSimulaterService():
return data return data
#根据当前所在GPS点,生成GPS消息体,不包含消息头 #根据当前所在GPS点,生成GPS消息体,不包含消息头
def genGPSData2(self): def genGPSData2(self):
gpsLineIndex = self.gpsLineIndex
if gpsLineIndex >= len(self.gpsLine):
gpsLineIndex = gpsLineIndex - 1
gpsObj = GPSReport_protocol(DEV_ID=self.carId,WATER_CODE=self.sn) gpsObj = GPSReport_protocol(DEV_ID=self.carId,WATER_CODE=self.sn)
gpsObj.setLatitude(self.gpsLine[self.gpsLineIndex]["lat"]) # gpsObj.setLatitude(self.gpsLine[self.gpsLineIndex]["lat"])
gpsObj.setLongitude(self.gpsLine[self.gpsLineIndex]["lng"]) # gpsObj.setLongitude(self.gpsLine[self.gpsLineIndex]["lng"])
gpsObj.setLatitude(self.gpsLine[gpsLineIndex]["lat"])
gpsObj.setLongitude(self.gpsLine[gpsLineIndex]["lng"])
if self.lngLatIsOk == 0: if self.lngLatIsOk == 0:
gpsObj.setLatitude(0) gpsObj.setLatitude(0)
gpsObj.setLongitude(0) gpsObj.setLongitude(0)
......
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