Update the query for scada
This commit is contained in:
@@ -13,6 +13,7 @@ import schedule
|
|||||||
import threading
|
import threading
|
||||||
import globals
|
import globals
|
||||||
import influxdb_info
|
import influxdb_info
|
||||||
|
import time_api
|
||||||
|
|
||||||
# influxdb数据库连接信息
|
# influxdb数据库连接信息
|
||||||
url = influxdb_info.url
|
url = influxdb_info.url
|
||||||
@@ -1170,7 +1171,7 @@ def query_latest_record_by_ID(ID: str, type: str, bucket: str="realtime_simulati
|
|||||||
flux_query = f'''
|
flux_query = f'''
|
||||||
from(bucket: "SCADA_data")
|
from(bucket: "SCADA_data")
|
||||||
|> range(start: -30d) // 查找最近一月的记录
|
|> range(start: -30d) // 查找最近一月的记录
|
||||||
|> filter(fn: (r) => r["_measurement"] == "reservoir_liquid_level_realtime")
|
|> filter(fn: (r) => r["_measurement"] == "pressure_realtime")
|
||||||
|> filter(fn: (r) => r["device_ID"] == "{ID}")
|
|> filter(fn: (r) => r["device_ID"] == "{ID}")
|
||||||
|> pivot(
|
|> pivot(
|
||||||
rowKey:["_time"],
|
rowKey:["_time"],
|
||||||
|
|||||||
Reference in New Issue
Block a user