Skip to content

Commit

Permalink
Add a detection threshold slider
Browse files Browse the repository at this point in the history
  • Loading branch information
argilo committed Jan 28, 2024
1 parent b49ddc5 commit 106111d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
15 changes: 12 additions & 3 deletions secplus_rx.grc
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,24 @@ blocks:
rotation: 0
state: enabled
- name: threshold
id: variable
id: variable_qtgui_range
parameters:
comment: ''
value: '0.05'
gui_hint: ''
label: Detection threshold
min_len: '200'
orient: QtCore.Qt.Horizontal
rangeType: float
start: '0.01'
step: '0.01'
stop: '1.00'
value: '0.10'
widget: counter_slider
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [8, 332]
coordinate: [8, 332.0]
rotation: 0
state: enabled
- name: blocks_complex_to_mag_0
Expand Down
6 changes: 5 additions & 1 deletion secplus_rx.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from PyQt5 import Qt
from gnuradio import qtgui
from PyQt5 import QtCore
from PyQt5.QtCore import QObject, pyqtSlot
from gnuradio import blocks
from gnuradio import filter
Expand Down Expand Up @@ -66,7 +67,7 @@ def __init__(self):
##################################################
# Variables
##################################################
self.threshold = threshold = 0.05
self.threshold = threshold = 0.10
self.samp_rate = samp_rate = 2000000
self.freq = freq = 315150000
self.decim2 = decim2 = 50
Expand All @@ -76,6 +77,9 @@ def __init__(self):
# Blocks
##################################################

self._threshold_range = qtgui.Range(0.01, 1.00, 0.01, 0.10, 200)
self._threshold_win = qtgui.RangeWidget(self._threshold_range, self.set_threshold, "Detection threshold", "counter_slider", float, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._threshold_win)
# Create the options list
self._freq_options = [310150000, 315150000, 390150000]
# Create the labels list
Expand Down

0 comments on commit 106111d

Please sign in to comment.