Get all scada elements

This commit is contained in:
WQY\qiong
2023-03-29 22:34:28 +08:00
parent 7451cf9ddd
commit 0f1d2d5435
4 changed files with 19 additions and 1 deletions

View File

@@ -22,6 +22,14 @@ def _check_model_id(name: str, cs: ChangeSet) -> bool:
return is_node(name, model_id) or is_link(name, model_id)
def get_scada_elements(name: str) -> list[str]:
result : list[str] = []
rows = read_all(name, 'select id from scada_element order by id')
for row in rows:
result.append(str(row['id']))
return result
def get_scada_element_schema(name: str) -> dict[str, dict[str, Any]]:
return { 'id' : {'type': 'str' , 'optional': False , 'readonly': True },
'x' : {'type': 'float' , 'optional': False , 'readonly': False},