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 = self.find(QVBoxLayout, "verticalLayout")
|
||||||
self.plot_layout.addWidget(self.canvas)
|
self.plot_layout.addWidget(self.canvas)
|
||||||
|
|
||||||
|
self._update_plot()
|
||||||
|
|
||||||
|
def _update_plot(self):
|
||||||
self.plot = Plot(
|
self.plot = Plot(
|
||||||
canvas = self.canvas,
|
canvas = self.canvas,
|
||||||
data = self._profile,
|
data = self._profile,
|
||||||
|
|
@ -124,6 +127,12 @@ class ProfileSedimentLayersWindow(ASubMainWindow, ListedSubWindow):
|
||||||
self.copy_sc.activated.connect(self.copy)
|
self.copy_sc.activated.connect(self.copy)
|
||||||
self.paste_sc.activated.connect(self.paste)
|
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):
|
def index_selected_rows(self):
|
||||||
table = self.find(QTableView, f"tableView")
|
table = self.find(QTableView, f"tableView")
|
||||||
return list(
|
return list(
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,9 @@ class ReachSedimentLayersWindow(ASubMainWindow, ListedSubWindow):
|
||||||
self.plot_layout = self.find(QVBoxLayout, "verticalLayout_2")
|
self.plot_layout = self.find(QVBoxLayout, "verticalLayout_2")
|
||||||
self.plot_layout.addWidget(self.canvas)
|
self.plot_layout.addWidget(self.canvas)
|
||||||
|
|
||||||
|
self._update_plot()
|
||||||
|
|
||||||
|
def _update_plot(self):
|
||||||
self.plot = Plot(
|
self.plot = Plot(
|
||||||
canvas = self.canvas,
|
canvas = self.canvas,
|
||||||
data = self._reach,
|
data = self._reach,
|
||||||
|
|
@ -124,6 +127,12 @@ class ReachSedimentLayersWindow(ASubMainWindow, ListedSubWindow):
|
||||||
self.copy_sc.activated.connect(self.copy)
|
self.copy_sc.activated.connect(self.copy)
|
||||||
self.paste_sc.activated.connect(self.paste)
|
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):
|
def index_selected_rows(self):
|
||||||
table = self.find(QTableView, f"tableView")
|
table = self.find(QTableView, f"tableView")
|
||||||
return list(
|
return list(
|
||||||
|
|
@ -144,9 +153,11 @@ class ReachSedimentLayersWindow(ASubMainWindow, ListedSubWindow):
|
||||||
|
|
||||||
def undo(self):
|
def undo(self):
|
||||||
self._table.undo()
|
self._table.undo()
|
||||||
|
self._update_plot()
|
||||||
|
|
||||||
def redo(self):
|
def redo(self):
|
||||||
self._table.redo()
|
self._table.redo()
|
||||||
|
self._update_plot()
|
||||||
|
|
||||||
def apply_sl_each_profile(self):
|
def apply_sl_each_profile(self):
|
||||||
slw = SLDialog(
|
slw = SLDialog(
|
||||||
|
|
@ -157,6 +168,8 @@ class ReachSedimentLayersWindow(ASubMainWindow, ListedSubWindow):
|
||||||
sl = slw.sl
|
sl = slw.sl
|
||||||
self._table.apply_sl_each_profile(sl)
|
self._table.apply_sl_each_profile(sl)
|
||||||
|
|
||||||
|
self._update_plot()
|
||||||
|
|
||||||
def edit_profile(self):
|
def edit_profile(self):
|
||||||
rows = self.index_selected_rows()
|
rows = self.index_selected_rows()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue