From 29b9d15f388606843a7f0bb9cbf03f4b2a307138 Mon Sep 17 00:00:00 2001 From: vixadd Date: Tue, 24 Sep 2024 16:32:49 -0400 Subject: [PATCH 1/2] This commit fixes the waterfall error being given. --- qspectrumanalyzer/plot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qspectrumanalyzer/plot.py b/qspectrumanalyzer/plot.py index 3473bb3..ede48e9 100644 --- a/qspectrumanalyzer/plot.py +++ b/qspectrumanalyzer/plot.py @@ -1,6 +1,7 @@ import collections, math -from Qt import QtCore +from Qt import QtCore, QtGui + import pyqtgraph as pg # Basic PyQtGraph settings @@ -310,8 +311,11 @@ class WaterfallPlotWidget: # Create waterfall image on first run if self.counter == 1: + tr = QtGui.QTransform() + tr.scale((data_storage.x[-1] - data_storage.x[0]) / len(data_storage.x), 1) + self.waterfallImg = pg.ImageItem() - self.waterfallImg.scale((data_storage.x[-1] - data_storage.x[0]) / len(data_storage.x), 1) + self.waterfallImg.setTransform(tr) self.plot.clear() self.plot.addItem(self.waterfallImg) From 6b3aac483391fda68f4145920fbef7423821d794 Mon Sep 17 00:00:00 2001 From: vixadd Date: Tue, 24 Sep 2024 17:10:27 -0400 Subject: [PATCH 2/2] Fixing float type mismatch --- qspectrumanalyzer/__main__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qspectrumanalyzer/__main__.py b/qspectrumanalyzer/__main__.py index 2a87922..1902d73 100644 --- a/qspectrumanalyzer/__main__.py +++ b/qspectrumanalyzer/__main__.py @@ -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)