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 = self.find(QTableView, f"tableView")
|
||||||
table.selectionModel()\
|
table.selectionModel()\
|
||||||
.selectionChanged\
|
.selectionChanged\
|
||||||
.connect(self._set_current_reach)
|
.connect(self.update)
|
||||||
|
|
||||||
self._table.dataChanged\
|
self._table.dataChanged\
|
||||||
.connect(self._set_current_reach)
|
.connect(self.update)
|
||||||
|
|
||||||
def index_selected_rows(self):
|
def index_selected_rows(self):
|
||||||
table = self.find(QTableView, f"tableView")
|
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):
|
def _set_current_reach(self):
|
||||||
rows = self.index_selected_rows()
|
rows = self.index_selected_rows()
|
||||||
|
|
||||||
|
|
@ -190,22 +200,16 @@ class FrictionsWindow(PamhyrWindow):
|
||||||
sec = self._frictions.get(rows[0])
|
sec = self._frictions.get(rows[0])
|
||||||
highlight = (sec.begin_kp, sec.end_kp)
|
highlight = (sec.begin_kp, sec.end_kp)
|
||||||
|
|
||||||
self.plot = PlotKPZ(
|
self.update_plot(highlight)
|
||||||
canvas=self.canvas,
|
|
||||||
data=reach,
|
def update_plot(self, highlight=None):
|
||||||
toolbar=None,
|
if highlight is not None:
|
||||||
)
|
self.plot.highlight = highlight
|
||||||
self.plot.highlight = highlight
|
|
||||||
self.plot.draw()
|
self.plot.draw()
|
||||||
|
|
||||||
self.plot = PlotStricklers(
|
if highlight is not None:
|
||||||
canvas=self.canvas_2,
|
self.plot_2.highlight = highlight
|
||||||
data=data,
|
self.plot_2.draw()
|
||||||
trad=self._trad,
|
|
||||||
toolbar=None
|
|
||||||
)
|
|
||||||
self.plot.highlight = highlight
|
|
||||||
self.plot.draw()
|
|
||||||
|
|
||||||
def add(self):
|
def add(self):
|
||||||
rows = self.index_selected_rows()
|
rows = self.index_selected_rows()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue