From a55d53a60b29ce048c1c8aba25fa236d9db1a462 Mon Sep 17 00:00:00 2001 From: DingZQ Date: Fri, 31 Jan 2025 13:00:13 +0800 Subject: [PATCH] Add comments for scada --- api/s31_scada_element.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/api/s31_scada_element.py b/api/s31_scada_element.py index 5b1f522..457def3 100644 --- a/api/s31_scada_element.py +++ b/api/s31_scada_element.py @@ -179,5 +179,19 @@ def get_all_scada_element_ids(name: str) -> list[str]: result.append(str(row['id'])) return result +# +# create table scada_element +# ( +# id text primary key +# , x float8 not null +# , y float8 not null +# , device_id text references scada_device(id) +# , model_id varchar(32) -- add constraint in API +# , model_type scada_model_type +# , status scada_element_status not null default 'OFF' +# ); +# +# 返回list,list里每个item是dict,内容是 'id':'abc' 这样 +# scada_model type 是类似pressure,flow之类的,是由Device 决定 的 def get_all_scada_elements(name: str) -> list[dict[str, Any]]: return read_all(name, 'select * from scada_element order by id')