Skip to content

Commit

Permalink
Added the delete schematized floodplain xs button
Browse files Browse the repository at this point in the history
  • Loading branch information
rpachaly committed Jan 8, 2025
1 parent eccb981 commit a4b169b
Show file tree
Hide file tree
Showing 3 changed files with 415 additions and 2 deletions.
22 changes: 21 additions & 1 deletion flo2d/gui/fpxsec_editor_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def __init__(self, iface, lyrs, plot, table):
self.revert_changes_btn.clicked.connect(self.revert_fpxs_lyr_edits)
self.delete_fpxs_btn.clicked.connect(self.delete_cur_fpxs)
self.schem_fpxs_btn.clicked.connect(self.schematize_fpxs)
self.del_schem_fpxs_btn.clicked.connect(self.delete_schema_fpxs)
self.rename_fpxs_btn.clicked.connect(self.rename_fpxs)
self.fpxs_cbo.activated.connect(self.cur_fpxs_changed)
self.flow_dir_cbo.activated.connect(self.save_fpxs)
Expand Down Expand Up @@ -236,7 +237,26 @@ def schematize_fpxs(self):
"Please check your User Layers."
)
return
self.uc.show_info("Floodplain cross-sections schematized!")
self.uc.bar_info("Floodplain cross-sections schematized!")
self.uc.log_info("Floodplain cross-sections schematized!")

def delete_schema_fpxs(self):
"""
Function to delete the floodplain cross-section schematized data
"""
if self.gutils.is_table_empty("fpxsec") or self.gutils.is_table_empty("fpxsec_cells"):
self.uc.bar_warn("There is no schematized floodplain cross sections!")
self.uc.log_info("There is no schematized floodplain cross sections!")
return

self.gutils.clear_tables("fpxsec", "fpxsec_cells")

self.uc.bar_info("Schematized floodplain cross sections deleted!")
self.uc.log_info("Schematized floodplain cross sections deleted!")

self.lyrs.clear_rubber()
self.lyrs.data["fpxsec"]["qlyr"].triggerRepaint()
self.lyrs.data["fpxsec_cells"]["qlyr"].triggerRepaint()

def set_report(self):
if self.report_chbox.isChecked():
Expand Down
Loading

0 comments on commit a4b169b

Please sign in to comment.