diff --git a/api/s10_status.py b/api/s10_status.py index c242fa4..2c7dd9b 100644 --- a/api/s10_status.py +++ b/api/s10_status.py @@ -68,6 +68,10 @@ def set_status(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, set_status_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# link value +#-------------------------------------------------------------- class InpStatus: def __init__(self, line: str) -> None: tokens = line.split() diff --git a/api/s11_patterns.py b/api/s11_patterns.py index e2bc1d5..7fa4048 100644 --- a/api/s11_patterns.py +++ b/api/s11_patterns.py @@ -93,6 +93,10 @@ def delete_pattern(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, delete_pattern_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# id mult1 mult2 ..... +#-------------------------------------------------------------- def inp_in_pattern(section: list[str]) -> ChangeSet: descs = {} patterns: dict[str, list[float]] = {} diff --git a/api/s12_curves.py b/api/s12_curves.py index 823ecc5..4f7e5a9 100644 --- a/api/s12_curves.py +++ b/api/s12_curves.py @@ -121,6 +121,10 @@ def delete_curve(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, delete_curve_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# id x y +#-------------------------------------------------------------- def inp_in_curve(section: list[str]) -> ChangeSet: types = {} descs = {} diff --git a/api/s13_controls.py b/api/s13_controls.py index 3ba7b45..f95377e 100644 --- a/api/s13_controls.py +++ b/api/s13_controls.py @@ -34,6 +34,13 @@ def set_control(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, set_control_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# LINK linkID setting IF NODE nodeID {BELOW/ABOVE} level +# LINK linkID setting AT TIME value (units) +# LINK linkID setting AT CLOCKTIME value (units) +# (0) (1) (2) (3) (4) (5) (6) (7) +#-------------------------------------------------------------- def inp_in_control(section: list[str]) -> ChangeSet: if len(section) > 0: return ChangeSet(g_update_prefix | {'type': 'control', 'controls' : section}) diff --git a/api/s14_rules.py b/api/s14_rules.py index 381003b..3f7d3d4 100644 --- a/api/s14_rules.py +++ b/api/s14_rules.py @@ -34,6 +34,10 @@ def set_rule(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, set_rule_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# TODO... +#-------------------------------------------------------------- def inp_in_rule(section: list[str]) -> ChangeSet: if len(section) > 0: return ChangeSet(g_update_prefix | {'type': 'rule', 'rules' : section}) diff --git a/api/s15_energy.py b/api/s15_energy.py index 2845056..8591215 100644 --- a/api/s15_energy.py +++ b/api/s15_energy.py @@ -131,6 +131,12 @@ def set_pump_energy(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, set_pump_energy_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# GLOBAL {PRICE/PATTERN/EFFIC} value +# PUMP id {PRICE/PATTERN/EFFIC} value +# DEMAND CHARGE value +#-------------------------------------------------------------- def inp_in_energy(section: list[str]) -> ChangeSet: cs = ChangeSet() diff --git a/api/s16_emitters.py b/api/s16_emitters.py index 7245cf9..a5d7a12 100644 --- a/api/s16_emitters.py +++ b/api/s16_emitters.py @@ -59,6 +59,10 @@ def set_emitter(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, set_emitter_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# node Ke +#-------------------------------------------------------------- class InpEmitter: def __init__(self, line: str) -> None: tokens = line.split() diff --git a/api/s17_quality.py b/api/s17_quality.py index 3d716b2..8d90065 100644 --- a/api/s17_quality.py +++ b/api/s17_quality.py @@ -59,6 +59,10 @@ def set_quality(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, set_quality_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# node initqual +#-------------------------------------------------------------- class InpQuality: def __init__(self, line: str) -> None: tokens = line.split() diff --git a/api/s18_sources.py b/api/s18_sources.py index 1baeab8..d43b06f 100644 --- a/api/s18_sources.py +++ b/api/s18_sources.py @@ -102,6 +102,10 @@ def delete_source(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, delete_source_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# node sourcetype quality (pattern) +#-------------------------------------------------------------- class InpSource: def __init__(self, line: str) -> None: tokens = line.split() diff --git a/api/s19_reactions.py b/api/s19_reactions.py index a7bd4b7..1366f28 100644 --- a/api/s19_reactions.py +++ b/api/s19_reactions.py @@ -181,6 +181,17 @@ def set_tank_reaction(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, set_tank_reaction_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# ORDER {BULK/WALL/TANK} value +# GLOBAL BULK coeff +# GLOBAL WALL coeff +# BULK link1 (link2) coeff +# WALL link1 (link2) coeff +# TANK node1 (node2) coeff +# LIMITING POTENTIAL value +# ROUGHNESS CORRELATION value +#-------------------------------------------------------------- def inp_in_reaction(section: list[str]) -> ChangeSet: cs = ChangeSet() diff --git a/api/s20_mixing.py b/api/s20_mixing.py index d02aa0f..7e4a4a9 100644 --- a/api/s20_mixing.py +++ b/api/s20_mixing.py @@ -96,6 +96,10 @@ def delete_mixing(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, delete_mixing_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# TankID MixModel FractVolume +#-------------------------------------------------------------- class InpMixing: def __init__(self, line: str) -> None: tokens = line.split() diff --git a/api/s21_times.py b/api/s21_times.py index 26eaf15..5a84569 100644 --- a/api/s21_times.py +++ b/api/s21_times.py @@ -67,6 +67,19 @@ def set_time(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, set_time_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# STATISTIC {NONE/AVERAGE/MIN/MAX/RANGE} +# DURATION value (units) +# HYDRAULIC TIMESTEP value (units) +# QUALITY TIMESTEP value (units) +# RULE TIMESTEP value (units) +# PATTERN TIMESTEP value (units) +# PATTERN START value (units) +# REPORT TIMESTEP value (units) +# REPORT START value (units) +# START CLOCKTIME value (AM PM) +#-------------------------------------------------------------- def inp_in_time(section: list[str]) -> ChangeSet: if len(section) > 0: cs = g_update_prefix | { 'type' : 'time' } diff --git a/api/s22_report.py b/api/s22_report.py index 6fc4f38..e093f2f 100644 --- a/api/s22_report.py +++ b/api/s22_report.py @@ -1,6 +1,25 @@ from .database import * +#-------------------------------------------------------------- +# [EPANET2] +# PAGE linesperpage +# STATUS {NONE/YES/FULL} +# SUMMARY {YES/NO} +# MESSAGES {YES/NO} +# ENERGY {NO/YES} +# NODES {NONE/ALL} +# NODES node1 node2 ... +# LINKS {NONE/ALL} +# LINKS link1 link2 ... +# FILE filename +# variable {YES/NO} +# variable {BELOW/ABOVE/PRECISION} value +#-------------------------------------------------------------- +def inp_in_report(section: list[str]) -> ChangeSet: + return ChangeSet() + + def inp_out_report(name: str) -> list[str]: lines = [] objs = read_all(name, f"select * from report") diff --git a/api/s23_options.py b/api/s23_options.py index 5e3fed5..591bece 100644 --- a/api/s23_options.py +++ b/api/s23_options.py @@ -105,6 +105,40 @@ def set_option(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, set_option_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# UNITS CFS/GPM/MGD/IMGD/AFD/LPS/LPM/MLD/CMH/CMD/SI +# PRESSURE PSI/KPA/M +# HEADLOSS H-W/D-W/C-M +# HYDRAULICS USE/SAVE filename +# QUALITY NONE/AGE/TRACE/CHEMICAL (TraceNode) +# MAP filename +# VERIFY filename +# UNBALANCED STOP/CONTINUE {Niter} +# PATTERN id +# DEMAND MODEL DDA/PDA +# DEMAND MULTIPLIER value +# EMITTER EXPONENT value +# VISCOSITY value +# DIFFUSIVITY value +# SPECIFIC GRAVITY value +# TRIALS value +# ACCURACY value# +# HEADERROR value +# FLOWCHANGE value +# MINIMUM PRESSURE value +# REQUIRED PRESSURE value +# PRESSURE EXPONENT value# +# TOLERANCE value +# SEGMENTS value (not used) +# ---- Undocumented Options ----- +# HTOL value +# QTOL value +# RQTOL value +# CHECKFREQ value +# MAXCHECK value +# DAMPLIMIT value +#-------------------------------------------------------------- def inp_in_option(section: list[str]) -> ChangeSet: if len(section) > 0: cs = g_update_prefix | { 'type' : 'option' } diff --git a/api/s24_coordinates.py b/api/s24_coordinates.py index ee9cfe0..82ac880 100644 --- a/api/s24_coordinates.py +++ b/api/s24_coordinates.py @@ -10,6 +10,11 @@ def get_node_coord(name: str, id: str) -> dict[str, float]: row = read(name, f"select * from coordinates where node = '{id}'") return _to_client_point(row['coord']) + +#-------------------------------------------------------------- +# [EPANET2] +# id x y +#-------------------------------------------------------------- # exception ! need merge to node change set ! def inp_in_coord(section: list[str]) -> dict[str, dict[str, float]]: coords = {} diff --git a/api/s25_vertices.py b/api/s25_vertices.py index 1eabb10..c82f052 100644 --- a/api/s25_vertices.py +++ b/api/s25_vertices.py @@ -75,6 +75,10 @@ def delete_vertex(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, result) +#-------------------------------------------------------------- +# [EPANET2] +# id x y +#-------------------------------------------------------------- def inp_in_vertex(section: list[str]) -> ChangeSet: vertices: dict[str, list[dict[str, float]]] = {} diff --git a/api/s2_junctions.py b/api/s2_junctions.py index ee0fd78..1e9886d 100644 --- a/api/s2_junctions.py +++ b/api/s2_junctions.py @@ -120,6 +120,10 @@ def delete_junction(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, delete_junction_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# id elev. (demand) (demand pattern) +#-------------------------------------------------------------- class InpJunction: def __init__(self, line: str) -> None: tokens = line.split() diff --git a/api/s3_reservoirs.py b/api/s3_reservoirs.py index 425f874..23965ed 100644 --- a/api/s3_reservoirs.py +++ b/api/s3_reservoirs.py @@ -116,6 +116,10 @@ def delete_reservoir(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, delete_reservoir_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# id elev (pattern) +#-------------------------------------------------------------- class InpReservoir: def __init__(self, line: str) -> None: tokens = line.split() diff --git a/api/s4_tanks.py b/api/s4_tanks.py index 8d64205..3833c84 100644 --- a/api/s4_tanks.py +++ b/api/s4_tanks.py @@ -144,6 +144,10 @@ def delete_tank(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, delete_tank_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# id elev initlevel minlevel maxlevel diam (minvol vcurve) +#-------------------------------------------------------------- class InpTank: def __init__(self, line: str) -> None: tokens = line.split() diff --git a/api/s5_pipes.py b/api/s5_pipes.py index dc101cf..8ce833c 100644 --- a/api/s5_pipes.py +++ b/api/s5_pipes.py @@ -123,6 +123,10 @@ def delete_pipe(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, delete_pipe_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# id node1 node2 length diam rcoeff (lcoeff) (status) +#-------------------------------------------------------------- class InpPipe: def __init__(self, line: str) -> None: tokens = line.split() diff --git a/api/s6_pumps.py b/api/s6_pumps.py index 1bdbef9..de32ff1 100644 --- a/api/s6_pumps.py +++ b/api/s6_pumps.py @@ -114,6 +114,11 @@ def delete_pump(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, delete_pump_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] Version 1.x is deprecated +# id node1 node2 KEYWORD value {KEYWORD value ...} +# where KEYWORD = [POWER,HEAD,PATTERN,SPEED] +#-------------------------------------------------------------- class InpPump: def __init__(self, line: str) -> None: tokens = line.split() diff --git a/api/s7_valves.py b/api/s7_valves.py index a56cb7d..8b9fffe 100644 --- a/api/s7_valves.py +++ b/api/s7_valves.py @@ -122,6 +122,12 @@ def delete_valve(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, delete_valve_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# id node1 node2 diam type setting (lcoeff lcurve) +# for GPV, setting is string = head curve id +# for PCV, add loss curve if present +#-------------------------------------------------------------- class InpValve: def __init__(self, line: str) -> None: tokens = line.split() diff --git a/api/s9_demands.py b/api/s9_demands.py index 38d84c8..b61c42b 100644 --- a/api/s9_demands.py +++ b/api/s9_demands.py @@ -85,6 +85,11 @@ def set_demand(name: str, cs: ChangeSet) -> ChangeSet: return execute_command(name, set_demand_cmd(name, cs)) +#-------------------------------------------------------------- +# [EPANET2] +# MULTIPLY factor +# node base_demand (pattern) +#-------------------------------------------------------------- class InpDemand: def __init__(self, line: str) -> None: tokens = line.split()