IC: Sync axes between the two plots and minor change.

mesh
Pierre-Antoine Rouby 2023-06-01 10:54:30 +02:00
parent f3abb003f4
commit 240367fed1
4 changed files with 25 additions and 6 deletions

View File

@ -30,16 +30,20 @@ class PlotDKP(APlot):
self.canvas.axes.set_ylabel(
_translate("MainWindow_reach", "Draft (m)"),
color='green', fontsize=12
color='green', fontsize=11
)
self.canvas.axes.set_xlabel(
_translate("MainWindow_reach", "KP (m)"),
color='green', fontsize=12
color='green', fontsize=11
)
kp = self.data.reach.reach.get_kp()
z_min = self.data.reach.reach.get_z_min()
self.canvas.axes.set_xlim(
left = min(kp), right = max(kp)
)
self.line_kp_zmin = self.canvas.axes.plot(
kp, z_min,
color='grey', lw=1.

View File

@ -29,12 +29,18 @@ class PlotFlow(APlot):
return
self.canvas.axes.set_ylabel(
_translate("MainWindow_reach", "Flow (m³/s)"),
color='green', fontsize=12
_translate("MainWindow_reach", "Flow (m^3/s)"),
color='green', fontsize=11
)
self.canvas.axes.set_xlabel(
_translate("MainWindow_reach", "KP (m)"),
color='green', fontsize=12
color='green', fontsize=11
)
kp = self.data.reach.reach.get_kp()
self.canvas.axes.set_xlim(
left = min(kp), right = max(kp)
)
kp = self.data.get_kp()

View File

@ -119,7 +119,6 @@ class InitialConditionsWindow(ASubMainWindow, ListedSubWindow):
data = self._ics,
toolbar = None,
)
self.plot_2.draw()
def setup_connections(self):

View File

@ -197,6 +197,8 @@ class LateralContributionWindow(ASubMainWindow, ListedSubWindow):
else:
self._table[tab].add(rows[0])
self._set_current_reach()
def delete(self):
tab = self.current_tab()
rows = self.index_selected_rows()
@ -204,34 +206,42 @@ class LateralContributionWindow(ASubMainWindow, ListedSubWindow):
return
self._table[tab].delete(rows)
self._set_current_reach()
def sort(self):
tab = self.current_tab()
self._table[tab].sort(False)
self._set_current_reach()
def move_up(self):
tab = self.current_tab()
row = self.index_selected_row()
self._table[tab].move_up(row)
self._set_current_reach()
def move_down(self):
tab = self.current_tab()
row = self.index_selected_row()
self._table[tab].move_down(row)
self._set_current_reach()
def copy(self):
print("TODO")
self._set_current_reach()
def paste(self):
print("TODO")
self._set_current_reach()
def undo(self):
tab = self.current_tab()
self._table[tab].undo()
self._set_current_reach()
def redo(self):
tab = self.current_tab()
self._table[tab].redo()
self._set_current_reach()
def edit(self):
tab = self.current_tab()