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
6be4db2f
Commit
6be4db2f
authored
4 years ago
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
车安优图形模拟器增加怠速过长解除报警功能
parent
9f8b5c4e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
4 deletions
+64
-4
config/protocolTools/carSimulater.conf
config/protocolTools/carSimulater.conf
+2
-2
templates/messageTools/message/M_simulater_page.html
templates/messageTools/message/M_simulater_page.html
+13
-0
views/messageTools/M_simulater_process.py
views/messageTools/M_simulater_process.py
+49
-2
No files found.
config/protocolTools/carSimulater.conf
View file @
6be4db2f
[
socket
]
host
=
1
14
.
116
.
205
.
211
port
=
8003
host
=
1
72
.
19
.
7
.
13
port
=
49008
This diff is collapsed.
Click to expand it.
templates/messageTools/message/M_simulater_page.html
View file @
6be4db2f
...
...
@@ -149,6 +149,7 @@
<label
style=
"padding: 0px 10px;"
><input
type=
"checkbox"
id=
"sharpTurnEvent_check"
onclick=
"eventSelect(this)"
checked
/>
急左转弯
</label>
<label
style=
"padding: 0px 10px;"
><input
type=
"checkbox"
id=
"sharpRightTurnEvent_check"
onclick=
"eventSelect(this)"
checked
/>
急右转弯
</label>
<label
style=
"padding: 0px 10px;"
><input
type=
"checkbox"
id=
"idlingSpeedOver_check"
onclick=
"eventSelect(this)"
checked
/>
怠速过长
</label>
<label
style=
"padding: 0px 10px;"
><input
type=
"checkbox"
id=
"UnIdlingSpeedOver_check"
onclick=
"eventSelect(this)"
checked
/>
怠速过长(解除)
</label>
<label
style=
"padding: 0px 10px;"
><input
type=
"checkbox"
id=
"overspeed_check"
onclick=
"eventSelect(this)"
checked
/>
超速报警
</label>
<label
style=
"padding: 0px 10px;"
><input
type=
"checkbox"
id=
"fatigueDriving_check"
onclick=
"eventSelect(this)"
checked
/>
疲劳驾驶
</label>
<label
style=
"padding: 0px 10px;"
><input
type=
"checkbox"
id=
"waterTemperatureAlarm_check"
onclick=
"eventSelect(this)"
checked
/>
水温报警
</label>
...
...
@@ -164,6 +165,7 @@
<span
id=
"sharpTurnEvent_button"
style=
"display:inline;"
><button
type=
"button"
class=
"btn btn-primary"
onclick=
"sendSharpTurnEvent(this)"
>
急左转弯
</button></label></span>
<span
id=
"sharpRightTurnEvent_button"
style=
"display:inline;"
><button
type=
"button"
class=
"btn btn-primary"
onclick=
"sendRightSharpTurnEvent(this)"
>
急右转弯
</button></label></span>
<span
id=
"idlingSpeedOver_button"
style=
"display:inline;"
><button
type=
"button"
class=
"btn btn-primary"
onclick=
"sendIdlingSpeedOverEvent(this)"
>
怠速过长
</button></label></span>
<span
id=
"UnIdlingSpeedOver_button"
style=
"display:inline;"
><button
type=
"button"
class=
"btn btn-primary"
onclick=
"sendUnIdlingSpeedOverEvent(this)"
>
怠速过长(解除)
</button></label></span>
<span
id=
"overspeed_button"
style=
"display:inline;"
><button
type=
"button"
class=
"btn btn-primary"
onclick=
"sendOverspeedEvent(this)"
>
超速报警
</button></label></span>
<span
id=
"fatigueDriving_button"
style=
"display:inline;"
><button
type=
"button"
class=
"btn btn-primary"
onclick=
"sendFatigueDrivingEvent(this)"
>
疲劳驾驶
</button></label></span>
<span
id=
"waterTemperatureAlarm_button"
style=
"display:inline;"
><button
type=
"button"
class=
"btn btn-primary"
onclick=
"sendWaterTemperatureAlarmEvent(this)"
>
水温报警
</button></label></span>
...
...
@@ -764,6 +766,8 @@ function eventSelect(e){
$
(
"
#setDownDefencesEvent_button
"
).
css
(
"
display
"
,
"
inline
"
)
}
else
if
(
$
(
e
).
attr
(
"
id
"
)
==
"
idlingSpeedOver_check
"
){
$
(
"
#idlingSpeedOver_button
"
).
css
(
"
display
"
,
"
inline
"
)
}
else
if
(
$
(
e
).
attr
(
"
id
"
)
==
"
UnIdlingSpeedOver_check
"
){
$
(
"
#UnIdlingSpeedOver_button
"
).
css
(
"
display
"
,
"
inline
"
)
}
else
if
(
$
(
e
).
attr
(
"
id
"
)
==
"
overspeed_check
"
){
$
(
"
#overspeed_button
"
).
css
(
"
display
"
,
"
inline
"
)
}
else
if
(
$
(
e
).
attr
(
"
id
"
)
==
"
fatigueDriving_check
"
){
...
...
@@ -796,6 +800,8 @@ function eventSelect(e){
$
(
"
#setDownDefencesEvent_button
"
).
css
(
"
display
"
,
"
none
"
)
}
else
if
(
$
(
e
).
attr
(
"
id
"
)
==
"
idlingSpeedOver_check
"
){
$
(
"
#idlingSpeedOver_button
"
).
css
(
"
display
"
,
"
none
"
)
}
else
if
(
$
(
e
).
attr
(
"
id
"
)
==
"
UnIdlingSpeedOver_check
"
){
$
(
"
#UnIdlingSpeedOver_button
"
).
css
(
"
display
"
,
"
none
"
)
}
else
if
(
$
(
e
).
attr
(
"
id
"
)
==
"
overspeed_check
"
){
$
(
"
#overspeed_button
"
).
css
(
"
display
"
,
"
none
"
)
}
else
if
(
$
(
e
).
attr
(
"
id
"
)
==
"
fatigueDriving_check
"
){
...
...
@@ -867,6 +873,13 @@ function sendIdlingSpeedOverEvent(){
var
url
=
"
http://
"
+
host
+
"
/messageTools/M_simulater_process/sendIdlingSpeedOverEvent
"
;
sendHttpMsg
(
data
,
url
);
}
//发送怠速过长(解除)事件消息
function
sendUnIdlingSpeedOverEvent
(){
var
data
=
getPageData
();
var
host
=
window
.
location
.
host
;
var
url
=
"
http://
"
+
host
+
"
/messageTools/M_simulater_process/sendUnIdlingSpeedOverEvent
"
;
sendHttpMsg
(
data
,
url
);
}
//发送超速报警消息
function
sendOverspeedEvent
(){
var
data
=
getPageData
();
...
...
This diff is collapsed.
Click to expand it.
views/messageTools/M_simulater_process.py
View file @
6be4db2f
...
...
@@ -763,8 +763,8 @@ def sendIdlingSpeedOverEvent():
"baseInfo"
:
{
"alarmFlag"
:
0
,
"status"
:
262402
,
"latitude"
:
29.40268
,
"longtitude"
:
106.54041
,
"elevation"
:
"521"
,
"speed"
:
"66"
,
"directionAngle"
:
"59"
,
"infoTime"
:
"2020-05-28 14:20:04"
},
"extraInfo"
:
{
"FA"
:
{
"idlingSpeedOver"
:
{
"alarmType"
:
"1"
,
"idlingTimeOfDuration"
:
"
6
00"
,
"idlingOilExpend"
:
"
1200"
,
"idlingEngineMaxSpeed"
:
"5000"
,
"idlingEngineMinSpeed"
:
"5
00"
}}}}
"extraInfo"
:
{
"FA"
:
{
"idlingSpeedOver"
:
{
"alarmType"
:
"1"
,
"idlingTimeOfDuration"
:
"
3
00"
,
"idlingOilExpend"
:
"
300"
,
"idlingEngineMaxSpeed"
:
"2000"
,
"idlingEngineMinSpeed"
:
"10
00"
}}}}
timeStamp
=
time
.
time
()
timeArray
=
time
.
localtime
(
timeStamp
)
curTime
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
timeArray
)
...
...
@@ -787,6 +787,53 @@ def sendIdlingSpeedOverEvent():
data
[
"message"
]
=
"Error: 发送怠速过长事件失败!"
return
Response
(
json
.
dumps
(
data
),
mimetype
=
'application/json'
)
##########################################
# 【接口类型】发送怠速过长解除事件
##########################################
@
M_simulater_process
.
route
(
"/sendUnIdlingSpeedOverEvent"
,
methods
=
[
'POST'
])
def
sendUnIdlingSpeedOverEvent
():
params
=
request
.
get_data
()
params
=
json
.
loads
(
params
.
decode
(
"utf-8"
))
sessionId
=
params
[
"session"
][
"sessionId"
]
data
=
{}
if
not
sessionId
in
connects
.
keys
():
data
[
"status"
]
=
"4003"
data
[
"message"
]
=
"Error: 未启动服务,不可发送怠速过长解除事件!"
return
Response
(
json
.
dumps
(
data
),
mimetype
=
'application/json'
)
service
=
connects
[
sessionId
][
"service"
]
try
:
jdata
=
{
"msgID"
:
"0200"
,
"phoneNum"
:
"13146201119"
,
"msgWaterCode"
:
"1"
,
"encryptionType"
:
"0"
,
"subPkg"
:
"0"
,
"pkgCounts"
:
"0"
,
"baseInfo"
:
{
"alarmFlag"
:
0
,
"status"
:
262402
,
"latitude"
:
29.40268
,
"longtitude"
:
106.54041
,
"elevation"
:
"521"
,
"speed"
:
"66"
,
"directionAngle"
:
"59"
,
"infoTime"
:
"2020-05-28 14:20:04"
},
"extraInfo"
:
{
"FA"
:
{
"idlingSpeedOver"
:
{
"alarmType"
:
"0"
,
"idlingTimeOfDuration"
:
"500"
,
"idlingOilExpend"
:
"500"
,
"idlingEngineMaxSpeed"
:
"2000"
,
"idlingEngineMinSpeed"
:
"1000"
}}}}
timeStamp
=
time
.
time
()
timeArray
=
time
.
localtime
(
timeStamp
)
curTime
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
timeArray
)
jdata
[
"phoneNum"
]
=
params
[
"phoneNum"
]
jdata
[
"msgWaterCode"
]
=
service
.
getSn
()
jdata
[
"baseInfo"
][
"infoTime"
]
=
curTime
jdata
[
"baseInfo"
][
"latitude"
]
=
service
.
getCurLatitude
()
jdata
[
"baseInfo"
][
"longtitude"
]
=
service
.
getCurLongtitude
()
jdata
[
"baseInfo"
][
"directionAngle"
]
=
service
.
getDirAngle
()
msgObj
=
Location_msg
()
msg
=
msgObj
.
generateMsg_GUI
(
jdata
)
service
.
serviceSendMsg
(
msg
)
service
.
setSn
(
service
.
getSn
()
+
1
)
data
[
"status"
]
=
"200"
data
[
"message"
]
=
"发送怠速过长解除事件成功!"
except
BaseException
as
e
:
# 打印异常信息
traceback
.
print_exc
()
data
[
"status"
]
=
"4003"
data
[
"message"
]
=
"Error: 发送怠速过长解除事件失败!"
return
Response
(
json
.
dumps
(
data
),
mimetype
=
'application/json'
)
##########################################
# 【接口类型】发送超速事件
##########################################
...
...
This diff is collapsed.
Click to expand it.
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