Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
new-socketemulator
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李远洪
new-socketemulator
Commits
e316dd9d
Commit
e316dd9d
authored
Jul 28, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了M500故障码上报
parent
9cf8d5a0
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
219 additions
and
20 deletions
+219
-20
data/messageTools/carData/012201500010.json
data/messageTools/carData/012201500010.json
+1
-1
data/protocolTools/carData/M202003060520.json
data/protocolTools/carData/M202003060520.json
+1
-1
data/protocolTools/sendMsg/genBigPkg.py
data/protocolTools/sendMsg/genBigPkg.py
+4
-2
lib/protocol/m300Plateform/ResponseBase.py
lib/protocol/m300Plateform/ResponseBase.py
+3
-2
lib/protocol/message/DataUpstreamTransport_msg.py
lib/protocol/message/DataUpstreamTransport_msg.py
+16
-7
lib/protocol/messagePlateform/ResponseBase.py
lib/protocol/messagePlateform/ResponseBase.py
+1
-1
lib/protocol/reportPlateform/ResponseBase.py
lib/protocol/reportPlateform/ResponseBase.py
+1
-1
lib/socket/messageTest.py
lib/socket/messageTest.py
+2
-2
lib/socket/service/ProtocolSimulaterService.py
lib/socket/service/ProtocolSimulaterService.py
+0
-1
run.py
run.py
+4
-0
static/js/index.js
static/js/index.js
+2
-0
templates/base.html
templates/base.html
+1
-1
templates/messageTools/message/dataUpstreamTransport_msg_f2_page.html
...ssageTools/message/dataUpstreamTransport_msg_f2_page.html
+8
-0
templates/otherTools/index.html
templates/otherTools/index.html
+40
-0
templates/otherTools/maptool.html
templates/otherTools/maptool.html
+109
-0
views/messageTools/message_process.py
views/messageTools/message_process.py
+4
-1
views/otherTools/__init__.py
views/otherTools/__init__.py
+0
-0
views/otherTools/mapTools_view.py
views/otherTools/mapTools_view.py
+22
-0
No files found.
data/messageTools/carData/012201500010.json
View file @
e316dd9d
{
"time"
:
{
"dateTime"
:
"2020-07-14 11:09:33"
,
"date"
:
"2020-07-14"
,
"time"
:
"11:09:33"
},
"curDayTravel"
:
{
"todayTotalMilleage"
:
3852
,
"todayTotalOil"
:
297
,
"todayTotalTime"
:
237
,
"theMilleage"
:
422
,
"theOil"
:
32
,
"theTime"
:
26
},
"travelData"
:
{
"totalMilleage"
:
119707
,
"totalOil"
:
10670
,
"totalTime"
:
7340
}}
{
"time"
:
{
"dateTime"
:
"2020-07-24 13:33:24"
,
"date"
:
"2020-07-24"
,
"time"
:
"13:33:24"
},
"curDayTravel"
:
{
"todayTotalMilleage"
:
3158
,
"todayTotalOil"
:
203
,
"todayTotalTime"
:
197
,
"theMilleage"
:
3158
,
"theOil"
:
203
,
"theTime"
:
197
},
"travelData"
:
{
"totalMilleage"
:
123527
,
"totalOil"
:
10920
,
"totalTime"
:
7578
}}
\ No newline at end of file
\ No newline at end of file
data/protocolTools/carData/M202003060520.json
View file @
e316dd9d
{
"time"
:
{
"dateTime"
:
"2020-07-10 10:37:16"
,
"date"
:
"2020-07-10"
,
"time"
:
"10:37:16"
},
"curDayTravel"
:
{
"todayTotalMilleage"
:
17293
,
"todayTotalOil"
:
1213
,
"todayTotalTime"
:
1072
,
"theMilleage"
:
1952
,
"theOil"
:
122
,
"theTime"
:
122
},
"travelData"
:
{
"totalMilleage"
:
581717
,
"totalOil"
:
52607
,
"totalTime"
:
34930
},
"event"
:
{
"threeRapid"
:
{
"totalRapidlyAccelerate"
:
43
,
"totalSharpSlowdown"
:
31
,
"totalSharpTurn"
:
34
}}}
{
"time"
:
{
"dateTime"
:
"2020-07-24 10:18:22"
,
"date"
:
"2020-07-24"
,
"time"
:
"10:18:22"
},
"curDayTravel"
:
{
"todayTotalMilleage"
:
19292
,
"todayTotalOil"
:
1217
,
"todayTotalTime"
:
1205
,
"theMilleage"
:
3008
,
"theOil"
:
188
,
"theTime"
:
188
},
"travelData"
:
{
"totalMilleage"
:
622444
,
"totalOil"
:
55189
,
"totalTime"
:
37473
},
"event"
:
{
"threeRapid"
:
{
"totalRapidlyAccelerate"
:
53
,
"totalSharpSlowdown"
:
42
,
"totalSharpTurn"
:
44
}}}
\ No newline at end of file
\ No newline at end of file
data/protocolTools/sendMsg/genBigPkg.py
View file @
e316dd9d
...
@@ -226,8 +226,10 @@ def sendMsg(msgs):
...
@@ -226,8 +226,10 @@ def sendMsg(msgs):
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
# msg = getEventPkg()
msg
=
getEventPkg
()
# msg = getGpsPkg()
sendMsg
(
msg
)
msg
=
getGpsPkg
()
sendMsg
(
msg
)
msg
=
getObdPkg
()
msg
=
getObdPkg
()
sendMsg
(
msg
)
sendMsg
(
msg
)
...
...
lib/protocol/m300Plateform/ResponseBase.py
View file @
e316dd9d
...
@@ -95,7 +95,8 @@ class ResponseBase(Base):
...
@@ -95,7 +95,8 @@ class ResponseBase(Base):
return
otherStyleTime
return
otherStyleTime
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
print
(
ResponseBase
()
.
hexDate2date
(
"01c329ed065"
))
# print(ResponseBase().hexDate2date("01c329ed065"))
print
(
ResponseBase
()
.
hexTimestamp2date
(
"5e60723b"
))
# print(ResponseBase().hexTimestamp2date("5e60723b"))
print
(
ResponseBase
()
.
hex2string
(
"4d3530304142303230322e303030432c3131312e31302e32342e3133312c32312c7673742c767374323031332c4d3530304142303230322e303030432e42494e2c"
))
lib/protocol/message/DataUpstreamTransport_msg.py
View file @
e316dd9d
...
@@ -87,7 +87,7 @@ class DataUpstreamTransport_msg(MessageBase):
...
@@ -87,7 +87,7 @@ class DataUpstreamTransport_msg(MessageBase):
data
[
"speedOut120"
],
data
[
"rapidlyAccelerateTimes"
],
data
[
"rapidlySharpSlowdownTimes"
],
data
[
"sharpCurveTimes"
])
data
[
"speedOut120"
],
data
[
"rapidlyAccelerateTimes"
],
data
[
"rapidlySharpSlowdownTimes"
],
data
[
"sharpCurveTimes"
])
elif
msgType
==
"F2"
:
elif
msgType
==
"F2"
:
# 故障码数据(状态改变发送)
# 故障码数据(状态改变发送)
msgContent
=
self
.
getTroubleCodeData_GUI
(
data
[
"infoTime"
],
data
[
"latitude"
],
data
[
"longitude"
],
data
[
"troubleCodeNums"
])
msgContent
=
self
.
getTroubleCodeData_GUI
(
data
[
"infoTime"
],
data
[
"latitude"
],
data
[
"longitude"
],
data
[
"troubleCodeNums"
]
,
data
[
"systemId"
]
)
elif
msgType
==
"F3"
:
elif
msgType
==
"F3"
:
# 休眠进入(进入休眠模式发送)
# 休眠进入(进入休眠模式发送)
msgContent
=
self
.
getIntoSleepData_GUI
(
data
[
"infoTime"
])
msgContent
=
self
.
getIntoSleepData_GUI
(
data
[
"infoTime"
])
...
@@ -334,16 +334,20 @@ class DataUpstreamTransport_msg(MessageBase):
...
@@ -334,16 +334,20 @@ class DataUpstreamTransport_msg(MessageBase):
#故障码
#故障码
troubleCode
=
""
troubleCode
=
""
for
i
in
range
(
0
,
troubleCodeNums
):
for
i
in
range
(
0
,
troubleCodeNums
):
tbc0
=
self
.
int2hexStringByBytes
(
i
)
# tbc0 = self.int2hexStringByBytes(i)
tbc1
=
self
.
int2hexStringByBytes
(
1
)
tbc0
=
"00"
tbc2
=
self
.
int2hexStringByBytes
(
2
)
# tbc1 = self.int2hexStringByBytes(1)
tbc3
=
self
.
int2hexStringByBytes
(
3
)
tbc1
=
self
.
int2hexStringByBytes
(
0
)
# tbc2 = self.int2hexStringByBytes(2)
tbc2
=
self
.
int2hexStringByBytes
(
i
)
# tbc3 = self.int2hexStringByBytes(3)
tbc3
=
self
.
int2hexStringByBytes
(
0
)
troubleCode
=
troubleCode
+
tbc0
+
tbc1
+
tbc2
+
tbc3
troubleCode
=
troubleCode
+
tbc0
+
tbc1
+
tbc2
+
tbc3
data
=
infoTime
+
latitude
+
longitude
+
troubleCodeNumsHex
+
troubleCode
data
=
infoTime
+
latitude
+
longitude
+
troubleCodeNumsHex
+
troubleCode
return
data
return
data
# 获取故障码数据,针对图形界面,可传递参数
# 获取故障码数据,针对图形界面,可传递参数
def
getTroubleCodeData_GUI
(
self
,
infoTime
=
"2020-02-06 11:31:56"
,
latitude
=
29.40268
,
longitude
=
106.54041
,
troubleCodeNums
=
3
):
def
getTroubleCodeData_GUI
(
self
,
infoTime
=
"2020-02-06 11:31:56"
,
latitude
=
29.40268
,
longitude
=
106.54041
,
troubleCodeNums
=
3
,
systemId
=
"00"
):
infoTime
=
self
.
getBCDTime
(
infoTime
)
infoTime
=
self
.
getBCDTime
(
infoTime
)
#单位:0.000001 度,Bit31=0/1 北纬/南纬
#单位:0.000001 度,Bit31=0/1 北纬/南纬
latitude
=
self
.
getLatitude
(
latitude
)
latitude
=
self
.
getLatitude
(
latitude
)
...
@@ -355,7 +359,12 @@ class DataUpstreamTransport_msg(MessageBase):
...
@@ -355,7 +359,12 @@ class DataUpstreamTransport_msg(MessageBase):
#故障码
#故障码
troubleCode
=
""
troubleCode
=
""
for
i
in
range
(
0
,
troubleCodeNums
):
for
i
in
range
(
0
,
troubleCodeNums
):
troubleCode
=
troubleCode
+
self
.
int2hexStringByBytes
(
i
,
4
)
# troubleCode = troubleCode + self.int2hexStringByBytes(i,4)
tbc0
=
systemId
tbc1
=
self
.
int2hexStringByBytes
(
0
)
tbc2
=
self
.
int2hexStringByBytes
(
i
)
tbc3
=
self
.
int2hexStringByBytes
(
0
)
troubleCode
=
troubleCode
+
tbc0
+
tbc1
+
tbc2
+
tbc3
data
=
infoTime
+
latitude
+
longitude
+
troubleCodeNumsHex
+
troubleCode
data
=
infoTime
+
latitude
+
longitude
+
troubleCodeNumsHex
+
troubleCode
return
data
return
data
#获取维度
#获取维度
...
...
lib/protocol/messagePlateform/ResponseBase.py
View file @
e316dd9d
...
@@ -100,5 +100,5 @@ if __name__ == "__main__":
...
@@ -100,5 +100,5 @@ if __name__ == "__main__":
# print(ResponseBase().int2binStr(7,2))
# print(ResponseBase().int2binStr(7,2))
# print(ResponseBase().getMsgId("7e0002000001314620111800065b7e"))
# print(ResponseBase().getMsgId("7e0002000001314620111800065b7e"))
# print(ResponseBase().getMsgId("7e80010005013146201118e1480006000200767e"))
# print(ResponseBase().getMsgId("7e80010005013146201118e1480006000200767e"))
print
(
ResponseBase
()
.
hex2string
(
"
7975616e686f6e67
"
))
print
(
ResponseBase
()
.
hex2string
(
"
014c3230304142303030302c737a6c696e6779692e716963702e7669702c383838392c537a4c696e6759692c7a373254713246742c4c3230304142303130322e303030342e42494e2c2f2c
"
))
print
(
ResponseBase
()
.
hexString2int
(
"00001f43 "
))
print
(
ResponseBase
()
.
hexString2int
(
"00001f43 "
))
\ No newline at end of file
lib/protocol/reportPlateform/ResponseBase.py
View file @
e316dd9d
...
@@ -110,6 +110,6 @@ class ResponseBase(Base):
...
@@ -110,6 +110,6 @@ class ResponseBase(Base):
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
print
(
ResponseBase
()
.
hexDate2date
(
"01c329ed065"
))
print
(
ResponseBase
()
.
hexDate2date
(
"01c329ed065"
))
print
(
ResponseBase
()
.
hexTimestamp2date
(
"5e60723b"
))
print
(
ResponseBase
()
.
hexTimestamp2date
(
"5e60723b"
))
print
(
ResponseBase
()
.
hex2string
(
"
4d3530304142303330332e303130302c3131312e31302e32342e3133312c32312c7673742c767374323031332c4d3530304142303330332e303130302e42494e2c
"
))
print
(
ResponseBase
()
.
hex2string
(
"
312c312c767374322e76616e64796f2e636e2c383030332c302c434d4e45542c7975616e686f6e672c70617373776f72640d0a
"
))
lib/socket/messageTest.py
View file @
e316dd9d
...
@@ -32,8 +32,8 @@ port = 9001
...
@@ -32,8 +32,8 @@ port = 9001
# msg = TerminalVersionInfo_msg().generateMsg() #终端版本信息上报
# msg = TerminalVersionInfo_msg().generateMsg() #终端版本信息上报
# msg = QueryTerminalParam_res().generateMsg() #查询终端参数应答
# msg = QueryTerminalParam_res().generateMsg() #查询终端参数应答
# msg = QueryTerminalProperty_res().generateMsg() #查询终端属性应答消息
# msg = QueryTerminalProperty_res().generateMsg() #查询终端属性应答消息
msg
=
Location_msg
()
.
generateMsg
()
#位置信息汇报
#
msg = Location_msg().generateMsg() #位置信息汇报
#
msg = DataUpstreamTransport_msg().generateMsg() #数据上行透传消息
msg
=
DataUpstreamTransport_msg
()
.
generateMsg
()
#数据上行透传消息
# msg = TerminalUpdataResult_msg().generateMsg() #终端升级结果通知
# msg = TerminalUpdataResult_msg().generateMsg() #终端升级结果通知
# msg = LocationDataBatchUpdate_msg().generateMsg() #定位数据批量上传
# msg = LocationDataBatchUpdate_msg().generateMsg() #定位数据批量上传
# msg = TextInfoUpload_msg().generateMsg() #文本信息上传
# msg = TextInfoUpload_msg().generateMsg() #文本信息上传
...
...
lib/socket/service/ProtocolSimulaterService.py
View file @
e316dd9d
...
@@ -676,7 +676,6 @@ class ProtocolSimulaterService():
...
@@ -676,7 +676,6 @@ class ProtocolSimulaterService():
fi
.
write
(
"["
+
curTime
+
"]"
+
data
+
"
\n
"
)
fi
.
write
(
"["
+
curTime
+
"]"
+
data
+
"
\n
"
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
ProtocolSimulaterService
()
.
getDirAngleTest
()
ProtocolSimulaterService
()
.
getDirAngleTest
()
...
...
run.py
View file @
e316dd9d
...
@@ -20,6 +20,8 @@ from views.messageTools.message_process import message_process
...
@@ -20,6 +20,8 @@ from views.messageTools.message_process import message_process
from
views.messageTools.M_simulater_view
import
M_simulater_view
from
views.messageTools.M_simulater_view
import
M_simulater_view
from
views.messageTools.M_simulater_process
import
M_simulater_process
from
views.messageTools.M_simulater_process
import
M_simulater_process
from
views.otherTools.mapTools_view
import
mapTools_view
app
=
Flask
(
__name__
)
app
=
Flask
(
__name__
)
app
.
register_blueprint
(
setting_view
,
url_prefix
=
"/protocolTools/setting_view"
)
app
.
register_blueprint
(
setting_view
,
url_prefix
=
"/protocolTools/setting_view"
)
app
.
register_blueprint
(
setting_process
,
url_prefix
=
"/protocolTools/setting_process"
)
app
.
register_blueprint
(
setting_process
,
url_prefix
=
"/protocolTools/setting_process"
)
...
@@ -41,6 +43,8 @@ app.register_blueprint(message_process,url_prefix = "/messageTools/message_proce
...
@@ -41,6 +43,8 @@ app.register_blueprint(message_process,url_prefix = "/messageTools/message_proce
app
.
register_blueprint
(
M_simulater_view
,
url_prefix
=
"/messageTools/M_simulater_view"
)
app
.
register_blueprint
(
M_simulater_view
,
url_prefix
=
"/messageTools/M_simulater_view"
)
app
.
register_blueprint
(
M_simulater_process
,
url_prefix
=
"/messageTools/M_simulater_process"
)
app
.
register_blueprint
(
M_simulater_process
,
url_prefix
=
"/messageTools/M_simulater_process"
)
app
.
register_blueprint
(
mapTools_view
,
url_prefix
=
"/otherTools/mapTools_view"
)
@
app
.
route
(
'/'
)
@
app
.
route
(
'/'
)
def
hello
():
def
hello
():
return
redirect
(
'/messageTools/message_view/heartBeat_msg_page'
)
return
redirect
(
'/messageTools/message_view/heartBeat_msg_page'
)
...
...
static/js/index.js
View file @
e316dd9d
...
@@ -9,5 +9,7 @@ function swichTap(e){
...
@@ -9,5 +9,7 @@ function swichTap(e){
$
(
location
).
attr
(
'
href
'
,
"
http://
"
+
window
.
location
.
host
+
"
/messageTools/message_view/heartBeat_msg_page
"
);
$
(
location
).
attr
(
'
href
'
,
"
http://
"
+
window
.
location
.
host
+
"
/messageTools/message_view/heartBeat_msg_page
"
);
}
else
if
(
id
==
"
m300Tools
"
){
}
else
if
(
id
==
"
m300Tools
"
){
$
(
location
).
attr
(
'
href
'
,
"
http://
"
+
window
.
location
.
host
+
"
/m300Tools/P_m300Protocol_view/P_heartBeat_m300_page
"
);
$
(
location
).
attr
(
'
href
'
,
"
http://
"
+
window
.
location
.
host
+
"
/m300Tools/P_m300Protocol_view/P_heartBeat_m300_page
"
);
}
else
if
(
id
==
"
otherTools
"
){
$
(
location
).
attr
(
'
href
'
,
"
http://
"
+
window
.
location
.
host
+
"
/otherTools/mapTools_view/maptool_page
"
);
}
}
}
}
templates/base.html
View file @
e316dd9d
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
<li
role=
"presentation"
{%
if
arg.path[0]=
="protocolTools"
%}
class=
"active"
{%
endif
%}
><a
onclick=
"swichTap(this)"
id=
"protocolTools"
>
M500协议工具
</a></li>
<li
role=
"presentation"
{%
if
arg.path[0]=
="protocolTools"
%}
class=
"active"
{%
endif
%}
><a
onclick=
"swichTap(this)"
id=
"protocolTools"
>
M500协议工具
</a></li>
<li
role=
"presentation"
{%
if
arg.path[0]=
="m300Tools"
%}
class=
"active"
{%
endif
%}
><a
onclick=
"swichTap(this)"
id=
"m300Tools"
>
M300协议工具
</a></li>
<li
role=
"presentation"
{%
if
arg.path[0]=
="m300Tools"
%}
class=
"active"
{%
endif
%}
><a
onclick=
"swichTap(this)"
id=
"m300Tools"
>
M300协议工具
</a></li>
<li
role=
"presentation"
{%
if
arg.path[0]=
="messageTools"
%}
class=
"active"
{%
endif
%}
><a
onclick=
"swichTap(this)"
id=
"messageTools"
>
新硬件消息工具
</a></li>
<li
role=
"presentation"
{%
if
arg.path[0]=
="messageTools"
%}
class=
"active"
{%
endif
%}
><a
onclick=
"swichTap(this)"
id=
"messageTools"
>
新硬件消息工具
</a></li>
<!-- <li role="presentation" {% if arg.path[0]=="otherTools" %} class="active" {% endif %}><a onclick="swichTap(this)" id="otherTools">其他工具</a></li>--
>
<li
role=
"presentation"
{%
if
arg.path[0]=
="otherTools"
%}
class=
"active"
{%
endif
%}
><a
onclick=
"swichTap(this)"
id=
"otherTools"
>
其他工具
</a></li
>
</ul>
</ul>
</div>
</div>
</div>
</div>
...
...
templates/messageTools/message/dataUpstreamTransport_msg_f2_page.html
View file @
e316dd9d
...
@@ -37,6 +37,12 @@
...
@@ -37,6 +37,12 @@
<option
value=
"1"
>
西经
</option>
<option
value=
"1"
>
西经
</option>
</select></li>
</select></li>
<li><label>
故障码个数:
</label><input
id=
"troubleCodeNums"
type=
"text"
class=
"form-control"
value=
"3"
></li>
<li><label>
故障码个数:
</label><input
id=
"troubleCodeNums"
type=
"text"
class=
"form-control"
value=
"3"
></li>
<li><label>
故障码类型:
</label><select
id=
"systemId"
class=
"form-control"
>
<option
value=
"00"
>
发动机故障码
</option>
<option
value=
"01"
>
变速箱故障码
</option>
<option
value=
"02"
>
ABS 故障码
</option>
<option
value=
"03"
>
安全气囊故障码
</option>
</select></li>
</ul>
</ul>
<H3
style=
"border-bottom: 1px solid #eee;"
>
控制:
</H3>
<H3
style=
"border-bottom: 1px solid #eee;"
>
控制:
</H3>
<div
style=
"width:100%;padding:5px;margin-top:10px;"
>
<div
style=
"width:100%;padding:5px;margin-top:10px;"
>
...
@@ -76,6 +82,7 @@ $("#sendMsgBtn").click(function(){
...
@@ -76,6 +82,7 @@ $("#sendMsgBtn").click(function(){
longitude
=
parseFloat
(
longitude
)
+
2147483648
/
1000000
longitude
=
parseFloat
(
longitude
)
+
2147483648
/
1000000
}
}
var
troubleCodeNums
=
$
(
"
#troubleCodeNums
"
).
val
();
var
troubleCodeNums
=
$
(
"
#troubleCodeNums
"
).
val
();
var
systemId
=
$
(
"
#systemId
"
).
val
();
var
data
=
{};
var
data
=
{};
data
[
"
msgID
"
]
=
msgID
;
data
[
"
msgID
"
]
=
msgID
;
...
@@ -90,6 +97,7 @@ $("#sendMsgBtn").click(function(){
...
@@ -90,6 +97,7 @@ $("#sendMsgBtn").click(function(){
data
[
"
latitude
"
]
=
latitude
;
data
[
"
latitude
"
]
=
latitude
;
data
[
"
longitude
"
]
=
longitude
;
data
[
"
longitude
"
]
=
longitude
;
data
[
"
troubleCodeNums
"
]
=
troubleCodeNums
;
data
[
"
troubleCodeNums
"
]
=
troubleCodeNums
;
data
[
"
systemId
"
]
=
systemId
;
var
host
=
window
.
location
.
host
;
var
host
=
window
.
location
.
host
;
$
(
"
#showFeedback
"
).
val
(
""
)
$
(
"
#showFeedback
"
).
val
(
""
)
...
...
templates/otherTools/index.html
0 → 100644
View file @
e316dd9d
{% extends "base.html" %}
{% block title %}其他工具{% endblock %}
{% block content %}
<style
type=
"text/css"
>
.link-tab
{
background-color
:
#e4e2dd
;
}
.active_left_tab
{
background-color
:
#428BCA
;
color
:
white
;
}
.table
>
thead
>
tr
>
th
,
.table
>
tbody
>
tr
>
td
{
_background-color
:
red
;
}
</style>
<!-- 切换左边的tab -->
<script
type=
"text/javascript"
>
function
swichLeftTab
(
e
){
var
id
=
$
(
e
).
attr
(
"
id
"
)
if
(
id
==
"
mapTools
"
){
$
(
location
).
attr
(
'
href
'
,
"
http://
"
+
window
.
location
.
host
+
"
/messageTools/msgSetting_view/msgSetting_page
"
);
}
}
</script>
<!-- 左侧导航添加为可继承模块 -->
{% block leftNav %}
<div
id=
"container1"
class=
"col-sm-3 col-md-2 sidebar"
style=
"margin-top:50px;width:12%;padding:0px;margin-right:15px;"
>
<ul
class=
"nav nav-sidebar"
style=
"margin-top:20px;"
>
<li
id=
"maptools"
onclick=
"swichLeftTab(this)"
><a
{%
if
arg.path[1]=
="mapTools_view"
%}
class=
"active_left_tab"
{%
endif
%}
><span
class=
"glyphicon glyphicon-hand-right"
aria-hidden=
"true"
></span></span>
地图工具(开发中)
</a></li>
</ul>
</div>
{% endblock %}
{% block content_01 %}
<!-- 右边内容区域 -->
{% endblock %}
{% endblock %}
</div>
\ No newline at end of file
templates/otherTools/maptool.html
0 → 100644
View file @
e316dd9d
{% extends "otherTools/index.html" %}
{% block title %}msgSetting{% endblock %}
{% block content_01 %}
<script
src=
"../../static/js/messageTools/setting.js"
></script>
<script
type=
"text/javascript"
src=
"https://webapi.amap.com/maps?v=1.4.15&key=d96c8dc7e0d6c636d65e6f6d75b0ccb4"
></script>
<style>
.nav-pills
li
{
margin-bottom
:
5px
;
}
.form-control
{
display
:
inline
;
width
:
160px
;
}
.protocol_content
:after
{
clear
:
both
;
display
:
block
;
content
:
" "
;
}
.protocol_content
li
{
width
:
250px
;
_background
:
yellow
;
list-style
:
none
;
margin-top
:
5px
;
float
:
left
;
}
.protocol_content
label
{
width
:
90px
;
text-align
:
right
;
}
</style>
<div
id=
"container2"
style=
"width:85%;min-height:750px;float:left;_background:pink;"
>
{% block content_1 %}
<div
id=
"container3"
style=
"width:100%;min-height:750px;float:left;_background:pink;margin-top:10px;_border-top: 1px solid #eee;"
>
<div
class=
"btn-group btn-group-justified"
role=
"group"
aria-label=
"Justified button group"
style=
"width:400px;height:35px;background:pink;z-index:50;position:absolute;top:120px;right:40px;border-radius:5px;"
>
<a
href=
"#"
class=
"btn btn-default"
role=
"button"
id=
"ctrArea1"
onclick=
"ctrAreaShow(this)"
>
轨迹点查询
</a>
<a
href=
"#"
class=
"btn btn-default"
role=
"button"
id=
"ctrArea2"
onclick=
"ctrAreaShow(this)"
>
录制轨迹
</a>
<a
href=
"#"
class=
"btn btn-default"
role=
"button"
id=
"ctrArea3"
onclick=
"ctrAreaShow(this)"
>
查询轨迹
</a>
</div>
<div
id=
"ctrArea_1"
style=
"width:400px;height:250px;background:white;z-index:50;position:absolute;top:160px;right:40px;border-radius:5px;display:none;"
class=
"btn-group btn-group-justified"
role=
"group"
>
111
</div>
<div
id=
"ctrArea_2"
style=
"width:400px;height:250px;background:white;z-index:50;position:absolute;top:160px;right:40px;border-radius:5px;display:none;"
class=
"btn-group btn-group-justified"
role=
"group"
>
222
</div>
<div
id=
"ctrArea_3"
style=
"width:400px;height:250px;background:white;z-index:50;position:absolute;top:160px;right:40px;border-radius:5px;display:none;"
class=
"btn-group btn-group-justified"
role=
"group"
>
333
</div>
<div
id=
"container"
style=
"width:100%; height: 750px;"
>
</div>
</div>
<script>
var
map
=
null
;
var
curShow
=
""
;
//加载地图
(
function
(){
map
=
new
AMap
.
Map
(
'
container
'
,
{
zoom
:
12
,
//级别
center
:
[
106.587436
,
29.565099
]
});
})();
//处理地图点击事件
map
.
on
(
'
click
'
,
function
(
ev
)
{
var
lnglat
=
ev
.
lnglat
;
console
.
log
(
lnglat
);
});
function
ctrAreaShow
(
e
){
var
cliId
=
$
(
e
).
attr
(
"
id
"
);
if
(
cliId
==
"
ctrArea1
"
){
if
(
curShow
==
"
ctrArea1
"
){
$
(
"
#ctrArea_1
"
).
css
(
"
display
"
,
"
none
"
);
curShow
=
""
;
}
else
{
$
(
"
#ctrArea_1
"
).
css
(
"
display
"
,
"
block
"
);
$
(
"
#ctrArea_2
"
).
css
(
"
display
"
,
"
none
"
);
$
(
"
#ctrArea_3
"
).
css
(
"
display
"
,
"
none
"
);
curShow
=
"
ctrArea1
"
;
}
}
else
if
(
cliId
==
"
ctrArea2
"
){
if
(
curShow
==
"
ctrArea2
"
){
$
(
"
#ctrArea_2
"
).
css
(
"
display
"
,
"
none
"
);
curShow
=
""
;
}
else
{
$
(
"
#ctrArea_1
"
).
css
(
"
display
"
,
"
none
"
);
$
(
"
#ctrArea_2
"
).
css
(
"
display
"
,
"
block
"
);
$
(
"
#ctrArea_3
"
).
css
(
"
display
"
,
"
none
"
);
curShow
=
"
ctrArea2
"
;
}
}
else
if
(
cliId
==
"
ctrArea3
"
){
if
(
curShow
==
"
ctrArea3
"
){
$
(
"
#ctrArea_3
"
).
css
(
"
display
"
,
"
none
"
);
curShow
=
""
;
}
else
{
$
(
"
#ctrArea_1
"
).
css
(
"
display
"
,
"
none
"
);
$
(
"
#ctrArea_2
"
).
css
(
"
display
"
,
"
none
"
);
$
(
"
#ctrArea_3
"
).
css
(
"
display
"
,
"
block
"
);
curShow
=
"
ctrArea3
"
;
}
}
}
</script>
{% endblock %}
</div>
{% endblock %}
\ No newline at end of file
views/messageTools/message_process.py
View file @
e316dd9d
...
@@ -358,10 +358,12 @@ def porcessDataUpstreamTransportMsg_F2():
...
@@ -358,10 +358,12 @@ def porcessDataUpstreamTransportMsg_F2():
latitude
=
float
(
request
.
form
.
get
(
"latitude"
))
latitude
=
float
(
request
.
form
.
get
(
"latitude"
))
longitude
=
float
(
request
.
form
.
get
(
"longitude"
))
longitude
=
float
(
request
.
form
.
get
(
"longitude"
))
troubleCodeNums
=
int
(
request
.
form
.
get
(
"troubleCodeNums"
))
troubleCodeNums
=
int
(
request
.
form
.
get
(
"troubleCodeNums"
))
systemId
=
request
.
form
.
get
(
"systemId"
)
data
=
{}
data
=
{}
if
(
msgID
==
None
or
phoneNum
==
None
or
msgWaterCode
==
None
or
encryptionType
==
None
or
subPkg
==
None
\
if
(
msgID
==
None
or
phoneNum
==
None
or
msgWaterCode
==
None
or
encryptionType
==
None
or
subPkg
==
None
\
or
pkgCounts
==
None
or
infoTime
==
None
or
latitude
==
None
or
longitude
==
None
or
troubleCodeNums
==
None
):
or
pkgCounts
==
None
or
infoTime
==
None
or
latitude
==
None
or
longitude
==
None
or
troubleCodeNums
==
None
\
or
systemId
==
None
):
data
[
"status"
]
=
"4003"
data
[
"status"
]
=
"4003"
data
[
"message"
]
=
"Info: 请检查是否传入了空数据!"
data
[
"message"
]
=
"Info: 请检查是否传入了空数据!"
return
Response
(
json
.
dumps
(
data
),
mimetype
=
'application/json'
)
return
Response
(
json
.
dumps
(
data
),
mimetype
=
'application/json'
)
...
@@ -372,6 +374,7 @@ def porcessDataUpstreamTransportMsg_F2():
...
@@ -372,6 +374,7 @@ def porcessDataUpstreamTransportMsg_F2():
msgData
[
"latitude"
]
=
latitude
msgData
[
"latitude"
]
=
latitude
msgData
[
"longitude"
]
=
longitude
msgData
[
"longitude"
]
=
longitude
msgData
[
"troubleCodeNums"
]
=
troubleCodeNums
msgData
[
"troubleCodeNums"
]
=
troubleCodeNums
msgData
[
"systemId"
]
=
systemId
conf_R
=
ConfigParser
()
conf_R
=
ConfigParser
()
conf_R
.
read
(
"config/messageTools/messageTools.conf"
)
conf_R
.
read
(
"config/messageTools/messageTools.conf"
)
...
...
views/otherTools/__init__.py
0 → 100644
View file @
e316dd9d
views/otherTools/mapTools_view.py
0 → 100644
View file @
e316dd9d
#coding:utf-8
from
flask
import
Blueprint
,
render_template
,
request
import
re
from
lib.util
import
fileUtil
mapTools_view
=
Blueprint
(
'mapTools_view'
,
__name__
)
##########################################
# 【视图类型】访问模拟器页面
##########################################
@
mapTools_view
.
route
(
'/maptool_page'
)
def
maptool_page
():
#获取请求的路劲
url
=
request
.
url
reqPath
=
re
.
findall
(
"http://(.*)$"
,
url
)[
0
]
reqPath
=
re
.
findall
(
"/(.*)$"
,
reqPath
)[
0
]
arg
=
{}
path
=
"otherTools/maptool.html"
arg
[
"path"
]
=
reqPath
.
split
(
"/"
)
return
render_template
(
path
,
arg
=
arg
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment