Commit a9b905a0 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

SL: Reach/Profile: Add update.

Showing with 22 additions and 0 deletions
+22 -0
......@@ -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()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment