Add level for section

This commit is contained in:
Joey Wang
2023-03-10 09:23:27 +08:00
parent 1fda14c3cf
commit b3db5bd027

View File

@@ -17,6 +17,44 @@ from .s27_backdrop import inp_in_backdrop_new
_UNKNOWN = 'UNKNOWN'
_level_1 = {
TITLE,
PATTERNS,
CURVES,
CONTROLS,
RULES,
TIMES,
REPORT,
OPTIONS,
BACKDROP,
}
_level_2 = {
JUNCTIONS,
RESERVOIRS,
TANKS,
}
_level_3 = {
PIPES,
PUMPS,
VALVES,
DEMANDS,
EMITTERS,
QUALITY,
SOURCES,
MIXING,
COORDINATES,
LABELS,
}
_level_4 = {
TAGS,
STATUS,
ENERGY,
REACTIONS,
VERTICES,
}
def scan1(project: str, inp: str) -> list[str]:
handlers = {
@@ -110,16 +148,7 @@ def scan2(project: str, inp: str) -> None:
def scan3(project: str, inp: str) -> None:
handlers = {
#PIPES: , #5
#PUMPS: , #6
#VALVES: , #7
#DEMANDS: , #9
#EMITTERS: , #16
#QUALITY: , #17
#SOURCES: , #18
#MIXING: , #20
#COORDINATES: #24
#LABELS: #26
}
curr_section = _UNKNOWN
@@ -155,11 +184,7 @@ def scan3(project: str, inp: str) -> None:
def scan4(project: str, inp: str) -> None:
handlers = {
#TAGS: inp_in_junction_new, #5
#STATUS: inp_in_reservoir_new, #6
#ENERGY: inp_in_tank_new, #7
#REACTIONS: , #9
#VERTICES: , #16
}
curr_section = _UNKNOWN