Commit 9f8b5c4e authored by liyuanhong's avatar liyuanhong

车安优图形模拟器增加了反向功能

parent 0add8537
[socket]
host = 172.19.7.13
port = 49008
host = 114.116.205.211
port = 8003
......@@ -559,7 +559,10 @@ class MessageSimulaterService():
with open("data/messageTools/GPSLines/" + fileName,"r",encoding="utf-8") as fi:
content = fi.read()
conJson = json.loads(content)
self.gpsLine = conJson["GPSLine"]
if (int(self.data["travelData"]["travelDirection"]) == 0):
self.gpsLine = conJson["GPSLine"]
else:
self.gpsLine = conJson["GPSLine"][::-1] # 反转gps数组
########################################################
#启动接收消息的服务
......
......@@ -127,6 +127,10 @@
<button id="clear_B" type="button" class="btn btn-warning" onclick="clearlog()">清空日志</button>
<span style="margin-left:20px;"><label>当前状态:</label><input id="curStatus" value="断网" disabled="disabled" class="form-control" style="font-weight: bold;width:85px;color:red;border-width: 1px; border-style: solid; border-color: darkgray; border-radius: 10px;"></span>
<span style="width:80px;padding-left:10px;"><label style="width:70px"><input type="checkbox" id="ignition" onclick="isLogShow(this)"/>隐藏日志</label> </span>
<span style="border-width:1px;border-style:solid;border-color:darkgray;border-radius:10px;padding:1px 10px;">
<label><input name="travelDirection" type="radio" value="0" checked="checked"/>正向</label>
<label style="margin-left:10px;"><input name="travelDirection" type="radio" value="1"/>反向</label>
</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>
......@@ -445,12 +449,14 @@ function getPageData(){
var votage = 120
var surplusOil = 505
var engineSpeed = 3000
var travelDirection = $("input[name='travelDirection']:checked").val()
data["travelData"]["carSpeed"] = carSpeed
data["travelData"]["oilExpend"] = oilExpend
data["travelData"]["travelLoop"] = travelLoop
data["travelData"]["votage"] = votage
data["travelData"]["surplusOil"] = surplusOil
data["travelData"]["engineSpeed"] = engineSpeed
data["travelData"]["travelDirection"] = travelDirection //控制正向还是反向行驶
return data;
}
//控制登录数据区域的显示与隐藏
......
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