mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
InitialConditionsAdisTS: split correctly reach and InitialConditionsAdisTS + display only enabled reach in tab
This commit is contained in:
1 parent
6175e8a03e
commit
5e95c286a9
6 files changed
+117
-25
No files matched your search
@@ -55,17 +55,27 @@ class ComboBoxDelegate(QItemDelegate):
|
||||
self._trad = trad
|
||||
self._ic_spec_lst = ic_spec_lst
|
||||
|
||||
def _specifications(self):
|
||||
if hasattr(
|
||||
self._ic_spec_lst,
|
||||
"get_specs_for_enabled_reaches"
|
||||
):
|
||||
return self._ic_spec_lst.get_specs_for_enabled_reaches(
|
||||
self._data.edges()
|
||||
)
|
||||
return self._ic_spec_lst
|
||||
|
||||
def createEditor(self, parent, option, index):
|
||||
self.editor = QComboBox(parent)
|
||||
|
||||
val = []
|
||||
if self._mode == "rk":
|
||||
reach_id = self._ic_spec_lst[index.row()].reach
|
||||
reach_id = self._specifications()[index.row()].reach
|
||||
|
||||
reach = next(filter(lambda edge: edge.id == reach_id,
|
||||
self._data.edges()), None)
|
||||
|
||||
if reach_id is not None:
|
||||
if reach is not None:
|
||||
val = list(
|
||||
map(
|
||||
lambda rk: str(rk), reach.reach.get_rk()
|
||||
@@ -74,7 +84,7 @@ class ComboBoxDelegate(QItemDelegate):
|
||||
else:
|
||||
val = list(
|
||||
map(
|
||||
lambda n: n.name, self._data.edges()
|
||||
lambda n: n.name, self._data.enable_edges()
|
||||
)
|
||||
)
|
||||
|
||||
@@ -117,11 +127,8 @@ class InitialConditionTableModel(PamhyrTableModel):
|
||||
self._data = data
|
||||
|
||||
def _setup_lst(self):
|
||||
self._lst = list(
|
||||
filter(
|
||||
lambda ica: ica._deleted is False,
|
||||
self._data._data
|
||||
)
|
||||
self._lst = self._data.get_specs_for_enabled_reaches(
|
||||
self._river.edges()
|
||||
)
|
||||
|
||||
def rowCount(self, parent):
|
||||
|
||||
Reference in new issue
Block a user