107 lines
3.1 KiB
Python
107 lines
3.1 KiB
Python
import api
|
|
|
|
JUNCTION = "JUNCTION"
|
|
RESERVOIR = "RESERVOIR"
|
|
TANK = "TANK"
|
|
PIPE = "PIPE"
|
|
PUMP = "PUMP"
|
|
VALVE = "VALVE"
|
|
|
|
# project
|
|
|
|
def have_project(name: str) -> bool:
|
|
return api.have_project(name)
|
|
|
|
def create_project(name: str) -> None:
|
|
return api.create_project(name)
|
|
|
|
def delete_project(name: str) -> None:
|
|
return api.delete_project(name)
|
|
|
|
def is_project_open(name: str) -> bool:
|
|
return api.is_project_open(name)
|
|
|
|
def open_project(name: str) -> None:
|
|
return api.open_project(name)
|
|
|
|
def close_project(name: str) -> None:
|
|
return api.close_project(name)
|
|
|
|
# operation
|
|
|
|
def undo(name: str) -> None:
|
|
return api.undo(name)
|
|
|
|
def redo(name: str) -> None:
|
|
return api.redo(name)
|
|
|
|
# 0.base
|
|
|
|
def is_node(name: str, node_id: str) -> bool:
|
|
return api.is_node(name, node_id)
|
|
|
|
def is_junction(name: str, node_id: str) -> bool:
|
|
return api.is_junction(name, node_id)
|
|
|
|
def is_reservoir(name: str, node_id: str) -> bool:
|
|
return api.is_reservoir(name, node_id)
|
|
|
|
def is_tank(name: str, node_id: str) -> bool:
|
|
return api.is_tank(name, node_id)
|
|
|
|
def is_link(name: str, link_id: str) -> bool:
|
|
return api.is_link(name, link_id)
|
|
|
|
def is_pipe(name: str, link_id: str) -> bool:
|
|
return api.is_pipe(name, link_id)
|
|
|
|
def is_pump(name: str, link_id: str) -> bool:
|
|
return api.is_pump(name, link_id)
|
|
|
|
def is_valve(name: str, link_id: str) -> bool:
|
|
return api.is_valve(name, link_id)
|
|
|
|
def is_curve(name: str, curve_id: str) -> bool:
|
|
return api.is_curve(name, curve_id)
|
|
|
|
def is_pattern(name: str, pattern_id: str) -> bool:
|
|
return api.is_pattern(name, pattern_id)
|
|
|
|
# 1.title
|
|
def set_title(name: str, title: str) -> None:
|
|
return api.set_title(name, title)
|
|
|
|
def get_title(name: str) -> str:
|
|
return api.get_title(name)
|
|
|
|
# 2.junction
|
|
def add_junction(name: str, junction_id: str, x: float, y: float, elevation: float) -> None:
|
|
return api.add_junction(name, junction_id, x, y, elevation)
|
|
|
|
def delete_junction(name: str, junction_id: str) -> None:
|
|
return api.delete_junction(name, junction_id)
|
|
|
|
def get_junction_elevation(name: str, junction_id: str) -> float | None:
|
|
return api.get_junction_elevation(name, junction_id)
|
|
|
|
def get_junction_demand(name: str, junction_id: str) -> float | str | None:
|
|
return api.get_junction_demand(name, junction_id)
|
|
|
|
def get_junction_pattern(name: str, junction_id: str) -> str | None:
|
|
return api.get_junction_pattern(name, junction_id)
|
|
|
|
def get_junction_coord(name: str, junction_id: str) -> dict[str, float] | None:
|
|
return api.get_junction_coord(name, junction_id)
|
|
|
|
def set_junction_elevation(name: str, junction_id: str, elevation: float) -> None:
|
|
return api.set_junction_elevation(name, junction_id, elevation)
|
|
|
|
def set_junction_demand(name: str, junction_id: str, demand: float) -> None:
|
|
return api.set_junction_demand(name, junction_id, demand)
|
|
|
|
def set_junction_pattern(name: str, junction_id: str, pattern: str) -> None:
|
|
return api.set_junction_pattern(name, junction_id, pattern)
|
|
|
|
def set_junction_coord(name: str, junction_id: str, x: float, y: float) -> None:
|
|
return api.set_junction_coord(name, junction_id, x, y)
|