diff --git a/src/View/Geometry/GeometryWindow.py b/src/View/Geometry/GeometryWindow.py index f466febd497dd37ac2d3ea53b37837f4cff2f227..ffdc1eb8e67aa6f3d1807b99cc7eaea3fc5cf571 100644 --- a/src/View/Geometry/GeometryWindow.py +++ b/src/View/Geometry/GeometryWindow.py @@ -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) diff --git a/src/View/Geometry/PlotAC.py b/src/View/Geometry/PlotAC.py index f4dd768e208817994d33acc83a71b06a8a2cffce..1dfb9bbc1bd7b92fc20996c1f9038b90c066fa45 100644 --- a/src/View/Geometry/PlotAC.py +++ b/src/View/Geometry/PlotAC.py @@ -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 diff --git a/src/View/Geometry/PlotKPC.py b/src/View/Geometry/PlotKPC.py index 690367cfe6a1528a1fa4c10af40250eaf2dd96d2..8a5d7364305087c0582e0fdc7456110d058cf805 100644 --- a/src/View/Geometry/PlotKPC.py +++ b/src/View/Geometry/PlotKPC.py @@ -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 diff --git a/src/View/Geometry/PlotXY.py b/src/View/Geometry/PlotXY.py index 2d7b6ed0c07432bc24c67338cf82d807b5afcc03..7e182447b4752c98abd73bc0ba6dab765aaddf80 100644 --- a/src/View/Geometry/PlotXY.py +++ b/src/View/Geometry/PlotXY.py @@ -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()