Commit a3533c2f authored by liyuanhong's avatar liyuanhong

地理位置页面与后端对接完成

parent 4ccba252
This diff is collapsed.
...@@ -31,6 +31,21 @@ class CarSafeStatusInfo(MessageBase): ...@@ -31,6 +31,21 @@ class CarSafeStatusInfo(MessageBase):
data = data + statusCode + securityStatus + doorStatus + lockStatus + windowStatus + lightStatus + onoffStatusA + onoffStatusB + retain1 + retain2 + retain3 data = data + statusCode + securityStatus + doorStatus + lockStatus + windowStatus + lightStatus + onoffStatusA + onoffStatusB + retain1 + retain2 + retain3
return data return data
def generateSecurityStatusData_GUI(self,data):
dataHex = ""
statusCode = data["statusCode"] #状态掩码
securityStatus = self.int2hexStringByBytes(int(data["securityStatus"])) #安全状态
doorStatus = self.int2hexStringByBytes(int(data["doorStatus"])) #门状态
lockStatus = self.int2hexStringByBytes(int(data["lockStatus"])) #锁状态
windowStatus = self.int2hexStringByBytes(int(data["windowStatus"])) #窗户状态
lightStatus = self.int2hexStringByBytes(int(data["lightStatus"])) #灯光状态
onoffStatusA = self.int2hexStringByBytes(int(data["onoffStatusA"])) #开关状态A
onoffStatusB = self.int2hexStringByBytes(int(data["onoffStatusB"])) #开关状态B
retain1 = "00" #预留
retain2 = "00" #预留
retain3 = "00" # 预留
dataHex = dataHex + statusCode + securityStatus + doorStatus + lockStatus + windowStatus + lightStatus + onoffStatusA + onoffStatusB + retain1 + retain2 + retain3
return dataHex
#创建安防状态数据,数据随机产生 #创建安防状态数据,数据随机产生
def generateSecurityStatusData_random(self): def generateSecurityStatusData_random(self):
data = "" data = ""
......
...@@ -76,6 +76,67 @@ class SaloonCarOBD_data(MessageBase): ...@@ -76,6 +76,67 @@ class SaloonCarOBD_data(MessageBase):
data = data + backBrakeBlockAbrasion + brakeFluidLocation + engineOilLocation + tirePressureAlarm + coolingLiquidLocation data = data + backBrakeBlockAbrasion + brakeFluidLocation + engineOilLocation + tirePressureAlarm + coolingLiquidLocation
data = data + enduranceMileage data = data + enduranceMileage
return data return data
def generateSaloonCarOBDData_GUI(self,data):
dataHex = ""
#发动机转速 , 0 - 8000 rpm
engineSpeed = "60C0" + self.int2hexStringByBytes(2) + self.int2hexStringByBytes(int(data["engineSpeed"]),2)
#车速 , 0 - 240 Km/h
carSpeed = "60D0" + self.int2hexStringByBytes(1) + self.int2hexStringByBytes(int(data["carSpeed"]))
#剩余油量 ,剩余油量,单位 L 或%Bit15=0 百分比%,OBD 都为百分比Bit15=1 单位 L,显示值为上传值/10
surplusOil = "62f0" + self.int2hexStringByBytes(2) + self.int2hexStringByBytes(int(data["surplusOil"]))
#冷却液温度 ,-40.0℃ 到 +210℃,上传值减去 40
coolingLiquidTemperature = "6050" + self.int2hexStringByBytes(1) + self.int2hexStringByBytes(int(data["coolingLiquidTemperature"]))
#进气口温度 ,-40.0℃ 到 +210℃,上传值减去 40
airInletTemperature = "60F0" + self.int2hexStringByBytes(1) + self.int2hexStringByBytes(int(data["airInletTemperature"]))
#进气(岐管绝对)压力 , 0 - 250kpa
intakeManifoldPressure = "60B0" + self.int2hexStringByBytes(1) + self.int2hexStringByBytes(int(data["intakeManifoldPressure"]))
#大气压力 , 0 - 125kpa
atmosphericPressure = "6330" + self.int2hexStringByBytes(1) + self.int2hexStringByBytes(int(data["atmosphericPressure"]))
#环境温度 , -40.0℃ 到 +210℃,上传值减去 40
envTemperature = "6460" + self.int2hexStringByBytes(1) + self.int2hexStringByBytes(int(data["envTemperature"]))
#加速踏板位置 , 0% - 100%
acceleratorLocation = "6490" + self.int2hexStringByBytes(1) + self.int2hexStringByBytes(int(data["acceleratorLocation"]))
#燃油压力 , 0 - 500kpa
oilPressure = "60A0" + self.int2hexStringByBytes(2) + self.int2hexStringByBytes(int(data["oilPressure"]),2)
#故障码状态 , 发动机故障码状态
troubleCodeStatus = "6014" + self.int2hexStringByBytes(1) + self.int2hexStringByBytes(int(data["troubleCodeStatus"]))
#故障码个数
troubleCodeNum = "6010" + self.int2hexStringByBytes(1) + self.int2hexStringByBytes(int(data["troubleCodeNum"]))
#空气流量 , 0.1 实际值为上传值/10 0.1g/s
airFlow = "6100" + self.int2hexStringByBytes(2) + self.int2hexStringByBytes(int(data["airFlow"]),2)
#绝对气门位置
valveLocation = "6110" + self.int2hexStringByBytes(2) + self.int2hexStringByBytes(int(data["valveLocation"]),2)
#自发动机启动运行时间 sec
engineRunTime = "61F0" + self.int2hexStringByBytes(2) + self.int2hexStringByBytes(int(data["engineRunTime"]),2)
#故障行驶里程 , Km
troubleMileage = "6210" + self.int2hexStringByBytes(4) + self.int2hexStringByBytes(int(data["troubleMileage"]),4)
#计算负荷值
calculateLoadValue = "6040" + self.int2hexStringByBytes(1) + self.int2hexStringByBytes(int(data["calculateLoadValue"]))
#长期燃油修正(气缸列 1 和 3)
fuelTrim = "6070" + self.int2hexStringByBytes(2) + self.int2hexStringByBytes(int(data["fuelTrim"]),2)
#第一缸点火正时提前角 ,显示值为上传值-64
fireAngle = "60E0" + self.int2hexStringByBytes(2) + self.int2hexStringByBytes(int(data["fireAngle"]),2)
#前刹车片磨损 , 0 正常/否则,显示对应数据,单位:级
frontBrakeBlockAbrasion = "6701" + self.int2hexStringByBytes(1) + self.int2hexStringByBytes(int(data["frontBrakeBlockAbrasion"]))
#后刹车片磨损 , 0 正常/否则,显示对应数据,单位:级
backBrakeBlockAbrasion = "6702" + self.int2hexStringByBytes(1) + self.int2hexStringByBytes(int(data["backBrakeBlockAbrasion"]))
#制动液液位 , 0:不正 1:正常 其他:无法使用
brakeFluidLocation = "6703" + self.int2hexStringByBytes(1) + self.int2hexStringByBytes(int(data["brakeFluidLocation"]))
#机油液位 , 显示值为上传值/1000 单位 毫米
engineOilLocation = "6704" + self.int2hexStringByBytes(2) + self.int2hexStringByBytes(int(data["engineOilLocation"]),2)
#胎压报警 0:当前无警告 1:存在胎压失压 其他:不可用
tirePressureAlarm = "6705" + self.int2hexStringByBytes(2) + self.int2hexStringByBytes(int(data["tirePressureAlarm"]),2)
#冷却液液位 , 显示值为上传值-48
coolingLiquidLocation = "6706" + self.int2hexStringByBytes(2) + self.int2hexStringByBytes(int(data["coolingLiquidLocation"]),2)
#续航里程 0.1 km ; 显示值为上传值/10
enduranceMileage = "6707" + self.int2hexStringByBytes(4) + self.int2hexStringByBytes(int(data["enduranceMileage"]),4)
dataHex = dataHex + engineSpeed + carSpeed + surplusOil + coolingLiquidTemperature + airInletTemperature
dataHex = dataHex + intakeManifoldPressure + atmosphericPressure + envTemperature + acceleratorLocation + oilPressure
dataHex = dataHex + troubleCodeStatus + troubleCodeNum + airFlow + valveLocation + engineRunTime
dataHex = dataHex + troubleMileage + calculateLoadValue + fuelTrim + fireAngle + frontBrakeBlockAbrasion
dataHex = dataHex + backBrakeBlockAbrasion + brakeFluidLocation + engineOilLocation + tirePressureAlarm + coolingLiquidLocation
dataHex = dataHex + enduranceMileage
return dataHex
def generateSaloonCarOBDData_random(self): def generateSaloonCarOBDData_random(self):
data = "" data = ""
#发动机转速 , 0 - 8000 rpm #发动机转速 , 0 - 8000 rpm
......
...@@ -642,10 +642,10 @@ ...@@ -642,10 +642,10 @@
<li style="width:110px;"><label style="width:100px"><input type="checkbox" id="terminalPullOut" />终端拔出报警</label> </li> <li style="width:110px;"><label style="width:100px"><input type="checkbox" id="terminalPullOut" />终端拔出报警</label> </li>
<li style="width:110px;"><label style="width:100px"><input type="checkbox" id="terminalInsert" />终端插入报警</label> </li> <li style="width:110px;"><label style="width:100px"><input type="checkbox" id="terminalInsert" />终端插入报警</label> </li>
<li style="width:100px;"><label style="width:90px"><input type="checkbox" id="lowVoltage" />低电压报警</label> </li> <li style="width:100px;"><label style="width:90px"><input type="checkbox" id="lowVoltage" />低电压报警</label> </li>
<li style="width:110px;"><label style="width:100px"><input type="checkbox" id="idlingSpeedOver" />怠速过长报警</label> </li> <li style="width:110px;"><label style="width:100px"><input type="checkbox" id="idlingSpeedOver" onclick="alarmEventSelect(this)"/>怠速过长报警</label> </li>
<li style="width:80px;"><label style="width:70px"><input type="checkbox" id="overspeedAlarm_AE" />超速报警</label> </li> <li style="width:80px;"><label style="width:70px"><input type="checkbox" id="overspeedAlarm_AE" onclick="alarmEventSelect(this)"/>超速报警</label> </li>
<li style="width:110px;"><label style="width:100px"><input type="checkbox" id="fatigueDriving_AE" />疲劳驾驶报警</label> </li> <li style="width:110px;"><label style="width:100px"><input type="checkbox" id="fatigueDriving_AE" onclick="alarmEventSelect(this)"/>疲劳驾驶报警</label> </li>
<li style="width:80px;"><label style="width:70px"><input type="checkbox" id="waterTemperatureAlarm_AE" />水温报警</label> </li> <li style="width:80px;"><label style="width:70px"><input type="checkbox" id="waterTemperatureAlarm_AE" onclick="alarmEventSelect(this)"/>水温报警</label> </li>
<li style="width:140px;"><label style="width:130px"><input type="checkbox" id="highSpeedNeutralGear" />高速空档滑行报警</label> </li> <li style="width:140px;"><label style="width:130px"><input type="checkbox" id="highSpeedNeutralGear" />高速空档滑行报警</label> </li>
<li style="width:130px;"><label style="width:120px"><input type="checkbox" id="oilExpendNotSurport" />油耗不支持报警</label> </li> <li style="width:130px;"><label style="width:120px"><input type="checkbox" id="oilExpendNotSurport" />油耗不支持报警</label> </li>
<li style="width:140px;"><label style="width:130px"><input type="checkbox" id="OBDNotSurport" />OBD 不支持报警</label> </li> <li style="width:140px;"><label style="width:130px"><input type="checkbox" id="OBDNotSurport" />OBD 不支持报警</label> </li>
...@@ -660,7 +660,7 @@ ...@@ -660,7 +660,7 @@
<li style="width:100px;"><label style="width:90px"><input type="checkbox" id="rapidChangeLines" />急变道报警</label> </li> <li style="width:100px;"><label style="width:90px"><input type="checkbox" id="rapidChangeLines" />急变道报警</label> </li>
</ul> </ul>
</div> </div>
<div style="width:100%;border-width:1px;border-style:solid;border-radius:10px;padding:2px;margin-top:5px;"> <div id="alarm_idlingSpeedOver" style="display:none;width:100%;border-width:1px;border-style:solid;border-radius:10px;padding:2px;margin-top:5px;">
<label>怠速过长报警:</label> <label>怠速过长报警:</label>
<ul class="protocol_content" style="padding:0px;"> <ul class="protocol_content" style="padding:0px;">
<li><label>报警属性:</label><select style="width:150px;" id="alarmType" class="form-control"> <li><label>报警属性:</label><select style="width:150px;" id="alarmType" class="form-control">
...@@ -672,7 +672,7 @@ ...@@ -672,7 +672,7 @@
<li style="word-break:break-all;font-size:10px;"><label>怠速最低转速:</label><input id="idlingEngineMinSpeed" type="text" class="form-control" value="500"></li> <li style="word-break:break-all;font-size:10px;"><label>怠速最低转速:</label><input id="idlingEngineMinSpeed" type="text" class="form-control" value="500"></li>
</ul> </ul>
</div> </div>
<div style="width:100%;border-width:1px;border-style:solid;border-radius:10px;padding:2px;margin-top:5px;"> <div id="alarm_overspeedAlarm_AE" style="display:none;width:100%;border-width:1px;border-style:solid;border-radius:10px;padding:2px;margin-top:5px;">
<label>超速报警:</label> <label>超速报警:</label>
<ul class="protocol_content" style="padding:0px;"> <ul class="protocol_content" style="padding:0px;">
<li><label>报警属性:</label><select style="width:150px;" id="alarmType_cs" class="form-control"> <li><label>报警属性:</label><select style="width:150px;" id="alarmType_cs" class="form-control">
...@@ -684,7 +684,7 @@ ...@@ -684,7 +684,7 @@
<li style="word-break:break-all;font-size:10px;"><label>怠速最低转速:</label><input id="overspeedDistance" type="text" class="form-control" value="10000"></li> <li style="word-break:break-all;font-size:10px;"><label>怠速最低转速:</label><input id="overspeedDistance" type="text" class="form-control" value="10000"></li>
</ul> </ul>
</div> </div>
<div style="width:100%;border-width:1px;border-style:solid;border-radius:10px;padding:2px;margin-top:5px;"> <div id="alarm_fatigueDriving_AE" style="display:none;width:100%;border-width:1px;border-style:solid;border-radius:10px;padding:2px;margin-top:5px;">
<label>超速报警:</label> <label>超速报警:</label>
<ul class="protocol_content" style="padding:0px;"> <ul class="protocol_content" style="padding:0px;">
<li><label>疲劳驾驶报警:</label><select style="width:150px;" id="alarmType_pljs" class="form-control"> <li><label>疲劳驾驶报警:</label><select style="width:150px;" id="alarmType_pljs" class="form-control">
...@@ -693,7 +693,7 @@ ...@@ -693,7 +693,7 @@
<li style="word-break:break-all;font-size:10px;"><label>累计持续驾驶时间,秒:</label><input id="totalContinueDrivingTime" type="text" class="form-control" value="10000"></li> <li style="word-break:break-all;font-size:10px;"><label>累计持续驾驶时间,秒:</label><input id="totalContinueDrivingTime" type="text" class="form-control" value="10000"></li>
</ul> </ul>
</div> </div>
<div style="width:100%;border-width:1px;border-style:solid;border-radius:10px;padding:2px;margin-top:5px;"> <div id="alarm_waterTemperatureAlarm_AE" style="display:none;width:100%;border-width:1px;border-style:solid;border-radius:10px;padding:2px;margin-top:5px;">
<label>水温报警:</label> <label>水温报警:</label>
<ul class="protocol_content" style="padding:0px;"> <ul class="protocol_content" style="padding:0px;">
<li><label>疲劳驾驶报警:</label><select style="width:150px;" id="alarmType_sw" class="form-control"> <li><label>疲劳驾驶报警:</label><select style="width:150px;" id="alarmType_sw" class="form-control">
...@@ -747,7 +747,6 @@ $("#sendMsgBtn").click(function(){ ...@@ -747,7 +747,6 @@ $("#sendMsgBtn").click(function(){
console.log(data) console.log(data)
/**
var host = window.location.host; var host = window.location.host;
$("#showFeedback").val(""); $("#showFeedback").val("");
$.ajax({ $.ajax({
...@@ -770,7 +769,6 @@ $("#sendMsgBtn").click(function(){ ...@@ -770,7 +769,6 @@ $("#sendMsgBtn").click(function(){
} }
} }
}); });
*/
}); });
/******************************************* /*******************************************
...@@ -1506,5 +1504,29 @@ function baseInfoSelect(e){ ...@@ -1506,5 +1504,29 @@ function baseInfoSelect(e){
} }
} }
//报警事件的选择与取消选择
function alarmEventSelect(e){
if($(e).is(':checked')){
if($(e).attr("id") == "idlingSpeedOver"){
$("#alarm_idlingSpeedOver").css("display","block")
}else if($(e).attr("id") == "overspeedAlarm_AE"){
$("#alarm_overspeedAlarm_AE").css("display","block")
}else if($(e).attr("id") == "fatigueDriving_AE"){
$("#alarm_fatigueDriving_AE").css("display","block")
}else if($(e).attr("id") == "waterTemperatureAlarm_AE"){
$("#alarm_waterTemperatureAlarm_AE").css("display","block")
}
}else{
if($(e).attr("id") == "idlingSpeedOver"){
$("#alarm_idlingSpeedOver").css("display","none")
}else if($(e).attr("id") == "overspeedAlarm_AE"){
$("#alarm_overspeedAlarm_AE").css("display","none")
}else if($(e).attr("id") == "fatigueDriving_AE"){
$("#alarm_fatigueDriving_AE").css("display","none")
}else if($(e).attr("id") == "waterTemperatureAlarm_AE"){
$("#alarm_waterTemperatureAlarm_AE").css("display","none")
}
}
}
</script> </script>
{% endblock %} {% endblock %}
\ No newline at end of file
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