mirror of https://gitlab.com/pamhyr/pamhyr2
SL: Reach/Profile: Add update.
parent
bccbc41fe8
commit
a9b905a039
|
|
@ -109,6 +109,9 @@ class ProfileSedimentLayersWindow(ASubMainWindow, ListedSubWindow):
|
|||
self.plot_layout = self.find(QVBoxLayout, "verticalLayout")
|
||||
self.plot_layout.addWidget(self.canvas)
|
||||
|
||||
self._update_plot()
|
||||
|
||||
def _update_plot(self):
|
||||
self.plot = Plot(
|
||||
canvas = self.canvas,
|
||||
data = self._profile,
|
||||
|
|
@ -124,6 +127,12 @@ class ProfileSedimentLayersWindow(ASubMainWindow, ListedSubWindow):
|
|||
self.copy_sc.activated.connect(self.copy)
|
||||
self.paste_sc.activated.connect(self.paste)
|
||||
|
||||
self._table.layoutChanged\
|
||||
.connect(self._update_plot)
|
||||
self._table.dataChanged\
|
||||
.connect(self._update_plot)
|
||||
|
||||
|
||||
def index_selected_rows(self):
|
||||
table = self.find(QTableView, f"tableView")
|
||||
return list(
|
||||
|
|
|
|||
|
|
@ -100,6 +100,9 @@ class ReachSedimentLayersWindow(ASubMainWindow, ListedSubWindow):
|
|||
self.plot_layout = self.find(QVBoxLayout, "verticalLayout_2")
|
||||
self.plot_layout.addWidget(self.canvas)
|
||||
|
||||
self._update_plot()
|
||||
|
||||
def _update_plot(self):
|
||||
self.plot = Plot(
|
||||
canvas = self.canvas,
|
||||
data = self._reach,
|
||||
|
|
@ -124,6 +127,12 @@ class ReachSedimentLayersWindow(ASubMainWindow, ListedSubWindow):
|
|||
self.copy_sc.activated.connect(self.copy)
|
||||
self.paste_sc.activated.connect(self.paste)
|
||||
|
||||
self._table.layoutChanged\
|
||||
.connect(self._update_plot)
|
||||
self._table.dataChanged\
|
||||
.connect(self._update_plot)
|
||||
|
||||
|
||||
def index_selected_rows(self):
|
||||
table = self.find(QTableView, f"tableView")
|
||||
return list(
|
||||
|
|
@ -144,9 +153,11 @@ class ReachSedimentLayersWindow(ASubMainWindow, ListedSubWindow):
|
|||
|
||||
def undo(self):
|
||||
self._table.undo()
|
||||
self._update_plot()
|
||||
|
||||
def redo(self):
|
||||
self._table.redo()
|
||||
self._update_plot()
|
||||
|
||||
def apply_sl_each_profile(self):
|
||||
slw = SLDialog(
|
||||
|
|
@ -157,6 +168,8 @@ class ReachSedimentLayersWindow(ASubMainWindow, ListedSubWindow):
|
|||
sl = slw.sl
|
||||
self._table.apply_sl_each_profile(sl)
|
||||
|
||||
self._update_plot()
|
||||
|
||||
def edit_profile(self):
|
||||
rows = self.index_selected_rows()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue