Commit 6965a6b3 authored by ZZH's avatar ZZH

opt water sta map info 2026-4-28 9:00

parent 2989168c
This diff is collapsed.
...@@ -81,14 +81,14 @@ class Meter3rdForward: ...@@ -81,14 +81,14 @@ class Meter3rdForward:
for item in data["items"]: for item in data["items"]:
try: try:
scada_id = item["n"] scada_id = item["n"]
if scada_id in SCADA_FIELDS_MAP[fid].keys(): if scada_id in SCADA_FIELDS_MAP[fid]:
tmp = SCADA_FIELDS_MAP[fid][scada_id] tmp = SCADA_FIELDS_MAP[fid][scada_id]
cid, mid = tmp["cid"], tmp["sid"] mid = tmp["sid"]
tag = {tmp["field"]: item["v"]} tag = {tmp["field"]: item["v"]}
if mid in d_pyds: if mid in d_pyds:
d_pyds[mid]["images"][0]["tags"].update(tag) d_pyds[mid]["images"][0]["tags"].update(tag)
else: else:
d_pyds[mid] = {"cid": cid, "mid": mid, "nm": mid, d_pyds[mid] = {"cid": fid, "mid": mid, "nm": mid,
"images": [{"t": ts, "tags": tag}]} "images": [{"t": ts, "tags": tag}]}
except Exception as e: except Exception as e:
continue continue
......
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