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
3edd93c9
Commit
3edd93c9
authored
Mar 05, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
并发线程脚本开发完成
parent
634a7493
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
191 additions
and
46 deletions
+191
-46
README.md
README.md
+22
-1
doc/img/m500_1.png
doc/img/m500_1.png
+0
-0
doc/img/new_hard_1.png
doc/img/new_hard_1.png
+0
-0
doc/lib_details.md
doc/lib_details.md
+2
-0
lib/multiThread/SendMultMsgThread_m500.py
lib/multiThread/SendMultMsgThread_m500.py
+153
-33
lib/protocol/ProtocolBase.py
lib/protocol/ProtocolBase.py
+6
-4
lib/util/dataUtil.py
lib/util/dataUtil.py
+6
-6
templates/base.html
templates/base.html
+2
-2
No files found.
README.md
View file @
3edd93c9
# 模拟程序说明文档
#### (一)、框架结构说明
\ No newline at end of file
#### (一)、框架结构说明
config:存放项目配置文件
dada:存放项目需要的数据和产生的数据
doc:项目帮助文档,markdown格式编写
img:存放项目需要的图片资源
lib:车机协议实现的类,以及各种业务逻辑
log:项目运行日志文件
static:存放网页端图形操作界面的静态文件,包含:js,css,图片等
templates:存放网页模板文件 html
views:存放网页端操作的后台处理逻辑,以及页面的展示逻辑
run.py:启动项目图形操作界面主程序,访问:127.0.0.1:5000 即可
requirements.txt:设置项目需要的依赖库
### (二)、文档目录
[
1、lib使用库说明
](
doc/lib_details.md
)
[
2、如何使用web图形操作界面
](
https://www.baidu.com/
)
### (三)、图形界面展示
#### m500操作界面:

#### 车安优操作界面:

\ No newline at end of file
doc/img/m500_1.png
0 → 100644
View file @
3edd93c9
84.9 KB
doc/img/new_hard_1.png
0 → 100644
View file @
3edd93c9
113 KB
doc/lib_details.md
0 → 100644
View file @
3edd93c9
# lib库使用说明
### (一)、lib库目录结构
lib/multiThread/SendMultMsgThread_m500.py
View file @
3edd93c9
This diff is collapsed.
Click to expand it.
lib/protocol/ProtocolBase.py
View file @
3edd93c9
...
...
@@ -88,7 +88,7 @@ class ProtocolBase(Base):
#####################################################
# 将字符串转换为对应的ascii值数组
#####################################################
def
str2Ascsii
(
s
):
def
str2Ascsii
(
s
elf
,
s
):
asciiArr
=
[]
for
i
in
range
(
0
,
len
(
s
)):
asciiValue
=
ord
(
s
[
i
])
...
...
@@ -194,6 +194,8 @@ if __name__ == "__main__":
# print(ProtocolBase().str2Hex("a"))
# print(ProtocolBase().int2hexStringByBytes(1,6))
# print(ProtocolBase().num2signedNum(-5))
print
(
ProtocolBase
()
.
getUTCTimeHex
(
"2020-01-03 13:05:13"
))
print
(
ProtocolBase
()
.
hex2UTCTime
(
"1401030d050d"
))
print
(
ProtocolBase
()
.
hex2UTCTime
(
"14020a07122b"
))
# print(ProtocolBase().getUTCTimeHex("2020-01-03 13:05:13"))
# print(ProtocolBase().hex2UTCTime("1401030d050d"))
# print(ProtocolBase().hex2UTCTime("14020a07122b"))
print
(
ProtocolBase
()
.
crc16
(
"4040007000064d20191201000200120114030503202d26d7fffff0000000000505000000143c00000bb80100000fa00000000a0000000000005e60723b723b39331e100055320000001312001007d0001e0000000000000096000000280096ffff3e0001f40000003e0000000000000000000000"
))
print
(
ProtocolBase
()
.
myCrc16
(
"4040007000064d20191201000200120114030503202d26d7fffff0000000000505000000143c00000bb80100000fa00000000a0000000000005e60723b723b39331e100055320000001312001007d0001e0000000000000096000000280096ffff3e0001f40000003e0000000000000000000000"
))
lib/util/dataUtil.py
View file @
3edd93c9
...
...
@@ -100,9 +100,9 @@ def str2Ascsii(s):
if
__name__
==
"__main__"
:
print
(
crc16
(
str2Hex
(
"aa"
)))
print
(
str2Hex
(
"aa"
))
print
(
str2HexStrip
(
"aa"
))
print
(
str2Ascsii
(
"aa"
))
print
(
myCrc16
(
"
aa
"
))
print
(
crc16
(
str2HexStrip
(
"aa"
)))
#
print(crc16(str2Hex("aa")))
#
print(str2Hex("aa"))
#
print(str2HexStrip("aa"))
#
print(str2Ascsii("aa"))
print
(
myCrc16
(
"
4040007000064d20191201000200120114030503202d26d7fffff0000000000505000000143c00000bb80100000fa00000000a0000000000005e60723b723b39331e100055320000001312001007d0001e0000000000000096000000280096ffff3e0001f40000003e0000000000000000000000
"
))
#
print(crc16(str2HexStrip("aa")))
templates/base.html
View file @
3edd93c9
...
...
@@ -19,8 +19,8 @@
<div
style=
"background:#222222;height:50px;"
></div>
<div
style=
"width: 70%;margin: 0 auto"
>
<ul
class=
"nav nav-tabs"
style=
"font-size:18px;"
>
<li
role=
"presentation"
{%
if
arg.path[0]=
="protocolTools"
%}
class=
"active"
{%
endif
%}
><a
onclick=
"swichTap(this)"
id=
"protocolTools"
>
协议工具
</a></li>
<li
role=
"presentation"
{%
if
arg.path[0]=
="messageTools"
%}
class=
"active"
{%
endif
%}
><a
onclick=
"swichTap(this)"
id=
"messageTools"
>
消息工具
</a></li>
<li
role=
"presentation"
{%
if
arg.path[0]=
="protocolTools"
%}
class=
"active"
{%
endif
%}
><a
onclick=
"swichTap(this)"
id=
"protocolTools"
>
M500
协议工具
</a></li>
<li
role=
"presentation"
{%
if
arg.path[0]=
="messageTools"
%}
class=
"active"
{%
endif
%}
><a
onclick=
"swichTap(this)"
id=
"messageTools"
>
新硬件
消息工具
</a></li>
<li
role=
"presentation"
{%
if
arg.path[0]=
="tab1"
%}
class=
"active"
{%
endif
%}
><a
onclick=
"swichTap(this)"
id=
"tab1"
>
案例
</a></li>
<li
role=
"presentation"
{%
if
arg.path[0]=
="tab2"
%}
class=
"active"
{%
endif
%}
><a
onclick=
"swichTap(this)"
id=
"tab2"
>
演示页面
</a></li>
<li
role=
"presentation"
{%
if
arg.path[0]=
="other"
%}
class=
"active"
{%
endif
%}
><a
onclick=
"swichTap(this)"
id=
"otherTab"
>
其他
</a></li>
...
...
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