diff --git a/src/View/Geometry/PlotKPZ.py b/src/View/Geometry/PlotKPZ.py index f4dbd7907024086339533d376fd9324fd8967f08..1c80af12abae4b103a01569fb08b5e5685eba76d 100644 --- a/src/View/Geometry/PlotKPZ.py +++ b/src/View/Geometry/PlotKPZ.py @@ -25,8 +25,11 @@ logger = logging.getLogger() class PlotKPZ(PamhyrPlot): - def __init__(self, canvas=None, trad=None, data=None, toolbar=None, + def __init__(self, canvas=None, trad=None, + study=None, data=None, toolbar=None, parent=None): + self._study = study + super(PlotKPZ, self).__init__( canvas=canvas, trad=trad, @@ -75,6 +78,7 @@ class PlotKPZ(PamhyrPlot): self.draw_current() self.draw_gl() self.draw_bottom() + self.draw_profiles_hs(self._data) self.idle() self._init = True @@ -184,6 +188,34 @@ class PlotKPZ(PamhyrPlot): color='lightgrey' ) + def draw_profiles_hs(self, reach): + lhs = filter( + lambda hs: hs._input_reach.reach is reach, + self._study.river.hydraulic_structures.lst + ) + + for hs in lhs: + x = hs.input_kp + z_min = reach.get_z_min() + z_max = reach.get_z_max() + + self.canvas.axes.plot( + [x, x], + [min(z_min), max(z_max)], + linestyle="--", + lw=1., + color=self.color_plot_previous, + ) + + self.canvas.axes.annotate( + " > " + hs.name, + (x, max(z_max)), + horizontalalignment='left', + verticalalignment='top', + annotation_clip=True, + fontsize=9, color=self.color_plot_previous, + ) + @timer def update(self): if not self._init: diff --git a/src/View/Geometry/Window.py b/src/View/Geometry/Window.py index 5e13a1dc96e593ca9991ed30909b44e9ef442fc7..65ffb8f5c47b749aa1f0cdec105aaf3747307b7f 100644 --- a/src/View/Geometry/Window.py +++ b/src/View/Geometry/Window.py @@ -376,6 +376,7 @@ class GeometryWindow(PamhyrWindow): self._plot_kpc = PlotKPZ( canvas=self._canvas_kpc, + study=self._study, data=self._reach, trad=self._trad, toolbar=self._toolbar_kpc diff --git a/src/View/Results/PlotKPC.py b/src/View/Results/PlotKPC.py index 4d7bc7564761f5a5f60c5650fb36fe219c29f43c..77e101dc2cd7c6096d111555c2cbd3abdbcd630d 100644 --- a/src/View/Results/PlotKPC.py +++ b/src/View/Results/PlotKPC.py @@ -120,7 +120,7 @@ class PlotKPC(PamhyrPlot): self.canvas.axes.plot( [x, x], [min(z_min), max(z_max)], - linestyle="solid", + linestyle="--", lw=1., color=self.color_plot_previous, )