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 = []
|
hs_color = []
|
||||||
index = self.parent.tableView.selectedIndexes()
|
index = self.parent.tableView.selectedIndexes()
|
||||||
for i, hs in enumerate(lhs):
|
for i, hs in enumerate(lhs):
|
||||||
|
section = hs.input_section
|
||||||
|
if section is None:
|
||||||
|
continue
|
||||||
|
|
||||||
if i == index[0].row():
|
if i == index[0].row():
|
||||||
hs_color.append("blue")
|
color = "blue"
|
||||||
elif hs.enabled:
|
elif hs.enabled:
|
||||||
hs_color.append("red")
|
color = "red"
|
||||||
else:
|
else:
|
||||||
hs_color.append("darkgrey")
|
color = "darkgrey"
|
||||||
x = hs.input_section.rk
|
|
||||||
|
x = section.rk
|
||||||
if x is not None:
|
if x is not None:
|
||||||
a = self.canvas.axes.annotate(
|
a = self.canvas.axes.annotate(
|
||||||
" > " + hs.name,
|
" > " + hs.name,
|
||||||
|
|
@ -151,12 +156,13 @@ class PlotRKC(PamhyrPlot):
|
||||||
verticalalignment='top',
|
verticalalignment='top',
|
||||||
annotation_clip=True,
|
annotation_clip=True,
|
||||||
fontsize=9,
|
fontsize=9,
|
||||||
color=hs_color[-1],
|
color=color,
|
||||||
)
|
)
|
||||||
self.anotate_lst.append(a)
|
self.anotate_lst.append(a)
|
||||||
vx.append(x)
|
vx.append(x)
|
||||||
vymin.append(min(z_min))
|
vymin.append(min(z_min))
|
||||||
vymax.append(max(z_max))
|
vymax.append(max(z_max))
|
||||||
|
hs_color.append(color)
|
||||||
|
|
||||||
self.hs_vlines = self.canvas.axes.vlines(
|
self.hs_vlines = self.canvas.axes.vlines(
|
||||||
x=vx, ymin=vymin, ymax=vymax,
|
x=vx, ymin=vymin, ymax=vymax,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue