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

@@ -222,6 +222,28 @@ def inp_in_reaction(section: list[str]) -> ChangeSet:
return cs
def inp_in_reaction_new(name: str, line: str) -> None:
tokens = line.split()
token0 = tokens[0].upper()
if token0 == 'BULK' or token0 == 'WALL':
pipe = tokens[1]
key = token0.lower()
value = tokens[2]
write(name, f"insert into reactions_pipe_{key} (pipe, value) values ('{pipe}', {value});")
elif token0 == 'TANK':
tank = tokens[1]
value = tokens[2]
write(name, f"insert into reactions_tank (tank, value) values ('{tank}', {value});")
else:
line = line.upper().strip()
for key in get_reaction_schema('').keys():
if line.startswith(key):
value = line.removeprefix(key).strip()
write(name, f"update reactions set value = '{value}' where key = '{key}';")
def inp_out_reaction(name: str) -> list[str]:
lines = []