Expose node specific api

This commit is contained in:
wqy
2022-09-30 21:01:57 +08:00
parent 964e9af033
commit 85f27cf655
3 changed files with 14 additions and 2 deletions

View File

@@ -33,4 +33,4 @@ from .s6_pumps import get_pump_schema, add_pump, get_pump, set_pump, delete_pump
from .s7_valves import VALVES_TYPE_PRV, VALVES_TYPE_PSV, VALVES_TYPE_PBV, VALVES_TYPE_FCV, VALVES_TYPE_TCV, VALVES_TYPE_GPV
from .s7_valves import get_valve_schema, add_valve, get_valve, set_valve, delete_valve
# from .s24_coordinates import get_node_coord, set_node_coord
from .s24_coordinates import get_node_coord

View File

@@ -20,7 +20,7 @@ def get_node_coord(name: str, id: str) -> dict[str, float] | None:
coord = str(row['coord'])
return _to_client_point(coord)
'''
def set_node_coord(name: str, node_type: str, id: str, x: float, y: float) -> ChangeSet:
old = get_node_coord(name, id)
if old == None:
@@ -39,3 +39,4 @@ def set_node_coord(name: str, node_type: str, id: str, x: float, y: float) -> Ch
change = ChangeSet()
change.update(node_type, id, 'coord')
return change
'''