mirror of https://gitlab.com/pamhyr/pamhyr2
Merge branch 'dev_dylan' into scenarios
commit
e49724072b
|
|
@ -166,7 +166,6 @@ class InternalMeshing(AMeshingTool):
|
|||
for i in range(len1):
|
||||
ltot1 += sect1.point(start1+i).dist(sect1.point(start1+i+1))
|
||||
alpha.append(ltot1)
|
||||
alpha = list(map(lambda x: x/ltot1, alpha)) # target ratios
|
||||
for i in range(len2):
|
||||
ltot2 += sect2.point(start2+i).dist(sect2.point(start2+i+1))
|
||||
beta.append(ltot2)
|
||||
|
|
@ -181,6 +180,7 @@ class InternalMeshing(AMeshingTool):
|
|||
sect2.add_npoints(len1-len2)
|
||||
len2 = len1
|
||||
else: # regular case
|
||||
alpha = list(map(lambda x: x/ltot1, alpha)) # target ratios
|
||||
beta = list(map(lambda x: x/ltot2, beta)) # current ratios
|
||||
for i in range(len1 - len2):
|
||||
beta.append(1.0)
|
||||
|
|
|
|||
|
|
@ -514,42 +514,6 @@ class BoundaryCondition(SQLSubModel):
|
|||
self._sigma = float(value)
|
||||
self.modified()
|
||||
|
||||
@property
|
||||
def d50(self):
|
||||
return self._d50
|
||||
|
||||
@d50.setter
|
||||
def d50(self, value):
|
||||
self._d50 = float(value)
|
||||
self.modified()
|
||||
|
||||
@property
|
||||
def sigma(self):
|
||||
return self._sigma
|
||||
|
||||
@sigma.setter
|
||||
def sigma(self, value):
|
||||
self._sigma = float(value)
|
||||
self.modified()
|
||||
|
||||
@property
|
||||
def d50(self):
|
||||
return self._d50
|
||||
|
||||
@d50.setter
|
||||
def d50(self, value):
|
||||
self._d50 = float(value)
|
||||
self.modified()
|
||||
|
||||
@property
|
||||
def sigma(self):
|
||||
return self._sigma
|
||||
|
||||
@sigma.setter
|
||||
def sigma(self, value):
|
||||
self._sigma = float(value)
|
||||
self.modified()
|
||||
|
||||
@property
|
||||
def header(self):
|
||||
return self._header.copy()
|
||||
|
|
|
|||
|
|
@ -350,6 +350,7 @@ class Pollutants(SQLSubModel):
|
|||
CREATE TABLE pollutants{ext}(
|
||||
{cls.create_db_add_pamhyr_id()},
|
||||
deleted BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
enabled BOOLEAN NOT NULL DEFAULT TRUE,
|
||||
name TEXT NOT NULL,
|
||||
{Scenario.create_db_add_scenario()},
|
||||
{Scenario.create_db_add_scenario_fk()}
|
||||
|
|
@ -373,6 +374,14 @@ class Pollutants(SQLSubModel):
|
|||
cls._db_create(execute)
|
||||
created = True
|
||||
|
||||
if major == "0" and minor == "2":
|
||||
if int(release) < 5:
|
||||
execute(f"ALTER TABLE pollutants " +
|
||||
f"ADD COLUMN enabled BOOLEAN NOT NULL DEFAULT TRUE")
|
||||
|
||||
# cls._db_update_to_0_2_5(execute, data)
|
||||
# # created = True
|
||||
|
||||
if not created:
|
||||
return cls._update_submodel(execute, version, data)
|
||||
|
||||
|
|
@ -410,7 +419,8 @@ class Pollutants(SQLSubModel):
|
|||
return new
|
||||
|
||||
table = execute(
|
||||
"SELECT pamhyr_id, deleted, name, scenario FROM pollutants " +
|
||||
"SELECT pamhyr_id, deleted, enabled, name, scenario " +
|
||||
"FROM pollutants " +
|
||||
f"WHERE scenario = {scenario.id} " +
|
||||
f"AND pamhyr_id NOT IN ({', '.join(map(str, loaded))})"
|
||||
)
|
||||
|
|
@ -421,6 +431,7 @@ class Pollutants(SQLSubModel):
|
|||
|
||||
pid = next(it)
|
||||
deleted = (next(it) == 1)
|
||||
enabled = (next(it) == 1)
|
||||
name = next(it)
|
||||
owner_scenario = next(it)
|
||||
|
||||
|
|
@ -431,6 +442,8 @@ class Pollutants(SQLSubModel):
|
|||
)
|
||||
if deleted:
|
||||
new_pollutant.set_as_deleted()
|
||||
if not enabled:
|
||||
new_pollutant.enabled = False
|
||||
|
||||
data["pollutant"] = new_pollutant
|
||||
new_pollutant._data = PollutantCharacteristics._db_load(
|
||||
|
|
@ -472,9 +485,10 @@ class Pollutants(SQLSubModel):
|
|||
|
||||
execute(
|
||||
"INSERT INTO " +
|
||||
"pollutants(pamhyr_id, deleted, name, scenario) " +
|
||||
"pollutants(pamhyr_id, deleted, enabled, name, scenario) " +
|
||||
"VALUES (" +
|
||||
f"{self.id}, {self._db_format(self.is_deleted())}, " +
|
||||
f"{self._db_format(self._enabled)}, " +
|
||||
f"'{self._db_format(self._name)}', " +
|
||||
f"{self._status.scenario_id}" +
|
||||
")"
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ class PlotAC(PamhyrPlot):
|
|||
]
|
||||
else:
|
||||
color = self.color_incomplete_gl[
|
||||
lincomplete.index(txt)
|
||||
lincomplete.index(txt) % len(self.color_incomplete_gl)
|
||||
]
|
||||
|
||||
annotation = self.canvas.axes.annotate(
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class TableModel(PamhyrTableModel):
|
|||
def enabled(self, row, enabled, parent=QModelIndex()):
|
||||
self._undo.push(
|
||||
SetEnabledCommand(
|
||||
self._data._Pollutants, row, enabled
|
||||
self._lst, row, enabled
|
||||
)
|
||||
)
|
||||
self.layoutChanged.emit()
|
||||
|
|
|
|||
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