Commit 3edd93c9 authored by liyuanhong's avatar liyuanhong

并发线程脚本开发完成

parent 634a7493
# 模拟程序说明文档 # 模拟程序说明文档
#### (一)、框架结构说明 #### (一)、框架结构说明
\ 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操作界面:
![alt text](doc/img/m500_1.png "Title Text")
#### 车安优操作界面:
![alt text](doc/img/new_hard_1.png "Title Text")
\ No newline at end of file
# lib库使用说明
### (一)、lib库目录结构
This diff is collapsed.
...@@ -88,7 +88,7 @@ class ProtocolBase(Base): ...@@ -88,7 +88,7 @@ class ProtocolBase(Base):
##################################################### #####################################################
# 将字符串转换为对应的ascii值数组 # 将字符串转换为对应的ascii值数组
##################################################### #####################################################
def str2Ascsii(s): def str2Ascsii(self,s):
asciiArr = [] asciiArr = []
for i in range(0, len(s)): for i in range(0, len(s)):
asciiValue = ord(s[i]) asciiValue = ord(s[i])
...@@ -194,6 +194,8 @@ if __name__ == "__main__": ...@@ -194,6 +194,8 @@ if __name__ == "__main__":
# print(ProtocolBase().str2Hex("a")) # print(ProtocolBase().str2Hex("a"))
# print(ProtocolBase().int2hexStringByBytes(1,6)) # print(ProtocolBase().int2hexStringByBytes(1,6))
# print(ProtocolBase().num2signedNum(-5)) # print(ProtocolBase().num2signedNum(-5))
print(ProtocolBase().getUTCTimeHex("2020-01-03 13:05:13")) # print(ProtocolBase().getUTCTimeHex("2020-01-03 13:05:13"))
print(ProtocolBase().hex2UTCTime("1401030d050d")) # print(ProtocolBase().hex2UTCTime("1401030d050d"))
print(ProtocolBase().hex2UTCTime("14020a07122b")) # print(ProtocolBase().hex2UTCTime("14020a07122b"))
print(ProtocolBase().crc16("4040007000064d20191201000200120114030503202d26d7fffff0000000000505000000143c00000bb80100000fa00000000a0000000000005e60723b723b39331e100055320000001312001007d0001e0000000000000096000000280096ffff3e0001f40000003e0000000000000000000000"))
print(ProtocolBase().myCrc16("4040007000064d20191201000200120114030503202d26d7fffff0000000000505000000143c00000bb80100000fa00000000a0000000000005e60723b723b39331e100055320000001312001007d0001e0000000000000096000000280096ffff3e0001f40000003e0000000000000000000000"))
...@@ -100,9 +100,9 @@ def str2Ascsii(s): ...@@ -100,9 +100,9 @@ def str2Ascsii(s):
if __name__ == "__main__": if __name__ == "__main__":
print(crc16(str2Hex("aa"))) # print(crc16(str2Hex("aa")))
print(str2Hex("aa")) # print(str2Hex("aa"))
print(str2HexStrip("aa")) # print(str2HexStrip("aa"))
print(str2Ascsii("aa")) # print(str2Ascsii("aa"))
print(myCrc16("aa")) print(myCrc16("4040007000064d20191201000200120114030503202d26d7fffff0000000000505000000143c00000bb80100000fa00000000a0000000000005e60723b723b39331e100055320000001312001007d0001e0000000000000096000000280096ffff3e0001f40000003e0000000000000000000000"))
print(crc16(str2HexStrip("aa"))) # print(crc16(str2HexStrip("aa")))
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
<div style="background:#222222;height:50px;"></div> <div style="background:#222222;height:50px;"></div>
<div style="width: 70%;margin: 0 auto"> <div style="width: 70%;margin: 0 auto">
<ul class="nav nav-tabs" style="font-size:18px;"> <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]=="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]=="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]=="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]=="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> <li role="presentation" {% if arg.path[0]=="other" %} class="active" {% endif %}><a onclick="swichTap(this)" id="otherTab">其他</a></li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment