USEPA / SWMM-EPANET_User_Interface

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

Study area map "unmaximizes" after every simulation is run #330

Closed barrc closed 4 years ago

barrc commented 4 years ago

If I have the SWMM UI maximized, every time I run a simulation it becomes "unmaximized". The program shouldn't change its state unless the user asks. I don't think this happened with older versions of the UI.

Before: image

After: image

Version: MTP6r1

TongZhai commented 4 years ago

@barrc very interesting. Apparently, it seems that it only does this when the main window is maximized, any other size window won't get resized when running simulation.

barrc commented 4 years ago

@TongZhai that's correct. I was looking at the code and I think it's happening in the below section of frmRunSWMM.py, specifically the statement in the try/except block. If you get rid of the try/except block the window doesn't get resized and it doesn't seem to cause any problems, but I'm not sure the difference between the two showNormal calls?

        if self._main_form:
            try:
                self._main_form.showNormal()
            except:
                pass
        self.showNormal()
TongZhai commented 4 years ago

@barrc thanks for the tip, I will take a look at this.

TongZhai commented 4 years ago

@barrc you are right, the _main_form is referencing the main window of the application and you are also right in that there is no particular reason for it, so that action is removed. Please help confirm this fix, you can close the issue afterwards, thanks.

barrc commented 4 years ago

@TongZhai tested successfully in my development environment so I'll close the issue. Thanks!