From ba3c44cdd381d2889ebb71afbb25cb01207408a9 Mon Sep 17 00:00:00 2001 From: Robson Pachaly <39889306+rpachaly@users.noreply.github.com> Date: Fri, 20 Sep 2024 11:54:01 -0300 Subject: [PATCH] Switches on (#1564) * Improved the Hydraulic Structures message and turned on the Channel switch when the channel test is passed. * Turned on the ARF and WRF switch when the ARF and WRF is calculated successfully. * Turned on the Infiltration switch when the Infiltration is schematized. --- flo2d/gui/grid_tools_widget.py | 5 ++++- flo2d/gui/infil_editor_widget.py | 7 +++++-- flo2d/gui/struct_editor_widget.py | 4 ++-- flo2d/gui/xs_editor_widget.py | 7 ++++++- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/flo2d/gui/grid_tools_widget.py b/flo2d/gui/grid_tools_widget.py index 8e5fa95d..1280d87b 100644 --- a/flo2d/gui/grid_tools_widget.py +++ b/flo2d/gui/grid_tools_widget.py @@ -1001,7 +1001,10 @@ def eval_arfwrf(self): self.iface.mapCanvas().clearCache() user_arf_lyr.triggerRepaint() QApplication.restoreOverrideCursor() - self.uc.show_info("ARF and WRF values calculated!") + self.uc.bar_info("ARF and WRF values calculated! The ARF and WRF switch is now enabled.") + self.uc.log_info("ARF and WRF values calculated! The ARF and WRF switch is now enabled.") + # Set ARFs on the Control Parameters + self.gutils.set_cont_par("IWRFS", 1) except Exception as e: self.uc.log_info(traceback.format_exc()) self.uc.show_error( diff --git a/flo2d/gui/infil_editor_widget.py b/flo2d/gui/infil_editor_widget.py index aec071ab..e9fc0bbd 100644 --- a/flo2d/gui/infil_editor_widget.py +++ b/flo2d/gui/infil_editor_widget.py @@ -480,8 +480,11 @@ def schematize_infiltration(self): self.con.commit() self.gutils.enable_geom_triggers() QApplication.restoreOverrideCursor() - self.uc.bar_info("Schematizing of infiltration finished!") - self.uc.log_info("Schematizing of infiltration finished!") + self.uc.bar_info("Schematizing Infiltration finished! The Infiltration switch is now enabled.") + self.uc.log_info("Schematizing Infiltration finished! The Infiltration switch is now enabled.") + # Set Structures on the Control Parameters + self.gutils.set_cont_par("INFIL", 1) + except Exception as e: self.gutils.enable_geom_triggers() self.uc.log_info(traceback.format_exc()) diff --git a/flo2d/gui/struct_editor_widget.py b/flo2d/gui/struct_editor_widget.py index 20271eb1..eec239d5 100644 --- a/flo2d/gui/struct_editor_widget.py +++ b/flo2d/gui/struct_editor_widget.py @@ -325,11 +325,11 @@ def schematize_struct(self): # Return True there are no errors else: self.uc.log_info( - "Schematizing Hydraulic Structures finished!\n\n" + "Schematizing Hydraulic Structures finished! The Hydraulic Structure switch is now enabled.\n\n" + str(len(structs)) + " structures were updated in the Hydraulic Structures table." ) self.uc.bar_info( - "Schematizing Hydraulic Structures finished!" + "Schematizing Hydraulic Structures finished! The Hydraulic Structure switch is now enabled." ) else: self.uc.bar_error("WARNING 151203.0646: Error during Hydraulic Structures schematization!") diff --git a/flo2d/gui/xs_editor_widget.py b/flo2d/gui/xs_editor_widget.py index e17ea755..f81392f8 100644 --- a/flo2d/gui/xs_editor_widget.py +++ b/flo2d/gui/xs_editor_widget.py @@ -1095,7 +1095,12 @@ def check_schematized_channel(self): self.uc.log_info(msg) else: - self.uc.show_info("The schematized channel has passed all required checks!") + self.uc.bar_info("The schematized channel has passed all required checks! The Channel switch is now " + "enabled.") + self.uc.log_info("The schematized channel has passed all required checks! The Channel switch is now " + "enabled.") + # Set Channels on the Control Parameters + self.gutils.set_cont_par("ICHANNEL", 1) except Exception as e: QApplication.restoreOverrideCursor()