USEPA/SWMM-EPANET_User_Interface

Controls section disabled

MitchHeineman opened this issue · 7 comments

The GUI reads and writes [CONTROLS] from an existing input file, but they're not visible from the GUI and the buttons are all grayed out

Many active buttons are grayed out.

In addition to the buttons being gray, the rules are not displayed below the buttons as they should be. Looking more closely, I see this diagnostic in the command line window for the example below: "Skipping link CSOgate: could not convert string to float:"

[JUNCTIONS]
C41609B 77.31 22.69 0 0 0
CSO_RhodeIs_B 75.80 28 0 0 0
CSO_RhodeIs 75.90 27 0 0 0

[OUTFALLS]
C42156 75.1 NORMAL NO

[ORIFICES]
CSOgate CSO_RhodeIs CSO_RhodeIs_B BOTTOM 0 .5 NO .25

[XSECTIONS]
CSOgate CIRCULAR 4 0 0 0

[CONTROLS]
RULE Test
IF NODE C41609B INFLOW > 35.0
THEN ORIFICE CSOgate SETTING = 1.0
ELSE ORIFICE CSOgate SETTING = 0.0

barrc commented

If I double click on the word Controls on an empty file, it opens an editor:
image

If I double click on the word Controls with an existing inp file that has controls, it opens an editor like this:

image

In the Delphi GUI the [CONTROLS] line is skipped but it displays the description and both rules together:
image

Some of the buttons are grayed out on the Delphi GUI too:
image

So I think the action items to make it work more like the Delphi GUI would be:

  • Don't put the [CONTROLS] line in the controls editor
  • Parse the rule names and place them under the word Controls
  • Make it so the user can select the Edit hand on the rule names

Does that seem right?

The old double click trick! I was single clicking and nothing happened. Your observations are all correct

barrc commented

I was working on this and got kind of stuck. I have my work on a local branch and may come back to this, but here are some notes in case I don't, since it does work if you double click.

  • There is already a commented-out class ControlRule
  • Modifying the class Controls to make its self.value a list of ControlRules seemed promising, along with additionally storing the text that was in self.value as something else in Controls so you could just display that in the Controls Editor
  • Comments can be interspersed so be careful (this was partly why it seemed to make sense to store the text separately)
  • Since the Controls are all together in one editor, if the user changes anything in the Controls editor, you then need to re-parse the control text to get the rule names and update the GUI accordingly (I got stuck on updating the GUI)

I just made a code fix to make editing work again for control rules.
image

And, yes, the double-click is the way to edit the control rules in this UI.