diff --git a/src/View/Results/CustomPlot/Plot.py b/src/View/Results/CustomPlot/Plot.py index 4ce0c815..bcce3e66 100644 --- a/src/View/Results/CustomPlot/Plot.py +++ b/src/View/Results/CustomPlot/Plot.py @@ -62,9 +62,9 @@ class CustomPlot(PamhyrPlot): self._x = x self._y = y self._envelop = envelop - self._reach = reach - self._profile = profile - self._timestamp = timestamp + self._current_reach = reach + self._current_profile_id = profile + self._current_timestamp = timestamp self._current_res_id = res_id[0] self._parent = parent @@ -144,14 +144,14 @@ class CustomPlot(PamhyrPlot): Get SL list for profile p at current time """ return map( - lambda p: p.get_ts_key(self._timestamp, "sl")[0], + lambda p: p.get_ts_key(self._current_timestamp, "sl")[0], reach.profiles ) def get_ts_zmin(self, profile, res_id): results = self.data[res_id] nt = len(list(results.get("timestamps"))) - reach = results.river.reach(self._reach) + reach = results.river.reach(self._current_reach) berdrock = self.sl_compute_bedrock(reach) sl = reach.profile(profile).get_key("sl") @@ -171,10 +171,10 @@ class CustomPlot(PamhyrPlot): def _draw_rk(self): results = self.data[self._current_res_id] - reach = results.river.reach(self._reach) + reach = results.river.reach(self._current_reach) if self._current_res_id == 2: # compare results - reach1 = self.data[0].river.reach(self._reach) - reach2 = self.data[1].river.reach(self._reach) + reach1 = self.data[0].river.reach(self._current_reach) + reach2 = self.data[1].river.reach(self._current_reach) rk = reach.geometry.get_rk() if reach.has_sediment(): z_min = self.draw_bottom_with_bedload(reach) @@ -183,19 +183,19 @@ class CustomPlot(PamhyrPlot): q = list( map( - lambda p: p.get_ts_key(self._timestamp, "Q"), + lambda p: p.get_ts_key(self._current_timestamp, "Q"), reach.profiles ) ) z = list( map( - lambda p: p.get_ts_key(self._timestamp, "Z"), + lambda p: p.get_ts_key(self._current_timestamp, "Z"), reach.profiles ) ) v = list( map( - lambda p: p.get_ts_key(self._timestamp, "V"), + lambda p: p.get_ts_key(self._current_timestamp, "V"), reach.profiles ) ) @@ -404,7 +404,7 @@ class CustomPlot(PamhyrPlot): d = list( map( lambda p: p.geometry.max_water_depth( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach.profiles ) ) @@ -412,14 +412,14 @@ class CustomPlot(PamhyrPlot): d1 = list( map( lambda p: p.geometry.max_water_depth( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach1.profiles ) ) d2 = list( map( lambda p: p.geometry.max_water_depth( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach2.profiles ) ) @@ -473,7 +473,7 @@ class CustomPlot(PamhyrPlot): d = list( map( lambda p: p.geometry.mean_water_depth( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach.profiles ) ) @@ -481,14 +481,14 @@ class CustomPlot(PamhyrPlot): d1 = list( map( lambda p: p.geometry.mean_water_depth( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach1.profiles ) ) d2 = list( map( lambda p: p.geometry.mean_water_depth( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach2.profiles ) ) @@ -512,12 +512,12 @@ class CustomPlot(PamhyrPlot): fr = list( map( lambda p: - p.get_ts_key(self._timestamp, "V") / + p.get_ts_key(self._current_timestamp, "V") / sqrt(9.81 * ( - p.geometry.wet_area( - p.get_ts_key(self._timestamp, "Z")) / - p.geometry.wet_width( - p.get_ts_key(self._timestamp, "Z")) + p.geometry.wet_area(p.get_ts_key( + self._current_timestamp, "Z")) / + p.geometry.wet_width(p.get_ts_key( + self._current_timestamp, "Z")) )), reach.profiles ) @@ -526,12 +526,12 @@ class CustomPlot(PamhyrPlot): fr1 = list( map( lambda p: - p.get_ts_key(self._timestamp, "V") / + p.get_ts_key(self._current_timestamp, "V") / sqrt(9.81 * ( - p.geometry.wet_area( - p.get_ts_key(self._timestamp, "Z")) / - p.geometry.wet_width( - p.get_ts_key(self._timestamp, "Z")) + p.geometry.wet_area(p.get_ts_key( + self._current_timestamp, "Z")) / + p.geometry.wet_width(p.get_ts_key( + self._current_timestamp, "Z")) )), reach1.profiles ) @@ -539,12 +539,12 @@ class CustomPlot(PamhyrPlot): fr2 = list( map( lambda p: - p.get_ts_key(self._timestamp, "V") / + p.get_ts_key(self._current_timestamp, "V") / sqrt(9.81 * ( - p.geometry.wet_area( - p.get_ts_key(self._timestamp, "Z")) / - p.geometry.wet_width( - p.get_ts_key(self._timestamp, "Z")) + p.geometry.wet_area(p.get_ts_key( + self._current_timestamp, "Z")) / + p.geometry.wet_width(p.get_ts_key( + self._current_timestamp, "Z")) )), reach2.profiles ) @@ -568,7 +568,7 @@ class CustomPlot(PamhyrPlot): d = list( map( lambda p: p.geometry.wet_area( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach.profiles ) ) @@ -576,14 +576,14 @@ class CustomPlot(PamhyrPlot): d1 = list( map( lambda p: p.geometry.wet_area( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach1.profiles ) ) d2 = list( map( lambda p: p.geometry.wet_area( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach2.profiles ) ) @@ -611,10 +611,10 @@ class CustomPlot(PamhyrPlot): def _redraw_rk(self): results = self.data[self._current_res_id] - reach = results.river.reach(self._reach) + reach = results.river.reach(self._current_reach) if self._current_res_id == 2: # compare results - reach1 = self.data[0].river.reach(self._reach) - reach2 = self.data[1].river.reach(self._reach) + reach1 = self.data[0].river.reach(self._current_reach) + reach2 = self.data[1].river.reach(self._current_reach) rk = reach.geometry.get_rk() z_min = reach.geometry.get_z_min() @@ -625,19 +625,19 @@ class CustomPlot(PamhyrPlot): q = list( map( - lambda p: p.get_ts_key(self._timestamp, "Q"), + lambda p: p.get_ts_key(self._current_timestamp, "Q"), reach.profiles ) ) z = list( map( - lambda p: p.get_ts_key(self._timestamp, "Z"), + lambda p: p.get_ts_key(self._current_timestamp, "Z"), reach.profiles ) ) v = list( map( - lambda p: p.get_ts_key(self._timestamp, "V"), + lambda p: p.get_ts_key(self._current_timestamp, "V"), reach.profiles ) ) @@ -681,7 +681,7 @@ class CustomPlot(PamhyrPlot): d = list( map( lambda p: p.geometry.max_water_depth( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach.profiles ) ) @@ -689,14 +689,14 @@ class CustomPlot(PamhyrPlot): d1 = list( map( lambda p: p.geometry.max_water_depth( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach1.profiles ) ) d2 = list( map( lambda p: p.geometry.max_water_depth( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach2.profiles ) ) @@ -714,7 +714,7 @@ class CustomPlot(PamhyrPlot): d = list( map( lambda p: p.geometry.mean_water_depth( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach.profiles ) ) @@ -722,14 +722,14 @@ class CustomPlot(PamhyrPlot): d1 = list( map( lambda p: p.geometry.mean_water_depth( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach1.profiles ) ) d2 = list( map( lambda p: p.geometry.mean_water_depth( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach2.profiles ) ) @@ -747,12 +747,12 @@ class CustomPlot(PamhyrPlot): fr = list( map( lambda p: - p.get_ts_key(self._timestamp, "V") / + p.get_ts_key(self._current_timestamp, "V") / sqrt(9.81 * ( - p.geometry.wet_area( - p.get_ts_key(self._timestamp, "Z")) / - p.geometry.wet_width( - p.get_ts_key(self._timestamp, "Z")) + p.geometry.wet_area(p.get_ts_key( + self._current_timestamp, "Z")) / + p.geometry.wet_width(p.get_ts_key( + self._current_timestamp, "Z")) )), reach.profiles ) @@ -761,12 +761,12 @@ class CustomPlot(PamhyrPlot): fr1 = list( map( lambda p: - p.get_ts_key(self._timestamp, "V") / + p.get_ts_key(self._current_timestamp, "V") / sqrt(9.81 * ( - p.geometry.wet_area( - p.get_ts_key(self._timestamp, "Z")) / - p.geometry.wet_width( - p.get_ts_key(self._timestamp, "Z")) + p.geometry.wet_area(p.get_ts_key( + self._current_timestamp, "Z")) / + p.geometry.wet_width(p.get_ts_key( + self._current_timestamp, "Z")) )), reach1.profiles ) @@ -774,12 +774,12 @@ class CustomPlot(PamhyrPlot): fr2 = list( map( lambda p: - p.get_ts_key(self._timestamp, "V") / + p.get_ts_key(self._current_timestamp, "V") / sqrt(9.81 * ( - p.geometry.wet_area( - p.get_ts_key(self._timestamp, "Z")) / - p.geometry.wet_width( - p.get_ts_key(self._timestamp, "Z")) + p.geometry.wet_area(p.get_ts_key( + self._current_timestamp, "Z")) / + p.geometry.wet_width(p.get_ts_key( + self._current_timestamp, "Z")) )), reach2.profiles ) @@ -798,7 +798,7 @@ class CustomPlot(PamhyrPlot): d = list( map( lambda p: p.geometry.wet_area( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach.profiles ) ) @@ -806,14 +806,14 @@ class CustomPlot(PamhyrPlot): d1 = list( map( lambda p: p.geometry.wet_area( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach1.profiles ) ) d2 = list( map( lambda p: p.geometry.wet_area( - p.get_ts_key(self._timestamp, "Z")), + p.get_ts_key(self._current_timestamp, "Z")), reach2.profiles ) ) @@ -870,8 +870,8 @@ class CustomPlot(PamhyrPlot): def _draw_time(self): results = self.data[self._current_res_id] - reach = results.river.reach(self._reach) - profile = reach.profile(self._profile) + reach = results.river.reach(self._current_reach) + profile = reach.profile(self._current_profile_id) shift = 0 compt = 0 @@ -886,10 +886,10 @@ class CustomPlot(PamhyrPlot): ts = self._parent._timestamps if self._current_res_id == 2: # compare results - reach1 = self.data[0].river.reach(self._reach) - reach2 = self.data[1].river.reach(self._reach) - profile1 = reach1.profile(self._profile) - profile2 = reach2.profile(self._profile) + reach1 = self.data[0].river.reach(self._current_reach) + reach2 = self.data[1].river.reach(self._current_reach) + profile1 = reach1.profile(self._current_profile_id) + profile2 = reach2.profile(self._current_profile_id) q1 = profile1.get_key("Q") z1 = profile1.get_key("Z") @@ -905,7 +905,8 @@ class CustomPlot(PamhyrPlot): z_min = profile.geometry.z_min() if self._current_res_id < 2: if reach.has_sediment(): - ts_z_min = self.get_ts_zmin(self._profile, self._current_res_id) + ts_z_min = self.get_ts_zmin( + self._current_profile_id, self._current_res_id) else: ts_z_min = list( map( @@ -922,8 +923,8 @@ class CustomPlot(PamhyrPlot): if self._current_res_id == 2: if reach.has_sediment(): - ts_z_min1 = self.get_ts_zmin(self._profile1, 0) - ts_z_min2 = self.get_ts_zmin(self._profile2, 1) + ts_z_min1 = self.get_ts_zmin(self._current_profile_id1, 0) + ts_z_min2 = self.get_ts_zmin(self._current_profile_id2, 1) ts_z_min = list( map( lambda x, y: x - y, @@ -1116,16 +1117,16 @@ class CustomPlot(PamhyrPlot): def _redraw_time(self): results = self.data[self._current_res_id] - reach = results.river.reach(self._reach) - profile = reach.profile(self._profile) + reach = results.river.reach(self._current_reach) + profile = reach.profile(self._current_profile_id) ts = list(results.get("timestamps")) ts.sort() if self._current_res_id == 2: # compare results - reach1 = self.data[0].river.reach(self._reach) - reach2 = self.data[1].river.reach(self._reach) - profile1 = reach1.profile(self._profile) - profile2 = reach2.profile(self._profile) + reach1 = self.data[0].river.reach(self._current_reach) + reach2 = self.data[1].river.reach(self._current_reach) + profile1 = reach1.profile(self._current_profile_id) + profile2 = reach2.profile(self._current_profile_id) q1 = profile1.get_key("Q") z1 = profile1.get_key("Z") @@ -1140,7 +1141,8 @@ class CustomPlot(PamhyrPlot): v = profile.get_key("V") if self._current_res_id < 2: if reach.has_sediment(): - ts_z_min = self.get_ts_zmin(self._profile, self._current_res_id) + ts_z_min = self.get_ts_zmin( + self._current_profile_id, self._current_res_id) else: z_min = profile.geometry.z_min() ts_z_min = list( @@ -1152,8 +1154,8 @@ class CustomPlot(PamhyrPlot): if "bed_elevation" in self._y: if self._current_res_id == 2: if reach.has_sediment(): - ts_z_min1 = self.get_ts_zmin(self._profile1, 0) - ts_z_min2 = self.get_ts_zmin(self._profile2, 1) + ts_z_min1 = self.get_ts_zmin(self._current_profile_id1, 0) + ts_z_min2 = self.get_ts_zmin(self._current_profile_id2, 1) ts_z_min = list( map( lambda x, y: x - y, @@ -1360,11 +1362,12 @@ class CustomPlot(PamhyrPlot): elif self._x == "time": self._draw_time() if self._x == "rk": - reach = self.data[self._current_res_id].river.reach(self._reach) - profile = reach.profile(self._profile) + reach = self.data[self._current_res_id].river.reach( + self._current_reach) + profile = reach.profile(self._current_profile_id) x = profile.rk elif self._x == "time": - x = self._timestamp + x = self._current_timestamp self._current, = self.canvas.axes.plot( [x, x], @@ -1387,13 +1390,13 @@ class CustomPlot(PamhyrPlot): return def set_reach(self, reach_id): - self._reach = reach_id - self._profile = 0 + self._current_reach = reach_id + self._current_profile_id = 0 self.draw() def set_profile(self, profile_id): - self._profile = profile_id + self._current_profile_id = profile_id if self._x != "rk": self.update() @@ -1405,19 +1408,27 @@ class CustomPlot(PamhyrPlot): self.draw() def set_timestamp(self, timestamp): - self._timestamp = timestamp + self._current_timestamp = timestamp if self._x != "time": self.update() else: self.draw_current() + def update_all(self): + self._current_reach_id = self._parent._get_current_reach() + self._current_profile_id = self._parent._get_current_profile() + self._current_res_id = self._parent._get_current_results()[0] + self._current_timestamp = self._parent._get_current_timestamp() + self.draw() + def draw_current(self): if self._x == "rk": - reach = self.data[self._current_res_id].river.reach(self._reach) - profile = reach.profile(self._profile) + reach = self.data[self._current_res_id].river.reach( + self._current_reach) + profile = reach.profile(self._current_profile_id) x = profile.rk elif self._x == "time": - x = self._timestamp + x = self._current_timestamp self._current.set_data([x, x], self.canvas.axes.get_ylim()) self.canvas.draw_idle() diff --git a/src/View/Results/PlotAC.py b/src/View/Results/PlotAC.py index c452a790..2948e0f6 100644 --- a/src/View/Results/PlotAC.py +++ b/src/View/Results/PlotAC.py @@ -39,6 +39,7 @@ class PlotAC(PamhyrPlot): parent=parent ) + self._parent = parent self._current_reach_id = reach_id self._current_profile_id = profile_id self._current_res_id = res_id[0] @@ -243,6 +244,14 @@ class PlotAC(PamhyrPlot): self.update_idle() + def update_all(self): + self._current_reach_id = self._parent._get_current_reach() + self._current_profile_id = self._parent._get_current_profile() + self._current_res_id = self._parent._get_current_results()[0] + self._current_timestamp = self._parent._get_current_timestamp() + self._init = False + self.update() + def update_gl(self): for a in self.annotation: a.remove() diff --git a/src/View/Results/PlotH.py b/src/View/Results/PlotH.py index 06658d7d..d4a8a295 100644 --- a/src/View/Results/PlotH.py +++ b/src/View/Results/PlotH.py @@ -47,6 +47,7 @@ class PlotH(PamhyrPlot): self._mode = "time" + self._parent = parent self._current_reach_id = reach_id self._current_profile_id = profile_id self._current_res_id = res_id @@ -216,20 +217,16 @@ class PlotH(PamhyrPlot): if not self._init: self.draw() - self.update_data() self.update_current() self.update_idle() - def update_data(self): - for res, res_id in enumerate(self._current_res_id): - results = self.results[res_id] - reach = results.river.reach(self._current_reach_id) - profile = reach.profile(self._current_profile_id) - - x = self._timestamps - y = profile.get_key("Q") - - self._line[res].set_data(x, y) + def update_all(self): + self._current_reach_id = self._parent._get_current_reach() + self._current_profile_id = self._parent._get_current_profiles_list() + self._current_res_id = self._parent._get_current_results() + self._current_timestamp = self._parent._get_current_timestamp() + self._init = False + self.update() def update_current(self): y = self._current.get_ydata() diff --git a/src/View/Results/PlotRKC.py b/src/View/Results/PlotRKC.py index e1f53c6c..b2713370 100644 --- a/src/View/Results/PlotRKC.py +++ b/src/View/Results/PlotRKC.py @@ -42,6 +42,7 @@ class PlotRKC(PamhyrPlot): parent=parent ) + self._parent = parent self._current_reach_id = reach_id self._current_profile_id = profile_id self._current_res_id = res_id[0] @@ -343,6 +344,14 @@ class PlotRKC(PamhyrPlot): self.update_idle() + def update_all(self): + self._current_reach_id = self._parent._get_current_reach() + self._current_profile_id = self._parent._get_current_profile() + self._current_res_id = self._parent._get_current_results()[0] + self._current_timestamp = self._parent._get_current_timestamp() + self._init = False + self.update() + def update_water_elevation(self): results = self.results[self._current_res_id] reach = results.river.reach(self._current_reach_id) diff --git a/src/View/Results/PlotXY.py b/src/View/Results/PlotXY.py index 5fb00460..4eb22338 100644 --- a/src/View/Results/PlotXY.py +++ b/src/View/Results/PlotXY.py @@ -52,6 +52,7 @@ class PlotXY(PamhyrPlot): self.line_gl = [] self.overflow = [] + self._parent = parent self._timestamps = parent._timestamps self._current_timestamp = max(self._timestamps) self._current_reach_id = reach_id @@ -332,6 +333,14 @@ class PlotXY(PamhyrPlot): self.update_idle() + def update_all(self): + self._current_reach_id = self._parent._get_current_reach() + self._current_profile_id = self._parent._get_current_profile() + self._current_res_id = self._parent._get_current_results()[0] + self._current_timestamp = self._parent._get_current_timestamp() + self._init = False + self.update() + def update_profile(self): results = self.results[self._current_res_id] reach = results.river.reach(self._current_reach_id) diff --git a/src/View/Results/Window.py b/src/View/Results/Window.py index 4080c1fe..ff7df6a6 100644 --- a/src/View/Results/Window.py +++ b/src/View/Results/Window.py @@ -445,49 +445,69 @@ class ResultsWindow(PamhyrWindow): solver_id=None, timestamp=None): - if reach_id is not None: - self.plot_xy.set_reach(reach_id) - self.plot_ac.set_reach(reach_id) - self.plot_rkc.set_reach(reach_id) - self.plot_h.set_reach(reach_id) + tab_widget = self.find(QTabWidget, f"tabWidget") + tab_index = tab_widget.currentIndex() + name = tab_widget.tabText(tab_index) - for plot in self._additional_plot: - self._additional_plot[plot].set_reach(reach_id) + if reach_id is not None: + if tab_index == 1: + self.plot_xy.set_reach(reach_id) + self.plot_ac.set_reach(reach_id) + self.plot_rkc.set_reach(reach_id) + elif tab_index == 2: + self.plot_h.set_reach(reach_id) + elif tab_index > 2: + self._additional_plot[name].set_reach(reach_id) + + # for plot in self._additional_plot: + # self._additional_plot[plot].set_reach(reach_id) self.update_table_selection_reach(reach_id) self.update_table_selection_profile(0) if profile_id is not None: - self.plot_xy.set_profile(profile_id[0]) - self.plot_ac.set_profile(profile_id[0]) - self.plot_rkc.set_profile(profile_id[0]) - self.plot_h.set_profile(profile_id) + if tab_index == 1: + self.plot_xy.set_profile(profile_id[0]) + self.plot_ac.set_profile(profile_id[0]) + self.plot_rkc.set_profile(profile_id[0]) + elif tab_index == 2: + self.plot_h.set_profile(profile_id) + elif tab_widget.currentIndex() > 2: + self._additional_plot[name].set_profile(profile_id[0]) - for plot in self._additional_plot: - self._additional_plot[plot].set_profile(profile_id[0]) + # for plot in self._additional_plot: + # self._additional_plot[plot].set_profile(profile_id[0]) tab_widget = self.find(QTabWidget, f"tabWidget") if tab_widget.currentIndex() != 2: self.update_table_selection_profile(profile_id[0]) if solver_id is not None: - self._current_results = solver_id - self.plot_xy.set_result(solver_id) - self.plot_ac.set_result(solver_id) - self.plot_rkc.set_result(solver_id) - self.plot_h.set_result(solver_id) + if tab_index == 1: + self._current_results = solver_id + self.plot_xy.set_result(solver_id) + self.plot_ac.set_result(solver_id) + self.plot_rkc.set_result(solver_id) + elif tab_index == 2: + self.plot_h.set_result(solver_id) + elif tab_widget.currentIndex() > 2: + self._additional_plot[name].set_result(solver_id) - for plot in self._additional_plot: - self._additional_plot[plot].set_result(solver_id) + # for plot in self._additional_plot: + # self._additional_plot[plot].set_result(solver_id) if timestamp is not None: self.plot_xy.set_timestamp(timestamp) self.plot_ac.set_timestamp(timestamp) self.plot_rkc.set_timestamp(timestamp) - self.plot_h.set_timestamp(timestamp) + if tab_index == 2: + self.plot_h.set_timestamp(timestamp) - for plot in self._additional_plot: - self._additional_plot[plot].set_timestamp(timestamp) + if tab_widget.currentIndex() > 2: + self._additional_plot[name].set_timestamp(timestamp) + + # for plot in self._additional_plot: + # self._additional_plot[plot].set_timestamp(timestamp) self._table["raw_data"].timestamp = timestamp @@ -522,6 +542,14 @@ class ResultsWindow(PamhyrWindow): self._slider_time.value() ] + def _get_current_results(self): + table = self.find(QTableView, f"tableView_solver") + indexes = table.selectedIndexes() + if len(indexes) == 0: + return + + return [i.row() for i in indexes] + def _set_current_reach(self): table = self.find(QTableView, f"tableView_reach") indexes = table.selectedIndexes() @@ -1201,6 +1229,16 @@ class ResultsWindow(PamhyrWindow): profile_id = self._get_current_profile() self.update_table_selection_profile(profile_id) tab_widget = self.find(QTabWidget, f"tabWidget") + tab_index = tab_widget.currentIndex() + name = tab_widget.tabText(tab_index) + if tab_index == 1: + self.plot_xy.update_all() + self.plot_ac.update_all() + self.plot_rkc.update_all() + elif tab_index == 2: + self.plot_h.update_all() + elif tab_index > 2: + self._additional_plot[name].update_all() def import_geotiff(self): return