Remove old inp in routine
This commit is contained in:
@@ -101,31 +101,9 @@ def delete_mixing(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
# TankID MixModel FractVolume
|
||||
# FractVolume if type == MIX2
|
||||
#--------------------------------------------------------------
|
||||
class InpMixing:
|
||||
def __init__(self, line: str) -> None:
|
||||
tokens = line.split()
|
||||
|
||||
num = len(tokens)
|
||||
has_desc = tokens[-1].startswith(';')
|
||||
num_without_desc = (num - 1) if has_desc else num
|
||||
|
||||
self.tank = str(tokens[0])
|
||||
self.model = str(tokens[1].upper())
|
||||
self.value = float(tokens[3]) if num_without_desc >= 4 else None
|
||||
|
||||
|
||||
def inp_in_mixing(section: list[str]) -> ChangeSet:
|
||||
cs = ChangeSet()
|
||||
for s in section:
|
||||
# skip comment
|
||||
if s.startswith(';'):
|
||||
continue
|
||||
obj = InpMixing(s)
|
||||
cs.append(g_add_prefix | {'type': 'mixing', 'tank': obj.tank, 'model': obj.model, 'value': obj.value})
|
||||
return cs
|
||||
|
||||
|
||||
def inp_in_mixing_new(line: str) -> str:
|
||||
def inp_in_mixing(line: str) -> str:
|
||||
tokens = line.split()
|
||||
|
||||
num = len(tokens)
|
||||
|
||||
Reference in New Issue
Block a user