Refine
This commit is contained in:
@@ -1505,17 +1505,16 @@ def query_SCADA_data_by_device_ID_and_timerange(query_ids_list: List[str], start
|
|||||||
# 从查询结果中提取 monitored_value
|
# 从查询结果中提取 monitored_value
|
||||||
if result:
|
if result:
|
||||||
# 假设返回的结果为一行数据
|
# 假设返回的结果为一行数据
|
||||||
records_list = []
|
records_list = []
|
||||||
|
|
||||||
for table in result:
|
for table in result:
|
||||||
for record in table.records:
|
for record in table.records:
|
||||||
# 获取记录的时间和监测值
|
# 获取记录的时间和监测值
|
||||||
records_list.append({
|
records_list.append({
|
||||||
"time": record["_time"],
|
"time": record["_time"],
|
||||||
"value": record["_value"]
|
"value": record["_value"]
|
||||||
})
|
})
|
||||||
|
SCADA_dict[device_id] = records_list
|
||||||
SCADA_dict[device_id] = records_list
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error querying InfluxDB for device ID {device_id}: {e}")
|
print(f"Error querying InfluxDB for device ID {device_id}: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user