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
1e08c824
Commit
1e08c824
authored
Jun 18, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
M500模拟器增加了时间差功能
parent
80d037dc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
data/protocolTools/carData/M202003060520.json
data/protocolTools/carData/M202003060520.json
+1
-1
lib/socket/service/ProtocolSimulaterService.py
lib/socket/service/ProtocolSimulaterService.py
+4
-4
templates/protocolTools/report/M_carSimulater_page.html
templates/protocolTools/report/M_carSimulater_page.html
+3
-0
No files found.
data/protocolTools/carData/M202003060520.json
View file @
1e08c824
{
"time"
:
{
"dateTime"
:
"2020-06-18 09:52:18"
,
"date"
:
"2020-06-18"
,
"time"
:
"09:52:18"
},
"curDayTravel"
:
{
"todayTotalMilleage"
:
24370
,
"todayTotalOil"
:
2170
,
"todayTotalTime"
:
1480
,
"theMilleage"
:
415
,
"theOil"
:
40
,
"theTime"
:
25
},
"travelData"
:
{
"totalMilleage"
:
451940
,
"totalOil"
:
42185
,
"totalTime"
:
26973
},
"event"
:
{
"threeRapid"
:
{
"totalRapidlyAccelerate"
:
33
,
"totalSharpSlowdown"
:
23
,
"totalSharpTurn"
:
26
}}}
\ No newline at end of file
{
"time"
:
{
"dateTime"
:
"2020-06-18 09:52:18"
,
"date"
:
"2020-06-18"
,
"time"
:
"09:52:18"
},
"curDayTravel"
:
{
"todayTotalMilleage"
:
25532
,
"todayTotalOil"
:
2282
,
"todayTotalTime"
:
1550
,
"theMilleage"
:
1162
,
"theOil"
:
112
,
"theTime"
:
70
},
"travelData"
:
{
"totalMilleage"
:
453102
,
"totalOil"
:
42297
,
"totalTime"
:
27043
},
"event"
:
{
"threeRapid"
:
{
"totalRapidlyAccelerate"
:
33
,
"totalSharpSlowdown"
:
23
,
"totalSharpTurn"
:
26
}}}
\ No newline at end of file
lib/socket/service/ProtocolSimulaterService.py
View file @
1e08c824
...
...
@@ -480,7 +480,7 @@ class ProtocolSimulaterService():
elif
self
.
GPSValid
==
0
:
gpsObj
.
setGpsValid
(
0
)
gpsObj
.
setDirectionAngle
(
self
.
getDirAngle
())
timeS
=
int
(
time
.
time
())
-
8
*
3600
timeS
=
int
(
time
.
time
())
-
8
*
3600
+
int
(
self
.
data
[
"timeDif"
])
timeArray
=
time
.
localtime
(
timeS
)
UTCTime
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
timeArray
)
gpsObj
.
setUTCTime
(
UTCTime
)
...
...
@@ -500,7 +500,7 @@ class ProtocolSimulaterService():
elif
self
.
GPSValid
==
0
:
gpsObj
.
setGpsValid
(
0
)
gpsObj
.
setDirectionAngle
(
self
.
getDirAngle
())
timeS
=
int
(
time
.
time
())
-
8
*
3600
timeS
=
int
(
time
.
time
())
-
8
*
3600
+
int
(
self
.
data
[
"timeDif"
])
timeArray
=
time
.
localtime
(
timeS
)
UTCTime
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
timeArray
)
gpsObj
.
setUTCTime
(
UTCTime
)
...
...
@@ -520,7 +520,7 @@ class ProtocolSimulaterService():
elif
self
.
GPSValid
==
0
:
gpsObj
.
setGpsValid
(
0
)
gpsObj
.
setDirectionAngle
(
self
.
getDirAngle
())
timeS
=
int
(
time
.
time
())
-
8
*
3600
timeS
=
int
(
time
.
time
())
-
8
*
3600
+
int
(
self
.
data
[
"timeDif"
])
timeArray
=
time
.
localtime
(
timeS
)
UTCTime
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
timeArray
)
gpsObj
.
setUTCTime
(
UTCTime
)
...
...
@@ -532,7 +532,7 @@ class ProtocolSimulaterService():
def
genOBDMsg
(
self
,
fireStatus
=
1
,
ACCStatus
=
0
,
engineSpeed
=
300
,
speed
=
0
,
meterMileage
=
6000
,
\
totailMileage
=
600
,
totalOilExpend
=
30
,
totalRunTime
=
10
):
OBDObj
=
OBDReport_CAN_protocol
(
DEV_ID
=
self
.
carId
,
WATER_CODE
=
self
.
sn
)
timeS
=
int
(
time
.
time
())
-
8
*
3600
timeS
=
int
(
time
.
time
())
-
8
*
3600
+
int
(
self
.
data
[
"timeDif"
])
timeArray
=
time
.
localtime
(
timeS
)
UTCTime
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
timeArray
)
OBDObj
.
setInfoTime
(
UTCTime
)
...
...
templates/protocolTools/report/M_carSimulater_page.html
View file @
1e08c824
...
...
@@ -46,6 +46,7 @@
<span
style=
"display:none;"
><label>
消息流水号:
</label><input
id=
"WATER_CODE"
style=
"width:60px;"
type=
"text"
class=
"form-control"
value=
"1"
></span>
<span><label>
上报间隔(秒):
</label><input
id=
"durTime"
style=
"width:60px;"
type=
"text"
class=
"form-control"
value=
"5"
></span>
<span><label>
设置超时时间:
</label><input
style=
"width:80px;"
id=
"timeout"
type=
"text"
class=
"form-control"
value=
"36000"
></span>
<span><label
title=
"可填入正负数,表示发送的报文时间与当前的时间差距"
>
报文时间差(秒):
</label><input
style=
"width:80px;"
id=
"timeDif"
type=
"text"
class=
"form-control"
value=
"0"
></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></h5>
...
...
@@ -214,10 +215,12 @@ function getPageData(){
var
WATER_CODE
=
$
(
"
#WATER_CODE
"
).
val
()
var
durTime
=
$
(
"
#durTime
"
).
val
()
var
timeout
=
$
(
"
#timeout
"
).
val
()
var
timeDif
=
$
(
"
#timeDif
"
).
val
()
data
[
"
carId
"
]
=
carId
data
[
"
WATER_CODE
"
]
=
WATER_CODE
data
[
"
durTime
"
]
=
durTime
data
[
"
timeout
"
]
=
timeout
data
[
"
timeDif
"
]
=
timeDif
//会话session数据
data
[
"
session
"
]
=
{}
var
sessionId
=
$
(
"
#curSession
"
).
val
()
...
...
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