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
2adbecfa
Commit
2adbecfa
authored
Apr 30, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
M500 协议,修改了事件上报页面
parent
dc0ca6a8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
16 deletions
+27
-16
lib/protocol/appendix/EventClass.py
lib/protocol/appendix/EventClass.py
+16
-14
lib/protocol/report/EventReport_protocol.py
lib/protocol/report/EventReport_protocol.py
+3
-2
lib/socket/service/ProtocolSimulaterDataService.py
lib/socket/service/ProtocolSimulaterDataService.py
+3
-0
templates/protocolTools/report/event_protocol_page.html
templates/protocolTools/report/event_protocol_page.html
+5
-0
No files found.
lib/protocol/appendix/EventClass.py
View file @
2adbecfa
...
...
@@ -135,9 +135,9 @@ class EventClass(ProtocolBase):
# 0020 急加速报警附带信息
def
rapidlyAccelerateExtraInfo
(
self
,
totalRapidlyAccelerateCount
=
100
,
totalSharpSlowdown
=
200
,
totalSharpTurn
=
50
,
dataProperty
=
2
):
totalRapidlyAccelerateCount
=
totalRapidlyAccelerateCount
#急加速总次数
totalSharpSlowdown
=
totalSharpSlowdown
#急减速总次数
totalSharpTurn
=
totalSharpTurn
#急转弯总次数
totalRapidlyAccelerateCount
=
totalRapidlyAccelerateCount
#急加速总次数
totalSharpSlowdown
=
totalSharpSlowdown
#急减速总次数
totalSharpTurn
=
totalSharpTurn
#急转弯总次数
dataProperty
=
dataProperty
#事件属性,1:表示事件发生时刻,前10秒的事件采样数据;2:表示事件发生时刻,后10秒的事件采样数据;
GPSSampleData
=
self
.
GPSDataFromSeconds
(
10
)
#GPS 采样点 ,N秒内的GPS采样数据,170个字节
CANSampleData
=
self
.
CANDataFromSeconds
(
10
)
#CAN采样点 ,N秒内的CAN采样数据,90个字节
...
...
@@ -150,11 +150,11 @@ class EventClass(ProtocolBase):
return
data
# 0021 急减速报警附带信息
def
sharpSlowdownExtraInfo
(
self
):
totalRapidlyAccelerateCount
=
100
#急加速总次数
totalSharpSlowdown
=
200
#急减速总次数
totalSharpTurn
=
50
#急转弯总次数
dataProperty
=
2
#事件属性,1:表示事件发生时刻,前10秒的事件采样数据;2:表示事件发生时刻,后10秒的事件采样数据;
def
sharpSlowdownExtraInfo
(
self
,
totalRapidlyAccelerateCount
=
100
,
totalSharpSlowdown
=
200
,
totalSharpTurn
=
50
,
dataProperty
=
2
):
totalRapidlyAccelerateCount
=
totalRapidlyAccelerateCount
#急加速总次数
totalSharpSlowdown
=
totalSharpSlowdown
#急减速总次数
totalSharpTurn
=
totalSharpTurn
#急转弯总次数
dataProperty
=
dataProperty
#事件属性,1:表示事件发生时刻,前10秒的事件采样数据;2:表示事件发生时刻,后10秒的事件采样数据;
GPSSampleData
=
self
.
GPSDataFromSeconds
(
10
)
#GPS 采样点 ,N秒内的GPS采样数据,170个字节
CANSampleData
=
self
.
CANDataFromSeconds
(
10
)
#CAN采样点 ,N秒内的CAN采样数据,90个字节
SENSORSampleData
=
self
.
SENSORDataFromSeconds
(
20
)
#SENSOR采样点 ,N秒内的SENSOR采样数据
...
...
@@ -166,19 +166,21 @@ class EventClass(ProtocolBase):
return
data
# 0022 急转弯报警附带信息
def
sharpTurnExtraInfo
(
self
):
totalRapidlyAccelerateCount
=
100
#急加速总次数
totalSharpSlowdown
=
200
#急减速总次数
totalSharpTurn
=
50
#急转弯总次数
dataProperty
=
2
#事件属性,1:表示事件发生时刻,前10秒的事件采样数据;2:表示事件发生时刻,后10秒的事件采样数据;
def
sharpTurnExtraInfo
(
self
,
totalRapidlyAccelerateCount
=
100
,
totalSharpSlowdown
=
200
,
totalSharpTurn
=
50
,
direction
=
0
,
dataProperty
=
2
):
totalRapidlyAccelerateCount
=
totalRapidlyAccelerateCount
#急加速总次数
totalSharpSlowdown
=
totalSharpSlowdown
#急减速总次数
totalSharpTurn
=
totalSharpTurn
#急转弯总次数
direction
=
direction
#急转弯方向,0:向右转;1:向左转
dataProperty
=
dataProperty
#事件属性,1:表示事件发生时刻,前10秒的事件采样数据;2:表示事件发生时刻,后10秒的事件采样数据;
GPSSampleData
=
self
.
GPSDataFromSeconds
(
10
)
#GPS 采样点 ,N秒内的GPS采样数据,170个字节
CANSampleData
=
self
.
CANDataFromSeconds
(
10
)
#CAN采样点 ,N秒内的CAN采样数据,90个字节
SENSORSampleData
=
self
.
SENSORDataFromSeconds
(
20
)
#SENSOR采样点 ,N秒内的SENSOR采样数据
totalRapidlyAccelerateCount
=
self
.
int2hexStringByBytes
(
totalRapidlyAccelerateCount
,
2
)
totalSharpSlowdown
=
self
.
int2hexStringByBytes
(
totalSharpSlowdown
,
2
)
totalSharpTurn
=
self
.
int2hexStringByBytes
(
totalSharpTurn
,
2
)
direction
=
self
.
int2hexStringByBytes
(
direction
)
dataProperty
=
self
.
int2hexStringByBytes
(
dataProperty
,
1
)
data
=
totalRapidlyAccelerateCount
+
totalSharpSlowdown
+
totalSharpTurn
+
dataProperty
+
GPSSampleData
+
CANSampleData
+
SENSORSampleData
data
=
totalRapidlyAccelerateCount
+
totalSharpSlowdown
+
totalSharpTurn
+
d
irection
+
d
ataProperty
+
GPSSampleData
+
CANSampleData
+
SENSORSampleData
return
data
#0023 碰撞报警附带信息
...
...
lib/protocol/report/EventReport_protocol.py
View file @
2adbecfa
...
...
@@ -246,7 +246,7 @@ class EventReport_protocol(ProtocolBase):
eventObj
=
EventClass
()
eventObj
.
setGPSpkg
(
self
.
GPSPkg
)
eventObj
.
setSecurityData
(
self
.
securityPkg
)
theData
=
eventObj
.
rapidlyAccelerate
ExtraInfo
(
int
(
eventData
[
"0021"
][
"allRapidlyAccelerateCount"
]),
theData
=
eventObj
.
sharpSlowdown
ExtraInfo
(
int
(
eventData
[
"0021"
][
"allRapidlyAccelerateCount"
]),
int
(
eventData
[
"0021"
][
"allSharpSlowdownCount"
]),
int
(
eventData
[
"0021"
][
"allSharpTurn"
]),
int
(
eventData
[
"0021"
][
"dataProperty"
]))
...
...
@@ -255,9 +255,10 @@ class EventReport_protocol(ProtocolBase):
eventObj
=
EventClass
()
eventObj
.
setGPSpkg
(
self
.
GPSPkg
)
eventObj
.
setSecurityData
(
self
.
securityPkg
)
theData
=
eventObj
.
rapidlyAccelerate
ExtraInfo
(
int
(
eventData
[
"0022"
][
"allRapidlyAccelerateCount"
]),
theData
=
eventObj
.
sharpTurn
ExtraInfo
(
int
(
eventData
[
"0022"
][
"allRapidlyAccelerateCount"
]),
int
(
eventData
[
"0022"
][
"allSharpSlowdownCount"
]),
int
(
eventData
[
"0022"
][
"allSharpTurn"
]),
int
(
eventData
[
"0022"
][
"direction"
]),
int
(
eventData
[
"0022"
][
"dataProperty"
]))
data
=
data
+
"0020"
+
self
.
int2hexStringByBytes
(
int
((
len
(
theData
)
/
2
)),
2
)
+
theData
if
(
"0036"
in
eventData
.
keys
()):
#低档高速报警
...
...
lib/socket/service/ProtocolSimulaterDataService.py
View file @
2adbecfa
...
...
@@ -43,6 +43,9 @@ class ProtocolSimulaterDataService():
data
[
"travelData"
][
"totalMilleage"
]
=
0
#行驶总里程
data
[
"travelData"
][
"totalOil"
]
=
0
#行驶总油耗
data
[
"travelData"
][
"totalTime"
]
=
0
#行驶总时间
data
[
"event"
]
=
{}
return
data
#设今日行驶总里程,同时写入文件
...
...
templates/protocolTools/report/event_protocol_page.html
View file @
2adbecfa
...
...
@@ -345,6 +345,10 @@
<span><label>
急加速总次数:
</label><input
style=
"width:80px;"
id=
"ST_allRapidlyAccelerateCount"
type=
"text"
class=
"form-control"
value=
"5"
></span>
<span><label>
急减速总次数:
</label><input
style=
"width:80px;"
id=
"ST_allSharpSlowdownCount"
type=
"text"
class=
"form-control"
value=
"6"
></span>
<span><label>
急转弯总次数:
</label><input
style=
"width:80px;"
id=
"ST_allSharpTurn"
type=
"text"
class=
"form-control"
value=
"4"
></span>
<span><label>
急转弯方向:
</label><select
style=
"width:100px;"
id=
"ST_direction"
class=
"form-control"
>
<option
value=
"0"
>
向右转
</option>
<option
value=
"1"
>
向左转
</option>
</select></span>
<span><label>
数据属性:
</label><select
style=
"width:200px;"
id=
"ST_dataProperty"
class=
"form-control"
>
<option
value=
"1"
>
前10秒的事件采样数据
</option>
<option
value=
"2"
>
后10秒的事件采样数据
</option>
...
...
@@ -631,6 +635,7 @@ function get0022(){ //获取急转弯
data
[
"
allRapidlyAccelerateCount
"
]
=
$
(
"
#ST_allRapidlyAccelerateCount
"
).
val
();
data
[
"
allSharpSlowdownCount
"
]
=
$
(
"
#ST_allSharpSlowdownCount
"
).
val
();
data
[
"
allSharpTurn
"
]
=
$
(
"
#ST_allSharpTurn
"
).
val
();
data
[
"
direction
"
]
=
$
(
"
#ST_direction
"
).
val
();
data
[
"
dataProperty
"
]
=
$
(
"
#ST_dataProperty
"
).
val
();
return
data
}
...
...
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