mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
HydraulicStructures: Fix hydraulic structures plot with missing input section
This commit is contained in:
1 parent
81ff6372e9
commit
ee28afac86
1 file changed
+11
-5
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user