mirror of https://gitlab.com/pamhyr/pamhyr2
HydraulicStructures: Fix hydraulic structures plot with missing input section
parent
81ff6372e9
commit
ee28afac86
|
|
@ -136,13 +136,18 @@ class PlotRKC(PamhyrPlot):
|
|||
hs_color = []
|
||||
index = self.parent.tableView.selectedIndexes()
|
||||
for i, hs in enumerate(lhs):
|
||||
section = hs.input_section
|
||||
if section is None:
|
||||
continue
|
||||
|
||||
if i == index[0].row():
|
||||
hs_color.append("blue")
|
||||
color = "blue"
|
||||
elif hs.enabled:
|
||||
hs_color.append("red")
|
||||
color = "red"
|
||||
else:
|
||||
hs_color.append("darkgrey")
|
||||
x = hs.input_section.rk
|
||||
color = "darkgrey"
|
||||
|
||||
x = section.rk
|
||||
if x is not None:
|
||||
a = self.canvas.axes.annotate(
|
||||
" > " + hs.name,
|
||||
|
|
@ -151,12 +156,13 @@ class PlotRKC(PamhyrPlot):
|
|||
verticalalignment='top',
|
||||
annotation_clip=True,
|
||||
fontsize=9,
|
||||
color=hs_color[-1],
|
||||
color=color,
|
||||
)
|
||||
self.anotate_lst.append(a)
|
||||
vx.append(x)
|
||||
vymin.append(min(z_min))
|
||||
vymax.append(max(z_max))
|
||||
hs_color.append(color)
|
||||
|
||||
self.hs_vlines = self.canvas.axes.vlines(
|
||||
x=vx, ymin=vymin, ymax=vymax,
|
||||
|
|
|
|||
Loading…
Reference in New Issue