USEPA / SWMM-EPANET_User_Interface

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

Error creating table of system variables #321

Closed barrc closed 4 years ago

barrc commented 4 years ago

I successfully ran a SWMM model, then tried to create a table of system runoff. The UI crashed (SWMM-UI.exe has stopped working. A problem caused the program to stop working correctly. Please close the program.)

The console showed an error:

Error reading series System -1, att #SystemAttribute.RUNOFF_FLOW
Traceback (most recent call last):
  File "Externals\swmm\outputapi\SMOutputSWIG.py", line 110, in get_series
TypeError: getsystemseries() takes 4 positional arguments but 5 were given

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "frmTableSelection.py", line 80, in cmdOK_Clicked
  File "Externals\swmm\outputapi\SMOutputSWIG.py", line 114, in get_series
  File "site-packages\swmm\output\output.py", line 445, in checkerror
TypeError: in method 'checkerror', argument 2 of type 'char **'

I tried with a different file and a different system variable and the same error occurred. But creating a table for subcatchment, node, or link variables worked fine, so this may be specific to system variables.

Version: MTP6r1

TongZhai commented 4 years ago

@barrc Good catch. will check all system output access in the new output api.

TongZhai commented 4 years ago

@michaeltryby I think this is in your wheelhouse. The SMOutputSWIG.py is trying to pass an empty python string to a C 2-d array of strings, char**, I've tried various combination of POINTER, c_char, and c_char_p to no avail, could you take a look what to pass as the correct argument for that SWMM output api function argument.

src\Externals\swmm\outputapi\SMOutputSWIG.py, line 113

barrc commented 4 years ago

I see there is a commit that addresses this and I tested successfully in a development environment with the dev-ui-py3qt5 branch so I will close the issue.