Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make qspectrumanalyzer usable again, as the souroundings changed #115

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .gitignore
100644 → 100755
Empty file.
16 changes: 16 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions qspectrumanalyzer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ def update_progress(self, value):
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"""
Expand All @@ -300,7 +300,7 @@ def start(self, single_shot=False):
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)
Expand Down
8 changes: 5 additions & 3 deletions qspectrumanalyzer/backends/rtl_power.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ def process_start(self):
"-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"]:
Expand Down
12 changes: 10 additions & 2 deletions qspectrumanalyzer/plot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import collections, math

from Qt import QtCore
from Qt import QtGui

import pyqtgraph as pg

# Basic PyQtGraph settings
Expand Down Expand Up @@ -310,8 +312,14 @@ def update_plot(self, data_storage):

# 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)

Expand Down
Empty file modified setup.py
100755 → 100644
Empty file.