diff --git a/resources/ObservationTabComponents/ObservationFilterColumn.qml b/resources/ObservationTabComponents/ObservationFilterColumn.qml index 51c36178a..9f1cb3d81 100644 --- a/resources/ObservationTabComponents/ObservationFilterColumn.qml +++ b/resources/ObservationTabComponents/ObservationFilterColumn.qml @@ -23,7 +23,7 @@ ColumnLayout { spacing: 2 padding: 2 verticalPadding: 0.2 - checked: true + checked: !observationTableModel.code_filters.includes(modelData) onCheckedChanged: { observationTableModel.filter_prn(modelData, !checked); observationTableModel.update(); diff --git a/swiftnav_console/observation_tab.py b/swiftnav_console/observation_tab.py index d971d29f1..143bafd73 100644 --- a/swiftnav_console/observation_tab.py +++ b/swiftnav_console/observation_tab.py @@ -99,6 +99,9 @@ def get_codes(self) -> List[List[str]]: observation_tab = REMOTE_OBSERVATION_TAB if self._remote else LOCAL_OBSERVATION_TAB return [entry["prn"].code for entry in observation_tab[Keys.ROWS]] + def get_code_filters(self) -> List[str]: + return list(self._code_filters) + def get_codes_by_prefix(self, prefix) -> List[List[str]]: return sorted([code for code in self._codes if code.startswith(prefix)]) @@ -247,6 +250,7 @@ def padFloat(self, num, length, digits=2, allowNegative=True): # pylint: disabl sbas_codes = Property(QTKeys.QVARIANTLIST, get_sbas_codes, notify=codes_changed) # type: ignore # Confusingly, codes depends on self._rows not self._codes codes = Property(QTKeys.QVARIANTLIST, get_codes, notify=row_count_changed) # type: ignore + code_filters = Property(QTKeys.QVARIANTLIST, get_code_filters, constant=True) # type: ignore def obs_rows_to_json(rows):