fix(simulation): export ACTIVE valves correctly for EPANET 2
The legacy online simulation path still exported internal ACTIVE states as STATUS keywords, which EPANET 2 rejects. Preserve numeric settings and EPANET 3 output while passing the format through both exporters. Surface the original engine error inside the model transaction so failed runs roll back before result storage. Regression guard: six failures reproduced on the deployed baseline, including native input validation. All 34 focused export, service and endpoint checks pass after the fix; the real project also returns native node and link results.
This commit is contained in:
@@ -120,7 +120,7 @@ def dump_inp(project: str, inp: str, version: str = '3'):
|
||||
file.write('\n'.join(inp_out_demand(project)))
|
||||
|
||||
elif name == STATUS:
|
||||
file.write('\n'.join(inp_out_status(project)))
|
||||
file.write('\n'.join(inp_out_status(project, version=version)))
|
||||
|
||||
elif name == PATTERNS:
|
||||
if version == '3':
|
||||
@@ -232,7 +232,7 @@ def export_inp(project: str, version: str = '3') -> ChangeSet:
|
||||
inp += '\n'.join(inp_out_demand(project))
|
||||
|
||||
elif name == STATUS:
|
||||
inp += '\n'.join(inp_out_status(project))
|
||||
inp += '\n'.join(inp_out_status(project, version=version))
|
||||
|
||||
elif name == PATTERNS:
|
||||
if version == '3':
|
||||
|
||||
Reference in New Issue
Block a user