Support run epa3
This commit is contained in:
@@ -227,17 +227,21 @@ def dump_output(path: str) -> str:
|
||||
return json.dumps(data)
|
||||
|
||||
|
||||
def run_project(name: str) -> str:
|
||||
def run_project(name: str, version: str = '3') -> str:
|
||||
if version != '3' and version != '2':
|
||||
version = '2'
|
||||
|
||||
if not project.have_project(name):
|
||||
raise Exception(f'Not found project [{name}]')
|
||||
|
||||
dir = os.path.abspath(os.getcwd())
|
||||
|
||||
db_inp = os.path.join(os.path.join(dir, 'db_inp'), name + '.db.inp')
|
||||
inp_out.dump_inp(name, db_inp)
|
||||
inp_out.dump_inp(name, db_inp, version)
|
||||
|
||||
input = name + '.db'
|
||||
exe = os.path.join(os.path.join(dir, 'epanet'), 'runepanet.exe')
|
||||
program = 'runepanet.exe' if version == '2' else 'run-epanet3.exe'
|
||||
exe = os.path.join(os.path.join(dir, 'epanet'), program)
|
||||
inp = os.path.join(os.path.join(dir, 'db_inp'), input + '.inp')
|
||||
rpt = os.path.join(os.path.join(dir, 'temp'), input + '.rpt')
|
||||
opt = os.path.join(os.path.join(dir, 'temp'), input + '.opt')
|
||||
|
||||
Reference in New Issue
Block a user