Allow to read EPANET3 curve
This commit is contained in:
@@ -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])})
|
||||
|
||||
Reference in New Issue
Block a user