USEPA / SWMM-EPANET_User_Interface

User interface for the Stormwater-Management-Model
113 stars 67 forks source link

Handle SWMM simulation error more smoothly #410

Open barrc opened 4 years ago

barrc commented 4 years ago

In the Delphi GUI, if you run a simulation that has errors, you get a popup that says: "Run was unsuccessful. See Status Report for reasons." After you click OK, the status report opens.

In the new UI, if you run the same inp file, you get a popup that stays: "Exception running simulation: Fatal error occured SWMM Error code 133 None". If you click OK, it launches the status report. Then you get another popup that says "Error opening model output: C:\Users\path\to\output\file.out File Error 435: invalid file - not created by SWMM None". We should handle an error more smoothly.

barrc commented 4 years ago

I'm working on this ticket. The output API returns Error 435 if the magic numbers from the .out file do not match:

// Is this a valid SWMM binary output file?
if (magic1 != magic2) errorcode = 435;

It looks like the Closing Records section of the .out file is not being written in some cases, so magic2 is not equal to magic1. If I run SWMM from the command line, the second magic number is written.