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
8d9e57c3
Commit
8d9e57c3
authored
4 years ago
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了M300和M500登录信息自动补全的功能
parent
2df85f64
master
No related merge requests found
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
22 deletions
+46
-22
config/m300Tools/m300Simulater.conf
config/m300Tools/m300Simulater.conf
+2
-2
config/m300Tools/m300Tools.conf
config/m300Tools/m300Tools.conf
+2
-2
config/messageTools/carSimulater.conf
config/messageTools/carSimulater.conf
+2
-2
config/messageTools/messageTools.conf
config/messageTools/messageTools.conf
+2
-2
lib/socket/service/M300SimulaterService.py
lib/socket/service/M300SimulaterService.py
+10
-1
lib/socket/service/MessageSimulaterService.py
lib/socket/service/MessageSimulaterService.py
+16
-1
templates/otherTools/maptool.html
templates/otherTools/maptool.html
+12
-12
No files found.
config/m300Tools/m300Simulater.conf
View file @
8d9e57c3
[
socket
]
host
=
1
0
.
100
.
12
.
32
port
=
9009
host
=
1
72
.
19
.
7
.
13
port
=
4
9009
This diff is collapsed.
Click to expand it.
config/m300Tools/m300Tools.conf
View file @
8d9e57c3
[
socket
]
host
=
1
0
.
100
.
12
.
32
port
=
9009
host
=
1
72
.
19
.
7
.
13
port
=
4
9009
This diff is collapsed.
Click to expand it.
config/messageTools/carSimulater.conf
View file @
8d9e57c3
[
socket
]
host
=
1
0
.
100
.
12
.
32
port
=
9001
host
=
1
72
.
19
.
7
.
13
port
=
49007
This diff is collapsed.
Click to expand it.
config/messageTools/messageTools.conf
View file @
8d9e57c3
[
socket
]
host
=
1
0
.
100
.
12
.
32
port
=
9001
host
=
1
72
.
19
.
7
.
13
port
=
49007
This diff is collapsed.
Click to expand it.
lib/socket/service/M300SimulaterService.py
View file @
8d9e57c3
...
...
@@ -19,6 +19,7 @@ from lib.protocol.m300.OBDCAN_protocol_m300 import OBDCAN_protocol_m300
from
lib.protocol.m300.VersionInfo_protocol_m300
import
VersionInfo_protocol_m300
from
lib.socket.service.M300SimulaterDataService
import
M300SimulaterDataService
from
lib.socket.service.websocket_service
import
Websocket_service
from
lib.util.util
import
strAddSpace
class
M300SimulaterService
():
...
...
@@ -81,8 +82,9 @@ class M300SimulaterService():
def
setCarData
(
self
,
data
):
self
.
carData
=
data
def
setWebsocketId
(
self
):
sleep
(
0.
1
)
sleep
(
1
)
self
.
websocketId
=
self
.
websocket
.
getCurrentClientId
()
print
(
self
.
websocketId
)
def
setWebsocket
(
self
,
data
):
self
.
websocket
=
data
def
setSn
(
self
,
data
):
...
...
@@ -118,6 +120,12 @@ class M300SimulaterService():
self
.
websocket
.
sendMsgToClient
(
info
,
self
.
websocketId
)
self
.
sn
=
self
.
sn
+
1
time
.
sleep
(
0.5
)
self
.
data
[
"version"
][
"SWVersion"
]
=
strAddSpace
(
self
.
data
[
"version"
][
"SWVersion"
],
12
)
self
.
data
[
"version"
][
"HWVersion"
]
=
strAddSpace
(
self
.
data
[
"version"
][
"HWVersion"
],
4
)
self
.
data
[
"version"
][
"GSMType"
]
=
strAddSpace
(
self
.
data
[
"version"
][
"GSMType"
],
15
)
self
.
data
[
"version"
][
"VINCode"
]
=
strAddSpace
(
self
.
data
[
"version"
][
"VINCode"
],
20
)
verObj
=
VersionInfo_protocol_m300
(
waterCode
=
self
.
sn
,
DEV_ID
=
self
.
data
[
"carId"
],
SWVersion
=
self
.
data
[
"version"
][
"SWVersion"
],
\
SWDate
=
self
.
data
[
"version"
][
"SWDate"
],
HWVersion
=
self
.
data
[
"version"
][
"HWVersion"
],
GSMType
=
self
.
data
[
"version"
][
"GSMType"
],
\
carType
=
int
(
self
.
data
[
"version"
][
"carType"
]),
engineCode
=
int
(
self
.
data
[
"version"
][
"engineCode"
]),
VINCode
=
self
.
data
[
"version"
][
"VINCode"
])
...
...
@@ -478,6 +486,7 @@ class M300SimulaterService():
#启动与页面交互的websocket服务
########################################################
def
startWebsocketService
(
self
):
time
.
sleep
(
0.5
)
if
self
.
websocket
==
None
:
t
=
threading
.
Thread
(
target
=
self
.
websocketService
,
args
=
())
t
.
start
()
...
...
This diff is collapsed.
Click to expand it.
lib/socket/service/MessageSimulaterService.py
View file @
8d9e57c3
...
...
@@ -20,6 +20,7 @@ from lib.protocol.message.response.QueryTheTerminalParam_res import QueryTheTerm
from
lib.protocol.messagePlateform.PlateformVersionInfo_res
import
PlatefromVersionInfo_res
from
lib.socket.service.MessageSimulaterDataService
import
MessageSimulaterDataService
from
lib.socket.service.websocket_service
import
Websocket_service
from
lib.util.util
import
strAddSpace
class
MessageSimulaterService
():
...
...
@@ -96,7 +97,7 @@ class MessageSimulaterService():
def
setData
(
self
,
data
):
self
.
data
=
data
def
setWebsocketId
(
self
):
sleep
(
0.
1
)
sleep
(
1
)
self
.
websocketId
=
self
.
websocket
.
getCurrentClientId
()
def
setWebsocket
(
self
,
data
):
self
.
websocket
=
data
...
...
@@ -136,6 +137,11 @@ class MessageSimulaterService():
########################################################
def
carLogin
(
self
):
loginObj
=
TerminalRegister_msg
()
self
.
data
[
"login"
][
"manufacturerId"
]
=
strAddSpace
(
self
.
data
[
"login"
][
"manufacturerId"
],
5
)
self
.
data
[
"login"
][
"terminalType"
]
=
strAddSpace
(
self
.
data
[
"login"
][
"terminalType"
],
20
)
self
.
data
[
"login"
][
"terminalId"
]
=
strAddSpace
(
self
.
data
[
"login"
][
"terminalId"
],
7
)
msg
=
loginObj
.
generateMsg_GUI
(
msgID
=
"0100"
,
phoneNum
=
int
(
self
.
data
[
"phoneNum"
]),
msgWaterCode
=
self
.
sn
,
encryptionType
=
0
,
subPkg
=
0
,
provinceId
=
int
(
self
.
data
[
"login"
][
"provinceId"
]),
\
countyId
=
int
(
self
.
data
[
"login"
][
"countyId"
]),
manufacturerId
=
self
.
data
[
"login"
][
"manufacturerId"
],
terminalType
=
self
.
data
[
"login"
][
"terminalType"
],
\
terminalId
=
self
.
data
[
"login"
][
"terminalId"
],
licencePlateColor
=
int
(
self
.
data
[
"login"
][
"licencePlateColor"
]),
carSign
=
self
.
data
[
"login"
][
"carSign"
])
...
...
@@ -146,6 +152,15 @@ class MessageSimulaterService():
self
.
sn
=
self
.
sn
+
1
verObj
=
TerminalVersionInfo_msg
()
time
.
sleep
(
0.5
)
self
.
data
[
"version"
][
"softwareVersion"
]
=
strAddSpace
(
self
.
data
[
"version"
][
"softwareVersion"
],
14
)
self
.
data
[
"version"
][
"CPUId"
]
=
strAddSpace
(
self
.
data
[
"version"
][
"CPUId"
],
12
)
self
.
data
[
"version"
][
"GMSType"
]
=
strAddSpace
(
self
.
data
[
"version"
][
"GMSType"
],
15
)
self
.
data
[
"version"
][
"GMS_IMEI"
]
=
strAddSpace
(
self
.
data
[
"version"
][
"GMS_IMEI"
],
15
)
self
.
data
[
"version"
][
"SIM_IMSI"
]
=
strAddSpace
(
self
.
data
[
"version"
][
"SIM_IMSI"
],
15
)
self
.
data
[
"version"
][
"SIM_ICCID"
]
=
strAddSpace
(
self
.
data
[
"version"
][
"SIM_ICCID"
],
20
)
self
.
data
[
"version"
][
"VIN"
]
=
strAddSpace
(
self
.
data
[
"version"
][
"VIN"
],
17
)
msg
=
verObj
.
generateMsg_GUI
(
msgID
=
"0205"
,
phoneNum
=
int
(
self
.
data
[
"phoneNum"
]),
msgWaterCode
=
self
.
sn
,
encryptionType
=
0
,
subPkg
=
0
,
\
softwareVersion
=
self
.
data
[
"version"
][
"softwareVersion"
],
softwareVersionDate
=
self
.
data
[
"version"
][
"softwareVersionDate"
],
CPUId
=
self
.
data
[
"version"
][
"CPUId"
],
\
GMSType
=
self
.
data
[
"version"
][
"GMSType"
],
GMS_IMEI
=
self
.
data
[
"version"
][
"GMS_IMEI"
],
SIM_IMSI
=
self
.
data
[
"version"
][
"SIM_IMSI"
],
\
...
...
This diff is collapsed.
Click to expand it.
templates/otherTools/maptool.html
View file @
8d9e57c3
...
...
@@ -97,18 +97,18 @@
{
"name": "gpsLine",
"GPSLine": [
[
"106.584986",
"29.564424"
]
,
[
"106.584815",
"29.562559"
]
,
[
"106.584043",
"29.560618"
]
{
"
lng":"
106.584986",
"
lat":"
29.564424"
}
,
{
"
lng":"
106.584815",
"
lat":"
29.562559"
}
,
{
"
lng":"
106.584043",
"
lat":"
29.560618"
}
]
}
格式'
></textarea>
...
...
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