mirror of https://gitlab.com/pamhyr/pamhyr2
Friction: Connect to geometry update.
parent
ebc3e938bf
commit
ab776f15f4
|
|
@ -160,10 +160,10 @@ class FrictionsWindow(PamhyrWindow):
|
|||
table = self.find(QTableView, f"tableView")
|
||||
table.selectionModel()\
|
||||
.selectionChanged\
|
||||
.connect(self._set_current_reach)
|
||||
.connect(self.update)
|
||||
|
||||
self._table.dataChanged\
|
||||
.connect(self._set_current_reach)
|
||||
.connect(self.update)
|
||||
|
||||
def index_selected_rows(self):
|
||||
table = self.find(QTableView, f"tableView")
|
||||
|
|
@ -177,6 +177,16 @@ class FrictionsWindow(PamhyrWindow):
|
|||
)
|
||||
)
|
||||
|
||||
def update(self):
|
||||
self._set_current_reach()
|
||||
# self._propagate_update(key="friction")
|
||||
|
||||
def _propagated_update(self, key=None):
|
||||
if key != "geometry":
|
||||
return
|
||||
|
||||
self.update_plot()
|
||||
|
||||
def _set_current_reach(self):
|
||||
rows = self.index_selected_rows()
|
||||
|
||||
|
|
@ -190,22 +200,16 @@ class FrictionsWindow(PamhyrWindow):
|
|||
sec = self._frictions.get(rows[0])
|
||||
highlight = (sec.begin_kp, sec.end_kp)
|
||||
|
||||
self.plot = PlotKPZ(
|
||||
canvas=self.canvas,
|
||||
data=reach,
|
||||
toolbar=None,
|
||||
)
|
||||
self.plot.highlight = highlight
|
||||
self.update_plot(highlight)
|
||||
|
||||
def update_plot(self, highlight=None):
|
||||
if highlight is not None:
|
||||
self.plot.highlight = highlight
|
||||
self.plot.draw()
|
||||
|
||||
self.plot = PlotStricklers(
|
||||
canvas=self.canvas_2,
|
||||
data=data,
|
||||
trad=self._trad,
|
||||
toolbar=None
|
||||
)
|
||||
self.plot.highlight = highlight
|
||||
self.plot.draw()
|
||||
if highlight is not None:
|
||||
self.plot_2.highlight = highlight
|
||||
self.plot_2.draw()
|
||||
|
||||
def add(self):
|
||||
rows = self.index_selected_rows()
|
||||
|
|
|
|||
Loading…
Reference in New Issue