Skip to content

Commit

Permalink
multi_vfo: make it possible to load setting...
Browse files Browse the repository at this point in the history
...from a bookmark/create demodulator by right-clicking/middle-clicking
a tag marker on the plotter
  • Loading branch information
vladisslav2011 committed Nov 5, 2022
1 parent 30926df commit ff69939
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 4 deletions.
29 changes: 29 additions & 0 deletions src/applications/gqrx/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2575,6 +2575,35 @@ void MainWindow::on_plotter_newDemodFreq(qint64 freq, qint64 delta)

}

/* CPlotter::NewDemodFreqLoad() is emitted */
/* tune and load demodulator settings */
void MainWindow::on_plotter_newDemodFreqLoad(qint64 freq, qint64 delta)
{
// set RX filter
if (delta != qint64(rx->get_filter_offset()))
{
rx->set_filter_offset((double) delta);
updateFrequencyRange();
}

QList<BookmarkInfo> tags =
Bookmarks::Get().getBookmarksInRange(freq, freq);
if(tags.size() > 0)
{
BookmarkInfo & first = tags.first();
onBookmarkActivated(freq, first.modulation, first.bandwidth);
}else
setNewFrequency(freq);
}

/* CPlotter::NewDemodFreqLoad() is emitted */
/* new demodulator here */
void MainWindow::on_plotter_newDemodFreqAdd(qint64 freq, qint64 delta)
{
on_actionAddDemodulator_triggered();
on_plotter_newDemodFreqLoad(freq, delta);
}

/* CPlotter::NewfilterFreq() is emitted or bookmark activated */
void MainWindow::on_plotter_newFilterFreq(int low, int high)
{ /* parameter correctness will be checked in receiver class */
Expand Down
4 changes: 3 additions & 1 deletion src/applications/gqrx/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ private slots:
void setWfSize();

/* FFT plot */
void on_plotter_newDemodFreq(qint64 freq, qint64 delta); /*! New demod freq (aka. filter offset). */
void on_plotter_newDemodFreq(qint64 freq, qint64 delta); /*! New demod freq (aka. filter offset). */
void on_plotter_newDemodFreqLoad(qint64 freq, qint64 delta);/* tune and load demodulator settings */
void on_plotter_newDemodFreqAdd(qint64 freq, qint64 delta); /* new demodulator here */
void on_plotter_newFilterFreq(int low, int high); /*! New filter width */
void on_plotter_selectVfo(int i);

Expand Down
24 changes: 21 additions & 3 deletions src/qtgui/plotter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,9 +752,27 @@ void CPlotter::mousePressEvent(QMouseEvent * event)
{
if (tag.first.contains(event->pos()))
{
m_DemodCenterFreq = tag.second;
emit newDemodFreq(m_DemodCenterFreq, m_DemodCenterFreq - m_CenterFreq);
break;
if (event->buttons() == Qt::LeftButton)
{
//just tune
m_DemodCenterFreq = tag.second;
emit newDemodFreq(m_DemodCenterFreq, m_DemodCenterFreq - m_CenterFreq);
break;
}
else if (event->buttons() == Qt::MidButton)
{
//tune and load settings
m_DemodCenterFreq = tag.second;
emit newDemodFreqAdd(m_DemodCenterFreq, m_DemodCenterFreq - m_CenterFreq);
break;
}
else if (event->buttons() == Qt::RightButton)
{
//new demod here
m_DemodCenterFreq = tag.second;
emit newDemodFreqLoad(m_DemodCenterFreq, m_DemodCenterFreq - m_CenterFreq);
break;
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/qtgui/plotter.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ class CPlotter : public QFrame

signals:
void newDemodFreq(qint64 freq, qint64 delta); /* delta is the offset from the center */
void newDemodFreqLoad(qint64 freq, qint64 delta);/* tune and load demodulator settings */
void newDemodFreqAdd(qint64 freq, qint64 delta);/* new demodulator here */
void newLowCutFreq(int f);
void newHighCutFreq(int f);
void newFilterFreq(int low, int high); /* substitute for NewLow / NewHigh */
Expand Down

0 comments on commit ff69939

Please sign in to comment.