mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
add reach selection in geometry
This commit is contained in:
1 parent
24d92b2ac0
commit
f35048b89f
9 files changed
+187
-5
No files matched your search
@@ -51,6 +51,11 @@ class PlotAC(PamhyrPlot):
|
||||
self.plot_selected = None
|
||||
self.next_plot_selected = None
|
||||
|
||||
@timer
|
||||
def redraw(self, data):
|
||||
self._data = data
|
||||
self.draw()
|
||||
|
||||
@timer
|
||||
def draw(self):
|
||||
self.init_axes()
|
||||
|
||||
@@ -163,6 +163,11 @@ class PlotRKZ(PamhyrPlot):
|
||||
)
|
||||
self._table.scrollTo(self._table.model().index(ind2, 0))
|
||||
|
||||
@timer
|
||||
def redraw(self, data):
|
||||
self._data = data
|
||||
self.draw()
|
||||
|
||||
@timer
|
||||
def draw(self):
|
||||
self.init_axes()
|
||||
|
||||
@@ -162,6 +162,11 @@ class PlotXY(PamhyrPlot):
|
||||
)
|
||||
self._table.scrollTo(self._table.model().index(ind2, 0))
|
||||
|
||||
@timer
|
||||
def redraw(self, data):
|
||||
self._data = data
|
||||
self.draw()
|
||||
|
||||
@timer
|
||||
def draw(self):
|
||||
self.init_axes()
|
||||
|
||||
@@ -47,6 +47,8 @@ from View.Tools.PamhyrWindow import PamhyrWindow
|
||||
from View.Tools.Plot.PamhyrToolbar import PamhyrPlotToolbar
|
||||
from View.Tools.Plot.PamhyrCanvas import MplCanvas
|
||||
|
||||
from View.SelectReach.Window import SelectReachWindow
|
||||
|
||||
from Meshing.Mage import (
|
||||
MeshingWithMage, MeshingWithMageMailleurTT
|
||||
)
|
||||
@@ -196,6 +198,7 @@ class GeometryWindow(PamhyrWindow):
|
||||
"action_update_rk": self.update_rk,
|
||||
"action_purge": self.purge,
|
||||
"action_shift": self.shift,
|
||||
"action_select_reach": self.select_reach,
|
||||
}
|
||||
|
||||
for action in actions:
|
||||
@@ -217,9 +220,9 @@ class GeometryWindow(PamhyrWindow):
|
||||
|
||||
def _update(self, redraw=False, propagate=True):
|
||||
if redraw:
|
||||
self._plot_xy.draw()
|
||||
self._plot_rkc.draw()
|
||||
self._plot_ac.draw()
|
||||
self._plot_xy.redraw(data=self._reach)
|
||||
self._plot_rkc.redraw(data=self._reach)
|
||||
self._plot_ac.redraw(data=self._reach)
|
||||
|
||||
self.select_current_profile()
|
||||
|
||||
@@ -535,6 +538,25 @@ class GeometryWindow(PamhyrWindow):
|
||||
logger_exception(e)
|
||||
return
|
||||
|
||||
def select_reach(self):
|
||||
try:
|
||||
dlg = SelectReachWindow(
|
||||
study=self._study,
|
||||
trad=self._trad,
|
||||
parent=self
|
||||
)
|
||||
if dlg.exec():
|
||||
self._reach = self._study.river.current_reach().reach
|
||||
self.setup_table()
|
||||
self.update_redraw() # Profile selection when line change in table
|
||||
self.find(QTableView, "tableView").selectionModel()\
|
||||
.selectionChanged\
|
||||
.connect(self.select_current_profile)
|
||||
except Exception as e:
|
||||
logger_exception(e)
|
||||
return
|
||||
|
||||
|
||||
def duplicate(self):
|
||||
rows = [
|
||||
row.row() for row in
|
||||
|
||||
Reference in new issue
Block a user