Remove old inp in routine

This commit is contained in:
WQY\qiong
2023-03-21 21:18:53 +08:00
parent 8681a56ed7
commit 9f9d3227b9
28 changed files with 83 additions and 642 deletions

View File

@@ -137,39 +137,9 @@ def set_pump_energy(name: str, cs: ChangeSet) -> ChangeSet:
# PUMP id {PRICE/PATTERN/EFFIC} value
# DEMAND CHARGE value
#--------------------------------------------------------------
def inp_in_energy(section: list[str]) -> ChangeSet:
cs = ChangeSet()
for s in section:
if s.startswith(';'):
continue
tokens = s.strip().split()
if tokens[0].upper() == 'PUMP':
pump = tokens[1]
key = tokens[2].lower()
value = tokens[3]
if key == 'price':
value = float(value)
cs.append(g_update_prefix | { 'type' : 'pump_energy', 'pump' : pump, key: value })
else:
line = s.upper().strip()
for key in get_energy_schema('').keys():
if line.startswith(key):
value = line.removeprefix(key).strip()
# exception here
if line.startswith('GLOBAL EFFICIENCY'):
value = line.removeprefix('GLOBAL EFFICIENCY').strip()
cs.append(g_update_prefix | { 'type' : 'energy', key : value })
return cs
def inp_in_energy_new(line: str) -> str:
def inp_in_energy(line: str) -> str:
tokens = line.split()
if tokens[0].upper() == 'PUMP':