Support inp in quality, source, reaction, mixing

This commit is contained in:
WQY\qiong
2023-03-16 00:02:11 +08:00
parent b35fccad49
commit bf1aeff1fa
6 changed files with 76 additions and 8 deletions

View File

@@ -125,6 +125,21 @@ def inp_in_mixing(section: list[str]) -> ChangeSet:
return cs
def inp_in_mixing_new(name: str, line: str) -> None:
tokens = line.split()
num = len(tokens)
has_desc = tokens[-1].startswith(';')
num_without_desc = (num - 1) if has_desc else num
tank = str(tokens[0])
model = str(tokens[1].upper())
value = float(tokens[3]) if num_without_desc >= 4 else None
value = value if value != None else 'null'
write(name, f"insert into mixing (tank, model, value) values ('{tank}', '{model}', {value});")
def inp_out_mixing(name: str) -> list[str]:
lines = []
objs = read_all(name, 'select * from mixing')