add talweg in update_rk

master
Theophile Terraz 2026-03-04 11:14:05 +01:00
parent 5fecd29666
commit 674247db09
2 changed files with 11 additions and 2 deletions

View File

@ -93,6 +93,9 @@ class Profile(object):
return self.points[0] return self.points[0]
elif name == "np": elif name == "np":
return self.points[-1] return self.points[-1]
elif name == "talweg":
zm = self.z_min()
return next((p for p in self.points if p.z == zm), None)
else: else:
return next((p for p in self.points if p.name == name), None) return next((p for p in self.points if p.name == name), None)
@ -101,6 +104,12 @@ class Profile(object):
return 0 return 0
elif name == "np": elif name == "np":
return len(self.points) - 1 return len(self.points) - 1
elif name == "talweg":
zm = self.z_min()
return next(
(p for p in enumerate(self.points) if p[1].z == zm),
None
)[0]
else: else:
return next( return next(
(p for p in enumerate(self.points) if p[1].name == name), (p for p in enumerate(self.points) if p[1].name == name),

View File

@ -119,8 +119,8 @@ class UpdateRKDialog(PamhyrDialog):
return name return name
def _init_default_values_guidelines(self): def _init_default_values_guidelines(self):
bgl = ['un'] + self._gl + ['np'] bgl = ['un'] + self._gl + ['np', 'talweg']
egl = ['un'] + self._gl + ['np'] egl = ['un'] + self._gl + ['np', 'talweg']
self.combobox_add_items("comboBox_begin_gl", bgl) self.combobox_add_items("comboBox_begin_gl", bgl)
self.combobox_add_items("comboBox_end_gl", egl) self.combobox_add_items("comboBox_end_gl", egl)