Compare commits

..

No commits in common. "ec2a1da6b6c972f715f057eac13f65d7bc099a8f" and "fc7d732e0af0ca8a3bddf6e3586bc932cdac5f2d" have entirely different histories.

7 changed files with 14 additions and 16 deletions

View File

@ -355,15 +355,13 @@ 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):

View File

@ -558,12 +558,12 @@ class Mage(CommandLineSolver):
if not hs.enabled: if not hs.enabled:
continue continue
if hs.input_section is None: if hs.input_rk is None:
continue continue
f.write( f.write(
'* ouvrage au pk ' + '* ouvrage au pk ' +
f"{float(hs.input_section.rk):>12.1f}" + ' ' + f"{float(hs.input_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_section.rk):>12.3f} " + f"{reach_id} {float(hs.input_rk):>12.3f} " +
f"{param_str} {name}\n" f"{param_str} {name}\n"
) )

View File

@ -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_section.rk x = hs.input_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()

View File

@ -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 = self._hs.input_section profile_rk = self._hs.input_rk
if profile is not None: if profile_rk 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

View File

@ -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_section.rk x = hs.input_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,

View File

@ -103,7 +103,7 @@ class ComboBoxDelegate(QItemDelegate):
) )
) )
value = profiles[0] if len(profiles) > 0 else None value = profiles[0].rk if len(profiles) > 0 else None
else: else:
value = text value = text

View File

@ -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 = self._hs_lst.get(rows[0]).input_section profile_rk = self._hs_lst.get(rows[0]).input_rk
if profile is not None: if profile_rk 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: