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
b9f23da8
Commit
b9f23da8
authored
Apr 01, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了数据丢失的问题
parent
a3533c2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
README.md
README.md
+4
-5
lib/protocol/message/Location_msg.py
lib/protocol/message/Location_msg.py
+10
-8
No files found.
README.md
View file @
b9f23da8
...
@@ -13,11 +13,10 @@ views:存放网页端操作的后台处理逻辑,以及页面的展示逻辑
...
@@ -13,11 +13,10 @@ views:存放网页端操作的后台处理逻辑,以及页面的展示逻辑
run.py:启动项目图形操作界面主程序,访问:127.0.0.1:5000 即可
run.py:启动项目图形操作界面主程序,访问:127.0.0.1:5000 即可
requirements.txt:设置项目需要的依赖库
requirements.txt:设置项目需要的依赖库
### (二)、安装部署
### (二)、安装部署
1、机器上安装了python3 和 pip包管理工具
1、机器上安装了python3 和 pip包管理工具
2、进入项目根目录,编辑requirements.txt, 删除第一行wxPython==4.0.7.post2
2、使用 :pip install -r requirement.txt 安装依赖库
3、使用 :pip install -r requirement.txt 安装依赖库
3、python3 run.py 运行项目
4、python3 run.py 运行项目
4、访问 host:5000 即可进入模拟器页面
5、访问 host:5000 即可进入模拟器页面
### (三)、文档目录
### (三)、文档目录
[
1、lib使用库说明
](
doc/lib_details.md
)
[
1、lib使用库说明
](
doc/lib_details.md
)
...
...
lib/protocol/message/Location_msg.py
View file @
b9f23da8
...
@@ -223,33 +223,35 @@ class Location_msg(MessageBase):
...
@@ -223,33 +223,35 @@ class Location_msg(MessageBase):
if
(
"EA"
in
extraInfo
.
keys
()):
if
(
"EA"
in
extraInfo
.
keys
()):
#基础数据项列表
#基础数据项列表
baseDataList
=
self
.
getBaseDataList_GUI
(
extraInfo
[
"EA"
])
baseDataList
=
self
.
getBaseDataList_GUI
(
extraInfo
[
"EA"
])
extra_EA
=
"EA"
+
self
.
int2hexStringByBytes
(
int
(
len
(
baseDataList
)
/
2
))
extra_EA
=
"EA"
+
self
.
int2hexStringByBytes
(
int
(
len
(
baseDataList
)
/
2
))
+
baseDataList
data
=
data
+
extra_EA
data
=
data
+
extra_EA
if
(
"EB"
in
extraInfo
.
keys
()):
if
(
"EB"
in
extraInfo
.
keys
()):
#轿车 OBD 数据流
#轿车 OBD 数据流
saloonCarOBD_data
=
SaloonCarOBD_data
()
.
generateSaloonCarOBDData_GUI
(
extraInfo
[
"EB"
])
saloonCarOBD_data
=
SaloonCarOBD_data
()
.
generateSaloonCarOBDData_GUI
(
extraInfo
[
"EB"
])
extra_EB
=
"EB"
+
self
.
int2hexStringByBytes
(
int
(
len
(
saloonCarOBD_data
)
/
2
))
extra_EB
=
"EB"
+
self
.
int2hexStringByBytes
(
int
(
len
(
saloonCarOBD_data
)
/
2
))
+
saloonCarOBD_data
data
=
data
+
extra_EB
data
=
data
+
extra_EB
print
(
data
)
if
(
"EC"
in
extraInfo
.
keys
()):
if
(
"EC"
in
extraInfo
.
keys
()):
#货车 OBD 数据流
#货车 OBD 数据流
truckCarOBD_data
=
TruckCarOBD_data
()
.
generateTruckCarOBD_data
()
truckCarOBD_data
=
TruckCarOBD_data
()
.
generateTruckCarOBD_data
()
extra_EC
=
"EC"
+
self
.
int2hexStringByBytes
(
int
(
len
(
truckCarOBD_data
)
/
2
))
extra_EC
=
"EC"
+
self
.
int2hexStringByBytes
(
int
(
len
(
truckCarOBD_data
)
/
2
))
+
truckCarOBD_data
data
=
data
+
extra_EC
data
=
data
+
extra_EC
if
(
"ED"
in
extraInfo
.
keys
()):
if
(
"ED"
in
extraInfo
.
keys
()):
#新能源 OBD 数据流
#新能源 OBD 数据流
newEnergyCar_data
=
NewEnergyCar_data
()
.
generateNewEnergyCar_data
()
newEnergyCar_data
=
NewEnergyCar_data
()
.
generateNewEnergyCar_data
()
extra_ED
=
"ED"
+
self
.
int2hexStringByBytes
(
int
(
len
(
newEnergyCar_data
)
/
2
))
extra_ED
=
"ED"
+
self
.
int2hexStringByBytes
(
int
(
len
(
newEnergyCar_data
)
/
2
))
+
newEnergyCar_data
data
=
data
+
extra_ED
data
=
data
+
extra_ED
if
(
"EE"
in
extraInfo
.
keys
()):
if
(
"EE"
in
extraInfo
.
keys
()):
#外设数据项列表
#外设数据项列表
circum_data
=
Circum_data
()
.
generateCircum_data
()
circum_data
=
Circum_data
()
.
generateCircum_data
()
extra_EE
=
"EE"
+
self
.
int2hexStringByBytes
(
int
(
len
(
circum_data
)
/
2
))
extra_EE
=
"EE"
+
self
.
int2hexStringByBytes
(
int
(
len
(
circum_data
)
/
2
))
+
circum_data
data
=
data
+
extra_EE
data
=
data
+
extra_EE
if
(
"FA"
in
extraInfo
.
keys
()):
if
(
"FA"
in
extraInfo
.
keys
()):
#报警事件 ID 数据项列表
#报警事件 ID 数据项列表
alarmEvent_data
=
AlarmEvent_data
()
.
generateAlarmEvent_data_GUI
(
extraInfo
[
"FA"
])
alarmEvent_data
=
AlarmEvent_data
()
.
generateAlarmEvent_data_GUI
(
extraInfo
[
"FA"
])
extra_FA
=
"FA"
+
self
.
int2hexStringByBytes
(
int
(
len
(
alarmEvent_data
)
/
2
))
extra_FA
=
"FA"
+
self
.
int2hexStringByBytes
(
int
(
len
(
alarmEvent_data
)
/
2
))
+
alarmEvent_data
data
=
data
+
extra_FA
data
=
data
+
extra_FA
print
(
data
)
return
data
return
data
# 获取位置附加信息,数据随机产生
# 获取位置附加信息,数据随机产生
...
@@ -483,11 +485,11 @@ class Location_msg(MessageBase):
...
@@ -483,11 +485,11 @@ class Location_msg(MessageBase):
dataHex
=
dataHex
+
dataId_0007
dataHex
=
dataHex
+
dataId_0007
if
(
"0010"
in
data
.
keys
()):
if
(
"0010"
in
data
.
keys
()):
speedupInOneSeconds
=
self
.
getSpeedupInOneSeconds_GUI
(
data
[
"0010"
])
speedupInOneSeconds
=
self
.
getSpeedupInOneSeconds_GUI
(
data
[
"0010"
])
dataId_0010
=
"0010"
+
self
.
int2hexStringByBytes
(
int
(
len
(
speedupInOneSeconds
)
/
2
))
dataId_0010
=
"0010"
+
self
.
int2hexStringByBytes
(
int
(
len
(
speedupInOneSeconds
)
/
2
))
+
speedupInOneSeconds
dataHex
=
dataHex
+
dataId_0010
dataHex
=
dataHex
+
dataId_0010
if
(
"0011"
in
data
.
keys
()):
if
(
"0011"
in
data
.
keys
()):
securityStatusData
=
CarSafeStatusInfo
()
.
generateSecurityStatusData_GUI
(
data
[
"0011"
])
securityStatusData
=
CarSafeStatusInfo
()
.
generateSecurityStatusData_GUI
(
data
[
"0011"
])
dataId_0011
=
"0011"
+
self
.
int2hexStringByBytes
(
int
(
len
(
securityStatusData
)
/
2
))
dataId_0011
=
"0011"
+
self
.
int2hexStringByBytes
(
int
(
len
(
securityStatusData
)
/
2
))
+
securityStatusData
dataHex
=
dataHex
+
dataId_0011
dataHex
=
dataHex
+
dataId_0011
if
(
"0012"
in
data
.
keys
()):
if
(
"0012"
in
data
.
keys
()):
dataId_0012
=
"0012"
+
self
.
int2hexStringByBytes
(
2
)
+
self
.
int2hexStringByBytes
(
int
(
data
[
"0012"
][
"dataId_0012"
]),
2
)
dataId_0012
=
"0012"
+
self
.
int2hexStringByBytes
(
2
)
+
self
.
int2hexStringByBytes
(
int
(
data
[
"0012"
][
"dataId_0012"
]),
2
)
...
...
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