This commit is contained in:
oe2lsp 2024-10-05 15:34:56 +02:00 committed by GitHub
commit b2235523e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 34 additions and 8 deletions

0
.gitignore vendored Normal file → Executable file
View File

View File

@ -182,3 +182,19 @@ Todo:
- display average noise level
- frequency markers / bookmarks with notes (even importing and exporting .csv file with
predefined channels, etc.)
Debugg:
-----
python3
import qspectrumanalyzer.__main__
qspectrumanalyzer.__main__.main()
Changelog:
-----
- rtl_power compatibility
- status bar back working
- fix waterfall

View File

@ -275,9 +275,9 @@ class QSpectrumAnalyzerMainWindow(QtWidgets.QMainWindow, Ui_QSpectrumAnalyzerMai
elif value > value_max:
value = value_max
else:
self.progressbar.setRange(0, value_max)
self.progressbar.setRange(0, int(value_max))
self.progressbar.setValue(value)
self.progressbar.setValue(int(value))
def on_power_thread_started(self):
"""Update buttons state when power thread is started"""
@ -300,7 +300,7 @@ class QSpectrumAnalyzerMainWindow(QtWidgets.QMainWindow, Ui_QSpectrumAnalyzerMai
self.start_timestamp = self.prev_data_timestamp
if self.intervalSpinBox.value() >= 1:
self.progressbar.setRange(0, self.intervalSpinBox.value() * 1000)
self.progressbar.setRange(0, int(self.intervalSpinBox.value()) * 1000)
else:
self.progressbar.setRange(0, 0)
self.update_progress(0)

View File

@ -50,9 +50,11 @@ class PowerThread(BasePowerThread):
"-p", "{}".format(self.params["ppm"]),
"-c", "{}".format(self.params["crop"])
])
if self.params["sample_rate"] > 0:
cmdline.extend(["-r", "{}M".format(self.params["sample_rate"] / 1e6)])
#not supported any more
#if self.params["sample_rate"] > 0:
# cmdline.extend(["-r", "{}M".format(self.params["sample_rate"] / 1e6)])
if self.params["gain"] >= 0:
cmdline.extend(["-g", "{}".format(self.params["gain"])])
if self.params["single_shot"]:

View File

@ -1,6 +1,8 @@
import collections, math
from Qt import QtCore
from Qt import QtGui
import pyqtgraph as pg
# Basic PyQtGraph settings
@ -310,8 +312,14 @@ class WaterfallPlotWidget:
# Create waterfall image on first run
if self.counter == 1:
self.waterfallImg = pg.ImageItem()
self.waterfallImg.scale((data_storage.x[-1] - data_storage.x[0]) / len(data_storage.x), 1)
self.waterfallImg = pg.ImageItem( levels=((data_storage.x[-1] - data_storage.x[0]) / len(data_storage.x), 1))
#self.waterfallImg.scale((data_storage.x[-1] - data_storage.x[0]) / len(data_storage.x), 1)
#self.waterfallImg.scale(float((data_storage.x[-1] - data_storage.x[0]) / len(data_storage.x)), float(1))
#self.waterfallImg.scale(5126)
tr = QtGui.QTransform() # prepare ImageItem transformation:
tr.scale((data_storage.x[-1] - data_storage.x[0]) / len(data_storage.x), 1) # scale horizontal and vertical axes
self.waterfallImg.setTransform(tr)
self.plot.clear()
self.plot.addItem(self.waterfallImg)

0
setup.py Executable file → Normal file
View File