mirror of https://gitlab.com/pamhyr/pamhyr2
geometry: Fix index 0 on plot and minor change.
parent
12814f82c8
commit
c3954208a6
|
|
@ -281,16 +281,20 @@ class GeometryWindow(QMainWindow, WindowToolKit):
|
|||
def get_elevation(self, ind: int):
|
||||
return self._reach.profile(ind).z()
|
||||
|
||||
def select_plot_plot_xy(self, ind: int):
|
||||
def select_plot_xy(self, ind: int):
|
||||
self.tableView.model().blockSignals(True)
|
||||
self._plot_xy.update(ind=ind)
|
||||
self.tableView.model().blockSignals(False)
|
||||
|
||||
def select_plot_plot_kpc(self, ind: int):
|
||||
def select_plot_kpc(self, ind: int):
|
||||
self.tableView.model().blockSignals(True)
|
||||
self._plot_kpc.update(ind=ind)
|
||||
self.tableView.model().blockSignals(False)
|
||||
|
||||
def select_plot_ac(self, ind: int):
|
||||
self.tableView.model().blockSignals(True)
|
||||
self._plot_ac.update(ind=ind)
|
||||
self.tableView.model().blockSignals(False)
|
||||
|
||||
def select_row_profile_slider(self, ind: int = 0):
|
||||
if self.tableView is not None:
|
||||
|
|
@ -313,15 +317,11 @@ class GeometryWindow(QMainWindow, WindowToolKit):
|
|||
row = self.index_selected_row()
|
||||
|
||||
self.ui.verticalSlider.setValue(row)
|
||||
self.select_plot_plot_xy(row)
|
||||
self.select_plot_plot_kpc(row)
|
||||
self.select_plot_xy(row)
|
||||
self.select_plot_kpc(row)
|
||||
self.select_plot_ac(row)
|
||||
|
||||
self._plot_xy.update(ind = row)
|
||||
self._plot_kpc.update(ind = row)
|
||||
|
||||
self.tableView.model().blockSignals(False)
|
||||
self.update_plot_ac(row)
|
||||
self.ui.canvas_2.figure.canvas.draw_idle()
|
||||
self.tableView.model().blockSignals(False)
|
||||
|
||||
def changed_slider_value(self):
|
||||
self.tableView.model().blockSignals(True)
|
||||
|
|
@ -340,8 +340,8 @@ class GeometryWindow(QMainWindow, WindowToolKit):
|
|||
f"{slider_value + 1}"
|
||||
)
|
||||
|
||||
self.select_plot_plot_xy(slider_value)
|
||||
self.select_plot_plot_kpc(slider_value)
|
||||
self.select_plot_xy(slider_value)
|
||||
self.select_plot_kpc(slider_value)
|
||||
self.select_row_profile_slider(slider_value)
|
||||
|
||||
self.tableView.model().blockSignals(False)
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ class PlotAC(APlot):
|
|||
|
||||
@timer
|
||||
def update(self, ind=None):
|
||||
if ind:
|
||||
if ind is not None:
|
||||
before = ind - 1
|
||||
after = ind + 1
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class PlotKPC(APlot):
|
|||
|
||||
@timer
|
||||
def update(self, ind=None):
|
||||
if ind:
|
||||
if ind is not None:
|
||||
before = ind - 1
|
||||
after = ind + 1
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class PlotXY(APlot):
|
|||
|
||||
@timer
|
||||
def update(self, ind=None):
|
||||
if ind:
|
||||
if ind is not None:
|
||||
before = ind - 1
|
||||
after = ind + 1
|
||||
|
||||
|
|
@ -116,7 +116,6 @@ class PlotXY(APlot):
|
|||
self.data.profile(after).y())
|
||||
self.after_plot_selected.set_visible(True)
|
||||
|
||||
self.canvas.figure.canvas.draw_idle()
|
||||
else:
|
||||
for ind in range(self.data.number_profiles):
|
||||
self.line_xy[ind][0].set_data(
|
||||
|
|
@ -133,4 +132,5 @@ class PlotXY(APlot):
|
|||
[y[i] for y in y_complete]
|
||||
)
|
||||
|
||||
self.canvas.figure.canvas.draw_idle()
|
||||
self.canvas.figure.tight_layout()
|
||||
self.canvas.figure.canvas.draw_idle()
|
||||
|
|
|
|||
Loading…
Reference in New Issue