Add comments for scada

This commit is contained in:
DingZQ
2025-01-31 13:00:13 +08:00
parent ca06f31e0a
commit a55d53a60b

View File

@@ -179,5 +179,19 @@ def get_all_scada_element_ids(name: str) -> list[str]:
result.append(str(row['id'])) result.append(str(row['id']))
return result 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'
# );
#
# 返回listlist里每个item是dict内容是 'id':'abc' 这样
# scada_model type 是类似pressureflow之类的是由Device 决定 的
def get_all_scada_elements(name: str) -> list[dict[str, Any]]: def get_all_scada_elements(name: str) -> list[dict[str, Any]]:
return read_all(name, 'select * from scada_element order by id') return read_all(name, 'select * from scada_element order by id')