Resutls: Read and display sediment results only if available.

This commit is contained in:
Pierre-Antoine Rouby committed 2023-08-22 11:39:08 +02:00
1 parent bab1ce9e17
commit c1ff99797c
2 files changed
+12 -3

No files matched your search

+2 -2
View File
@@ -677,8 +677,8 @@ class Mage8(Mage):
@timer @timer
def read_gra(self, study, repertory, results, qlog = None): def read_gra(self, study, repertory, results, qlog = None):
# if not study.river.has_sediment(): if not study.river.has_sediment():
# return return
logger.info(f"read_gra: Start ...") logger.info(f"read_gra: Start ...")
+10 -1
View File
@@ -182,12 +182,12 @@ class ResultsWindow(ASubMainWindow, ListedSubWindow):
) )
self.plot_h.draw() self.plot_h.draw()
self.canvas_5 = MplCanvas(width=5, height=4, dpi=100) self.canvas_5 = MplCanvas(width=5, height=4, dpi=100)
self.canvas_5.setObjectName("canvas_5") self.canvas_5.setObjectName("canvas_5")
self.plot_layout_5 = self.find(QVBoxLayout, "verticalLayout_sed_reach") self.plot_layout_5 = self.find(QVBoxLayout, "verticalLayout_sed_reach")
self.plot_layout_5.addWidget(self.canvas_5) self.plot_layout_5.addWidget(self.canvas_5)
if self._study.river.has_sediment():
self.plot_sed_reach = PlotSedReach( self.plot_sed_reach = PlotSedReach(
canvas = self.canvas_5, canvas = self.canvas_5,
results = self._results, results = self._results,
@@ -203,6 +203,7 @@ class ResultsWindow(ASubMainWindow, ListedSubWindow):
self.plot_layout_6 = self.find(QVBoxLayout, "verticalLayout_sed_profile") self.plot_layout_6 = self.find(QVBoxLayout, "verticalLayout_sed_profile")
self.plot_layout_6.addWidget(self.canvas_6) self.plot_layout_6.addWidget(self.canvas_6)
if self._study.river.has_sediment():
self.plot_sed_profile = PlotSedProfile( self.plot_sed_profile = PlotSedProfile(
canvas = self.canvas_6, canvas = self.canvas_6,
results = self._results, results = self._results,
@@ -243,6 +244,8 @@ class ResultsWindow(ASubMainWindow, ListedSubWindow):
self.plot_ac.set_reach(reach_id) self.plot_ac.set_reach(reach_id)
self.plot_kpc.set_reach(reach_id) self.plot_kpc.set_reach(reach_id)
self.plot_h.set_reach(reach_id) self.plot_h.set_reach(reach_id)
if self._study.river.has_sediment():
self.plot_sed_reach.set_reach(reach_id) self.plot_sed_reach.set_reach(reach_id)
self.plot_sed_profile.set_reach(reach_id) self.plot_sed_profile.set_reach(reach_id)
if profile_id is not None: if profile_id is not None:
@@ -250,6 +253,8 @@ class ResultsWindow(ASubMainWindow, ListedSubWindow):
self.plot_ac.set_profile(profile_id) self.plot_ac.set_profile(profile_id)
self.plot_kpc.set_profile(profile_id) self.plot_kpc.set_profile(profile_id)
self.plot_h.set_profile(profile_id) self.plot_h.set_profile(profile_id)
if self._study.river.has_sediment():
self.plot_sed_reach.set_profile(profile_id) self.plot_sed_reach.set_profile(profile_id)
self.plot_sed_profile.set_profile(profile_id) self.plot_sed_profile.set_profile(profile_id)
if timestamp is not None: if timestamp is not None:
@@ -257,6 +262,8 @@ class ResultsWindow(ASubMainWindow, ListedSubWindow):
self.plot_ac.set_timestamp(timestamp) self.plot_ac.set_timestamp(timestamp)
self.plot_kpc.set_timestamp(timestamp) self.plot_kpc.set_timestamp(timestamp)
self.plot_h.set_timestamp(timestamp) self.plot_h.set_timestamp(timestamp)
if self._study.river.has_sediment():
self.plot_sed_reach.set_timestamp(timestamp) self.plot_sed_reach.set_timestamp(timestamp)
self.plot_sed_profile.set_timestamp(timestamp) self.plot_sed_profile.set_timestamp(timestamp)
@@ -264,6 +271,8 @@ class ResultsWindow(ASubMainWindow, ListedSubWindow):
self.plot_ac.draw() self.plot_ac.draw()
self.plot_kpc.draw() self.plot_kpc.draw()
self.plot_h.draw() self.plot_h.draw()
if self._study.river.has_sediment():
self.plot_sed_reach.draw() self.plot_sed_reach.draw()
self.plot_sed_profile.draw() self.plot_sed_profile.draw()