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')