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
|
# ;type: desc
|
||||||
# id x y
|
# id x y
|
||||||
#--------------------------------------------------------------
|
#--------------------------------------------------------------
|
||||||
|
# [EPA3][IN][OUT]
|
||||||
|
# id type
|
||||||
|
# id x y
|
||||||
|
#--------------------------------------------------------------
|
||||||
def inp_in_curve(section: list[str]) -> ChangeSet:
|
def inp_in_curve(section: list[str]) -> ChangeSet:
|
||||||
types = {}
|
types = {}
|
||||||
descs = {}
|
descs = {}
|
||||||
@@ -146,6 +150,12 @@ def inp_in_curve(section: list[str]) -> ChangeSet:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
tokens = section[i].split()
|
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:
|
if tokens[0] not in curves:
|
||||||
curves[tokens[0]] = []
|
curves[tokens[0]] = []
|
||||||
curves[tokens[0]].append({'x': float(tokens[1]), 'y': float(tokens[2])})
|
curves[tokens[0]].append({'x': float(tokens[1]), 'y': float(tokens[2])})
|
||||||
|
|||||||
Reference in New Issue
Block a user