Refactor 'collect' functions
This commit is contained in:
25
artemis.py
25
artemis.py
@@ -915,26 +915,21 @@ class Artemis(QMainWindow, Ui_MainWindow):
|
|||||||
self.locations_list.addItems(self.collect_locations())
|
self.locations_list.addItems(self.collect_locations())
|
||||||
|
|
||||||
def collect_locations(self):
|
def collect_locations(self):
|
||||||
all_locs = self.db[Signal.LOCATION]
|
return self.collect_list(Signal.LOCATION)
|
||||||
all_locs = list(
|
|
||||||
set(
|
|
||||||
all_locs[all_locs != Constants.UNKNOWN]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
all_locs.sort()
|
|
||||||
all_locs.insert(0, Constants.UNKNOWN)
|
|
||||||
return all_locs
|
|
||||||
|
|
||||||
def collect_modulations(self):
|
def collect_modulations(self):
|
||||||
modulations = self.db[Signal.MODULATION]
|
return self.collect_list(Signal.MODULATION)
|
||||||
modulations = list(
|
|
||||||
|
def collect_list(self, list_property):
|
||||||
|
values = self.db[list_property]
|
||||||
|
values = list(
|
||||||
set(
|
set(
|
||||||
modulations[modulations != Constants.UNKNOWN]
|
values[values != Constants.UNKNOWN]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
modulations.sort()
|
values.sort()
|
||||||
modulations.insert(0, Constants.UNKNOWN)
|
values.insert(0, Constants.UNKNOWN)
|
||||||
return modulations
|
return values
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def set_min_value_upper_limit(self, lower_combo_box,
|
def set_min_value_upper_limit(self, lower_combo_box,
|
||||||
|
|||||||
Reference in New Issue
Block a user