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
2df85f64
Commit
2df85f64
authored
Sep 14, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了登录信息自动补全的功能
parent
ec1f53ea
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
6 deletions
+27
-6
config/protocolTools/carSimulater.conf
config/protocolTools/carSimulater.conf
+2
-2
config/protocolTools/protocolTools.conf
config/protocolTools/protocolTools.conf
+2
-2
lib/socket/service/ProtocolSimulaterService.py
lib/socket/service/ProtocolSimulaterService.py
+1
-1
lib/util/util.py
lib/util/util.py
+12
-0
templates/protocolTools/report/M_carSimulater_page.html
templates/protocolTools/report/M_carSimulater_page.html
+1
-1
views/protocolTools/M_carSimulater_process.py
views/protocolTools/M_carSimulater_process.py
+9
-0
No files found.
config/protocolTools/carSimulater.conf
View file @
2df85f64
[
socket
]
[
socket
]
host
=
1
14
.
116
.
205
.
211
host
=
1
72
.
19
.
7
.
13
port
=
8003
port
=
49008
config/protocolTools/protocolTools.conf
View file @
2df85f64
[
socket
]
[
socket
]
host
=
1
0
.
100
.
12
.
32
host
=
1
72
.
19
.
7
.
13
port
=
9008
port
=
4
9008
lib/socket/service/ProtocolSimulaterService.py
View file @
2df85f64
...
@@ -65,7 +65,7 @@ class ProtocolSimulaterService():
...
@@ -65,7 +65,7 @@ class ProtocolSimulaterService():
def
setData
(
self
,
data
):
def
setData
(
self
,
data
):
self
.
data
=
data
self
.
data
=
data
def
setWebsocketId
(
self
):
def
setWebsocketId
(
self
):
sleep
(
0.
1
)
sleep
(
0.
5
)
self
.
websocketId
=
self
.
websocket
.
getCurrentClientId
()
self
.
websocketId
=
self
.
websocket
.
getCurrentClientId
()
def
setWebsocket
(
self
,
data
):
def
setWebsocket
(
self
,
data
):
self
.
websocket
=
data
self
.
websocket
=
data
...
...
lib/util/util.py
0 → 100644
View file @
2df85f64
#coding:utf-8
#########################################
# 字符串自动补空格函数
# num 字符串期望的长度
#########################################
def
strAddSpace
(
str
,
num
):
data
=
str
if
len
(
str
)
<
num
:
for
i
in
range
(
0
,
num
-
len
(
str
)):
data
=
data
+
" "
return
data
\ No newline at end of file
templates/protocolTools/report/M_carSimulater_page.html
View file @
2df85f64
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
{% block content_1 %}
{% block content_1 %}
<div
id=
"container3"
style=
"width:100%;min-height:750px;float:left;_background:green;margin-top:10px;_border-top: 1px solid #eee;"
>
<div
id=
"container3"
style=
"width:100%;min-height:750px;float:left;_background:green;margin-top:10px;_border-top: 1px solid #eee;"
>
<div
style=
"width:100%;padding-bottom:10px;border-bottom: 1px solid #eee;"
>
<div
style=
"width:100%;padding-bottom:10px;border-bottom: 1px solid #eee;"
>
<span><label>
车机Id:
</label><input
id=
"carId"
type=
"text"
class=
"form-control"
value=
"M20200
3060520
"
></span>
<span><label>
车机Id:
</label><input
id=
"carId"
type=
"text"
class=
"form-control"
value=
"M20200
8270001
"
></span>
<span
style=
"display:none;"
><label>
消息流水号:
</label><input
id=
"WATER_CODE"
style=
"width:60px;"
type=
"text"
class=
"form-control"
value=
"1"
></span>
<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
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>
设置超时时间:
</label><input
style=
"width:80px;"
id=
"timeout"
type=
"text"
class=
"form-control"
value=
"36000"
></span>
...
...
views/protocolTools/M_carSimulater_process.py
View file @
2df85f64
...
@@ -17,6 +17,7 @@ import traceback
...
@@ -17,6 +17,7 @@ import traceback
from
lib.socket.service.ProtocolSimulaterService
import
ProtocolSimulaterService
from
lib.socket.service.ProtocolSimulaterService
import
ProtocolSimulaterService
from
lib.util
import
fileUtil
from
lib.util
import
fileUtil
from
lib.util.DelaySend
import
DelaySend
from
lib.util.DelaySend
import
DelaySend
from
lib.util.util
import
strAddSpace
M_carSimulater_process
=
Blueprint
(
'M_carSimulater_process'
,
__name__
)
M_carSimulater_process
=
Blueprint
(
'M_carSimulater_process'
,
__name__
)
...
@@ -120,6 +121,14 @@ def login():
...
@@ -120,6 +121,14 @@ def login():
params
=
json
.
loads
(
params
.
decode
(
"utf-8"
))
params
=
json
.
loads
(
params
.
decode
(
"utf-8"
))
sessionId
=
params
[
"session"
][
"sessionId"
]
sessionId
=
params
[
"session"
][
"sessionId"
]
data
=
{}
data
=
{}
params
[
"login"
][
"cpuId"
]
=
strAddSpace
(
params
[
"login"
][
"cpuId"
],
24
)
params
[
"login"
][
"imsi"
]
=
strAddSpace
(
params
[
"login"
][
"imsi"
],
15
)
params
[
"login"
][
"ccid"
]
=
strAddSpace
(
params
[
"login"
][
"ccid"
],
20
)
params
[
"login"
][
"imei"
]
=
strAddSpace
(
params
[
"login"
][
"imei"
],
15
)
params
[
"version"
][
"verInfo"
]
=
strAddSpace
(
params
[
"version"
][
"verInfo"
],
16
)
params
[
"version"
][
"compileDate"
]
=
strAddSpace
(
params
[
"version"
][
"compileDate"
],
10
)
params
[
"version"
][
"GSM"
]
=
strAddSpace
(
params
[
"version"
][
"GSM"
],
10
)
try
:
try
:
service
=
connects
[
sessionId
][
"service"
]
service
=
connects
[
sessionId
][
"service"
]
service
.
setCarId
(
params
[
"carId"
])
service
.
setCarId
(
params
[
"carId"
])
...
...
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