statistics
This commit is contained in:
parent
fa26dd2418
commit
9621df8711
15
config.py
15
config.py
|
@ -1,5 +1,6 @@
|
||||||
# 数据库插入类型
|
# 数据库插入类型
|
||||||
import base64
|
import base64
|
||||||
|
import copy
|
||||||
import time
|
import time
|
||||||
|
|
||||||
rfid_type = ["TEXT", "TEXT", "FLOAT", "INT32"]
|
rfid_type = ["TEXT", "TEXT", "FLOAT", "INT32"]
|
||||||
|
@ -134,17 +135,19 @@ def is_warning(deviceId, v, t):
|
||||||
|
|
||||||
|
|
||||||
def insert_to_warning_sql(deviceId, v, t):
|
def insert_to_warning_sql(deviceId, v, t):
|
||||||
measurements[t].append("reason")
|
ml = copy.deepcopy(measurements[t])
|
||||||
measurements[t].append("solve")
|
dt = copy.deepcopy(dataTypes[t])
|
||||||
dataTypes[t].append("TEXT")
|
ml.append("reason")
|
||||||
dataTypes[t].append("TEXT")
|
ml.append("solve")
|
||||||
|
dt.append("TEXT")
|
||||||
|
dt.append("TEXT")
|
||||||
v.append("无")
|
v.append("无")
|
||||||
v.append("无")
|
v.append("无")
|
||||||
return {
|
return {
|
||||||
"devices": ["root.warning." + deviceId],
|
"devices": ["root.warning." + deviceId],
|
||||||
"timestamps": [int(time.time() * 1000)],
|
"timestamps": [int(time.time() * 1000)],
|
||||||
"measurements_list": [measurements[t]],
|
"measurements_list": [ml],
|
||||||
"data_types_list": [dataTypes[t]],
|
"data_types_list": [dt],
|
||||||
"values_list": [v],
|
"values_list": [v],
|
||||||
"is_aligned": False
|
"is_aligned": False
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue