diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py index 2142028a391d427c11a71cc2d772b2304721e319..b08ac9436548843a597afead4f450ba87f99f304 100644 --- a/src/View/MainWindow.py +++ b/src/View/MainWindow.py @@ -1654,7 +1654,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): # TODO message return None - return [result1, result2] + # return [result1, result2] result3 = Results(self._study, solver3) result3.set("nb_reach", result1.get("nb_reach")) @@ -1672,12 +1672,12 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): reach2 = result2.river.reach(r) reach3 = result3.river.reach(r) for p, (profile1, profile2) in enumerate(zip(reach1.profiles, reach2.profiles)): - for key in ["Z", "Q"]: + for key in ["Z", "Q", "V"]: d1 = profile1.get_ts_key(timestamp, key) d2 = profile2.get_ts_key(timestamp, key) reach3.set(p, timestamp, key, d1-d2) - return result3 + return [result1, result2, result3] def open_results_adists(self): if self._study is None: diff --git a/src/View/Results/PlotH.py b/src/View/Results/PlotH.py index a1c5aa99965db7f1d0aa89e6851ab594be8b80a3..92b8155ad8871c808c365ee3883d14269673a1d7 100644 --- a/src/View/Results/PlotH.py +++ b/src/View/Results/PlotH.py @@ -76,7 +76,8 @@ class PlotH(PamhyrPlot): @timer def draw(self, highlight=None): - self.init_axes() + self.canvas.axes.cla() + self.canvas.axes.grid(color='grey', linestyle='--', linewidth=0.5) if self.results is None: return @@ -94,14 +95,14 @@ class PlotH(PamhyrPlot): self.draw_max(reach) self.draw_data(reach, profile) - self.draw_current() self.set_ticks_time_formater() self.enable_legend() - self.idle() - self.update_current() + self.canvas.draw_idle() + self.update_idle + self.draw_current() self._init = True def draw_data(self, reach, profile): @@ -156,7 +157,7 @@ class PlotH(PamhyrPlot): def set_result(self, res_id): self._current_result_id = res_id - self.update() + self.draw() def set_timestamp(self, timestamp): self._current_timestamp = timestamp @@ -168,6 +169,7 @@ class PlotH(PamhyrPlot): self.draw() self.update_data() + self.update_current() self.update_idle() def update_data(self): @@ -180,13 +182,14 @@ class PlotH(PamhyrPlot): self._line.set_data(x, y) - self._current.set_data( - [self._current_timestamp, self._current_timestamp], - self.canvas.axes.get_ylim() - ) + #self._current.set_data( + #[self._current_timestamp, self._current_timestamp], + #self.canvas.axes.get_ylim() + #) def update_current(self): + y = self._current.get_ydata() self._current.set_data( [self._current_timestamp, self._current_timestamp], - self.canvas.axes.get_ylim() + y ) diff --git a/src/View/Results/Window.py b/src/View/Results/Window.py index d3caa0c066598a689b927361cb8a39b27682e514..d06ba627287392edc233317ab48bc35402b6bde5 100644 --- a/src/View/Results/Window.py +++ b/src/View/Results/Window.py @@ -124,6 +124,10 @@ class ResultsWindow(PamhyrWindow): logger_exception(e) return + self.update(reach_id=0, + profile_id=0, + solver_id=0) + def setup_table(self): self._table = {} for t in ["reach", "profile", "raw_data", "solver"]: