mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Ensemble: Rename function to disctribution.
This commit is contained in:
1 parent
4040b2456c
commit
345f24996f
8 files changed
+77
-77
No files matched your search
@@ -36,7 +36,7 @@ from PyQt5.QtWidgets import (
|
||||
|
||||
from View.Ensembles.UndoCommand import (
|
||||
SetNameCommand, SetTypeCommand, SetDataCommand,
|
||||
SetFunctionCommand,
|
||||
SetDistributionCommand,
|
||||
AddCommand, DelCommand,
|
||||
)
|
||||
|
||||
@@ -96,13 +96,13 @@ class ComboBoxDelegate(QItemDelegate):
|
||||
)
|
||||
)
|
||||
)
|
||||
elif self._mode == "function":
|
||||
elif self._mode == "distribution":
|
||||
self.editor.addItems(
|
||||
[self._trad["not_defined"]] +
|
||||
list(
|
||||
map(
|
||||
lambda f: f.name,
|
||||
self._study._ens_functions.lst
|
||||
self._study._ens_distributions.lst
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -133,11 +133,11 @@ class ComboBoxDelegate(QItemDelegate):
|
||||
),
|
||||
None
|
||||
)
|
||||
elif self._mode == "function":
|
||||
elif self._mode == "distribution":
|
||||
value = next(
|
||||
filter(
|
||||
lambda f: f.name == text,
|
||||
self._study._ens_functions.lst
|
||||
self._study._ens_distributions.lst
|
||||
),
|
||||
None
|
||||
)
|
||||
@@ -182,8 +182,8 @@ class EnsembleTableModel(PamhyrTableModel):
|
||||
if value is None:
|
||||
return self._trad["not_defined"]
|
||||
return str(value)
|
||||
elif self._headers[column] == "function":
|
||||
value = self._lst.get(row).function
|
||||
elif self._headers[column] == "distribution":
|
||||
value = self._lst.get(row).distribution
|
||||
if value is None:
|
||||
return self._trad["not_defined"]
|
||||
return value.name
|
||||
@@ -222,9 +222,9 @@ class EnsembleTableModel(PamhyrTableModel):
|
||||
self._lst, row, value
|
||||
)
|
||||
)
|
||||
elif self._headers[column] == "function":
|
||||
elif self._headers[column] == "distribution":
|
||||
self._undo.push(
|
||||
SetFunctionCommand(
|
||||
SetDistributionCommand(
|
||||
self._lst, row, value
|
||||
)
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user