Add support for multiple modulations and locations per signal.
Also remove numbers from theme folders and order the themes appearence in action menu
26
artemis.py
@@ -922,12 +922,13 @@ class Artemis(QMainWindow, Ui_MainWindow):
|
||||
)
|
||||
)
|
||||
|
||||
def collect_list(self, list_property):
|
||||
def collect_list(self, list_property, separator=';'):
|
||||
values = self.db[list_property]
|
||||
values = list(
|
||||
set(
|
||||
values[values != Constants.UNKNOWN]
|
||||
)
|
||||
set([
|
||||
x.strip() for value in values[values != Constants.UNKNOWN]
|
||||
for x in value.split(separator)
|
||||
])
|
||||
)
|
||||
values.sort()
|
||||
values.insert(0, Constants.UNKNOWN)
|
||||
@@ -1249,7 +1250,10 @@ class Artemis(QMainWindow, Ui_MainWindow):
|
||||
return False
|
||||
selected_items = [item for item in self.mode_tree_widget.selectedItems()]
|
||||
selected_items_text = [i.text(0) for i in selected_items]
|
||||
parents = [item for item in selected_items_text if item in Constants.MODES.keys()]
|
||||
parents = [
|
||||
item for item in selected_items_text
|
||||
if item in Constants.MODES.keys()
|
||||
]
|
||||
ok = []
|
||||
for item in selected_items:
|
||||
if item.text(0) in parents:
|
||||
@@ -1261,9 +1265,11 @@ class Artemis(QMainWindow, Ui_MainWindow):
|
||||
def modulation_filters_ok(self, signal_name):
|
||||
if not self.apply_remove_modulation_filter_btn.isChecked():
|
||||
return True
|
||||
signal_modulation = self.db.at[signal_name, Signal.MODULATION]
|
||||
signal_modulation = [
|
||||
x.strip() for x in self.db.at[signal_name, Signal.MODULATION].split(',')
|
||||
]
|
||||
for item in self.modulation_list.selectedItems():
|
||||
if item.text() == signal_modulation:
|
||||
if item.text() in signal_modulation:
|
||||
return True
|
||||
return False
|
||||
|
||||
@@ -1298,7 +1304,7 @@ class Artemis(QMainWindow, Ui_MainWindow):
|
||||
@pyqtSlot(QListWidgetItem, QListWidgetItem)
|
||||
def display_specs(self, item, previous_item):
|
||||
self.display_spectrogram()
|
||||
if item:
|
||||
if item is not None:
|
||||
self.current_signal_name = item.text()
|
||||
self.name_lab.setText(self.current_signal_name)
|
||||
self.name_lab.setAlignment(Qt.AlignHCenter)
|
||||
@@ -1383,12 +1389,12 @@ class Artemis(QMainWindow, Ui_MainWindow):
|
||||
path_spectr = default_pic
|
||||
self.spectrogram.setPixmap(QPixmap(path_spectr))
|
||||
|
||||
def activate_band_category(self, band_label, activate = True):
|
||||
def activate_band_category(self, band_label, activate=True):
|
||||
color = self.active_color if activate else self.inactive_color
|
||||
for label in band_label:
|
||||
label.setStyleSheet(f"color: {color};")
|
||||
|
||||
def set_band_range(self, current_signal = None):
|
||||
def set_band_range(self, current_signal=None):
|
||||
if current_signal is not None and not is_undef_freq(current_signal):
|
||||
lower_freq = int(current_signal.at[Signal.INF_FREQ])
|
||||
upper_freq = int(current_signal.at[Signal.SUP_FREQ])
|
||||
|
||||
@@ -312,15 +312,15 @@ QComboBox::drop-down {
|
||||
}
|
||||
|
||||
QComboBox::down-arrow:enabled {
|
||||
image: url("./themes/2-dark/icons/down-arrow.png");
|
||||
image: url("./themes/dark/icons/down-arrow.png");
|
||||
}
|
||||
|
||||
QComboBox::down-arrow:disabled {
|
||||
image: url("./themes/2-dark/icons/down-arrow_off.png");
|
||||
image: url("./themes/dark/icons/down-arrow_off.png");
|
||||
}
|
||||
|
||||
QComboBox::down-arrow:hover {
|
||||
image: url("./themes/2-dark/icons/down-arrow_hover.png");
|
||||
image: url("./themes/dark/icons/down-arrow_hover.png");
|
||||
}
|
||||
|
||||
QComboBox::down-arrow:on {
|
||||
@@ -349,27 +349,27 @@ QRadioButton::indicator{
|
||||
}
|
||||
|
||||
QRadioButton::indicator::unchecked {
|
||||
image: url("./themes/2-dark/icons/off.png");
|
||||
image: url("./themes/dark/icons/off.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator:unchecked:hover {
|
||||
image: url("./themes/2-dark/icons/off_press.png");
|
||||
image: url("./themes/dark/icons/off_press.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator:unchecked:pressed {
|
||||
image: url("./themes/2-dark/icons/off_press.png");
|
||||
image: url("./themes/dark/icons/off_press.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator::checked {
|
||||
image: url("./themes/2-dark/icons/on.png");
|
||||
image: url("./themes/dark/icons/on.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator:checked:hover {
|
||||
image: url("./themes/2-dark/icons/on_press.png");
|
||||
image: url("./themes/dark/icons/on_press.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator:checked:pressed {
|
||||
image: url("./themes/2-dark/icons/on_press.png");
|
||||
image: url("./themes/dark/icons/on_press.png");
|
||||
}
|
||||
|
||||
/*************************************
|
||||
@@ -390,41 +390,41 @@ QSpinBox::up-button {
|
||||
subcontrol-origin: border;
|
||||
subcontrol-position: top right;
|
||||
width: 16px;
|
||||
image: url("./themes/2-dark/icons/up-arrow.png");
|
||||
image: url("./themes/dark/icons/up-arrow.png");
|
||||
border-width: 0px;
|
||||
}
|
||||
|
||||
QSpinBox::up-button:hover {
|
||||
image: url("./themes/2-dark/icons/up-arrow_hover.png");
|
||||
image: url("./themes/dark/icons/up-arrow_hover.png");
|
||||
}
|
||||
|
||||
QSpinBox::up-button:pressed {
|
||||
image: url("./themes/2-dark/icons/up-arrow.png");
|
||||
image: url("./themes/dark/icons/up-arrow.png");
|
||||
}
|
||||
|
||||
QSpinBox::up-button:disabled {
|
||||
image: url("./themes/2-dark/icons/up-arrow_off.png");
|
||||
image: url("./themes/dark/icons/up-arrow_off.png");
|
||||
}
|
||||
|
||||
QSpinBox::down-button {
|
||||
subcontrol-origin: border;
|
||||
subcontrol-position: bottom right;
|
||||
width: 16px;
|
||||
image: url("./themes/2-dark/icons/down-arrow.png");
|
||||
image: url("./themes/dark/icons/down-arrow.png");
|
||||
border-width: 0px;
|
||||
border-top-width: 0;
|
||||
}
|
||||
|
||||
QSpinBox::down-button:hover {
|
||||
image: url("./themes/2-dark/icons/down-arrow_hover.png");
|
||||
image: url("./themes/dark/icons/down-arrow_hover.png");
|
||||
}
|
||||
|
||||
QSpinBox::down-button:pressed {
|
||||
image: url("./themes/2-dark/icons/down-arrow.png");
|
||||
image: url("./themes/dark/icons/down-arrow.png");
|
||||
}
|
||||
|
||||
QSpinBox::down-button:disabled {
|
||||
image: url("./themes/2-dark/icons/down-arrow_off.png");
|
||||
image: url("./themes/dark/icons/down-arrow_off.png");
|
||||
}
|
||||
|
||||
/*************************************
|
||||
|
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 270 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 820 B After Width: | Height: | Size: 820 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 916 B After Width: | Height: | Size: 916 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 827 B After Width: | Height: | Size: 827 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 270 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 820 B After Width: | Height: | Size: 820 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 916 B After Width: | Height: | Size: 916 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 827 B After Width: | Height: | Size: 827 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
@@ -331,15 +331,15 @@ QComboBox::drop-down {
|
||||
}
|
||||
|
||||
QComboBox::down-arrow:enabled {
|
||||
image: url("./themes/3-material_design_dark/icons/down-arrow.png");
|
||||
image: url("./themes/material_design_dark/icons/down-arrow.png");
|
||||
}
|
||||
|
||||
QComboBox::down-arrow:disabled {
|
||||
image: url("./themes/3-material_design_dark/icons/down-arrow_off.png");
|
||||
image: url("./themes/material_design_dark/icons/down-arrow_off.png");
|
||||
}
|
||||
|
||||
QComboBox::down-arrow:hover {
|
||||
image: url("./themes/3-material_design_dark/icons/down-arrow_hover.png");
|
||||
image: url("./themes/material_design_dark/icons/down-arrow_hover.png");
|
||||
}
|
||||
|
||||
QComboBox::down-arrow:on {
|
||||
@@ -368,27 +368,27 @@ QRadioButton::indicator{
|
||||
}
|
||||
|
||||
QRadioButton::indicator::unchecked {
|
||||
image: url("./themes/3-material_design_dark/icons/off.png");
|
||||
image: url("./themes/material_design_dark/icons/off.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator:unchecked:hover {
|
||||
image: url("./themes/3-material_design_dark/icons/off_press.png");
|
||||
image: url("./themes/material_design_dark/icons/off_press.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator:unchecked:pressed {
|
||||
image: url("./themes/3-material_design_dark/icons/off_press.png");
|
||||
image: url("./themes/material_design_dark/icons/off_press.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator::checked {
|
||||
image: url("./themes/3-material_design_dark/icons/on.png");
|
||||
image: url("./themes/material_design_dark/icons/on.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator:checked:hover {
|
||||
image: url("./themes/3-material_design_dark/icons/on_press.png");
|
||||
image: url("./themes/material_design_dark/icons/on_press.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator:checked:pressed {
|
||||
image: url("./themes/3-material_design_dark/icons/on_press.png");
|
||||
image: url("./themes/material_design_dark/icons/on_press.png");
|
||||
}
|
||||
|
||||
/*************************************
|
||||
@@ -409,41 +409,41 @@ QSpinBox::up-button {
|
||||
subcontrol-origin: border;
|
||||
subcontrol-position: top right;
|
||||
width: 16px;
|
||||
image: url("./themes/3-material_design_dark/icons/up-arrow.png");
|
||||
image: url("./themes/material_design_dark/icons/up-arrow.png");
|
||||
border-width: 0px;
|
||||
}
|
||||
|
||||
QSpinBox::up-button:hover {
|
||||
image: url("./themes/3-material_design_dark/icons/up-arrow_hover.png");
|
||||
image: url("./themes/material_design_dark/icons/up-arrow_hover.png");
|
||||
}
|
||||
|
||||
QSpinBox::up-button:pressed {
|
||||
image: url("./themes/3-material_design_dark/icons/up-arrow.png");
|
||||
image: url("./themes/material_design_dark/icons/up-arrow.png");
|
||||
}
|
||||
|
||||
QSpinBox::up-button:disabled {
|
||||
image: url("./themes/3-material_design_dark/icons/up-arrow_off.png");
|
||||
image: url("./themes/material_design_dark/icons/up-arrow_off.png");
|
||||
}
|
||||
|
||||
QSpinBox::down-button {
|
||||
subcontrol-origin: border;
|
||||
subcontrol-position: bottom right;
|
||||
width: 16px;
|
||||
image: url("./themes/3-material_design_dark/icons/down-arrow.png");
|
||||
image: url("./themes/material_design_dark/icons/down-arrow.png");
|
||||
border-width: 0px;
|
||||
border-top-width: 0;
|
||||
}
|
||||
|
||||
QSpinBox::down-button:hover {
|
||||
image: url("./themes/3-material_design_dark/icons/down-arrow_hover.png");
|
||||
image: url("./themes/material_design_dark/icons/down-arrow_hover.png");
|
||||
}
|
||||
|
||||
QSpinBox::down-button:pressed {
|
||||
image: url("./themes/3-material_design_dark/icons/down-arrow.png");
|
||||
image: url("./themes/material_design_dark/icons/down-arrow.png");
|
||||
}
|
||||
|
||||
QSpinBox::down-button:disabled {
|
||||
image: url("./themes/3-material_design_dark/icons/down-arrow_off.png");
|
||||
image: url("./themes/material_design_dark/icons/down-arrow_off.png");
|
||||
}
|
||||
|
||||
/*************************************
|
||||
|
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 270 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 820 B After Width: | Height: | Size: 820 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 916 B After Width: | Height: | Size: 916 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 827 B After Width: | Height: | Size: 827 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
@@ -331,15 +331,15 @@ QComboBox::drop-down {
|
||||
}
|
||||
|
||||
QComboBox::down-arrow:enabled {
|
||||
image: url("./themes/4-material_design_light/icons/down-arrow.png");
|
||||
image: url("./themes/material_design_light/icons/down-arrow.png");
|
||||
}
|
||||
|
||||
QComboBox::down-arrow:disabled {
|
||||
image: url("./themes/4-material_design_light/icons/down-arrow_off.png");
|
||||
image: url("./themes/material_design_light/icons/down-arrow_off.png");
|
||||
}
|
||||
|
||||
QComboBox::down-arrow:hover {
|
||||
image: url("./themes/4-material_design_light/icons/down-arrow_hover.png");
|
||||
image: url("./themes/material_design_light/icons/down-arrow_hover.png");
|
||||
}
|
||||
|
||||
QComboBox::down-arrow:on {
|
||||
@@ -368,27 +368,27 @@ QRadioButton::indicator{
|
||||
}
|
||||
|
||||
QRadioButton::indicator::unchecked {
|
||||
image: url("./themes/4-material_design_light/icons/off.png");
|
||||
image: url("./themes/material_design_light/icons/off.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator:unchecked:hover {
|
||||
image: url("./themes/4-material_design_light/icons/off_press.png");
|
||||
image: url("./themes/material_design_light/icons/off_press.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator:unchecked:pressed {
|
||||
image: url("./themes/4-material_design_light/icons/off_press.png");
|
||||
image: url("./themes/material_design_light/icons/off_press.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator::checked {
|
||||
image: url("./themes/4-material_design_light/icons/on.png");
|
||||
image: url("./themes/material_design_light/icons/on.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator:checked:hover {
|
||||
image: url("./themes/4-material_design_light/icons/on_press.png");
|
||||
image: url("./themes/material_design_light/icons/on_press.png");
|
||||
}
|
||||
|
||||
QRadioButton::indicator:checked:pressed {
|
||||
image: url("./themes/4-material_design_light/icons/on_press.png");
|
||||
image: url("./themes/material_design_light/icons/on_press.png");
|
||||
}
|
||||
|
||||
/*************************************
|
||||
@@ -409,41 +409,41 @@ QSpinBox::up-button {
|
||||
subcontrol-origin: border;
|
||||
subcontrol-position: top right;
|
||||
width: 16px;
|
||||
image: url("./themes/4-material_design_light/icons/up-arrow.png");
|
||||
image: url("./themes/material_design_light/icons/up-arrow.png");
|
||||
border-width: 0px;
|
||||
}
|
||||
|
||||
QSpinBox::up-button:hover {
|
||||
image: url("./themes/4-material_design_light/icons/up-arrow_hover.png");
|
||||
image: url("./themes/material_design_light/icons/up-arrow_hover.png");
|
||||
}
|
||||
|
||||
QSpinBox::up-button:pressed {
|
||||
image: url("./themes/4-material_design_light/icons/up-arrow.png");
|
||||
image: url("./themes/material_design_light/icons/up-arrow.png");
|
||||
}
|
||||
|
||||
QSpinBox::up-button:disabled {
|
||||
image: url("./themes/4-material_design_light/icons/up-arrow_off.png");
|
||||
image: url("./themes/material_design_light/icons/up-arrow_off.png");
|
||||
}
|
||||
|
||||
QSpinBox::down-button {
|
||||
subcontrol-origin: border;
|
||||
subcontrol-position: bottom right;
|
||||
width: 16px;
|
||||
image: url("./themes/4-material_design_light/icons/down-arrow.png");
|
||||
image: url("./themes/material_design_light/icons/down-arrow.png");
|
||||
border-width: 0px;
|
||||
border-top-width: 0;
|
||||
}
|
||||
|
||||
QSpinBox::down-button:hover {
|
||||
image: url("./themes/4-material_design_light/icons/down-arrow_hover.png");
|
||||
image: url("./themes/material_design_light/icons/down-arrow_hover.png");
|
||||
}
|
||||
|
||||
QSpinBox::down-button:pressed {
|
||||
image: url("./themes/4-material_design_light/icons/down-arrow.png");
|
||||
image: url("./themes/material_design_light/icons/down-arrow.png");
|
||||
}
|
||||
|
||||
QSpinBox::down-button:disabled {
|
||||
image: url("./themes/4-material_design_light/icons/down-arrow_off.png");
|
||||
image: url("./themes/material_design_light/icons/down-arrow_off.png");
|
||||
}
|
||||
|
||||
/*************************************
|
||||
@@ -14,7 +14,7 @@ class ThemeConstants:
|
||||
FOLDER = "themes"
|
||||
EXTENSION = ".qss"
|
||||
ICONS_FOLDER = "icons"
|
||||
DEFAULT = "1-dark"
|
||||
DEFAULT = "dark"
|
||||
CURRENT = ".current_theme"
|
||||
COLORS = "colors.txt"
|
||||
COLOR_SEPARATOR = "="
|
||||
@@ -117,7 +117,7 @@ class ThemeManager:
|
||||
def __pretty_name(self, bad_name):
|
||||
return ' '.join(
|
||||
map(lambda s: s.capitalize(),
|
||||
bad_name.split('-')[1].split('_')
|
||||
bad_name.split('_')
|
||||
)
|
||||
)
|
||||
|
||||
@@ -125,7 +125,7 @@ class ThemeManager:
|
||||
themes = []
|
||||
ag = QActionGroup(self.__parent, exclusive=True)
|
||||
if os.path.exists(ThemeConstants.FOLDER):
|
||||
for theme_folder in os.listdir(ThemeConstants.FOLDER):
|
||||
for theme_folder in sorted(os.listdir(ThemeConstants.FOLDER)):
|
||||
relative_folder = os.path.join(ThemeConstants.FOLDER, theme_folder)
|
||||
if os.path.isdir(os.path.abspath(relative_folder)):
|
||||
relative_folder = os.path.join(ThemeConstants.FOLDER, theme_folder)
|
||||
@@ -157,7 +157,7 @@ class ThemeManager:
|
||||
return match_ok(colors)
|
||||
|
||||
def __change(self):
|
||||
theme_name = os.path.basename(self.__theme_path).split('-')[1] + ThemeConstants.EXTENSION
|
||||
theme_name = os.path.basename(self.__theme_path) + ThemeConstants.EXTENSION
|
||||
try:
|
||||
with open(
|
||||
os.path.join(self.__theme_path, theme_name), "r"
|
||||
|
||||