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
dec8403f
Commit
dec8403f
authored
Mar 06, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
备份提交
parent
3edd93c9
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
193 additions
and
16 deletions
+193
-16
lib/multiThread/SendMultMsgThread_m500.py
lib/multiThread/SendMultMsgThread_m500.py
+3
-4
lib/protocol/message/Location_msg.py
lib/protocol/message/Location_msg.py
+4
-4
lib/protocol/message/data/SaloonCarOBD_data.py
lib/protocol/message/data/SaloonCarOBD_data.py
+4
-4
templates/messageTools/message/location_msg_page.html
templates/messageTools/message/location_msg_page.html
+182
-4
No files found.
lib/multiThread/SendMultMsgThread_m500.py
View file @
dec8403f
...
...
@@ -18,7 +18,7 @@ class SendMultMsgThread():
self
.
msg
=
msg
self
.
timeOut
=
60
#socket超时时间
self
.
BUF_SIZE
=
1024
#接收消息缓存
self
.
threadCount
=
5
000
#并发线程数
self
.
threadCount
=
1
000
#并发线程数
self
.
totalTime
=
0
#所有线程的运行总和
self
.
threadArr
=
{}
#保存每个线程的信息
self
.
failThreadCount
=
0
#失败线程数
...
...
@@ -110,7 +110,6 @@ class SendMultMsgThread():
self
.
connectTimeoutNum
=
self
.
connectTimeoutNum
+
1
print
(
threadName
+
":"
+
"连接超时,socket断开"
)
return
while
(
endTime
-
startTime
)
<
self
.
durTime
:
msg
=
self
.
getRandomMsg
(
carId
)
try
:
...
...
@@ -203,7 +202,6 @@ class SendMultMsgThread():
print
(
"接收失败:"
+
str
(
self
.
reviceTimeoutNum
))
self
.
writeToFile
(
"../../data/threadDetailsContinuous.json"
,
self
.
threadArr
)
def
writeToFile
(
self
,
path
,
data
):
with
open
(
path
,
"w"
,
encoding
=
'utf-8'
)
as
fi
:
json
.
dump
(
data
,
fi
)
...
...
@@ -269,7 +267,8 @@ class SendMultMsgThread():
if
__name__
==
"__main__"
:
t
=
SendMultMsgThread
()
t
.
setHost
(
"10.100.12.32"
)
# t.setHost("10.100.12.32")
t
.
setHost
(
"10.100.5.251"
)
t
.
setPort
(
9008
)
# t.startThread()
t
.
startThreadContinuous
()
\ No newline at end of file
lib/protocol/message/Location_msg.py
View file @
dec8403f
...
...
@@ -174,7 +174,7 @@ class Location_msg(MessageBase):
extra_FA
=
"FA"
+
self
.
int2hexStringByBytes
(
int
(
len
(
AlarmEvent_data
()
.
generateAlarmEvent_data
())
/
2
))
+
AlarmEvent_data
()
.
generateAlarmEvent_data
()
# data = extra_01 + extra_02 + extra_11 + extra_31 + extra_EA + extra_EB + extra_FA
data
=
extra_11
+
extra_31
+
extra_EA
+
extra_EB
data
=
extra_11
+
extra_31
+
extra_EA
+
extra_EB
+
extra_FA
# data = extra_01 + extra_02 + extra_11 + extra_12 + extra_13
# data = data + extra_2A + extra_30 + extra_31 + extra_EA + extra_EB
...
...
@@ -666,10 +666,10 @@ class Location_msg(MessageBase):
# 获取状态
#######################################################
def
getStatus
(
self
):
ACCStatus
=
0
#0:ACC 关;1: ACC 开 (1)
ACCStatus
=
1
#0:ACC 关;1: ACC 开 (1)
locationStatus
=
2
#0:未定位;1:定位 (2)
latitudeStatus
=
1
#0:北纬;1:南纬 (4)
longitudeStatus
=
1
#0:东经;1:西经 (8)
latitudeStatus
=
4
#0:北纬;1:南纬 (4)
longitudeStatus
=
0
#0:东经;1:西经 (8)
runStatus
=
0
#0:运营状态;1:停运状态 (16)
isLocationEncrypt
=
0
#0:经纬度未经保密插件加密;1:经纬度已经保密插件加密 (32)
retain6_7
=
0
...
...
lib/protocol/message/data/SaloonCarOBD_data.py
View file @
dec8403f
...
...
@@ -37,13 +37,13 @@ class SaloonCarOBD_data(MessageBase):
#燃油压力 , 0 - 500kpa
oilPressure
=
"60A0"
+
self
.
int2hexStringByBytes
(
2
)
+
self
.
int2hexStringByBytes
(
276
,
2
)
#故障码状态 , 发动机故障码状态
troubleCodeStatus
=
"6014"
+
self
.
int2hexStringByBytes
(
1
)
+
self
.
int2hexStringByBytes
(
1
)
troubleCodeStatus
=
"6014"
+
self
.
int2hexStringByBytes
(
1
)
+
self
.
int2hexStringByBytes
(
0
)
#故障码个数
troubleCodeNum
=
"6010"
+
self
.
int2hexStringByBytes
(
1
)
+
self
.
int2hexStringByBytes
(
2
)
#空气流量 , 0.1 实际值为上传值/10 0.1g/s
airFlow
=
"6100"
+
self
.
int2hexStringByBytes
(
2
)
+
self
.
int2hexStringByBytes
(
550
,
2
)
#绝对气门位置
valveLocation
=
"6110"
+
self
.
int2hexStringByBytes
(
2
)
+
self
.
int2hexStringByBytes
(
5
0
1
,
2
)
valveLocation
=
"6110"
+
self
.
int2hexStringByBytes
(
2
)
+
self
.
int2hexStringByBytes
(
51
,
2
)
#自发动机启动运行时间 sec
engineRunTime
=
"61F0"
+
self
.
int2hexStringByBytes
(
2
)
+
self
.
int2hexStringByBytes
(
3700
,
2
)
#故障行驶里程 , Km
...
...
@@ -51,9 +51,9 @@ class SaloonCarOBD_data(MessageBase):
#计算负荷值
calculateLoadValue
=
"6040"
+
self
.
int2hexStringByBytes
(
1
)
+
self
.
int2hexStringByBytes
(
44
)
#长期燃油修正(气缸列 1 和 3)
fuelTrim
=
"6070"
+
self
.
int2hexStringByBytes
(
2
)
+
self
.
int2hexStringByBytes
(
230
,
2
)
fuelTrim
=
"6070"
+
self
.
int2hexStringByBytes
(
2
)
+
self
.
int2hexStringByBytes
(
89
,
2
)
#第一缸点火正时提前角 ,显示值为上传值-64
fireAngle
=
"60E0"
+
self
.
int2hexStringByBytes
(
2
)
+
self
.
int2hexStringByBytes
(
800
,
2
)
fireAngle
=
"60E0"
+
self
.
int2hexStringByBytes
(
2
)
+
self
.
int2hexStringByBytes
(
154
,
2
)
#前刹车片磨损 , 0 正常/否则,显示对应数据,单位:级
frontBrakeBlockAbrasion
=
"6701"
+
self
.
int2hexStringByBytes
(
1
)
+
self
.
int2hexStringByBytes
(
0
)
#后刹车片磨损 , 0 正常/否则,显示对应数据,单位:级
...
...
templates/messageTools/message/location_msg_page.html
View file @
dec8403f
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