Skip to content

Commit

Permalink
GUI controls for setting squelch level. Closes #7.
Browse files Browse the repository at this point in the history
  • Loading branch information
csete committed Jul 16, 2011
1 parent b09c204 commit fb52789
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 2 deletions.
10 changes: 10 additions & 0 deletions mainwindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(uiDockRxOpt, SIGNAL(fmEmphSelected(double)), this, SLOT(setFmEmph(double)));
connect(uiDockRxOpt, SIGNAL(sidebandSelected(int)), this, SLOT(setSideBand(int)));
connect(uiDockRxOpt, SIGNAL(audioGainChanged(int)), this, SLOT(setAudioGain(int)));
connect(uiDockRxOpt, SIGNAL(sqlLevelChanged(double)), this, SLOT(setSqlLevel(double)));
}

MainWindow::~MainWindow()
Expand Down Expand Up @@ -338,6 +339,15 @@ void MainWindow::setAudioGain(int value)
}


/*! \brief Squelch level changed.
* \param level_db The new squelch level in dBFS.
*/
void MainWindow::setSqlLevel(double level_db)
{
rx->set_sql_level(level_db);
}


/*! \brief Signal strength meter timeout */
void MainWindow::meterTimeout()
{
Expand Down
1 change: 1 addition & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ private slots:
void setAmDcrStatus(bool enabled);
void setSideBand(int sideband);
void setAudioGain(int gain);
void setSqlLevel(double level_db);

void on_rxStartStopButton_toggled(bool checked); /*! RX start/stop button toggled. */
void on_plotter_NewDemodFreq(qint64 freq, qint64 delta); /*! New demod freq (aka. filter offset). */
Expand Down
12 changes: 12 additions & 0 deletions qtgui/dockrxopt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,15 @@ void DockRxOpt::on_audioGainSlider_valueChanged(int value)
ui->audioGainDbLabel->setText(QString("%1 dB").arg(value/10));
emit audioGainChanged(value);
}


/*! \brief Squelch level change.
* \param value The new squelch level in tens of dB (because slider uses int).
*/
void DockRxOpt::on_sqlSlider_valueChanged(int value)
{
double level = double(value) / 10.0;

ui->sqlValueLabel->setText(QString("%1 dB").arg(level));
emit sqlLevelChanged(level);
}
5 changes: 5 additions & 0 deletions qtgui/dockrxopt.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,18 @@ class DockRxOpt : public QDockWidget
/*! \brief Signal emitted when audio gain has changed. */
void audioGainChanged(int gain);

/*! \brief Signal emitted when squelch level has changed. Level is in dBFS. */
void sqlLevelChanged(double level);


private slots:
void on_modeSelector_activated(int index);
void on_maxdevSelector_activated(int index);
void on_emphSelector_activated(int index);
void on_dcr_toggled(bool checked);
void on_sidebandSelector_activated(int index);
void on_audioGainSlider_valueChanged(int value);
void on_sqlSlider_valueChanged(int value);

private:
Ui::DockRxOpt *ui; /*! The Qt designer UI file. */
Expand Down
77 changes: 75 additions & 2 deletions qtgui/dockrxopt.ui
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>98</width>
<height>28</height>
<width>197</width>
<height>202</height>
</rect>
</property>
<property name="toolTip">
Expand All @@ -364,6 +364,79 @@
<attribute name="label">
<string>AGC / SQL</string>
</attribute>
<widget class="Line" name="line_2">
<property name="geometry">
<rect>
<x>0</x>
<y>40</y>
<width>191</width>
<height>16</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>191</width>
<height>44</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="sqlLabel">
<property name="text">
<string>Squelch</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="sqlValueLabel">
<property name="text">
<string>-100.0 dB</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QSlider" name="sqlSlider">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Squelch level in dBFS</string>
</property>
<property name="minimum">
<number>-1000</number>
</property>
<property name="maximum">
<number>0</number>
</property>
<property name="pageStep">
<number>100</number>
</property>
<property name="value">
<number>-1000</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="pageAudio">
<property name="geometry">
Expand Down

0 comments on commit fb52789

Please sign in to comment.