mirror of https://gitlab.com/pamhyr/pamhyr2
Compare commits
2 Commits
fc7d732e0a
...
ec2a1da6b6
| Author | SHA1 | Date |
|---|---|---|
|
|
ec2a1da6b6 | |
|
|
a072a28929 |
|
|
@ -355,13 +355,15 @@ class HydraulicStructure(SQLSubModel):
|
|||
def input_rk(self):
|
||||
if self._input_section is None:
|
||||
return None
|
||||
return self._input_section.rk
|
||||
|
||||
return self._input_section
|
||||
|
||||
@property
|
||||
def output_rk(self):
|
||||
if self._output_section is None:
|
||||
return None
|
||||
return self._output_section.rk
|
||||
|
||||
return self._output_section
|
||||
|
||||
@property
|
||||
def input_section(self):
|
||||
|
|
|
|||
|
|
@ -558,12 +558,12 @@ class Mage(CommandLineSolver):
|
|||
if not hs.enabled:
|
||||
continue
|
||||
|
||||
if hs.input_rk is None:
|
||||
if hs.input_section is None:
|
||||
continue
|
||||
|
||||
f.write(
|
||||
'* ouvrage au pk ' +
|
||||
f"{float(hs.input_rk):>12.1f}" + ' ' +
|
||||
f"{float(hs.input_section.rk):>12.1f}" + ' ' +
|
||||
hs.name + '\n'
|
||||
)
|
||||
|
||||
|
|
@ -590,7 +590,7 @@ class Mage(CommandLineSolver):
|
|||
|
||||
f.write(
|
||||
f"{sin_dict[bhs._type]} " +
|
||||
f"{reach_id} {float(hs.input_rk):>12.3f} " +
|
||||
f"{reach_id} {float(hs.input_section.rk):>12.3f} " +
|
||||
f"{param_str} {name}\n"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ class PlotRKZ(PamhyrPlot):
|
|||
for hs in lhs:
|
||||
if not hs.enabled:
|
||||
continue
|
||||
x = hs.input_rk
|
||||
x = hs.input_section.rk
|
||||
if x is not None:
|
||||
z_min = reach.get_z_min()
|
||||
z_max = reach.get_z_max()
|
||||
|
|
|
|||
|
|
@ -160,9 +160,9 @@ class BasicHydraulicStructuresWindow(PamhyrWindow):
|
|||
self.plot_layout.addWidget(self.canvas)
|
||||
|
||||
reach = self._hs.input_reach
|
||||
profile_rk = self._hs.input_rk
|
||||
if profile_rk is not None:
|
||||
profiles = reach.reach.get_profiles_from_rk(float(profile_rk))
|
||||
profile = self._hs.input_section
|
||||
if profile is not None:
|
||||
profiles = reach.reach.get_profiles_from_rk(float(profile.rk))
|
||||
else:
|
||||
profiles = None
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ class PlotRKC(PamhyrPlot):
|
|||
hs_color.append("red")
|
||||
else:
|
||||
hs_color.append("darkgrey")
|
||||
x = hs.input_rk
|
||||
x = hs.input_section.rk
|
||||
if x is not None:
|
||||
a = self.canvas.axes.annotate(
|
||||
" > " + hs.name,
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class ComboBoxDelegate(QItemDelegate):
|
|||
)
|
||||
)
|
||||
|
||||
value = profiles[0].rk if len(profiles) > 0 else None
|
||||
value = profiles[0] if len(profiles) > 0 else None
|
||||
else:
|
||||
value = text
|
||||
|
||||
|
|
|
|||
|
|
@ -297,11 +297,11 @@ class HydraulicStructuresWindow(PamhyrWindow):
|
|||
self.plot_rkc.set_reach(reach)
|
||||
self.plot_ac.set_reach(reach)
|
||||
|
||||
profile_rk = self._hs_lst.get(rows[0]).input_rk
|
||||
if profile_rk is not None:
|
||||
profile = self._hs_lst.get(rows[0]).input_section
|
||||
if profile is not None:
|
||||
profiles = reach.reach\
|
||||
.get_profiles_from_rk(
|
||||
float(profile_rk)
|
||||
float(profile.rk)
|
||||
)
|
||||
|
||||
if len(profiles) != 0 and profiles is not None:
|
||||
|
|
|
|||
Loading…
Reference in New Issue