Relax tank read limitation

This commit is contained in:
Joey Wang
2023-03-02 13:28:04 +08:00
parent 013a86ac3a
commit d514439bd2

View File

@@ -145,10 +145,13 @@ def delete_tank(name: str, cs: ChangeSet) -> ChangeSet:
#--------------------------------------------------------------
# [EPANET2][IN][OUT]
# [EPANET2]
# [IN]
# id elev initlevel minlevel maxlevel diam (minvol vcurve overflow) ;desc
# xxx
# * YES
# [OUT]
# id elev initlevel minlevel maxlevel diam minvol (vcurve overflow) ;desc
#--------------------------------------------------------------
class InpTank:
def __init__(self, line: str) -> None:
@@ -164,7 +167,7 @@ class InpTank:
self.min_level = float(tokens[3])
self.max_level = float(tokens[4])
self.diameter = float(tokens[5])
self.min_vol = float(tokens[6])
self.min_vol = float(tokens[6]) if num_without_desc >= 7 else 0.0
self.vol_curve = str(tokens[7]) if num_without_desc >= 8 and tokens[7] != '*' else None
self.overflow = str(tokens[8].upper()) if num_without_desc >= 9 else None
self.desc = str(tokens[-1]) if has_desc else None