mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Pollutants: ref to pol_name in the title of the lateral_contribution_pollutant
This commit is contained in:
1 parent
5da607865c
commit
7ef305e724
1 file changed
+13
-6
@@ -57,6 +57,15 @@ class EditLateralContributionAdisTSWindow(PamhyrWindow):
|
|||||||
name = trad[self._pamhyr_name]
|
name = trad[self._pamhyr_name]
|
||||||
|
|
||||||
if self._data is not None:
|
if self._data is not None:
|
||||||
|
pollutant_name = next(
|
||||||
|
(
|
||||||
|
pollutant.name
|
||||||
|
for pollutant in study.river.Pollutants.Pollutants_List
|
||||||
|
if pollutant.id == self._data.pollutant
|
||||||
|
),
|
||||||
|
None
|
||||||
|
)
|
||||||
|
|
||||||
if self._data.reach is not None:
|
if self._data.reach is not None:
|
||||||
reach_name = next(filter(
|
reach_name = next(filter(
|
||||||
lambda reach: reach.id == self._data.reach,
|
lambda reach: reach.id == self._data.reach,
|
||||||
@@ -75,12 +84,10 @@ class EditLateralContributionAdisTSWindow(PamhyrWindow):
|
|||||||
else:
|
else:
|
||||||
end_rk = trad['not_associated']
|
end_rk = trad['not_associated']
|
||||||
|
|
||||||
name += (
|
name += f" - {study.name}"
|
||||||
f" - {study.name} - " +
|
if pollutant_name is not None:
|
||||||
f"{reach_name} - " +
|
name += f" - {pollutant_name}"
|
||||||
f"({begin_rk} - " +
|
name += f" - {reach_name} - ({begin_rk} - {end_rk})"
|
||||||
f"{end_rk})"
|
|
||||||
)
|
|
||||||
|
|
||||||
super(EditLateralContributionAdisTSWindow, self).__init__(
|
super(EditLateralContributionAdisTSWindow, self).__init__(
|
||||||
title=name,
|
title=name,
|
||||||
|
|||||||
Reference in new issue
Block a user