mirror of https://gitlab.com/pamhyr/pamhyr2
UpdateRK: avoid crash when updating RK with missing points on a section, warning message instead
parent
fa8948c1b6
commit
32535af3e6
|
|
@ -97,3 +97,15 @@ class GeometryTranslate(MainTranslate):
|
|||
self._dict["format_not_exportable"] = _translate(
|
||||
"Geometry", "The format of the file is not exportable."
|
||||
)
|
||||
self._dict["update_rk_error"] = _translate(
|
||||
"Geometry",
|
||||
"RK update can't be executed."
|
||||
)
|
||||
self._dict["update_rk_empty_profiles"] = _translate(
|
||||
"Geometry",
|
||||
"Some profiles don't contain any point."
|
||||
)
|
||||
self._dict["update_rk_empty_profiles_info"] = _translate(
|
||||
"Geometry",
|
||||
"Profiles concerned:"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -371,6 +371,29 @@ class GeometryWindow(PamhyrWindow):
|
|||
parent=self
|
||||
)
|
||||
if dlg.exec():
|
||||
empty_profiles = [
|
||||
profile for profile in self._reach.profiles
|
||||
if profile.number_points == 0
|
||||
]
|
||||
if empty_profiles:
|
||||
profile_names = ", ".join(
|
||||
profile.name or str(profile.num)
|
||||
for profile in empty_profiles
|
||||
)
|
||||
self.message_box(
|
||||
(
|
||||
self._trad["update_rk_error"] +
|
||||
"\n" +
|
||||
self._trad["update_rk_empty_profiles"]
|
||||
),
|
||||
(
|
||||
self._trad["update_rk_empty_profiles_info"] +
|
||||
f" {profile_names}"
|
||||
),
|
||||
window_title=self._trad["warning"]
|
||||
)
|
||||
return
|
||||
|
||||
data = {
|
||||
"origin": dlg.origin,
|
||||
"directrices": [dlg.begin_dir, dlg.end_dir],
|
||||
|
|
|
|||
109
src/lang/fr.ts
109
src/lang/fr.ts
|
|
@ -771,12 +771,12 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<translation>Dernière modification :</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/CustomPlotValuesSelectionDialog.ui" line="27"/>
|
||||
<location filename="../View/ui/CustomPlotValuesSelectionDialog.ui" line="37"/>
|
||||
<source>X axis:</source>
|
||||
<translation>Axe X :</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/CustomPlotValuesSelectionDialog.ui" line="38"/>
|
||||
<location filename="../View/ui/CustomPlotValuesSelectionDialog.ui" line="48"/>
|
||||
<source>Y axis:</source>
|
||||
<translation>Axe Y :</translation>
|
||||
</message>
|
||||
|
|
@ -943,12 +943,12 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<message>
|
||||
<location filename="../View/ui/InitialConditions_Dialog_Generator_Height.ui" line="25"/>
|
||||
<source>Upstream height (m)</source>
|
||||
<translation>Cote à l'amont (m)</translation>
|
||||
<translation type="obsolete">Cote à l'amont (m)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/InitialConditions_Dialog_Generator_Height.ui" line="73"/>
|
||||
<source>Downstream height (m)</source>
|
||||
<translation>Cote à l'aval (m)</translation>
|
||||
<translation type="obsolete">Cote à l'aval (m)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/InitialConditions_Dialog_Generator_Height.ui" line="107"/>
|
||||
|
|
@ -991,7 +991,7 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<translation>Débit (m³/s)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/CustomExportAdisDialog.ui" line="59"/>
|
||||
<location filename="../View/ui/CustomExportAdisDialog.ui" line="49"/>
|
||||
<source>Pollutant:</source>
|
||||
<translation>Polluant:</translation>
|
||||
</message>
|
||||
|
|
@ -1040,6 +1040,21 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<source>Image coordinates</source>
|
||||
<translation type="obsolete">Coordonnées de l'image</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/CustomPlotValuesSelectionDialog.ui" line="59"/>
|
||||
<source>TextLabel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/InitialConditions_Dialog_Generator_Height.ui" line="25"/>
|
||||
<source>Upstream elevation (m)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/InitialConditions_Dialog_Generator_Height.ui" line="73"/>
|
||||
<source>Downstream elevation (m)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Documentation</name>
|
||||
|
|
@ -1557,12 +1572,33 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<message>
|
||||
<location filename="../View/Geometry/Translate.py" line="94"/>
|
||||
<source>Warning</source>
|
||||
<translation type="unfinished">Avertissement</translation>
|
||||
<translation>Avertissement</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Geometry/Translate.py" line="97"/>
|
||||
<source>The format of the file is not exportable.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Le format de fichier n'est pas exportable.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Geometry/Translate.py" line="100"/>
|
||||
<source>RK update can't be executed
|
||||
Some profiles don't contain any point.</source>
|
||||
<translation type="obsolete">La mise à jour du PK ne peut pas être exécutée\nDes profils ne contiennent aucun points.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Geometry/Translate.py" line="108"/>
|
||||
<source>Profiles concerned:</source>
|
||||
<translation>Profils concernés:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Geometry/Translate.py" line="100"/>
|
||||
<source>RK update can't be executed.</source>
|
||||
<translation>La mise à jour du PK ne peut pas être exécutée.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Geometry/Translate.py" line="104"/>
|
||||
<source>Some profiles don't contain any point.</source>
|
||||
<translation>Des profils ne contiennent aucun points.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
|
@ -1647,12 +1683,12 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<translation>Évaporation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/LateralContribution/translate.py" line="64"/>
|
||||
<location filename="../View/LateralContribution/translate.py" line="65"/>
|
||||
<source>Start (m)</source>
|
||||
<translation>PK de départ (m)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/LateralContribution/translate.py" line="65"/>
|
||||
<location filename="../View/LateralContribution/translate.py" line="66"/>
|
||||
<source>End (m)</source>
|
||||
<translation>PK de fin (m)</translation>
|
||||
</message>
|
||||
|
|
@ -1674,13 +1710,18 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<message>
|
||||
<location filename="../View/LateralContribution/translate.py" line="55"/>
|
||||
<source>Shapefile (*.LAT *.lat)</source>
|
||||
<translation>Shapefile (*.LAT *.lat)</translation>
|
||||
<translation type="obsolete">Shapefile (*.LAT *.lat)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/LateralContribution/translate.py" line="57"/>
|
||||
<location filename="../View/LateralContribution/translate.py" line="58"/>
|
||||
<source>All files (*)</source>
|
||||
<translation>Tous les fichiers (*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/LateralContribution/translate.py" line="55"/>
|
||||
<source>Mage lateral contributions file (*.LAT *.lat)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LateralContributionAdisTS</name>
|
||||
|
|
@ -2858,32 +2899,32 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<translation>AdisTS</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/MainWindow.ui" line="761"/>
|
||||
<location filename="../View/ui/MainWindow.ui" line="758"/>
|
||||
<source>Output RK</source>
|
||||
<translation>Pk de sortie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/MainWindow.ui" line="770"/>
|
||||
<location filename="../View/ui/MainWindow.ui" line="767"/>
|
||||
<source>Run AdisTS</source>
|
||||
<translation>Lancer AdisTS</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/MainWindow.ui" line="775"/>
|
||||
<location filename="../View/ui/MainWindow.ui" line="772"/>
|
||||
<source>Pollutants</source>
|
||||
<translation>Polluants</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/MainWindow.ui" line="780"/>
|
||||
<location filename="../View/ui/MainWindow.ui" line="777"/>
|
||||
<source>D90</source>
|
||||
<translation>D90</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/MainWindow.ui" line="785"/>
|
||||
<location filename="../View/ui/MainWindow.ui" line="782"/>
|
||||
<source>DIF</source>
|
||||
<translation>DIF</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/MainWindow.ui" line="801"/>
|
||||
<location filename="../View/ui/MainWindow.ui" line="798"/>
|
||||
<source>Open results AdisTS</source>
|
||||
<translation>Ouvrir des résultats AdisTS</translation>
|
||||
</message>
|
||||
|
|
@ -3008,7 +3049,7 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<translation>Non</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/MainWindow.ui" line="809"/>
|
||||
<location filename="../View/ui/MainWindow.ui" line="806"/>
|
||||
<source>Compare results</source>
|
||||
<translation>Comparaison de résultats</translation>
|
||||
</message>
|
||||
|
|
@ -3168,7 +3209,7 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<translation>Editer l'arbre des scénarios</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/MainWindow.ui" line="814"/>
|
||||
<location filename="../View/ui/MainWindow.ui" line="811"/>
|
||||
<source>GeoTIFF</source>
|
||||
<translation>GeoTIFF</translation>
|
||||
</message>
|
||||
|
|
@ -3432,22 +3473,22 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<context>
|
||||
<name>Results</name>
|
||||
<message>
|
||||
<location filename="../View/Results/Window.py" line="324"/>
|
||||
<location filename="../View/Results/Window.py" line="362"/>
|
||||
<source>days</source>
|
||||
<translation>jours</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Results/Window.py" line="325"/>
|
||||
<location filename="../View/Results/Window.py" line="363"/>
|
||||
<source>day</source>
|
||||
<translation>jour</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Results/PlotXY.py" line="78"/>
|
||||
<location filename="../View/Results/PlotXY.py" line="81"/>
|
||||
<source>X (m)</source>
|
||||
<translation>X (m)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Results/PlotXY.py" line="79"/>
|
||||
<location filename="../View/Results/PlotXY.py" line="82"/>
|
||||
<source>Y (m)</source>
|
||||
<translation>Y (m)</translation>
|
||||
</message>
|
||||
|
|
@ -3477,7 +3518,7 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<translation>Lecture des résultats</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Results/translate.py" line="151"/>
|
||||
<location filename="../View/Results/translate.py" line="158"/>
|
||||
<source>Water elevation</source>
|
||||
<translation>Cote de l'eau</translation>
|
||||
</message>
|
||||
|
|
@ -3487,12 +3528,12 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<translation>Cote maximum de l'eau</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Results/translate.py" line="61"/>
|
||||
<location filename="../View/Results/translate.py" line="68"/>
|
||||
<source>Reach name</source>
|
||||
<translation>Nom du bief</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Results/translate.py" line="157"/>
|
||||
<location filename="../View/Results/translate.py" line="164"/>
|
||||
<source>Profile</source>
|
||||
<translation>Profil</translation>
|
||||
</message>
|
||||
|
|
@ -3547,12 +3588,12 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<translation>Masse min</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Results/translate.py" line="65"/>
|
||||
<location filename="../View/Results/translate.py" line="72"/>
|
||||
<source>Variables names</source>
|
||||
<translation>Noms des variables</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Results/translate.py" line="78"/>
|
||||
<location filename="../View/Results/translate.py" line="85"/>
|
||||
<source>Pollutant name</source>
|
||||
<translation>Nom des polluants</translation>
|
||||
</message>
|
||||
|
|
@ -3562,7 +3603,7 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<translation type="obsolete">enveloppe</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Results/translate.py" line="69"/>
|
||||
<location filename="../View/Results/translate.py" line="76"/>
|
||||
<source>Profile name</source>
|
||||
<translation>Nom du profil</translation>
|
||||
</message>
|
||||
|
|
@ -3591,6 +3632,16 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translation>
|
|||
<source>All files (*)</source>
|
||||
<translation type="obsolete">Tous les fichiers (*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Results/translate.py" line="59"/>
|
||||
<source>An error occured when writing to file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/Results/translate.py" line="62"/>
|
||||
<source>If the file is in use, close it and try again</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Scenarios</name>
|
||||
|
|
|
|||
Loading…
Reference in New Issue