mirror of https://gitlab.com/pamhyr/pamhyr2
debug plotH
parent
c8606cf445
commit
e3229c8183
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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"]:
|
||||
|
|
|
|||
Loading…
Reference in New Issue