mirror of https://gitlab.com/pamhyr/pamhyr2
Compare commits
No commits in common. "48d6728e1e1512b2910775dd618df22c87e74fa7" and "fb8b5aa77fb448cf13fb45d1aea0973c3149ad44" have entirely different histories.
48d6728e1e
...
fb8b5aa77f
|
|
@ -514,6 +514,42 @@ class BoundaryCondition(SQLSubModel):
|
||||||
self._sigma = float(value)
|
self._sigma = float(value)
|
||||||
self.modified()
|
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
|
@property
|
||||||
def header(self):
|
def header(self):
|
||||||
return self._header.copy()
|
return self._header.copy()
|
||||||
|
|
|
||||||
|
|
@ -70,8 +70,9 @@ class Data(SQLSubModel):
|
||||||
def _db_update(cls, execute, version, data=None):
|
def _db_update(cls, execute, version, data=None):
|
||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
created = False
|
created = False
|
||||||
|
|
||||||
if major == "0" and minor == "0":
|
if major == "0" and minor == "0":
|
||||||
if int(release) < 11:
|
if int(release) < 7:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
created = True
|
created = True
|
||||||
|
|
||||||
|
|
@ -249,7 +250,7 @@ class BoundaryConditionAdisTS(SQLSubModel):
|
||||||
created = False
|
created = False
|
||||||
|
|
||||||
if major == "0" and minor == "0":
|
if major == "0" and minor == "0":
|
||||||
if int(release) < 11:
|
if int(release) < 7:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
created = True
|
created = True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,8 @@ class D90AdisTS(SQLSubModel):
|
||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
created = False
|
created = False
|
||||||
|
|
||||||
if major == "0" and minor == "0":
|
if major == "0" and int(minor) <= 1:
|
||||||
if int(release) < 11:
|
if int(release) < 6:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
created = True
|
created = True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,8 +72,8 @@ class D90AdisTSSpec(SQLSubModel):
|
||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
created = False
|
created = False
|
||||||
|
|
||||||
if major == "0" and minor == "0":
|
if major == 0 and minor < 1:
|
||||||
if int(release) < 11:
|
if int(release) < 6:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
created = True
|
created = True
|
||||||
|
|
||||||
|
|
@ -95,10 +95,8 @@ class D90AdisTSSpec(SQLSubModel):
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
f"INSERT INTO {table_new}_tmp " +
|
f"INSERT INTO {table_new}_tmp " +
|
||||||
"(pamhyr_id, d90_default, name, reach, " +
|
"(pamhyr_id, name, d90, enabled, scenario) " +
|
||||||
" start_rk, end_rk, d90, enabled, scenario) " +
|
"SELECT pamhyr_id, name, d90, enabled, scenario " +
|
||||||
"SELECT pamhyr_id, d90_default, name, reach, " +
|
|
||||||
" start_rk, end_rk, d90, enabled, scenario " +
|
|
||||||
f"FROM {table}"
|
f"FROM {table}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -111,7 +109,7 @@ class D90AdisTSSpec(SQLSubModel):
|
||||||
def _db_update_to_0_2_0_set_d90_pid(cls, execute, data):
|
def _db_update_to_0_2_0_set_d90_pid(cls, execute, data):
|
||||||
pid_d90 = data["id2pid"]["d90_adists"]
|
pid_d90 = data["id2pid"]["d90_adists"]
|
||||||
els = execute(
|
els = execute(
|
||||||
f"SELECT pamhyr_id, d90_default FROM d90_adists_spec"
|
f"SELECT pamhyr_id, d90 FROM d90_adists_spec"
|
||||||
)
|
)
|
||||||
|
|
||||||
for row in els:
|
for row in els:
|
||||||
|
|
@ -123,8 +121,8 @@ class D90AdisTSSpec(SQLSubModel):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
f"UPDATE d90_adists_spec " +
|
f"UPDATE d90_adists_spec" +
|
||||||
f"SET d90_default = {pid_d90[d90_id]} " +
|
f"SET d90 = {pid_d90[d90_id]} " +
|
||||||
f"WHERE pamhyr_id = {pid}"
|
f"WHERE pamhyr_id = {pid}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,8 @@ class DIFAdisTS(SQLSubModel):
|
||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
created = False
|
created = False
|
||||||
|
|
||||||
if major == "0" and minor == "0":
|
if major == "0" and int(minor) <= 1:
|
||||||
if int(release) < 11:
|
if int(release) < 6:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
created = True
|
created = True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,8 +83,8 @@ class DIFAdisTSSpec(SQLSubModel):
|
||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
created = False
|
created = False
|
||||||
|
|
||||||
if major == "0" and minor == "0":
|
if major == 0 and minor < 1:
|
||||||
if int(release) < 11:
|
if int(release) < 6:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
created = True
|
created = True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,8 +81,8 @@ class InitialConditionsAdisTS(SQLSubModel):
|
||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
created = False
|
created = False
|
||||||
|
|
||||||
if major == "0" and minor == "0":
|
if major == "0" and int(minor) <= 1:
|
||||||
if int(release) < 11:
|
if int(release) < 6:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
created = True
|
created = True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,8 @@ class ICAdisTSSpec(SQLSubModel):
|
||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
created = False
|
created = False
|
||||||
|
|
||||||
if major == "0" and minor == "0":
|
if major == 0 and minor < 1:
|
||||||
if int(release) < 11:
|
if int(release) < 6:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
created = True
|
created = True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,8 @@ class Data(SQLSubModel):
|
||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
created = False
|
created = False
|
||||||
|
|
||||||
if major == "0" and minor == "0":
|
if major == "0" and int(minor) <= 1:
|
||||||
if int(release) < 11:
|
if int(release) < 7:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
created = True
|
created = True
|
||||||
|
|
||||||
|
|
@ -243,8 +243,8 @@ class LateralContributionAdisTS(SQLSubModel):
|
||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
created = False
|
created = False
|
||||||
|
|
||||||
if major == "0" and minor == "0":
|
if major == "0" and int(minor) <= 1:
|
||||||
if int(release) < 11:
|
if int(release) < 7:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
created = True
|
created = True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,8 +97,8 @@ class OutputRKAdists(SQLSubModel):
|
||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
created = False
|
created = False
|
||||||
|
|
||||||
if major == "0" and minor == "0":
|
if major == "0" and int(minor) <= 1:
|
||||||
if int(release) < 11:
|
if int(release) < 7:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
created = True
|
created = True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,18 @@ from Model.BoundaryConditionsAdisTS.BoundaryConditionAdisTS import (
|
||||||
|
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
|
|
||||||
|
# Types de polluants: indice -> nom du type
|
||||||
|
POLLUTANT_TYPES = {
|
||||||
|
0: "Soluté",
|
||||||
|
1: "Particules sphériques",
|
||||||
|
2: "Galets lisses",
|
||||||
|
3: "Sable naturel",
|
||||||
|
4: "Sable concassé",
|
||||||
|
5: "Cylindres longs",
|
||||||
|
6: "Limon, particules cohésives",
|
||||||
|
7: "Flocs"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class PollutantCharacteristics(SQLSubModel):
|
class PollutantCharacteristics(SQLSubModel):
|
||||||
_sub_classes = []
|
_sub_classes = []
|
||||||
|
|
@ -140,8 +152,8 @@ class PollutantCharacteristics(SQLSubModel):
|
||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
created = False
|
created = False
|
||||||
|
|
||||||
if major == "0" and minor == "0":
|
if major == "0" and int(minor) <= 1:
|
||||||
if int(release) < 11:
|
if int(release) < 7:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
created = True
|
created = True
|
||||||
|
|
||||||
|
|
@ -332,21 +344,19 @@ class Pollutants(SQLSubModel):
|
||||||
|
|
||||||
@data.setter
|
@data.setter
|
||||||
def data(self, data):
|
def data(self, data):
|
||||||
self._data = [
|
self._data = [PollutantCharacteristics(type=int(data[0]),
|
||||||
PollutantCharacteristics(
|
diametre=float(data[1]),
|
||||||
type=int(data[0]),
|
rho=float(data[2]),
|
||||||
diametre=float(data[1]),
|
porosity=float(data[3]),
|
||||||
rho=float(data[2]),
|
cdc_riv=float(data[4]),
|
||||||
porosity=float(data[3]),
|
cdc_cas=float(data[5]),
|
||||||
cdc_riv=float(data[4]),
|
apd=float(data[6]),
|
||||||
cdc_cas=float(data[5]),
|
ac=float(data[7]),
|
||||||
apd=float(data[6]),
|
bc=float(data[8]),
|
||||||
ac=float(data[7]),
|
pollutant=self,
|
||||||
bc=float(data[8]),
|
status=self._status
|
||||||
pollutant=self,
|
)
|
||||||
status=self._status
|
]
|
||||||
)
|
|
||||||
]
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _db_create(cls, execute, ext=""):
|
def _db_create(cls, execute, ext=""):
|
||||||
|
|
@ -354,7 +364,6 @@ class Pollutants(SQLSubModel):
|
||||||
CREATE TABLE pollutants{ext}(
|
CREATE TABLE pollutants{ext}(
|
||||||
{cls.create_db_add_pamhyr_id()},
|
{cls.create_db_add_pamhyr_id()},
|
||||||
deleted BOOLEAN NOT NULL DEFAULT FALSE,
|
deleted BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
enabled BOOLEAN NOT NULL DEFAULT TRUE,
|
|
||||||
name TEXT NOT NULL,
|
name TEXT NOT NULL,
|
||||||
{Scenario.create_db_add_scenario()},
|
{Scenario.create_db_add_scenario()},
|
||||||
{Scenario.create_db_add_scenario_fk()}
|
{Scenario.create_db_add_scenario_fk()}
|
||||||
|
|
@ -371,22 +380,14 @@ class Pollutants(SQLSubModel):
|
||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
created = False
|
created = False
|
||||||
|
|
||||||
if major == "0" and minor == "0":
|
if major == "0" and int(minor) <= 1:
|
||||||
if int(release) < 11:
|
if int(release) < 7:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
created = True
|
created = True
|
||||||
|
|
||||||
if major == "0" and int(minor) < 2:
|
if major == "0" and int(minor) < 2:
|
||||||
if not created:
|
if not created:
|
||||||
cls._db_update_to_0_2_0(execute, data)
|
cls._db_update_to_0_2_0(execute, data)
|
||||||
|
|
||||||
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:
|
if not created:
|
||||||
return cls._update_submodel(execute, version, data)
|
return cls._update_submodel(execute, version, data)
|
||||||
|
|
@ -425,7 +426,7 @@ class Pollutants(SQLSubModel):
|
||||||
return new
|
return new
|
||||||
|
|
||||||
table = execute(
|
table = execute(
|
||||||
"SELECT pamhyr_id, deleted, enabled, name, scenario FROM pollutants " +
|
"SELECT pamhyr_id, deleted, name, scenario FROM pollutants " +
|
||||||
f"WHERE scenario = {scenario.id} " +
|
f"WHERE scenario = {scenario.id} " +
|
||||||
f"AND pamhyr_id NOT IN ({', '.join(map(str, loaded))})"
|
f"AND pamhyr_id NOT IN ({', '.join(map(str, loaded))})"
|
||||||
)
|
)
|
||||||
|
|
@ -436,7 +437,6 @@ class Pollutants(SQLSubModel):
|
||||||
|
|
||||||
pid = next(it)
|
pid = next(it)
|
||||||
deleted = (next(it) == 1)
|
deleted = (next(it) == 1)
|
||||||
enabled = (next(it) == 1)
|
|
||||||
name = next(it)
|
name = next(it)
|
||||||
owner_scenario = next(it)
|
owner_scenario = next(it)
|
||||||
|
|
||||||
|
|
@ -447,8 +447,6 @@ class Pollutants(SQLSubModel):
|
||||||
)
|
)
|
||||||
if deleted:
|
if deleted:
|
||||||
new_pollutant.set_as_deleted()
|
new_pollutant.set_as_deleted()
|
||||||
if not enabled:
|
|
||||||
new_pollutant.enabled = False
|
|
||||||
|
|
||||||
data["pollutant"] = new_pollutant
|
data["pollutant"] = new_pollutant
|
||||||
new_pollutant._data = PollutantCharacteristics._db_load(
|
new_pollutant._data = PollutantCharacteristics._db_load(
|
||||||
|
|
@ -490,10 +488,9 @@ class Pollutants(SQLSubModel):
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
"INSERT INTO " +
|
"INSERT INTO " +
|
||||||
"pollutants(pamhyr_id, deleted, enabled, name, scenario) " +
|
"pollutants(pamhyr_id, deleted, name, scenario) " +
|
||||||
"VALUES (" +
|
"VALUES (" +
|
||||||
f"{self.id}, {self._db_format(self.is_deleted())}, " +
|
f"{self.id}, {self._db_format(self.is_deleted())}, " +
|
||||||
f"{self._db_format(self._enabled)}, " +
|
|
||||||
f"'{self._db_format(self._name)}', " +
|
f"'{self._db_format(self._name)}', " +
|
||||||
f"{self._status.scenario_id}" +
|
f"{self._status.scenario_id}" +
|
||||||
")"
|
")"
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ logger = logging.getLogger()
|
||||||
|
|
||||||
|
|
||||||
class Study(SQLModel):
|
class Study(SQLModel):
|
||||||
_version = "0.2.5"
|
_version = "0.2.4"
|
||||||
|
|
||||||
_sub_classes = [
|
_sub_classes = [
|
||||||
Scenario,
|
Scenario,
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ from View.Pollutants.Edit.UndoCommand import (
|
||||||
SetDataCommand, PasteCommand,
|
SetDataCommand, PasteCommand,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from Model.Pollutants.Pollutants import POLLUTANT_TYPES
|
||||||
|
|
||||||
_translate = QCoreApplication.translate
|
_translate = QCoreApplication.translate
|
||||||
|
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
|
|
@ -49,20 +51,17 @@ class ComboBoxDelegate(QItemDelegate):
|
||||||
def __init__(self, type_dict=None, trad=None, parent=None):
|
def __init__(self, type_dict=None, trad=None, parent=None):
|
||||||
super(ComboBoxDelegate, self).__init__(parent)
|
super(ComboBoxDelegate, self).__init__(parent)
|
||||||
|
|
||||||
# self._type_dict = type_dict if type_dict else POLLUTANT_TYPES
|
self._type_dict = type_dict if type_dict else POLLUTANT_TYPES
|
||||||
self._trad = trad
|
self._trad = trad
|
||||||
self.editor = None
|
self.editor = None
|
||||||
|
|
||||||
self._type = {}
|
|
||||||
if self._trad is not None:
|
|
||||||
self._type = self._trad.get_dict("type")
|
|
||||||
|
|
||||||
def createEditor(self, parent, option, index):
|
def createEditor(self, parent, option, index):
|
||||||
self.editor = QComboBox(parent)
|
self.editor = QComboBox(parent)
|
||||||
|
|
||||||
# Ajouter les items du dictionnaire
|
# Ajouter les items du dictionnaire
|
||||||
for key, value in self._type.items():
|
for key in sorted(self._type_dict.keys()):
|
||||||
self.editor.addItem(value, key)
|
display_text = self._type_dict[key]
|
||||||
|
self.editor.addItem(display_text, userData=key)
|
||||||
|
|
||||||
self.editor.currentTextChanged.connect(self.currentItemChanged)
|
self.editor.currentTextChanged.connect(self.currentItemChanged)
|
||||||
return self.editor
|
return self.editor
|
||||||
|
|
@ -97,23 +96,6 @@ class ComboBoxDelegate(QItemDelegate):
|
||||||
|
|
||||||
|
|
||||||
class TableModel(PamhyrTableModel):
|
class TableModel(PamhyrTableModel):
|
||||||
def __init__(self, trad=None, **kwargs):
|
|
||||||
self._trad = trad
|
|
||||||
self._types = {}
|
|
||||||
if self._trad is not None:
|
|
||||||
self._types = self._trad.get_dict("types")
|
|
||||||
|
|
||||||
super(TableModel, self).__init__(trad=trad, **kwargs)
|
|
||||||
|
|
||||||
def is_same_data(self, index, value):
|
|
||||||
row = index.row()
|
|
||||||
column = index.column()
|
|
||||||
|
|
||||||
if self._headers[column] == "type":
|
|
||||||
return int(self._data.data[row][column]) == int(value)
|
|
||||||
|
|
||||||
return super(TableModel, self).is_same_data(index, value)
|
|
||||||
|
|
||||||
def data(self, index, role):
|
def data(self, index, role):
|
||||||
if role == Qt.TextAlignmentRole:
|
if role == Qt.TextAlignmentRole:
|
||||||
return Qt.AlignHCenter | Qt.AlignVCenter
|
return Qt.AlignHCenter | Qt.AlignVCenter
|
||||||
|
|
@ -131,7 +113,7 @@ class TableModel(PamhyrTableModel):
|
||||||
|
|
||||||
# Si c'est la colonne "type", convertir l'indice en string
|
# Si c'est la colonne "type", convertir l'indice en string
|
||||||
if self._headers[column] == "type":
|
if self._headers[column] == "type":
|
||||||
value = self._trad.get_dict("type").get(value, "")
|
return POLLUTANT_TYPES.get(int(value), str(value))
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,18 +24,6 @@ from View.Pollutants.Translate import PollutantsTranslate
|
||||||
|
|
||||||
_translate = QCoreApplication.translate
|
_translate = QCoreApplication.translate
|
||||||
|
|
||||||
# Types de polluants: indice -> nom du type
|
|
||||||
POLLUTANT_TYPES = {
|
|
||||||
0: "Solutes",
|
|
||||||
1: "Spherical particles",
|
|
||||||
2: "Smooth pebbles",
|
|
||||||
3: "Natural sand",
|
|
||||||
4: "Crushed sand",
|
|
||||||
5: "Elongated cylinders",
|
|
||||||
6: "Silts, cohesive particles",
|
|
||||||
7: "Flocs"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class EditPollutantTranslate(PollutantsTranslate):
|
class EditPollutantTranslate(PollutantsTranslate):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
@ -56,14 +44,3 @@ class EditPollutantTranslate(PollutantsTranslate):
|
||||||
"ac": self._dict["unit_ac"],
|
"ac": self._dict["unit_ac"],
|
||||||
"bc": self._dict["unit_bc"],
|
"bc": self._dict["unit_bc"],
|
||||||
}
|
}
|
||||||
|
|
||||||
self._sub_dict["type"] = {
|
|
||||||
0: _translate("Pollutants", "Solutes"),
|
|
||||||
1: _translate("Pollutants", "Spherical particles"),
|
|
||||||
2: _translate("Pollutants", "Smooth pebbles"),
|
|
||||||
3: _translate("Pollutants", "Natural sand"),
|
|
||||||
4: _translate("Pollutants", "Crushed sand"),
|
|
||||||
5: _translate("Pollutants", "Elongated cylinders"),
|
|
||||||
6: _translate("Pollutants", "Silts, cohesive particles"),
|
|
||||||
7: _translate("Pollutants", "Flocs"),
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,6 @@ class EditPolluantWindow(PamhyrWindow):
|
||||||
editable_headers=editable_headers,
|
editable_headers=editable_headers,
|
||||||
delegates={"type": self._delegate_type},
|
delegates={"type": self._delegate_type},
|
||||||
data=self._data,
|
data=self._data,
|
||||||
trad=self._trad,
|
|
||||||
undo=self._undo_stack,
|
undo=self._undo_stack,
|
||||||
opt_data=self._study.time_system
|
opt_data=self._study.time_system
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ class TableModel(PamhyrTableModel):
|
||||||
def enabled(self, row, enabled, parent=QModelIndex()):
|
def enabled(self, row, enabled, parent=QModelIndex()):
|
||||||
self._undo.push(
|
self._undo.push(
|
||||||
SetEnabledCommand(
|
SetEnabledCommand(
|
||||||
self._lst, row, enabled
|
self._data._Pollutants, row, enabled
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.layoutChanged.emit()
|
self.layoutChanged.emit()
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import tempfile
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from queue import Queue
|
from queue import Queue
|
||||||
from tools import trace, timer, logger_exception
|
from tools import trace, timer
|
||||||
|
|
||||||
from View.Tools.PamhyrWindow import PamhyrDialog, PamhyrWindow
|
from View.Tools.PamhyrWindow import PamhyrDialog, PamhyrWindow
|
||||||
|
|
||||||
|
|
@ -81,31 +81,25 @@ class SolverLogFileWindow(PamhyrWindow):
|
||||||
self.open_on_editor)
|
self.open_on_editor)
|
||||||
|
|
||||||
def setup_text(self):
|
def setup_text(self):
|
||||||
try:
|
with open(self._file_name, "r") as f:
|
||||||
with open(self._file_name, "r") as f:
|
for line in f:
|
||||||
for line in f:
|
line = line.rstrip()
|
||||||
line = line.rstrip()
|
self.find(QTextEdit, "textEdit").append(line)
|
||||||
self.find(QTextEdit, "textEdit").append(line)
|
|
||||||
except Exception as e:
|
|
||||||
logger_exception(e)
|
|
||||||
|
|
||||||
def revert(self):
|
def revert(self):
|
||||||
self.find(QTextEdit, "textEdit").clear()
|
self.find(QTextEdit, "textEdit").clear()
|
||||||
self.setup_text()
|
self.setup_text()
|
||||||
|
|
||||||
def open_on_editor(self):
|
def open_on_editor(self):
|
||||||
try:
|
p = QProcess(self)
|
||||||
p = QProcess(self)
|
|
||||||
|
|
||||||
cmd = self._config.editor
|
cmd = self._config.editor
|
||||||
cmd = cmd.replace("@file", self._file_name)
|
cmd = cmd.replace("@file", self._file_name)
|
||||||
|
|
||||||
cmd = cmd.split()
|
cmd = cmd.split()
|
||||||
exe = cmd[0]
|
exe = cmd[0]
|
||||||
args = cmd[1:]
|
args = cmd[1:]
|
||||||
|
|
||||||
p.start(
|
p.start(
|
||||||
exe, args,
|
exe, args,
|
||||||
)
|
)
|
||||||
except Exception as e:
|
|
||||||
logger_exception(e)
|
|
||||||
|
|
|
||||||
553
src/lang/fr.ts
553
src/lang/fr.ts
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue