From 406d88a6b88a72c0e723bf191a5cd9b7ed1c5ff4 Mon Sep 17 00:00:00 2001 From: "WQY\\qiong" Date: Thu, 2 Mar 2023 20:01:51 +0800 Subject: [PATCH] Allow to read EPANET3 curve --- api/s12_curves.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/api/s12_curves.py b/api/s12_curves.py index b0e6e71..87f634c 100644 --- a/api/s12_curves.py +++ b/api/s12_curves.py @@ -122,10 +122,14 @@ def delete_curve(name: str, cs: ChangeSet) -> ChangeSet: #-------------------------------------------------------------- -# [EPANET2][IN][OUT] +# [EPA2][IN][OUT] # ;type: desc # id x y #-------------------------------------------------------------- +# [EPA3][IN][OUT] +# id type +# id x y +#-------------------------------------------------------------- def inp_in_curve(section: list[str]) -> ChangeSet: types = {} descs = {} @@ -146,6 +150,12 @@ def inp_in_curve(section: list[str]) -> ChangeSet: continue tokens = section[i].split() + + # for EPA3 + if tokens[1] == 'PUMP' or tokens[1] == 'EFFICIENCY' or tokens[1] == 'VOLUME' or tokens[1] == 'HEADLOSS': + types[tokens[0]] = tokens[1] + continue + if tokens[0] not in curves: curves[tokens[0]] = [] curves[tokens[0]].append({'x': float(tokens[1]), 'y': float(tokens[2])})