Add peak hold and smoothing; fix window maximization at startup; split dock widgets

This commit is contained in:
Michal Krenek (Mikos) 2015-12-14 02:01:23 +01:00
parent 0af92b3d16
commit 8096c6e3c3
9 changed files with 1048 additions and 407 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ __pycache__/
build/ build/
dist/ dist/
MANIFEST MANIFEST
*.egg-info

View File

@ -8,6 +8,7 @@ import pyqtgraph as pg
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from qspectrumanalyzer.version import __version__ from qspectrumanalyzer.version import __version__
from qspectrumanalyzer.ui_qspectrumanalyzer_settings import Ui_QSpectrumAnalyzerSettings from qspectrumanalyzer.ui_qspectrumanalyzer_settings import Ui_QSpectrumAnalyzerSettings
from qspectrumanalyzer.ui_qspectrumanalyzer_smooth import Ui_QSpectrumAnalyzerSmooth
from qspectrumanalyzer.ui_qspectrumanalyzer import Ui_QSpectrumAnalyzerMainWindow from qspectrumanalyzer.ui_qspectrumanalyzer import Ui_QSpectrumAnalyzerMainWindow
@ -19,6 +20,30 @@ signal.signal(signal.SIGINT, signal.SIG_DFL)
signal.signal(signal.SIGTERM, signal.SIG_DFL) signal.signal(signal.SIGTERM, signal.SIG_DFL)
def smooth(x, window_len=11, window='hanning'):
"""Smooth 1D signal using specified window with given size"""
x = np.array(x)
if window_len < 3:
return x
if x.size < window_len:
raise ValueError("Input data length must be greater than window size")
if window not in ['rectangular', 'hanning', 'hamming', 'bartlett', 'blackman']:
raise ValueError("Window must be 'rectangular', 'hanning', 'hamming', 'bartlett' or 'blackman'")
if window == 'rectangular':
# Moving average
w = np.ones(window_len, 'd')
else:
w = getattr(np, window)(window_len)
s = np.r_[2 * x[0] - x[window_len:1:-1], x, 2 * x[-1] - x[-1:-window_len:-1]]
y = np.convolve(w / w.sum(), s, mode='same')
return y[window_len - 1:-window_len + 1]
class QSpectrumAnalyzerSettings(QtGui.QDialog, Ui_QSpectrumAnalyzerSettings): class QSpectrumAnalyzerSettings(QtGui.QDialog, Ui_QSpectrumAnalyzerSettings):
"""QSpectrumAnalyzer settings dialog""" """QSpectrumAnalyzer settings dialog"""
def __init__(self, parent=None): def __init__(self, parent=None):
@ -42,7 +67,7 @@ class QSpectrumAnalyzerSettings(QtGui.QDialog, Ui_QSpectrumAnalyzerSettings):
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def on_executableButton_clicked(self): def on_executableButton_clicked(self):
"""Open file dialog when button is clicked""" """Open file dialog when button is clicked"""
filename = QtGui.QFileDialog.getOpenFileName(self, "QSpectrumAnalyzer - executable") filename = QtGui.QFileDialog.getOpenFileName(self, self.tr("Select executable - QSpectrumAnalyzer"))
if filename: if filename:
self.executableEdit.setText(filename) self.executableEdit.setText(filename)
@ -61,6 +86,32 @@ class QSpectrumAnalyzerSettings(QtGui.QDialog, Ui_QSpectrumAnalyzerSettings):
QtGui.QDialog.accept(self) QtGui.QDialog.accept(self)
class QSpectrumAnalyzerSmooth(QtGui.QDialog, Ui_QSpectrumAnalyzerSmooth):
"""QSpectrumAnalyzer smoothing dialog"""
def __init__(self, parent=None):
# Initialize UI
super().__init__(parent)
self.setupUi(self)
# Load settings
settings = QtCore.QSettings()
self.windowLengthSpinBox.setValue(int(settings.value("smooth_length") or 11))
window_function = str(settings.value("smooth_window") or "hanning")
i = self.windowFunctionComboBox.findText(window_function)
if i == -1:
self.windowFunctionComboBox.setCurrentIndex(0)
else:
self.windowFunctionComboBox.setCurrentIndex(i)
def accept(self):
"""Save settings when dialog is accepted"""
settings = QtCore.QSettings()
settings.setValue("smooth_length", self.windowLengthSpinBox.value())
settings.setValue("smooth_window", self.windowFunctionComboBox.currentText())
QtGui.QDialog.accept(self)
class QSpectrumAnalyzerMainWindow(QtGui.QMainWindow, Ui_QSpectrumAnalyzerMainWindow): class QSpectrumAnalyzerMainWindow(QtGui.QMainWindow, Ui_QSpectrumAnalyzerMainWindow):
"""QSpectrumAnalyzer main window""" """QSpectrumAnalyzer main window"""
def __init__(self, parent=None): def __init__(self, parent=None):
@ -70,8 +121,13 @@ class QSpectrumAnalyzerMainWindow(QtGui.QMainWindow, Ui_QSpectrumAnalyzerMainWin
# Setup rtl_power thread and connect signals # Setup rtl_power thread and connect signals
self.waterfall_history_size = 100 self.waterfall_history_size = 100
self.datacounter = 0 self.smooth = False
self.datatimestamp = 0 self.smooth_length = 11
self.smooth_window = 'hanning'
self.peak_hold = False
self.data_counter = 0
self.data_timestamp = 0
self.data_peak_hold = None
self.rtl_power_thread = None self.rtl_power_thread = None
self.setup_rtl_power_thread() self.setup_rtl_power_thread()
@ -110,6 +166,9 @@ class QSpectrumAnalyzerMainWindow(QtGui.QMainWindow, Ui_QSpectrumAnalyzerMainWin
# Create spectrum curve # Create spectrum curve
self.curve = self.mainPlotWidget.plot() self.curve = self.mainPlotWidget.plot()
# Create peak hold curve
self.curve_peak_hold = self.mainPlotWidget.plot(pen='r')
# Create crosshair # Create crosshair
self.vLine = pg.InfiniteLine(angle=90, movable=False) self.vLine = pg.InfiniteLine(angle=90, movable=False)
self.hLine = pg.InfiniteLine(angle=0, movable=False) self.hLine = pg.InfiniteLine(angle=0, movable=False)
@ -161,22 +220,47 @@ class QSpectrumAnalyzerMainWindow(QtGui.QMainWindow, Ui_QSpectrumAnalyzerMainWin
def update_data(self, data): def update_data(self, data):
"""Update plots when new data is received""" """Update plots when new data is received"""
self.datacounter += 1 self.data_counter += 1
self.update_plot(data)
# Update waterfall
self.update_waterfall(data) self.update_waterfall(data)
# Update main spectrum plot
if self.smooth:
# Apply smoothing to data
data["y"] = smooth(data["y"],
window_len=self.smooth_length,
window=self.smooth_window)
if self.peak_hold:
if self.data_peak_hold is None:
self.data_peak_hold = data["y"]
else:
# Update peak hold data
for i, y in enumerate(data["y"]):
if y > self.data_peak_hold[i]:
self.data_peak_hold[i] = y
self.update_plot(data)
# Show number of hops and how much time did the sweep really take
timestamp = time.time() timestamp = time.time()
self.show_status("Sweep time: {:.2f} s".format(timestamp - self.datatimestamp), timeout=0) self.show_status(self.tr("Frequency hops: {} Sweep time: {:.2f} s").format(
self.datatimestamp = timestamp self.rtl_power_thread.params["hops"] or self.tr("N/A"),
timestamp - self.data_timestamp
), timeout=0)
self.data_timestamp = timestamp
def update_plot(self, data): def update_plot(self, data):
"""Update main spectrum plot""" """Update main spectrum plot"""
self.curve.setData(data["x"], data["y"]) self.curve.setData(data["x"], data["y"])
if self.peak_hold:
self.curve_peak_hold.setData(data["x"], self.data_peak_hold)
def update_waterfall(self, data): def update_waterfall(self, data):
"""Update waterfall plot""" """Update waterfall plot"""
# Create waterfall data array and waterfall image on first run # Create waterfall data array and waterfall image on first run
if self.datacounter == 1: if self.data_counter == 1:
self.waterfallImgArray = np.zeros((self.waterfall_history_size, len(data["x"]))) self.waterfallImgArray = np.zeros((self.waterfall_history_size, len(data["x"])))
self.waterfallImg = pg.ImageItem() self.waterfallImg = pg.ImageItem()
self.waterfallImg.scale((data["x"][-1] - data["x"][0]) / len(data["x"]), 1) self.waterfallImg.scale((data["x"][-1] - data["x"][0]) / len(data["x"]), 1)
@ -186,17 +270,17 @@ class QSpectrumAnalyzerMainWindow(QtGui.QMainWindow, Ui_QSpectrumAnalyzerMainWin
# Roll down one and replace leading edge with new data # Roll down one and replace leading edge with new data
self.waterfallImgArray = np.roll(self.waterfallImgArray, -1, axis=0) self.waterfallImgArray = np.roll(self.waterfallImgArray, -1, axis=0)
self.waterfallImgArray[-1] = data["y"] self.waterfallImgArray[-1] = data["y"]
self.waterfallImg.setImage(self.waterfallImgArray[-self.datacounter:].T, self.waterfallImg.setImage(self.waterfallImgArray[-self.data_counter:].T,
autoLevels=False, autoRange=False) autoLevels=False, autoRange=False)
# Move waterfall image to always start at 0 # Move waterfall image to always start at 0
self.waterfallImg.setPos(data["x"][0], self.waterfallImg.setPos(data["x"][0],
-self.datacounter if self.datacounter < self.waterfall_history_size -self.data_counter if self.data_counter < self.waterfall_history_size
else -self.waterfall_history_size) else -self.waterfall_history_size)
# Link histogram widget to waterfall image on first run # Link histogram widget to waterfall image on first run
# (must be done after first data is received or else levels would be wrong) # (must be done after first data is received or else levels would be wrong)
if self.datacounter == 1: if self.data_counter == 1:
self.waterfallHistogram.setImageItem(self.waterfallImg) self.waterfallHistogram.setImageItem(self.waterfallImg)
def load_settings(self): def load_settings(self):
@ -209,14 +293,56 @@ class QSpectrumAnalyzerMainWindow(QtGui.QMainWindow, Ui_QSpectrumAnalyzerMainWin
self.gainSpinBox.setValue(int(settings.value("gain") or 0)) self.gainSpinBox.setValue(int(settings.value("gain") or 0))
self.ppmSpinBox.setValue(int(settings.value("ppm") or 0)) self.ppmSpinBox.setValue(int(settings.value("ppm") or 0))
self.cropSpinBox.setValue(int(settings.value("crop") or 0)) self.cropSpinBox.setValue(int(settings.value("crop") or 0))
self.peakHoldCheckBox.setChecked(int(settings.value("peak_hold") or 0))
self.smoothCheckBox.setChecked(int(settings.value("smooth") or 0))
if settings.value("window_geometry"): # Restore window geometry
self.restoreGeometry(settings.value("window_geometry"))
if settings.value("window_state"): if settings.value("window_state"):
self.restoreState(settings.value("window_state")) self.restoreState(settings.value("window_state"))
if settings.value("plotsplitter_state"): if settings.value("plotsplitter_state"):
self.plotSplitter.restoreState(settings.value("plotsplitter_state")) self.plotSplitter.restoreState(settings.value("plotsplitter_state"))
# Migration from older version of config file
if int(settings.value("config_version") or 1) < 2:
# Make tabs from docks when started for first time
self.tabifyDockWidget(self.settingsDockWidget, self.levelsDockWidget)
self.settingsDockWidget.raise_()
self.set_dock_size(self.controlsDockWidget, 0, 0)
self.set_dock_size(self.frequencyDockWidget, 0, 0)
# Update config version
settings.setValue("config_version", 2)
# Window geometry has to be restored only after show(), because initial
# maximization doesn't work otherwise (at least not in some window managers on X11)
self.show()
if settings.value("window_geometry"):
self.restoreGeometry(settings.value("window_geometry"))
def set_dock_size(self, dock, width, height):
"""Ugly hack for resizing QDockWidget (because it doesn't respect minimumSize / sizePolicy set in Designer)
Link: https://stackoverflow.com/questions/2722939/c-resize-a-docked-qt-qdockwidget-programmatically"""
old_min_size = dock.minimumSize()
old_max_size = dock.maximumSize()
if width >= 0:
if dock.width() < width:
dock.setMinimumWidth(width)
else:
dock.setMaximumWidth(width)
if height >= 0:
if dock.height() < height:
dock.setMinimumHeight(height)
else:
dock.setMaximumHeight(height)
QtCore.QTimer.singleShot(0, lambda: self.set_dock_size_callback(dock, old_min_size, old_max_size))
def set_dock_size_callback(self, dock, old_min_size, old_max_size):
"""Return to original QDockWidget minimumSize and maximumSize after running set_dock_size()"""
dock.setMinimumSize(old_min_size)
dock.setMaximumSize(old_max_size)
def save_settings(self): def save_settings(self):
"""Save spectrum analyzer settings and window geometry""" """Save spectrum analyzer settings and window geometry"""
settings = QtCore.QSettings() settings = QtCore.QSettings()
@ -227,7 +353,10 @@ class QSpectrumAnalyzerMainWindow(QtGui.QMainWindow, Ui_QSpectrumAnalyzerMainWin
settings.setValue("gain", int(self.gainSpinBox.value())) settings.setValue("gain", int(self.gainSpinBox.value()))
settings.setValue("ppm", int(self.ppmSpinBox.value())) settings.setValue("ppm", int(self.ppmSpinBox.value()))
settings.setValue("crop", int(self.cropSpinBox.value())) settings.setValue("crop", int(self.cropSpinBox.value()))
settings.setValue("peak_hold", int(self.peakHoldCheckBox.isChecked()))
settings.setValue("smooth", int(self.smoothCheckBox.isChecked()))
# Save window geometry
settings.setValue("window_geometry", self.saveGeometry()) settings.setValue("window_geometry", self.saveGeometry())
settings.setValue("window_state", self.saveState()) settings.setValue("window_state", self.saveState())
settings.setValue("plotsplitter_state", self.plotSplitter.saveState()) settings.setValue("plotsplitter_state", self.plotSplitter.saveState())
@ -240,8 +369,13 @@ class QSpectrumAnalyzerMainWindow(QtGui.QMainWindow, Ui_QSpectrumAnalyzerMainWin
"""Start rtl_power thread""" """Start rtl_power thread"""
settings = QtCore.QSettings() settings = QtCore.QSettings()
self.waterfall_history_size = int(settings.value("waterfall_history_size") or 100) self.waterfall_history_size = int(settings.value("waterfall_history_size") or 100)
self.datacounter = 0 self.peak_hold = bool(self.peakHoldCheckBox.isChecked())
self.datatimestamp = time.time() self.smooth = bool(self.smoothCheckBox.isChecked())
self.smooth_length = int(settings.value("smooth_length") or 11)
self.smooth_window = str(settings.value("smooth_window") or "hanning")
self.data_counter = 0
self.data_peak_hold = None
self.data_timestamp = time.time()
if not self.rtl_power_thread.alive: if not self.rtl_power_thread.alive:
self.rtl_power_thread.setup(float(self.startFreqSpinBox.value()), self.rtl_power_thread.setup(float(self.startFreqSpinBox.value()),
float(self.stopFreqSpinBox.value()), float(self.stopFreqSpinBox.value()),
@ -271,6 +405,30 @@ class QSpectrumAnalyzerMainWindow(QtGui.QMainWindow, Ui_QSpectrumAnalyzerMainWin
def on_stopButton_clicked(self): def on_stopButton_clicked(self):
self.stop() self.stop()
@QtCore.pyqtSlot(bool)
def on_peakHoldCheckBox_toggled(self, checked):
self.peak_hold = checked
if not checked:
self.data_peak_hold = None
self.curve_peak_hold.clear()
@QtCore.pyqtSlot(bool)
def on_smoothCheckBox_toggled(self, checked):
self.smooth = checked
if self.peak_hold:
self.data_peak_hold = None
self.curve_peak_hold.clear()
@QtCore.pyqtSlot()
def on_smoothButton_clicked(self):
dialog = QSpectrumAnalyzerSmooth(self)
if dialog.exec_():
settings = QtCore.QSettings()
self.smooth_length = int(settings.value("smooth_length") or 11)
self.smooth_window = str(settings.value("smooth_window") or "hanning")
self.data_peak_hold = None
self.curve_peak_hold.clear()
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def on_action_Settings_triggered(self): def on_action_Settings_triggered(self):
dialog = QSpectrumAnalyzerSettings(self) dialog = QSpectrumAnalyzerSettings(self)
@ -279,7 +437,8 @@ class QSpectrumAnalyzerMainWindow(QtGui.QMainWindow, Ui_QSpectrumAnalyzerMainWin
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def on_action_About_triggered(self): def on_action_About_triggered(self):
QtGui.QMessageBox.information(self, self.tr("About"), self.tr("QSpectrumAnalyzer {}").format(__version__)) QtGui.QMessageBox.information(self, self.tr("About - QSpectrumAnalyzer"),
self.tr("QSpectrumAnalyzer {}").format(__version__))
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def on_action_Quit_triggered(self): def on_action_Quit_triggered(self):
@ -357,6 +516,7 @@ class RtlPowerThread(RtlPowerBaseThread):
"stop_freq": stop_freq, "stop_freq": stop_freq,
"bin_size": bin_size, "bin_size": bin_size,
"interval": interval, "interval": interval,
"hops": 0,
"gain": gain, "gain": gain,
"ppm": ppm, "ppm": ppm,
"crop": crop, "crop": crop,
@ -557,7 +717,6 @@ def main():
app.setOrganizationDomain("qspectrumanalyzer.eutopia.cz") app.setOrganizationDomain("qspectrumanalyzer.eutopia.cz")
app.setApplicationName("QSpectrumAnalyzer") app.setApplicationName("QSpectrumAnalyzer")
window = QSpectrumAnalyzerMainWindow() window = QSpectrumAnalyzerMainWindow()
window.show()
sys.exit(app.exec_()) sys.exit(app.exec_())

View File

@ -3,176 +3,249 @@
<context> <context>
<name>QSpectrumAnalyzerMainWindow</name> <name>QSpectrumAnalyzerMainWindow</name>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="217"/> <location filename="ui_qspectrumanalyzer.py" line="265"/>
<source>QSpectrumAnalyzer</source> <source>QSpectrumAnalyzer</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="231"/> <location filename="ui_qspectrumanalyzer.py" line="279"/>
<source>Settings</source> <source>Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="228"/> <location filename="ui_qspectrumanalyzer.py" line="276"/>
<source> MHz</source> <source> MHz</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="230"/> <location filename="ui_qspectrumanalyzer.py" line="278"/>
<source> kHz</source> <source> kHz</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="234"/> <location filename="ui_qspectrumanalyzer.py" line="284"/>
<source>auto</source> <source>auto</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="224"/> <location filename="ui_qspectrumanalyzer.py" line="272"/>
<source>Frequency</source> <source>Frequency</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="220"/> <location filename="ui_qspectrumanalyzer.py" line="268"/>
<source>Controls</source> <source>Controls</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="237"/> <location filename="ui_qspectrumanalyzer.py" line="288"/>
<source>Levels</source> <source>Levels</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="__main__.py" line="282"/> <location filename="__main__.py" line="440"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="__main__.py" line="282"/>
<source>QSpectrumAnalyzer {}</source> <source>QSpectrumAnalyzer {}</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="218"/> <location filename="ui_qspectrumanalyzer.py" line="266"/>
<source>&amp;File</source> <source>&amp;File</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="219"/> <location filename="ui_qspectrumanalyzer.py" line="267"/>
<source>&amp;Help</source> <source>&amp;Help</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="221"/> <location filename="ui_qspectrumanalyzer.py" line="269"/>
<source>&amp;Start</source> <source>&amp;Start</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="222"/> <location filename="ui_qspectrumanalyzer.py" line="270"/>
<source>S&amp;top</source> <source>S&amp;top</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="223"/> <location filename="ui_qspectrumanalyzer.py" line="271"/>
<source>Si&amp;ngle shot</source> <source>Si&amp;ngle shot</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="238"/> <location filename="ui_qspectrumanalyzer.py" line="289"/>
<source>&amp;Settings...</source> <source>&amp;Settings...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="239"/> <location filename="ui_qspectrumanalyzer.py" line="290"/>
<source>&amp;Quit</source> <source>&amp;Quit</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="240"/> <location filename="ui_qspectrumanalyzer.py" line="291"/>
<source>Ctrl+Q</source> <source>Ctrl+Q</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="241"/> <location filename="ui_qspectrumanalyzer.py" line="292"/>
<source>&amp;About</source> <source>&amp;About</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="232"/> <location filename="ui_qspectrumanalyzer.py" line="287"/>
<source>Interval [s]:</source> <source>Interval [s]:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="233"/> <location filename="ui_qspectrumanalyzer.py" line="286"/>
<source>Gain [dB]:</source> <source>Gain [dB]:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="235"/> <location filename="ui_qspectrumanalyzer.py" line="281"/>
<source>Corr. [ppm]:</source> <source>Corr. [ppm]:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="236"/> <location filename="ui_qspectrumanalyzer.py" line="285"/>
<source>Crop [%]:</source> <source>Crop [%]:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="225"/> <location filename="ui_qspectrumanalyzer.py" line="273"/>
<source>Start:</source> <source>Start:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="227"/> <location filename="ui_qspectrumanalyzer.py" line="275"/>
<source>Stop:</source> <source>Stop:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer.py" line="229"/> <location filename="ui_qspectrumanalyzer.py" line="277"/>
<source>Bin size:</source> <source>Bin size:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="ui_qspectrumanalyzer.py" line="282"/>
<source>Peak hold</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer.py" line="280"/>
<source>Smoothing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer.py" line="283"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="__main__.py" line="248"/>
<source>N/A</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="__main__.py" line="248"/>
<source>Frequency hops: {} Sweep time: {:.2f} s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="__main__.py" line="440"/>
<source>About - QSpectrumAnalyzer</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>QSpectrumAnalyzerSettings</name> <name>QSpectrumAnalyzerSettings</name>
<message> <message>
<location filename="ui_qspectrumanalyzer_settings.py" line="90"/> <location filename="ui_qspectrumanalyzer_settings.py" line="100"/>
<source>QSpectrumAnalyzer - Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer_settings.py" line="95"/>
<source>rtl_power</source> <source>rtl_power</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer_settings.py" line="96"/> <location filename="ui_qspectrumanalyzer_settings.py" line="101"/>
<source>...</source> <source>...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer_settings.py" line="97"/> <location filename="ui_qspectrumanalyzer_settings.py" line="98"/>
<source>Waterfall history size:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer_settings.py" line="91"/>
<source>Backend:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer_settings.py" line="93"/>
<source>rtl_power_fftw</source> <source>rtl_power_fftw</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer_settings.py" line="94"/> <location filename="ui_qspectrumanalyzer_settings.py" line="96"/>
<source>Executable:</source> <source>&amp;Backend:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="ui_qspectrumanalyzer_settings.py" line="98"/> <location filename="ui_qspectrumanalyzer_settings.py" line="99"/>
<source>Sample rate:</source> <source>E&amp;xecutable:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer_settings.py" line="102"/>
<source>&amp;Waterfall history size:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer_settings.py" line="103"/>
<source>Sa&amp;mple rate:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="__main__.py" line="70"/>
<source>Select executable - QSpectrumAnalyzer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer_settings.py" line="95"/>
<source>Settings - QSpectrumAnalyzer</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QSpectrumAnalyzerSmooth</name>
<message>
<location filename="ui_qspectrumanalyzer_smooth.py" line="72"/>
<source>&amp;Window function:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer_smooth.py" line="73"/>
<source>rectangular</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer_smooth.py" line="74"/>
<source>hanning</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer_smooth.py" line="75"/>
<source>hamming</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer_smooth.py" line="76"/>
<source>bartlett</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer_smooth.py" line="77"/>
<source>blackman</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer_smooth.py" line="78"/>
<source>Window len&amp;gth:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui_qspectrumanalyzer_smooth.py" line="71"/>
<source>Smoothing - QSpectrumAnalyzer</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1100</width> <width>1080</width>
<height>731</height> <height>776</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -51,7 +51,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1100</width> <width>1080</width>
<height>30</height> <height>30</height>
</rect> </rect>
</property> </property>
@ -73,21 +73,30 @@
<addaction name="menu_Help"/> <addaction name="menu_Help"/>
</widget> </widget>
<widget class="QStatusBar" name="statusbar"/> <widget class="QStatusBar" name="statusbar"/>
<widget class="QDockWidget" name="dockWidget"> <widget class="QDockWidget" name="controlsDockWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>190</width>
<height>126</height>
</size>
</property>
<property name="features"> <property name="features">
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set> <set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property> </property>
<property name="windowTitle">
<string>Controls</string>
</property>
<attribute name="dockWidgetArea"> <attribute name="dockWidgetArea">
<number>2</number> <number>2</number>
</attribute> </attribute>
<widget class="QWidget" name="dockWidgetContents"> <widget class="QWidget" name="controlsDockWidgetContents">
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QGridLayout" name="gridLayout_2">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Controls</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QPushButton" name="startButton"> <widget class="QPushButton" name="startButton">
<property name="text"> <property name="text">
@ -109,14 +118,45 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>561</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </widget>
<item> <widget class="QDockWidget" name="frequencyDockWidget">
<widget class="QGroupBox" name="groupBox"> <property name="sizePolicy">
<property name="title"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>156</width>
<height>232</height>
</size>
</property>
<property name="features">
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property>
<property name="windowTitle">
<string>Frequency</string> <string>Frequency</string>
</property> </property>
<attribute name="dockWidgetArea">
<number>2</number>
</attribute>
<widget class="QWidget" name="frequencyDockWidgetContents">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
@ -211,36 +251,101 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </widget>
<item> <widget class="QDockWidget" name="settingsDockWidget">
<widget class="QGroupBox" name="groupBox_3"> <property name="sizePolicy">
<property name="title"> <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="features">
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property>
<property name="windowTitle">
<string>Settings</string> <string>Settings</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <attribute name="dockWidgetArea">
<item row="0" column="0"> <number>2</number>
<widget class="QLabel" name="label_4"> </attribute>
<widget class="QWidget" name="settingsDockWidgetContents">
<layout class="QGridLayout" name="gridLayout">
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="smoothCheckBox">
<property name="text"> <property name="text">
<string>Interval [s]:</string> <string>Smoothing</string>
</property>
<property name="buddy">
<cstring>intervalSpinBox</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="2" column="0">
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_5">
<property name="text"> <property name="text">
<string>Gain [dB]:</string> <string>Corr. [ppm]:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>gainSpinBox</cstring> <cstring>ppmSpinBox</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="4" column="0" colspan="3">
<widget class="QCheckBox" name="peakHoldCheckBox">
<property name="text">
<string>Peak hold</string>
</property>
</widget>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QDoubleSpinBox" name="intervalSpinBox">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="maximum">
<double>999.000000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QToolButton" name="smoothButton">
<property name="text">
<string>...</string>
</property>
<property name="autoRaise">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QSpinBox" name="gainSpinBox"> <widget class="QSpinBox" name="gainSpinBox">
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -259,17 +364,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="1" colspan="2">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Corr. [ppm]:</string>
</property>
<property name="buddy">
<cstring>ppmSpinBox</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="label_7">
<property name="text"> <property name="text">
<string>Crop [%]:</string> <string>Crop [%]:</string>
@ -292,35 +387,54 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="0" column="1" colspan="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Gain [dB]:</string>
</property>
<property name="buddy">
<cstring>gainSpinBox</cstring>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QSpinBox" name="cropSpinBox"> <widget class="QSpinBox" name="cropSpinBox">
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="0" column="0">
<widget class="QDoubleSpinBox" name="intervalSpinBox"> <widget class="QLabel" name="label_4">
<property name="alignment"> <property name="text">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <string>Interval [s]:</string>
</property> </property>
<property name="maximum"> <property name="buddy">
<double>999.000000000000000</double> <cstring>intervalSpinBox</cstring>
</property>
<property name="value">
<double>1.000000000000000</double>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </widget>
<item> <widget class="QDockWidget" name="levelsDockWidget">
<widget class="QGroupBox" name="groupBox_4"> <property name="sizePolicy">
<property name="title"> <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="features">
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property>
<property name="windowTitle">
<string>Levels</string> <string>Levels</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <attribute name="dockWidgetArea">
<number>2</number>
</attribute>
<widget class="QWidget" name="levelsDockWidgetContents">
<layout class="QVBoxLayout" name="verticalLayout_6">
<item> <item>
<widget class="GraphicsLayoutWidget" name="histogramPlotLayout"> <widget class="GraphicsLayoutWidget" name="histogramPlotLayout">
<property name="sizePolicy"> <property name="sizePolicy">
@ -333,9 +447,6 @@
</item> </item>
</layout> </layout>
</widget> </widget>
</item>
</layout>
</widget>
</widget> </widget>
<action name="action_Settings"> <action name="action_Settings">
<property name="text"> <property name="text">
@ -374,6 +485,9 @@
<tabstop>gainSpinBox</tabstop> <tabstop>gainSpinBox</tabstop>
<tabstop>ppmSpinBox</tabstop> <tabstop>ppmSpinBox</tabstop>
<tabstop>cropSpinBox</tabstop> <tabstop>cropSpinBox</tabstop>
<tabstop>peakHoldCheckBox</tabstop>
<tabstop>smoothCheckBox</tabstop>
<tabstop>smoothButton</tabstop>
<tabstop>histogramPlotLayout</tabstop> <tabstop>histogramPlotLayout</tabstop>
<tabstop>mainPlotLayout</tabstop> <tabstop>mainPlotLayout</tabstop>
<tabstop>waterfallPlotLayout</tabstop> <tabstop>waterfallPlotLayout</tabstop>

View File

@ -6,12 +6,12 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>350</width> <width>400</width>
<height>210</height> <height>210</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>QSpectrumAnalyzer - Settings</string> <string>Settings - QSpectrumAnalyzer</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
@ -19,7 +19,10 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>Backend:</string> <string>&amp;Backend:</string>
</property>
<property name="buddy">
<cstring>backendComboBox</cstring>
</property> </property>
</widget> </widget>
</item> </item>
@ -40,7 +43,10 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Executable:</string> <string>E&amp;xecutable:</string>
</property>
<property name="buddy">
<cstring>executableEdit</cstring>
</property> </property>
</widget> </widget>
</item> </item>
@ -65,7 +71,10 @@
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>Waterfall history size:</string> <string>&amp;Waterfall history size:</string>
</property>
<property name="buddy">
<cstring>waterfallHistorySizeSpinBox</cstring>
</property> </property>
</widget> </widget>
</item> </item>
@ -85,7 +94,10 @@
<item row="3" column="0"> <item row="3" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>Sample rate:</string> <string>Sa&amp;mple rate:</string>
</property>
<property name="buddy">
<cstring>sampleRateSpinBox</cstring>
</property> </property>
</widget> </widget>
</item> </item>
@ -133,10 +145,11 @@
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>backendComboBox</tabstop>
<tabstop>executableEdit</tabstop> <tabstop>executableEdit</tabstop>
<tabstop>executableButton</tabstop> <tabstop>executableButton</tabstop>
<tabstop>waterfallHistorySizeSpinBox</tabstop> <tabstop>waterfallHistorySizeSpinBox</tabstop>
<tabstop>buttonBox</tabstop> <tabstop>sampleRateSpinBox</tabstop>
</tabstops> </tabstops>
<resources/> <resources/>
<connections> <connections>
@ -147,8 +160,8 @@
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>224</x> <x>230</x>
<y>126</y> <y>203</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>157</x> <x>157</x>
@ -163,8 +176,8 @@
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>292</x> <x>298</x>
<y>132</y> <y>203</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>286</x> <x>286</x>

View File

@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QSpectrumAnalyzerSmooth</class>
<widget class="QDialog" name="QSpectrumAnalyzerSmooth">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>250</width>
<height>130</height>
</rect>
</property>
<property name="windowTitle">
<string>Smoothing - QSpectrumAnalyzer</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Window function:</string>
</property>
<property name="buddy">
<cstring>windowFunctionComboBox</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="windowFunctionComboBox">
<property name="currentIndex">
<number>0</number>
</property>
<item>
<property name="text">
<string>rectangular</string>
</property>
</item>
<item>
<property name="text">
<string>hanning</string>
</property>
</item>
<item>
<property name="text">
<string>hamming</string>
</property>
</item>
<item>
<property name="text">
<string>bartlett</string>
</property>
</item>
<item>
<property name="text">
<string>blackman</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Window len&amp;gth:</string>
</property>
<property name="buddy">
<cstring>windowLengthSpinBox</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="windowLengthSpinBox">
<property name="minimum">
<number>3</number>
</property>
<property name="maximum">
<number>1001</number>
</property>
<property name="value">
<number>11</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>QSpectrumAnalyzerSmooth</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>218</x>
<y>104</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>129</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>QSpectrumAnalyzerSmooth</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>218</x>
<y>110</y>
</hint>
<hint type="destinationlabel">
<x>224</x>
<y>129</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -25,7 +25,7 @@ except AttributeError:
class Ui_QSpectrumAnalyzerMainWindow(object): class Ui_QSpectrumAnalyzerMainWindow(object):
def setupUi(self, QSpectrumAnalyzerMainWindow): def setupUi(self, QSpectrumAnalyzerMainWindow):
QSpectrumAnalyzerMainWindow.setObjectName(_fromUtf8("QSpectrumAnalyzerMainWindow")) QSpectrumAnalyzerMainWindow.setObjectName(_fromUtf8("QSpectrumAnalyzerMainWindow"))
QSpectrumAnalyzerMainWindow.resize(1100, 731) QSpectrumAnalyzerMainWindow.resize(1080, 776)
self.centralwidget = QtGui.QWidget(QSpectrumAnalyzerMainWindow) self.centralwidget = QtGui.QWidget(QSpectrumAnalyzerMainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget")) self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget) self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget)
@ -55,7 +55,7 @@ class Ui_QSpectrumAnalyzerMainWindow(object):
self.horizontalLayout.addWidget(self.plotSplitter) self.horizontalLayout.addWidget(self.plotSplitter)
QSpectrumAnalyzerMainWindow.setCentralWidget(self.centralwidget) QSpectrumAnalyzerMainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(QSpectrumAnalyzerMainWindow) self.menubar = QtGui.QMenuBar(QSpectrumAnalyzerMainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1100, 30)) self.menubar.setGeometry(QtCore.QRect(0, 0, 1080, 30))
self.menubar.setObjectName(_fromUtf8("menubar")) self.menubar.setObjectName(_fromUtf8("menubar"))
self.menu_File = QtGui.QMenu(self.menubar) self.menu_File = QtGui.QMenu(self.menubar)
self.menu_File.setObjectName(_fromUtf8("menu_File")) self.menu_File.setObjectName(_fromUtf8("menu_File"))
@ -65,35 +65,49 @@ class Ui_QSpectrumAnalyzerMainWindow(object):
self.statusbar = QtGui.QStatusBar(QSpectrumAnalyzerMainWindow) self.statusbar = QtGui.QStatusBar(QSpectrumAnalyzerMainWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar")) self.statusbar.setObjectName(_fromUtf8("statusbar"))
QSpectrumAnalyzerMainWindow.setStatusBar(self.statusbar) QSpectrumAnalyzerMainWindow.setStatusBar(self.statusbar)
self.dockWidget = QtGui.QDockWidget(QSpectrumAnalyzerMainWindow) self.controlsDockWidget = QtGui.QDockWidget(QSpectrumAnalyzerMainWindow)
self.dockWidget.setFeatures(QtGui.QDockWidget.DockWidgetFloatable|QtGui.QDockWidget.DockWidgetMovable) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum)
self.dockWidget.setObjectName(_fromUtf8("dockWidget")) sizePolicy.setHorizontalStretch(0)
self.dockWidgetContents = QtGui.QWidget() sizePolicy.setVerticalStretch(0)
self.dockWidgetContents.setObjectName(_fromUtf8("dockWidgetContents")) sizePolicy.setHeightForWidth(self.controlsDockWidget.sizePolicy().hasHeightForWidth())
self.verticalLayout_3 = QtGui.QVBoxLayout(self.dockWidgetContents) self.controlsDockWidget.setSizePolicy(sizePolicy)
self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) self.controlsDockWidget.setMinimumSize(QtCore.QSize(190, 126))
self.groupBox_2 = QtGui.QGroupBox(self.dockWidgetContents) self.controlsDockWidget.setFeatures(QtGui.QDockWidget.DockWidgetFloatable|QtGui.QDockWidget.DockWidgetMovable)
self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) self.controlsDockWidget.setObjectName(_fromUtf8("controlsDockWidget"))
self.gridLayout = QtGui.QGridLayout(self.groupBox_2) self.controlsDockWidgetContents = QtGui.QWidget()
self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.controlsDockWidgetContents.setObjectName(_fromUtf8("controlsDockWidgetContents"))
self.startButton = QtGui.QPushButton(self.groupBox_2) self.gridLayout_2 = QtGui.QGridLayout(self.controlsDockWidgetContents)
self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
self.startButton = QtGui.QPushButton(self.controlsDockWidgetContents)
self.startButton.setObjectName(_fromUtf8("startButton")) self.startButton.setObjectName(_fromUtf8("startButton"))
self.gridLayout.addWidget(self.startButton, 0, 0, 1, 1) self.gridLayout_2.addWidget(self.startButton, 0, 0, 1, 1)
self.stopButton = QtGui.QPushButton(self.groupBox_2) self.stopButton = QtGui.QPushButton(self.controlsDockWidgetContents)
self.stopButton.setObjectName(_fromUtf8("stopButton")) self.stopButton.setObjectName(_fromUtf8("stopButton"))
self.gridLayout.addWidget(self.stopButton, 0, 1, 1, 1) self.gridLayout_2.addWidget(self.stopButton, 0, 1, 1, 1)
self.singleShotButton = QtGui.QPushButton(self.groupBox_2) self.singleShotButton = QtGui.QPushButton(self.controlsDockWidgetContents)
self.singleShotButton.setObjectName(_fromUtf8("singleShotButton")) self.singleShotButton.setObjectName(_fromUtf8("singleShotButton"))
self.gridLayout.addWidget(self.singleShotButton, 1, 0, 1, 2) self.gridLayout_2.addWidget(self.singleShotButton, 1, 0, 1, 2)
self.verticalLayout_3.addWidget(self.groupBox_2) spacerItem = QtGui.QSpacerItem(20, 561, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.groupBox = QtGui.QGroupBox(self.dockWidgetContents) self.gridLayout_2.addItem(spacerItem, 2, 0, 1, 1)
self.groupBox.setObjectName(_fromUtf8("groupBox")) self.controlsDockWidget.setWidget(self.controlsDockWidgetContents)
self.verticalLayout = QtGui.QVBoxLayout(self.groupBox) QSpectrumAnalyzerMainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.controlsDockWidget)
self.frequencyDockWidget = QtGui.QDockWidget(QSpectrumAnalyzerMainWindow)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.frequencyDockWidget.sizePolicy().hasHeightForWidth())
self.frequencyDockWidget.setSizePolicy(sizePolicy)
self.frequencyDockWidget.setMinimumSize(QtCore.QSize(156, 232))
self.frequencyDockWidget.setFeatures(QtGui.QDockWidget.DockWidgetFloatable|QtGui.QDockWidget.DockWidgetMovable)
self.frequencyDockWidget.setObjectName(_fromUtf8("frequencyDockWidget"))
self.frequencyDockWidgetContents = QtGui.QWidget()
self.frequencyDockWidgetContents.setObjectName(_fromUtf8("frequencyDockWidgetContents"))
self.verticalLayout = QtGui.QVBoxLayout(self.frequencyDockWidgetContents)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.label_2 = QtGui.QLabel(self.groupBox) self.label_2 = QtGui.QLabel(self.frequencyDockWidgetContents)
self.label_2.setObjectName(_fromUtf8("label_2")) self.label_2.setObjectName(_fromUtf8("label_2"))
self.verticalLayout.addWidget(self.label_2) self.verticalLayout.addWidget(self.label_2)
self.startFreqSpinBox = QtGui.QDoubleSpinBox(self.groupBox) self.startFreqSpinBox = QtGui.QDoubleSpinBox(self.frequencyDockWidgetContents)
self.startFreqSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.startFreqSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.startFreqSpinBox.setDecimals(3) self.startFreqSpinBox.setDecimals(3)
self.startFreqSpinBox.setMinimum(24.0) self.startFreqSpinBox.setMinimum(24.0)
@ -101,10 +115,10 @@ class Ui_QSpectrumAnalyzerMainWindow(object):
self.startFreqSpinBox.setProperty("value", 87.0) self.startFreqSpinBox.setProperty("value", 87.0)
self.startFreqSpinBox.setObjectName(_fromUtf8("startFreqSpinBox")) self.startFreqSpinBox.setObjectName(_fromUtf8("startFreqSpinBox"))
self.verticalLayout.addWidget(self.startFreqSpinBox) self.verticalLayout.addWidget(self.startFreqSpinBox)
self.label_3 = QtGui.QLabel(self.groupBox) self.label_3 = QtGui.QLabel(self.frequencyDockWidgetContents)
self.label_3.setObjectName(_fromUtf8("label_3")) self.label_3.setObjectName(_fromUtf8("label_3"))
self.verticalLayout.addWidget(self.label_3) self.verticalLayout.addWidget(self.label_3)
self.stopFreqSpinBox = QtGui.QDoubleSpinBox(self.groupBox) self.stopFreqSpinBox = QtGui.QDoubleSpinBox(self.frequencyDockWidgetContents)
self.stopFreqSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.stopFreqSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.stopFreqSpinBox.setDecimals(3) self.stopFreqSpinBox.setDecimals(3)
self.stopFreqSpinBox.setMinimum(24.0) self.stopFreqSpinBox.setMinimum(24.0)
@ -112,72 +126,103 @@ class Ui_QSpectrumAnalyzerMainWindow(object):
self.stopFreqSpinBox.setProperty("value", 108.0) self.stopFreqSpinBox.setProperty("value", 108.0)
self.stopFreqSpinBox.setObjectName(_fromUtf8("stopFreqSpinBox")) self.stopFreqSpinBox.setObjectName(_fromUtf8("stopFreqSpinBox"))
self.verticalLayout.addWidget(self.stopFreqSpinBox) self.verticalLayout.addWidget(self.stopFreqSpinBox)
self.label = QtGui.QLabel(self.groupBox) self.label = QtGui.QLabel(self.frequencyDockWidgetContents)
self.label.setObjectName(_fromUtf8("label")) self.label.setObjectName(_fromUtf8("label"))
self.verticalLayout.addWidget(self.label) self.verticalLayout.addWidget(self.label)
self.binSizeSpinBox = QtGui.QDoubleSpinBox(self.groupBox) self.binSizeSpinBox = QtGui.QDoubleSpinBox(self.frequencyDockWidgetContents)
self.binSizeSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.binSizeSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.binSizeSpinBox.setDecimals(3) self.binSizeSpinBox.setDecimals(3)
self.binSizeSpinBox.setMaximum(2800.0) self.binSizeSpinBox.setMaximum(2800.0)
self.binSizeSpinBox.setProperty("value", 10.0) self.binSizeSpinBox.setProperty("value", 10.0)
self.binSizeSpinBox.setObjectName(_fromUtf8("binSizeSpinBox")) self.binSizeSpinBox.setObjectName(_fromUtf8("binSizeSpinBox"))
self.verticalLayout.addWidget(self.binSizeSpinBox) self.verticalLayout.addWidget(self.binSizeSpinBox)
self.verticalLayout_3.addWidget(self.groupBox) spacerItem1 = QtGui.QSpacerItem(20, 0, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.groupBox_3 = QtGui.QGroupBox(self.dockWidgetContents) self.verticalLayout.addItem(spacerItem1)
self.groupBox_3.setObjectName(_fromUtf8("groupBox_3")) self.frequencyDockWidget.setWidget(self.frequencyDockWidgetContents)
self.gridLayout_2 = QtGui.QGridLayout(self.groupBox_3) QSpectrumAnalyzerMainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.frequencyDockWidget)
self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) self.settingsDockWidget = QtGui.QDockWidget(QSpectrumAnalyzerMainWindow)
self.label_4 = QtGui.QLabel(self.groupBox_3) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
self.label_4.setObjectName(_fromUtf8("label_4")) sizePolicy.setHorizontalStretch(0)
self.gridLayout_2.addWidget(self.label_4, 0, 0, 1, 1) sizePolicy.setVerticalStretch(0)
self.label_6 = QtGui.QLabel(self.groupBox_3) sizePolicy.setHeightForWidth(self.settingsDockWidget.sizePolicy().hasHeightForWidth())
self.label_6.setObjectName(_fromUtf8("label_6")) self.settingsDockWidget.setSizePolicy(sizePolicy)
self.gridLayout_2.addWidget(self.label_6, 0, 1, 1, 1) self.settingsDockWidget.setFeatures(QtGui.QDockWidget.DockWidgetFloatable|QtGui.QDockWidget.DockWidgetMovable)
self.gainSpinBox = QtGui.QSpinBox(self.groupBox_3) self.settingsDockWidget.setObjectName(_fromUtf8("settingsDockWidget"))
self.settingsDockWidgetContents = QtGui.QWidget()
self.settingsDockWidgetContents.setObjectName(_fromUtf8("settingsDockWidgetContents"))
self.gridLayout = QtGui.QGridLayout(self.settingsDockWidgetContents)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.smoothCheckBox = QtGui.QCheckBox(self.settingsDockWidgetContents)
self.smoothCheckBox.setObjectName(_fromUtf8("smoothCheckBox"))
self.gridLayout.addWidget(self.smoothCheckBox, 5, 0, 1, 2)
self.label_5 = QtGui.QLabel(self.settingsDockWidgetContents)
self.label_5.setObjectName(_fromUtf8("label_5"))
self.gridLayout.addWidget(self.label_5, 2, 0, 1, 1)
self.peakHoldCheckBox = QtGui.QCheckBox(self.settingsDockWidgetContents)
self.peakHoldCheckBox.setObjectName(_fromUtf8("peakHoldCheckBox"))
self.gridLayout.addWidget(self.peakHoldCheckBox, 4, 0, 1, 3)
spacerItem2 = QtGui.QSpacerItem(20, 1, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.gridLayout.addItem(spacerItem2, 6, 0, 1, 1)
self.intervalSpinBox = QtGui.QDoubleSpinBox(self.settingsDockWidgetContents)
self.intervalSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.intervalSpinBox.setMaximum(999.0)
self.intervalSpinBox.setProperty("value", 1.0)
self.intervalSpinBox.setObjectName(_fromUtf8("intervalSpinBox"))
self.gridLayout.addWidget(self.intervalSpinBox, 1, 0, 1, 1)
self.smoothButton = QtGui.QToolButton(self.settingsDockWidgetContents)
self.smoothButton.setAutoRaise(False)
self.smoothButton.setObjectName(_fromUtf8("smoothButton"))
self.gridLayout.addWidget(self.smoothButton, 5, 2, 1, 1)
self.gainSpinBox = QtGui.QSpinBox(self.settingsDockWidgetContents)
self.gainSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.gainSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.gainSpinBox.setMinimum(-1) self.gainSpinBox.setMinimum(-1)
self.gainSpinBox.setMaximum(49) self.gainSpinBox.setMaximum(49)
self.gainSpinBox.setProperty("value", -1) self.gainSpinBox.setProperty("value", -1)
self.gainSpinBox.setObjectName(_fromUtf8("gainSpinBox")) self.gainSpinBox.setObjectName(_fromUtf8("gainSpinBox"))
self.gridLayout_2.addWidget(self.gainSpinBox, 1, 1, 1, 1) self.gridLayout.addWidget(self.gainSpinBox, 1, 1, 1, 2)
self.label_5 = QtGui.QLabel(self.groupBox_3) self.label_7 = QtGui.QLabel(self.settingsDockWidgetContents)
self.label_5.setObjectName(_fromUtf8("label_5"))
self.gridLayout_2.addWidget(self.label_5, 2, 0, 1, 1)
self.label_7 = QtGui.QLabel(self.groupBox_3)
self.label_7.setObjectName(_fromUtf8("label_7")) self.label_7.setObjectName(_fromUtf8("label_7"))
self.gridLayout_2.addWidget(self.label_7, 2, 1, 1, 1) self.gridLayout.addWidget(self.label_7, 2, 1, 1, 2)
self.ppmSpinBox = QtGui.QSpinBox(self.groupBox_3) self.ppmSpinBox = QtGui.QSpinBox(self.settingsDockWidgetContents)
self.ppmSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.ppmSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.ppmSpinBox.setMinimum(-999) self.ppmSpinBox.setMinimum(-999)
self.ppmSpinBox.setMaximum(999) self.ppmSpinBox.setMaximum(999)
self.ppmSpinBox.setObjectName(_fromUtf8("ppmSpinBox")) self.ppmSpinBox.setObjectName(_fromUtf8("ppmSpinBox"))
self.gridLayout_2.addWidget(self.ppmSpinBox, 3, 0, 1, 1) self.gridLayout.addWidget(self.ppmSpinBox, 3, 0, 1, 1)
self.cropSpinBox = QtGui.QSpinBox(self.groupBox_3) self.label_6 = QtGui.QLabel(self.settingsDockWidgetContents)
self.label_6.setObjectName(_fromUtf8("label_6"))
self.gridLayout.addWidget(self.label_6, 0, 1, 1, 2)
self.cropSpinBox = QtGui.QSpinBox(self.settingsDockWidgetContents)
self.cropSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.cropSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.cropSpinBox.setObjectName(_fromUtf8("cropSpinBox")) self.cropSpinBox.setObjectName(_fromUtf8("cropSpinBox"))
self.gridLayout_2.addWidget(self.cropSpinBox, 3, 1, 1, 1) self.gridLayout.addWidget(self.cropSpinBox, 3, 1, 1, 2)
self.intervalSpinBox = QtGui.QDoubleSpinBox(self.groupBox_3) self.label_4 = QtGui.QLabel(self.settingsDockWidgetContents)
self.intervalSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.label_4.setObjectName(_fromUtf8("label_4"))
self.intervalSpinBox.setMaximum(999.0) self.gridLayout.addWidget(self.label_4, 0, 0, 1, 1)
self.intervalSpinBox.setProperty("value", 1.0) self.settingsDockWidget.setWidget(self.settingsDockWidgetContents)
self.intervalSpinBox.setObjectName(_fromUtf8("intervalSpinBox")) QSpectrumAnalyzerMainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.settingsDockWidget)
self.gridLayout_2.addWidget(self.intervalSpinBox, 1, 0, 1, 1) self.levelsDockWidget = QtGui.QDockWidget(QSpectrumAnalyzerMainWindow)
self.verticalLayout_3.addWidget(self.groupBox_3) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
self.groupBox_4 = QtGui.QGroupBox(self.dockWidgetContents) sizePolicy.setHorizontalStretch(0)
self.groupBox_4.setObjectName(_fromUtf8("groupBox_4")) sizePolicy.setVerticalStretch(0)
self.verticalLayout_2 = QtGui.QVBoxLayout(self.groupBox_4) sizePolicy.setHeightForWidth(self.levelsDockWidget.sizePolicy().hasHeightForWidth())
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) self.levelsDockWidget.setSizePolicy(sizePolicy)
self.histogramPlotLayout = GraphicsLayoutWidget(self.groupBox_4) self.levelsDockWidget.setFeatures(QtGui.QDockWidget.DockWidgetFloatable|QtGui.QDockWidget.DockWidgetMovable)
self.levelsDockWidget.setObjectName(_fromUtf8("levelsDockWidget"))
self.levelsDockWidgetContents = QtGui.QWidget()
self.levelsDockWidgetContents.setObjectName(_fromUtf8("levelsDockWidgetContents"))
self.verticalLayout_6 = QtGui.QVBoxLayout(self.levelsDockWidgetContents)
self.verticalLayout_6.setObjectName(_fromUtf8("verticalLayout_6"))
self.histogramPlotLayout = GraphicsLayoutWidget(self.levelsDockWidgetContents)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Expanding) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.histogramPlotLayout.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.histogramPlotLayout.sizePolicy().hasHeightForWidth())
self.histogramPlotLayout.setSizePolicy(sizePolicy) self.histogramPlotLayout.setSizePolicy(sizePolicy)
self.histogramPlotLayout.setObjectName(_fromUtf8("histogramPlotLayout")) self.histogramPlotLayout.setObjectName(_fromUtf8("histogramPlotLayout"))
self.verticalLayout_2.addWidget(self.histogramPlotLayout) self.verticalLayout_6.addWidget(self.histogramPlotLayout)
self.verticalLayout_3.addWidget(self.groupBox_4) self.levelsDockWidget.setWidget(self.levelsDockWidgetContents)
self.dockWidget.setWidget(self.dockWidgetContents) QSpectrumAnalyzerMainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.levelsDockWidget)
QSpectrumAnalyzerMainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.dockWidget)
self.action_Settings = QtGui.QAction(QSpectrumAnalyzerMainWindow) self.action_Settings = QtGui.QAction(QSpectrumAnalyzerMainWindow)
self.action_Settings.setObjectName(_fromUtf8("action_Settings")) self.action_Settings.setObjectName(_fromUtf8("action_Settings"))
self.action_Quit = QtGui.QAction(QSpectrumAnalyzerMainWindow) self.action_Quit = QtGui.QAction(QSpectrumAnalyzerMainWindow)
@ -193,10 +238,10 @@ class Ui_QSpectrumAnalyzerMainWindow(object):
self.label_2.setBuddy(self.startFreqSpinBox) self.label_2.setBuddy(self.startFreqSpinBox)
self.label_3.setBuddy(self.stopFreqSpinBox) self.label_3.setBuddy(self.stopFreqSpinBox)
self.label.setBuddy(self.binSizeSpinBox) self.label.setBuddy(self.binSizeSpinBox)
self.label_4.setBuddy(self.intervalSpinBox)
self.label_6.setBuddy(self.gainSpinBox)
self.label_5.setBuddy(self.ppmSpinBox) self.label_5.setBuddy(self.ppmSpinBox)
self.label_7.setBuddy(self.cropSpinBox) self.label_7.setBuddy(self.cropSpinBox)
self.label_6.setBuddy(self.gainSpinBox)
self.label_4.setBuddy(self.intervalSpinBox)
self.retranslateUi(QSpectrumAnalyzerMainWindow) self.retranslateUi(QSpectrumAnalyzerMainWindow)
QtCore.QMetaObject.connectSlotsByName(QSpectrumAnalyzerMainWindow) QtCore.QMetaObject.connectSlotsByName(QSpectrumAnalyzerMainWindow)
@ -209,7 +254,10 @@ class Ui_QSpectrumAnalyzerMainWindow(object):
QSpectrumAnalyzerMainWindow.setTabOrder(self.intervalSpinBox, self.gainSpinBox) QSpectrumAnalyzerMainWindow.setTabOrder(self.intervalSpinBox, self.gainSpinBox)
QSpectrumAnalyzerMainWindow.setTabOrder(self.gainSpinBox, self.ppmSpinBox) QSpectrumAnalyzerMainWindow.setTabOrder(self.gainSpinBox, self.ppmSpinBox)
QSpectrumAnalyzerMainWindow.setTabOrder(self.ppmSpinBox, self.cropSpinBox) QSpectrumAnalyzerMainWindow.setTabOrder(self.ppmSpinBox, self.cropSpinBox)
QSpectrumAnalyzerMainWindow.setTabOrder(self.cropSpinBox, self.histogramPlotLayout) QSpectrumAnalyzerMainWindow.setTabOrder(self.cropSpinBox, self.peakHoldCheckBox)
QSpectrumAnalyzerMainWindow.setTabOrder(self.peakHoldCheckBox, self.smoothCheckBox)
QSpectrumAnalyzerMainWindow.setTabOrder(self.smoothCheckBox, self.smoothButton)
QSpectrumAnalyzerMainWindow.setTabOrder(self.smoothButton, self.histogramPlotLayout)
QSpectrumAnalyzerMainWindow.setTabOrder(self.histogramPlotLayout, self.mainPlotLayout) QSpectrumAnalyzerMainWindow.setTabOrder(self.histogramPlotLayout, self.mainPlotLayout)
QSpectrumAnalyzerMainWindow.setTabOrder(self.mainPlotLayout, self.waterfallPlotLayout) QSpectrumAnalyzerMainWindow.setTabOrder(self.mainPlotLayout, self.waterfallPlotLayout)
@ -217,24 +265,27 @@ class Ui_QSpectrumAnalyzerMainWindow(object):
QSpectrumAnalyzerMainWindow.setWindowTitle(_translate("QSpectrumAnalyzerMainWindow", "QSpectrumAnalyzer", None)) QSpectrumAnalyzerMainWindow.setWindowTitle(_translate("QSpectrumAnalyzerMainWindow", "QSpectrumAnalyzer", None))
self.menu_File.setTitle(_translate("QSpectrumAnalyzerMainWindow", "&File", None)) self.menu_File.setTitle(_translate("QSpectrumAnalyzerMainWindow", "&File", None))
self.menu_Help.setTitle(_translate("QSpectrumAnalyzerMainWindow", "&Help", None)) self.menu_Help.setTitle(_translate("QSpectrumAnalyzerMainWindow", "&Help", None))
self.groupBox_2.setTitle(_translate("QSpectrumAnalyzerMainWindow", "Controls", None)) self.controlsDockWidget.setWindowTitle(_translate("QSpectrumAnalyzerMainWindow", "Controls", None))
self.startButton.setText(_translate("QSpectrumAnalyzerMainWindow", "&Start", None)) self.startButton.setText(_translate("QSpectrumAnalyzerMainWindow", "&Start", None))
self.stopButton.setText(_translate("QSpectrumAnalyzerMainWindow", "S&top", None)) self.stopButton.setText(_translate("QSpectrumAnalyzerMainWindow", "S&top", None))
self.singleShotButton.setText(_translate("QSpectrumAnalyzerMainWindow", "Si&ngle shot", None)) self.singleShotButton.setText(_translate("QSpectrumAnalyzerMainWindow", "Si&ngle shot", None))
self.groupBox.setTitle(_translate("QSpectrumAnalyzerMainWindow", "Frequency", None)) self.frequencyDockWidget.setWindowTitle(_translate("QSpectrumAnalyzerMainWindow", "Frequency", None))
self.label_2.setText(_translate("QSpectrumAnalyzerMainWindow", "Start:", None)) self.label_2.setText(_translate("QSpectrumAnalyzerMainWindow", "Start:", None))
self.startFreqSpinBox.setSuffix(_translate("QSpectrumAnalyzerMainWindow", " MHz", None)) self.startFreqSpinBox.setSuffix(_translate("QSpectrumAnalyzerMainWindow", " MHz", None))
self.label_3.setText(_translate("QSpectrumAnalyzerMainWindow", "Stop:", None)) self.label_3.setText(_translate("QSpectrumAnalyzerMainWindow", "Stop:", None))
self.stopFreqSpinBox.setSuffix(_translate("QSpectrumAnalyzerMainWindow", " MHz", None)) self.stopFreqSpinBox.setSuffix(_translate("QSpectrumAnalyzerMainWindow", " MHz", None))
self.label.setText(_translate("QSpectrumAnalyzerMainWindow", "Bin size:", None)) self.label.setText(_translate("QSpectrumAnalyzerMainWindow", "Bin size:", None))
self.binSizeSpinBox.setSuffix(_translate("QSpectrumAnalyzerMainWindow", " kHz", None)) self.binSizeSpinBox.setSuffix(_translate("QSpectrumAnalyzerMainWindow", " kHz", None))
self.groupBox_3.setTitle(_translate("QSpectrumAnalyzerMainWindow", "Settings", None)) self.settingsDockWidget.setWindowTitle(_translate("QSpectrumAnalyzerMainWindow", "Settings", None))
self.label_4.setText(_translate("QSpectrumAnalyzerMainWindow", "Interval [s]:", None)) self.smoothCheckBox.setText(_translate("QSpectrumAnalyzerMainWindow", "Smoothing", None))
self.label_6.setText(_translate("QSpectrumAnalyzerMainWindow", "Gain [dB]:", None))
self.gainSpinBox.setSpecialValueText(_translate("QSpectrumAnalyzerMainWindow", "auto", None))
self.label_5.setText(_translate("QSpectrumAnalyzerMainWindow", "Corr. [ppm]:", None)) self.label_5.setText(_translate("QSpectrumAnalyzerMainWindow", "Corr. [ppm]:", None))
self.peakHoldCheckBox.setText(_translate("QSpectrumAnalyzerMainWindow", "Peak hold", None))
self.smoothButton.setText(_translate("QSpectrumAnalyzerMainWindow", "...", None))
self.gainSpinBox.setSpecialValueText(_translate("QSpectrumAnalyzerMainWindow", "auto", None))
self.label_7.setText(_translate("QSpectrumAnalyzerMainWindow", "Crop [%]:", None)) self.label_7.setText(_translate("QSpectrumAnalyzerMainWindow", "Crop [%]:", None))
self.groupBox_4.setTitle(_translate("QSpectrumAnalyzerMainWindow", "Levels", None)) self.label_6.setText(_translate("QSpectrumAnalyzerMainWindow", "Gain [dB]:", None))
self.label_4.setText(_translate("QSpectrumAnalyzerMainWindow", "Interval [s]:", None))
self.levelsDockWidget.setWindowTitle(_translate("QSpectrumAnalyzerMainWindow", "Levels", None))
self.action_Settings.setText(_translate("QSpectrumAnalyzerMainWindow", "&Settings...", None)) self.action_Settings.setText(_translate("QSpectrumAnalyzerMainWindow", "&Settings...", None))
self.action_Quit.setText(_translate("QSpectrumAnalyzerMainWindow", "&Quit", None)) self.action_Quit.setText(_translate("QSpectrumAnalyzerMainWindow", "&Quit", None))
self.action_Quit.setShortcut(_translate("QSpectrumAnalyzerMainWindow", "Ctrl+Q", None)) self.action_Quit.setShortcut(_translate("QSpectrumAnalyzerMainWindow", "Ctrl+Q", None))

View File

@ -25,7 +25,7 @@ except AttributeError:
class Ui_QSpectrumAnalyzerSettings(object): class Ui_QSpectrumAnalyzerSettings(object):
def setupUi(self, QSpectrumAnalyzerSettings): def setupUi(self, QSpectrumAnalyzerSettings):
QSpectrumAnalyzerSettings.setObjectName(_fromUtf8("QSpectrumAnalyzerSettings")) QSpectrumAnalyzerSettings.setObjectName(_fromUtf8("QSpectrumAnalyzerSettings"))
QSpectrumAnalyzerSettings.resize(350, 210) QSpectrumAnalyzerSettings.resize(400, 210)
self.verticalLayout = QtGui.QVBoxLayout(QSpectrumAnalyzerSettings) self.verticalLayout = QtGui.QVBoxLayout(QSpectrumAnalyzerSettings)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.formLayout = QtGui.QFormLayout() self.formLayout = QtGui.QFormLayout()
@ -77,23 +77,28 @@ class Ui_QSpectrumAnalyzerSettings(object):
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.verticalLayout.addWidget(self.buttonBox) self.verticalLayout.addWidget(self.buttonBox)
self.label_3.setBuddy(self.backendComboBox)
self.label.setBuddy(self.executableEdit)
self.label_2.setBuddy(self.waterfallHistorySizeSpinBox)
self.label_4.setBuddy(self.sampleRateSpinBox)
self.retranslateUi(QSpectrumAnalyzerSettings) self.retranslateUi(QSpectrumAnalyzerSettings)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), QSpectrumAnalyzerSettings.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), QSpectrumAnalyzerSettings.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), QSpectrumAnalyzerSettings.reject) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), QSpectrumAnalyzerSettings.reject)
QtCore.QMetaObject.connectSlotsByName(QSpectrumAnalyzerSettings) QtCore.QMetaObject.connectSlotsByName(QSpectrumAnalyzerSettings)
QSpectrumAnalyzerSettings.setTabOrder(self.backendComboBox, self.executableEdit)
QSpectrumAnalyzerSettings.setTabOrder(self.executableEdit, self.executableButton) QSpectrumAnalyzerSettings.setTabOrder(self.executableEdit, self.executableButton)
QSpectrumAnalyzerSettings.setTabOrder(self.executableButton, self.waterfallHistorySizeSpinBox) QSpectrumAnalyzerSettings.setTabOrder(self.executableButton, self.waterfallHistorySizeSpinBox)
QSpectrumAnalyzerSettings.setTabOrder(self.waterfallHistorySizeSpinBox, self.buttonBox) QSpectrumAnalyzerSettings.setTabOrder(self.waterfallHistorySizeSpinBox, self.sampleRateSpinBox)
def retranslateUi(self, QSpectrumAnalyzerSettings): def retranslateUi(self, QSpectrumAnalyzerSettings):
QSpectrumAnalyzerSettings.setWindowTitle(_translate("QSpectrumAnalyzerSettings", "QSpectrumAnalyzer - Settings", None)) QSpectrumAnalyzerSettings.setWindowTitle(_translate("QSpectrumAnalyzerSettings", "Settings - QSpectrumAnalyzer", None))
self.label_3.setText(_translate("QSpectrumAnalyzerSettings", "Backend:", None)) self.label_3.setText(_translate("QSpectrumAnalyzerSettings", "&Backend:", None))
self.backendComboBox.setItemText(0, _translate("QSpectrumAnalyzerSettings", "rtl_power", None)) self.backendComboBox.setItemText(0, _translate("QSpectrumAnalyzerSettings", "rtl_power", None))
self.backendComboBox.setItemText(1, _translate("QSpectrumAnalyzerSettings", "rtl_power_fftw", None)) self.backendComboBox.setItemText(1, _translate("QSpectrumAnalyzerSettings", "rtl_power_fftw", None))
self.label.setText(_translate("QSpectrumAnalyzerSettings", "Executable:", None)) self.label.setText(_translate("QSpectrumAnalyzerSettings", "E&xecutable:", None))
self.executableEdit.setText(_translate("QSpectrumAnalyzerSettings", "rtl_power", None)) self.executableEdit.setText(_translate("QSpectrumAnalyzerSettings", "rtl_power", None))
self.executableButton.setText(_translate("QSpectrumAnalyzerSettings", "...", None)) self.executableButton.setText(_translate("QSpectrumAnalyzerSettings", "...", None))
self.label_2.setText(_translate("QSpectrumAnalyzerSettings", "Waterfall history size:", None)) self.label_2.setText(_translate("QSpectrumAnalyzerSettings", "&Waterfall history size:", None))
self.label_4.setText(_translate("QSpectrumAnalyzerSettings", "Sample rate:", None)) self.label_4.setText(_translate("QSpectrumAnalyzerSettings", "Sa&mple rate:", None))

