Commit fd98141c authored by 方开's avatar 方开 🍔
Browse files

同步更新至云南主机版本

parent ce0ca931
...@@ -26,19 +26,29 @@ def checkSpecies(species, tempHumi): ...@@ -26,19 +26,29 @@ def checkSpecies(species, tempHumi):
def checkWater(species, waterData): def checkWater(species, waterData):
# 通道数据列表存放每一路的水分值 # 通道数据列表存放每一路的水分值
channelDataList = [] channelDataList = []
channelNumlist = []
# 循环找到各点数据,没找到默认为None值,实时样例数据字符串每一路为62长度,返回所有路的数据 # 循环找到各点数据,没找到默认为None值,实时样例数据字符串每一路为62长度,返回所有路的数据
# 1F 00 00 00 44 01 AC 05 FB 12 A1 05 D1 13 4D 05 D1 13 43 FF FF FF FF FF FF FF FF FF FF FF FF # 1F 00 00 00 44 01 AC 05 FB 12 A1 05 D1 13 4D 05 D1 13 43 FF FF FF FF FF FF FF FF FF FF FF FF
# 分割出每一路的水分数据进行处理 # 分割出每一路的水分数据进行处理
for i in range(0, len(waterData), 62): for i in range(0, len(waterData), 62):
try: try:
#channelNum=waterData[i+10:i+11]
channelNum=waterData[i+10:i+12]#冒号后的数不在数列内,多加一位
channelData = waterData[i:i + 62][14:] channelData = waterData[i:i + 62][14:]
channelDataList.append(channelData) channelDataList.append(channelData)
j=int(channelNum,16)
channelNumlist.append(j)
except Exception as e: except Exception as e:
# 填充6个ffff ffff 对应着六个点的温湿度 # 填充6个ffff ffff 对应着六个点的温湿度
logging.info(f"{e}") logging.info(f"{e}")
channelDataList.append("ffffffff" * 6) channelDataList.append("ffffffff" * 6)
logging.info(f"接收到的水份通道数据是:{channelDataList}") logging.info(f"接收到的水份通道数据是:{channelDataList},接受到的水分通道为{channelNumlist}")
for k in range (0,5):
if k+1 in channelNumlist:
pass
else:
channelDataList.insert(k,"ffffffff" * 6)
logging.info(f"补点后的水份通道数据是:{channelDataList}")
# 对每一路数据进行解析处理 # 对每一路数据进行解析处理
# 水分数据存放列表 # 水分数据存放列表
waterDataList = [] waterDataList = []
...@@ -67,6 +77,12 @@ def checkWater(species, waterData): ...@@ -67,6 +77,12 @@ def checkWater(species, waterData):
temp = (hiTemp * 256 + loTemp) / 100 temp = (hiTemp * 256 + loTemp) / 100
# 湿度直接换算 # 湿度直接换算
humi = (hiHumi * 256 + loHumi) / 100 humi = (hiHumi * 256 + loHumi) / 100
if temp > 30:
temp =30
if humi < 20:
humi = 20
elif humi >90:
humi=90
# 对温湿度取整,合并成 " 温度/湿度 " 的形式,进行下一步校验 # 对温湿度取整,合并成 " 温度/湿度 " 的形式,进行下一步校验
tempHumi = str(int(temp)) + "/" + str(int(humi)) tempHumi = str(int(temp)) + "/" + str(int(humi))
waterValue = checkSpecies(species, tempHumi) waterValue = checkSpecies(species, tempHumi)
......
...@@ -58,17 +58,18 @@ ...@@ -58,17 +58,18 @@
}, },
{ {
"004": [ "004": [
"0301010000000101f001" "0301010000000101f001",
"0301010000000101ff02"
] ]
}, },
{ {
"003": [ "003": [
"030101000000010190", "030101000000010190",
"0301010000000101ff02" "0301010000000101ff03"
] ]
}, },
{ {
"cerealsSpecies": "小麦", "cerealsSpecies": "稻谷",
"005": [ "005": [
"0301010000000101f101" "0301010000000101f101"
] ]
...@@ -168,17 +169,18 @@ ...@@ -168,17 +169,18 @@
}, },
{ {
"004": [ "004": [
"0301020000000101f001" "0301020000000101f001",
"0301020000000101ff02"
] ]
}, },
{ {
"003": [ "003": [
"030102000000010190", "030102000000010190",
"0301020000000101ff02" "0301020000000101ff03"
] ]
}, },
{ {
"cerealsSpecies": "小麦", "cerealsSpecies": "稻谷",
"005": [ "005": [
"0301020000000101f101" "0301020000000101f101"
] ]
...@@ -268,7 +270,7 @@ ...@@ -268,7 +270,7 @@
] ]
}, },
{ {
"cerealsSpecies": "小麦", "cerealsSpecies": "玉米",
"003": [ "003": [
"0301080000000101f101" "0301080000000101f101"
] ]
...@@ -322,7 +324,7 @@ ...@@ -322,7 +324,7 @@
] ]
}, },
{ {
"cerealsSpecies": "小麦", "cerealsSpecies": "玉米",
"003": [ "003": [
"0301040000000101f101" "0301040000000101f101"
] ]
...@@ -500,7 +502,7 @@ ...@@ -500,7 +502,7 @@
] ]
}, },
{ {
"cerealsSpecies": "小麦", "cerealsSpecies": "稻谷",
"003": [ "003": [
"0301090000000101f101" "0301090000000101f101"
] ]
...@@ -536,8 +538,6 @@ ...@@ -536,8 +538,6 @@
"60", "60",
"60", "60",
"60", "60",
"60",
"60",
"48" "48"
], ],
"001": [ "001": [
...@@ -554,9 +554,9 @@ ...@@ -554,9 +554,9 @@
] ]
}, },
{ {
"cerealsSpecies": "小麦", "cerealsSpecies": "稻谷",
"003": [ "003": [
"0301050000000101f101" "03010c0000000101f101"
] ]
} }
] ]
...@@ -608,7 +608,7 @@ ...@@ -608,7 +608,7 @@
] ]
}, },
{ {
"cerealsSpecies": "小麦", "cerealsSpecies": "稻谷",
"003": [ "003": [
"0301110000000101f101" "0301110000000101f101"
] ]
...@@ -662,7 +662,7 @@ ...@@ -662,7 +662,7 @@
] ]
}, },
{ {
"cerealsSpecies": "小麦", "cerealsSpecies": "玉米",
"003": [ "003": [
"03010f0000000101f101" "03010f0000000101f101"
] ]
...@@ -774,7 +774,7 @@ ...@@ -774,7 +774,7 @@
] ]
}, },
{ {
"cerealsSpecies": "小麦", "cerealsSpecies": "稻谷",
"003": [ "003": [
"0301100000000101f101" "0301100000000101f101"
] ]
...@@ -782,7 +782,7 @@ ...@@ -782,7 +782,7 @@
] ]
}, },
"735": { "735": {
"ip": "10.20.1.128", "ip": "10.20.1.171",
"port": 8000, "port": 8000,
"housetype": "multi", "housetype": "multi",
"all": [ "all": [
...@@ -832,9 +832,9 @@ ...@@ -832,9 +832,9 @@
] ]
}, },
{ {
"cerealsSpecies": "小麦", "cerealsSpecies": "稻谷",
"003": [ "003": [
"03010c0000000101f101" "0301050000000101f101"
] ]
} }
] ]
...@@ -890,7 +890,7 @@ ...@@ -890,7 +890,7 @@
] ]
}, },
{ {
"cerealsSpecies": "小麦", "cerealsSpecies": "稻谷",
"003": [ "003": [
"03010e0000000101f101" "03010e0000000101f101"
] ]
...@@ -948,9 +948,9 @@ ...@@ -948,9 +948,9 @@
] ]
}, },
{ {
"cerealsSpecies": "小麦", "cerealsSpecies": "稻谷",
"003": [ "003": [
"03010a0000000101f101" "0301120000000101f101"
] ]
} }
] ]
...@@ -1006,7 +1006,7 @@ ...@@ -1006,7 +1006,7 @@
] ]
}, },
{ {
"cerealsSpecies": "小麦", "cerealsSpecies": "稻谷",
"003": [ "003": [
"03010a0000000101f101" "03010a0000000101f101"
] ]
...@@ -1058,11 +1058,11 @@ ...@@ -1058,11 +1058,11 @@
}, },
{ {
"002": [ "002": [
"03012500000001012e" "03012500000001012c"
] ]
}, },
{ {
"cerealsSpecies": "小麦", "cerealsSpecies": "稻谷",
"003": [ "003": [
"0301030000000101f101" "0301030000000101f101"
] ]
...@@ -2104,9 +2104,9 @@ ...@@ -2104,9 +2104,9 @@
] ]
}, },
"765": { "765": {
"ip": "10.20.1.22", "ip": "10.20.1.128",
"port": 8000, "port": 8000,
"housetype": "multi", "housetype": "single",
"all": [ "all": [
"001", "001",
"002" "002"
...@@ -2117,11 +2117,6 @@ ...@@ -2117,11 +2117,6 @@
"temphumi": [ "temphumi": [
"002" "002"
], ],
"bug": [],
"air": [],
"wind": [],
"water": [],
"weather": [],
"cmds": [ "cmds": [
{ {
"pointNum": [ "pointNum": [
...@@ -2135,25 +2130,25 @@ ...@@ -2135,25 +2130,25 @@
"20" "20"
], ],
"001": [ "001": [
"03010300000001011d", "2d0402e8003Ef7fa",
"03010300000001011e", "2d040326003E97f9",
"03010300000001011f", "2d040364003E37ed",
"030103000000010120", "2d0403a2003Ed7d0",
"030103000000010150", "2d0403e0003E77c4",
"030103000000010151", "2d04041e003E1740",
"030103000000010152", "2d04045c003Eb754",
"030103000000010153" "2d04049a003E5769"
] ]
}, },
{ {
"002": [ "002": [
"030103000000010131" "2d0405d0003E7743"
] ]
} }
] ]
}, },
"766": { "766": {
"ip": "10.20.1.29", "ip": "10.20.1.30",
"port": 8000, "port": 8000,
"housetype": "single", "housetype": "single",
"all": [ "all": [
...@@ -2179,19 +2174,51 @@ ...@@ -2179,19 +2174,51 @@
"20" "20"
], ],
"001": [ "001": [
"050402e8003Ef1d2", "2e0402e8003Ef7c9",
"05040326003E91d1", "2e040326003E97ca",
"05040364003E31c5", "2e040364003E37de",
"050403a2003Ed1f8", "2e0403a2003Ed7e3",
"050403e0003E71ec", "2e0403e0003E77f7",
"0504041e003E1168", "2e04041e003E1773",
"0504045c003Eb17c", "2e04045c003Eb767",
"0504049a003E5141" "2e04049a003E575a"
]
},
{
"002": [
"2e0405d0003E7770"
]
}
]
},
"769": {
"ip": "10.20.1.68",
"port": 8000,
"housetype": "single",
"all": [
"001",
"002"
],
"temp": [
"001"
],
"temphumi": [
"002"
],
"cmds": [
{
"pointNum": [
"32",
"32"
],
"001": [
"2c040000003E77a7",
"2c04003e003E166b"
] ]
}, },
{ {
"002": [ "002": [
"050405d0003E716b" "2c040516003E96af"
] ]
} }
] ]
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"data": [{ "data": [{
"type": "control", "type": "control",
"houseId": "724", "houseId": "724",
"name": "L311",
"ip": "10.20.1.206", "ip": "10.20.1.206",
"port": 50, "port": 50,
"subMachine": [{ "subMachine": [{
...@@ -34,7 +35,7 @@ ...@@ -34,7 +35,7 @@
"type": "water", "type": "water",
"subAddr": "01", "subAddr": "01",
"subId": "005", "subId": "005",
"cerealsSpecies": "小麦" "cerealsSpecies": "稻谷"
}, },
{ {
"channelId": "30", "channelId": "30",
...@@ -53,6 +54,7 @@ ...@@ -53,6 +54,7 @@
{ {
"type": "control", "type": "control",
"houseId": "725", "houseId": "725",
"name": "L312",
"ip": "10.20.1.207", "ip": "10.20.1.207",
"port": 50, "port": 50,
"subMachine": [{ "subMachine": [{
...@@ -85,7 +87,7 @@ ...@@ -85,7 +87,7 @@
"type": "water", "type": "water",
"subAddr": "02", "subAddr": "02",
"subId": "005", "subId": "005",
"cerealsSpecies": "小麦" "cerealsSpecies": "稻谷"
}, },
{ {
"channelId": "30", "channelId": "30",
...@@ -106,6 +108,7 @@ ...@@ -106,6 +108,7 @@
"ip": "10.20.1.12", "ip": "10.20.1.12",
"port": 8000, "port": 8000,
"houseId": "723", "houseId": "723",
"name": "1",
"subMachine": [{ "subMachine": [{
"channelId": "11-17", "channelId": "11-17",
"type": "temp", "type": "temp",
...@@ -123,7 +126,7 @@ ...@@ -123,7 +126,7 @@
"type": "water", "type": "water",
"subAddr": "08", "subAddr": "08",
"subId": "003", "subId": "003",
"cerealsSpecies": "小麦" "cerealsSpecies": "玉米"
} }
] ]
}, },
...@@ -132,6 +135,7 @@ ...@@ -132,6 +135,7 @@
"ip": "10.20.1.19", "ip": "10.20.1.19",
"port": 8000, "port": 8000,
"houseId": "726", "houseId": "726",
"name": "2",
"subMachine": [{ "subMachine": [{
"channelId": "11-15", "channelId": "11-15",
"type": "temp", "type": "temp",
...@@ -149,7 +153,7 @@ ...@@ -149,7 +153,7 @@
"type": "water", "type": "water",
"subAddr": "04", "subAddr": "04",
"subId": "003", "subId": "003",
"cerealsSpecies": "小麦" "cerealsSpecies": "玉米"
} }
] ]
}, },
...@@ -158,6 +162,7 @@ ...@@ -158,6 +162,7 @@
"ip": "10.20.1.22", "ip": "10.20.1.22",
"port": 8000, "port": 8000,
"houseId": "727", "houseId": "727",
"name": "3",
"subMachine": [{ "subMachine": [{
"channelId": "11-1c", "channelId": "11-1c",
"type": "temp", "type": "temp",
...@@ -184,6 +189,7 @@ ...@@ -184,6 +189,7 @@
"ip": "10.20.1.32", "ip": "10.20.1.32",
"port": 8000, "port": 8000,
"houseId": "728", "houseId": "728",
"name": "6",
"subMachine": [{ "subMachine": [{
"channelId": "11-18", "channelId": "11-18",
"type": "temp", "type": "temp",
...@@ -211,6 +217,7 @@ ...@@ -211,6 +217,7 @@
"ip": "10.20.1.47", "ip": "10.20.1.47",
"port": 8000, "port": 8000,
"houseId": "729", "houseId": "729",
"name": "10",
"subMachine": [{ "subMachine": [{
"channelId": "11-15", "channelId": "11-15",
"type": "temp", "type": "temp",
...@@ -228,7 +235,7 @@ ...@@ -228,7 +235,7 @@
"type": "water", "type": "water",
"subAddr": "09", "subAddr": "09",
"subId": "003", "subId": "003",
"cerealsSpecies": "小麦" "cerealsSpecies": "稻谷"