Prioritize section parser
This commit is contained in:
@@ -171,11 +171,37 @@ def read_inp(project: str, inp: str):
|
||||
pass # :)
|
||||
|
||||
cs = ChangeSet()
|
||||
cs.merge(file_cs['PATTERNS'])
|
||||
cs.merge(file_cs['CURVES'])
|
||||
for s in section_name:
|
||||
if s == 'PATTERNS' or s == 'CURVES':
|
||||
continue
|
||||
priorities = [
|
||||
'PATTERNS',
|
||||
'CURVES',
|
||||
'JUNCTIONS',
|
||||
'RESERVOIRS',
|
||||
'TANKS',
|
||||
'COORDINATES',
|
||||
'PIPES',
|
||||
'PUMPS',
|
||||
'VALVES',
|
||||
'DEMANDS',
|
||||
'STATUS',
|
||||
'OPTIONS',
|
||||
'TIMES',
|
||||
'EMITTERS',
|
||||
'QUALITY',
|
||||
'SOURCES',
|
||||
'REACTIONS',
|
||||
'MIXING',
|
||||
'ENERGY',
|
||||
'REPORT',
|
||||
'VERTICES',
|
||||
'CONTROLS',
|
||||
'RULES',
|
||||
'TITLE',
|
||||
'TAGS',
|
||||
'LABELS',
|
||||
'BACKDROP',
|
||||
'END',
|
||||
]
|
||||
for s in priorities:
|
||||
cs.merge(file_cs[s])
|
||||
|
||||
if is_project_open(project):
|
||||
@@ -187,7 +213,7 @@ def read_inp(project: str, inp: str):
|
||||
create_project(project)
|
||||
open_project(project)
|
||||
|
||||
execute_batch_command(project, cs)
|
||||
execute_batch_commands(project, cs)
|
||||
|
||||
|
||||
def dump_inp(name: str, inp: str):
|
||||
|
||||
Reference in New Issue
Block a user