View File

@ -0,0 +1,79 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'qspectrumanalyzer/qspectrumanalyzer_smooth.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_QSpectrumAnalyzerSmooth(object):
def setupUi(self, QSpectrumAnalyzerSmooth):
QSpectrumAnalyzerSmooth.setObjectName(_fromUtf8("QSpectrumAnalyzerSmooth"))
QSpectrumAnalyzerSmooth.resize(250, 130)
self.verticalLayout = QtGui.QVBoxLayout(QSpectrumAnalyzerSmooth)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.formLayout = QtGui.QFormLayout()
self.formLayout.setObjectName(_fromUtf8("formLayout"))
self.label = QtGui.QLabel(QSpectrumAnalyzerSmooth)
self.label.setObjectName(_fromUtf8("label"))
self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label)
self.windowFunctionComboBox = QtGui.QComboBox(QSpectrumAnalyzerSmooth)
self.windowFunctionComboBox.setObjectName(_fromUtf8("windowFunctionComboBox"))
self.windowFunctionComboBox.addItem(_fromUtf8(""))
self.windowFunctionComboBox.addItem(_fromUtf8(""))
self.windowFunctionComboBox.addItem(_fromUtf8(""))
self.windowFunctionComboBox.addItem(_fromUtf8(""))
self.windowFunctionComboBox.addItem(_fromUtf8(""))
self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.windowFunctionComboBox)
self.label_2 = QtGui.QLabel(QSpectrumAnalyzerSmooth)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_2)
self.windowLengthSpinBox = QtGui.QSpinBox(QSpectrumAnalyzerSmooth)
self.windowLengthSpinBox.setMinimum(3)
self.windowLengthSpinBox.setMaximum(1001)
self.windowLengthSpinBox.setProperty("value", 11)
self.windowLengthSpinBox.setObjectName(_fromUtf8("windowLengthSpinBox"))
self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.windowLengthSpinBox)
self.verticalLayout.addLayout(self.formLayout)
spacerItem = QtGui.QSpacerItem(20, 1, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.buttonBox = QtGui.QDialogButtonBox(QSpectrumAnalyzerSmooth)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.verticalLayout.addWidget(self.buttonBox)
self.label.setBuddy(self.windowFunctionComboBox)
self.label_2.setBuddy(self.windowLengthSpinBox)
self.retranslateUi(QSpectrumAnalyzerSmooth)
self.windowFunctionComboBox.setCurrentIndex(0)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), QSpectrumAnalyzerSmooth.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), QSpectrumAnalyzerSmooth.reject)
QtCore.QMetaObject.connectSlotsByName(QSpectrumAnalyzerSmooth)
def retranslateUi(self, QSpectrumAnalyzerSmooth):
QSpectrumAnalyzerSmooth.setWindowTitle(_translate("QSpectrumAnalyzerSmooth", "Smoothing - QSpectrumAnalyzer", None))
self.label.setText(_translate("QSpectrumAnalyzerSmooth", "&Window function:", None))
self.windowFunctionComboBox.setItemText(0, _translate("QSpectrumAnalyzerSmooth", "rectangular", None))
self.windowFunctionComboBox.setItemText(1, _translate("QSpectrumAnalyzerSmooth", "hanning", None))
self.windowFunctionComboBox.setItemText(2, _translate("QSpectrumAnalyzerSmooth", "hamming", None))
self.windowFunctionComboBox.setItemText(3, _translate("QSpectrumAnalyzerSmooth", "bartlett", None))
self.windowFunctionComboBox.setItemText(4, _translate("QSpectrumAnalyzerSmooth", "blackman", None))
self.label_2.setText(_translate("QSpectrumAnalyzerSmooth", "Window len&gth:", None))