Commit dec8403f authored by liyuanhong's avatar liyuanhong

备份提交

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