Add modulation filter screen plus minor modifications
This commit is contained in:
@@ -8,7 +8,7 @@ import qtawesome as qta
|
|||||||
from utilities import Constants
|
from utilities import Constants
|
||||||
|
|
||||||
|
|
||||||
class AudioPlayer(QObject):
|
class AudioPlayer(QObject): # Maybe useless inheriting from QObject
|
||||||
"""
|
"""
|
||||||
This is the audio player widget. The only public methods are the __init__
|
This is the audio player widget. The only public methods are the __init__
|
||||||
method and set_audio_player, which loads the current file. Everything else
|
method and set_audio_player, which loads the current file. Everything else
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ from PyQt5 import uic
|
|||||||
from PyQt5.QtCore import Qt, pyqtSlot
|
from PyQt5.QtCore import Qt, pyqtSlot
|
||||||
from PyQt5.QtWidgets import QWidget, QMessageBox
|
from PyQt5.QtWidgets import QWidget, QMessageBox
|
||||||
from threads import DownloadThread, ThreadStatus
|
from threads import DownloadThread, ThreadStatus
|
||||||
|
|
||||||
Ui_Download_window, _ = uic.loadUiType("download_db_window.ui")
|
Ui_Download_window, _ = uic.loadUiType("download_db_window.ui")
|
||||||
|
|
||||||
class DownloadWindow(QWidget, Ui_Download_window):
|
class DownloadWindow(QWidget, Ui_Download_window):
|
||||||
|
|||||||
6
main.py
6
main.py
@@ -542,8 +542,8 @@ class MyApp(QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def display_signals(self):
|
def display_signals(self):
|
||||||
for i in range(self.result_list.count()):
|
# for i in range(self.result_list.count()):
|
||||||
self.result_list.item(i).setHidden(True)
|
# self.result_list.item(i).setHidden(True)
|
||||||
text = self.search_bar.text()
|
text = self.search_bar.text()
|
||||||
available_signals = 0
|
available_signals = 0
|
||||||
for index, signal in enumerate(self.signal_names):
|
for index, signal in enumerate(self.signal_names):
|
||||||
@@ -555,6 +555,8 @@ class MyApp(QMainWindow, Ui_MainWindow):
|
|||||||
self.modulation_filters_ok(signal)]):
|
self.modulation_filters_ok(signal)]):
|
||||||
self.result_list.item(index).setHidden(False)
|
self.result_list.item(index).setHidden(False)
|
||||||
available_signals += 1
|
available_signals += 1
|
||||||
|
else:
|
||||||
|
self.result_list.item(index).setHidden(True)
|
||||||
self.update_status_tip(available_signals)
|
self.update_status_tip(available_signals)
|
||||||
|
|
||||||
def update_status_tip(self, available_signals):
|
def update_status_tip(self, available_signals):
|
||||||
|
|||||||
@@ -134,6 +134,20 @@ QTextBrowser {
|
|||||||
|
|
||||||
QRadioButton {
|
QRadioButton {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
QListWidget {
|
||||||
|
background-color:rgb(52,52,52);
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
border: 1px solid gray;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineEdit {
|
||||||
|
background-color: #343434;
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
border: 1px solid gray;
|
||||||
|
border-radius: 5px;
|
||||||
}</string>
|
}</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget">
|
<widget class="QWidget" name="centralwidget">
|
||||||
@@ -187,10 +201,7 @@ QRadioButton {
|
|||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: #343434;
|
<string notr="true"/>
|
||||||
color: rgb(255, 255, 255);
|
|
||||||
border: 1px solid gray;
|
|
||||||
border-radius: 5px;</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -244,13 +255,7 @@ border-radius: 5px;</string>
|
|||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QListWidget {
|
<string notr="true"/>
|
||||||
background-color:rgb(52,52,52);
|
|
||||||
color: rgb(255, 255, 255);
|
|
||||||
border: 1px solid gray;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="verticalScrollBarPolicy">
|
<property name="verticalScrollBarPolicy">
|
||||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||||
@@ -330,7 +335,7 @@ QPushButton:!enabled {
|
|||||||
<enum>QTabWidget::Rounded</enum>
|
<enum>QTabWidget::Rounded</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="movable">
|
<property name="movable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@@ -1969,7 +1974,7 @@ QPushButton:checked {
|
|||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>4</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="movable">
|
<property name="movable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
|||||||
51
utilities.py
51
utilities.py
@@ -4,22 +4,31 @@ from pandas import read_csv
|
|||||||
|
|
||||||
class _ReadOnlyProperty(object):
|
class _ReadOnlyProperty(object):
|
||||||
def __init__(self, value):
|
def __init__(self, value):
|
||||||
self.value = value
|
self.__value = value
|
||||||
|
|
||||||
def __get__(self, obj, objtype):
|
def __get__(self, obj, objtype):
|
||||||
return self.value
|
return self.__value
|
||||||
|
|
||||||
def __Set__(self, obj, value):
|
def __set__(self, obj, value):
|
||||||
return NotImplementedError("Cannot change a constant.")
|
return NotImplementedError("Cannot change a constant.")
|
||||||
|
|
||||||
|
def __make_read_only(cls):
|
||||||
|
for k, v in cls.__dict__.items():
|
||||||
|
if not callable(getattr(cls, k)) and '__' not in k:
|
||||||
|
setattr(cls, k, _ReadOnlyProperty(v))
|
||||||
|
# def raise_err(self, attr, value):
|
||||||
|
# raise NotImplementedError("Cannot add an attribute.")
|
||||||
|
# setattr(cls, '__setattr__', raise_err)
|
||||||
|
return cls
|
||||||
|
|
||||||
class Constants(object):
|
@__make_read_only
|
||||||
DB_LOCATION = _ReadOnlyProperty('https://aresvalley.com/Storage/Artemis/Database/data.zip')
|
class __Constants(object):
|
||||||
REF_LOC = _ReadOnlyProperty('https://aresvalley.com/Storage/Artemis/Database/data.zip.log')
|
DB_LOCATION = 'https://aresvalley.com/Storage/Artemis/Database/data.zip'
|
||||||
DATA_FOLDER = _ReadOnlyProperty('Data')
|
REF_LOC = 'https://aresvalley.com/Storage/Artemis/Database/data.zip.log'
|
||||||
SPECTRA_FOLDER = _ReadOnlyProperty('Spectra')
|
DATA_FOLDER = 'Data'
|
||||||
AUDIO_FOLDER = _ReadOnlyProperty('Audio')
|
SPECTRA_FOLDER = 'Spectra'
|
||||||
ICONS_FOLDER = _ReadOnlyProperty('icons_imgs')
|
AUDIO_FOLDER = 'Audio'
|
||||||
|
ICONS_FOLDER = 'icons_imgs'
|
||||||
__Band = namedtuple("Band", ["lower", "upper"])
|
__Band = namedtuple("Band", ["lower", "upper"])
|
||||||
__ELF = __Band(0, 30) # Formally it is (3, 30) Hz.
|
__ELF = __Band(0, 30) # Formally it is (3, 30) Hz.
|
||||||
__SLF = __Band(30, 300)
|
__SLF = __Band(30, 300)
|
||||||
@@ -32,11 +41,11 @@ class Constants(object):
|
|||||||
__UHF = __Band(300 * 10**6, 3000 * 10**6)
|
__UHF = __Band(300 * 10**6, 3000 * 10**6)
|
||||||
__SHF = __Band(3 * 10**9, 30 * 10**9)
|
__SHF = __Band(3 * 10**9, 30 * 10**9)
|
||||||
__EHF = __Band(30 * 10**9, 300 * 10**9)
|
__EHF = __Band(30 * 10**9, 300 * 10**9)
|
||||||
BANDS = _ReadOnlyProperty((__ELF, __SLF, __ULF, __VLF, __LF, __MF, __HF, __VHF, __UHF, __SHF, __EHF))
|
BANDS = (__ELF, __SLF, __ULF, __VLF, __LF, __MF, __HF, __VHF, __UHF, __SHF, __EHF)
|
||||||
ACTIVE_COLOR = _ReadOnlyProperty("#39eaff")
|
ACTIVE_COLOR = "#39eaff"
|
||||||
INACTIVE_COLOR = _ReadOnlyProperty("#9f9f9f")
|
INACTIVE_COLOR = "#9f9f9f"
|
||||||
CONVERSION_FACTORS = _ReadOnlyProperty({"Hz":1, "kHz":1000, "MHz":1000000, "GHz":1000000000})
|
CONVERSION_FACTORS = {"Hz":1, "kHz":1000, "MHz":1000000, "GHz":1000000000}
|
||||||
MODES = _ReadOnlyProperty({"FM": ["NFM", "WFM"],
|
MODES = {"FM": ["NFM", "WFM"],
|
||||||
"AM": [],
|
"AM": [],
|
||||||
"CW": [],
|
"CW": [],
|
||||||
"SK": ["FSK", "PSK", "MSK"],
|
"SK": ["FSK", "PSK", "MSK"],
|
||||||
@@ -45,11 +54,10 @@ class Constants(object):
|
|||||||
"FHSS-TDM": [],
|
"FHSS-TDM": [],
|
||||||
"RAW": [],
|
"RAW": [],
|
||||||
"SC-FDMA": [],}
|
"SC-FDMA": [],}
|
||||||
)
|
APPLY = "Apply"
|
||||||
APPLY = _ReadOnlyProperty("Apply")
|
REMOVE = "Remove"
|
||||||
REMOVE = _ReadOnlyProperty("Remove")
|
UNKNOWN = "N/A"
|
||||||
UNKNOWN = _ReadOnlyProperty("N/A")
|
MODULATIONS = ["8VSB",
|
||||||
MODULATIONS = _ReadOnlyProperty(["8VSB",
|
|
||||||
"AFSK",
|
"AFSK",
|
||||||
"AM",
|
"AM",
|
||||||
"BFSK",
|
"BFSK",
|
||||||
@@ -73,8 +81,9 @@ class Constants(object):
|
|||||||
"PPM",
|
"PPM",
|
||||||
"PSK",
|
"PSK",
|
||||||
"QAM",
|
"QAM",
|
||||||
"TDMA",])
|
"TDMA",]
|
||||||
|
|
||||||
|
Constants = __Constants()
|
||||||
|
|
||||||
def reset_apply_remove_btn(button):
|
def reset_apply_remove_btn(button):
|
||||||
if button.isChecked():
|
if button.isChecked():
|
||||||
|
|||||||
Reference in New Issue
Block a user