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):
|
def input_rk(self):
|
||||||
if self._input_section is None:
|
if self._input_section is None:
|
||||||
return None
|
return None
|
||||||
return self._input_section.rk
|
|
||||||
|
return self._input_section
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def output_rk(self):
|
def output_rk(self):
|
||||||
if self._output_section is None:
|
if self._output_section is None:
|
||||||
return None
|
return None
|
||||||
return self._output_section.rk
|
|
||||||
|
return self._output_section
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def input_section(self):
|
def input_section(self):
|
||||||
|
|
|
||||||
|
|
@ -558,12 +558,12 @@ class Mage(CommandLineSolver):
|
||||||
if not hs.enabled:
|
if not hs.enabled:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if hs.input_rk is None:
|
if hs.input_section is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
f.write(
|
f.write(
|
||||||
'* ouvrage au pk ' +
|
'* ouvrage au pk ' +
|
||||||
f"{float(hs.input_rk):>12.1f}" + ' ' +
|
f"{float(hs.input_section.rk):>12.1f}" + ' ' +
|
||||||
hs.name + '\n'
|
hs.name + '\n'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -590,7 +590,7 @@ class Mage(CommandLineSolver):
|
||||||
|
|
||||||
f.write(
|
f.write(
|
||||||
f"{sin_dict[bhs._type]} " +
|
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"
|
f"{param_str} {name}\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,7 @@ class PlotRKZ(PamhyrPlot):
|
||||||
for hs in lhs:
|
for hs in lhs:
|
||||||
if not hs.enabled:
|
if not hs.enabled:
|
||||||
continue
|
continue
|
||||||
x = hs.input_rk
|
x = hs.input_section.rk
|
||||||
if x is not None:
|
if x is not None:
|
||||||
z_min = reach.get_z_min()
|
z_min = reach.get_z_min()
|
||||||
z_max = reach.get_z_max()
|
z_max = reach.get_z_max()
|
||||||
|
|
|
||||||
|
|
@ -160,9 +160,9 @@ class BasicHydraulicStructuresWindow(PamhyrWindow):
|
||||||
self.plot_layout.addWidget(self.canvas)
|
self.plot_layout.addWidget(self.canvas)
|
||||||
|
|
||||||
reach = self._hs.input_reach
|
reach = self._hs.input_reach
|
||||||
profile_rk = self._hs.input_rk
|
profile = self._hs.input_section
|
||||||
if profile_rk is not None:
|
if profile is not None:
|
||||||
profiles = reach.reach.get_profiles_from_rk(float(profile_rk))
|
profiles = reach.reach.get_profiles_from_rk(float(profile.rk))
|
||||||
else:
|
else:
|
||||||
profiles = None
|
profiles = None
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ class PlotRKC(PamhyrPlot):
|
||||||
hs_color.append("red")
|
hs_color.append("red")
|
||||||
else:
|
else:
|
||||||
hs_color.append("darkgrey")
|
hs_color.append("darkgrey")
|
||||||
x = hs.input_rk
|
x = hs.input_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,
|
||||||
|
|
|
||||||
|
|
@ -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:
|
else:
|
||||||
value = text
|
value = text
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -297,11 +297,11 @@ class HydraulicStructuresWindow(PamhyrWindow):
|
||||||
self.plot_rkc.set_reach(reach)
|
self.plot_rkc.set_reach(reach)
|
||||||
self.plot_ac.set_reach(reach)
|
self.plot_ac.set_reach(reach)
|
||||||
|
|
||||||
profile_rk = self._hs_lst.get(rows[0]).input_rk
|
profile = self._hs_lst.get(rows[0]).input_section
|
||||||
if profile_rk is not None:
|
if profile is not None:
|
||||||
profiles = reach.reach\
|
profiles = reach.reach\
|
||||||
.get_profiles_from_rk(
|
.get_profiles_from_rk(
|
||||||
float(profile_rk)
|
float(profile.rk)
|
||||||
)
|
)
|
||||||
|
|
||||||
if len(profiles) != 0 and profiles is not None:
|
if len(profiles) != 0 and profiles is not None:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue