Skip to content

Commit 48a9cbf

Browse files
multi_vfo: fix inactive VFO rendering
1 parent 07bf269 commit 48a9cbf

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

src/applications/gqrx/mainwindow.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,7 @@ void MainWindow::readRXSettings(int ver, double actual_rate)
11661166
if(std::abs(offs) > actual_rate / 2)
11671167
rx->set_filter_offset((offs > 0) ? (actual_rate / 2) : (-actual_rate / 2));
11681168
loadRxToGUI();
1169+
ui->plotter->updateOverlay();
11691170
}
11701171

11711172
/**
@@ -1527,6 +1528,7 @@ void MainWindow::setFilterOffset(qint64 freq_hz)
15271528
if (rx->is_rds_decoder_active()) {
15281529
rx->reset_rds_parser();
15291530
}
1531+
ui->plotter->updateOverlay();
15301532
}
15311533

15321534
/**
@@ -1755,6 +1757,7 @@ void MainWindow::selectDemod(Modulations::idx mode_idx)
17551757
}
17561758
rx->set_filter(flo, fhi, d_filter_shape);
17571759
updateDemodGUIRanges();
1760+
ui->plotter->updateOverlay();
17581761
}
17591762

17601763
/**
@@ -2360,6 +2363,7 @@ void MainWindow::startIqPlayback(const QString& filename, float samprate, qint64
23602363
uiDockRxOpt->setFilterOffsetRange((qint64)(actual_rate));
23612364
ui->plotter->setSampleRate(actual_rate);
23622365
ui->plotter->setSpanFreq((quint32)actual_rate);
2366+
ui->plotter->updateOverlay();
23632367
if (std::abs(current_offset) > actual_rate / 2)
23642368
on_plotter_newDemodFreq(center_freq, 0);
23652369
else
@@ -2400,6 +2404,7 @@ void MainWindow::stopIqPlayback()
24002404
uiDockRxOpt->setFilterOffsetRange((qint64)(actual_rate));
24012405
ui->plotter->setSampleRate(actual_rate);
24022406
ui->plotter->setSpanFreq((quint32)actual_rate);
2407+
ui->plotter->updateOverlay();
24032408
remote->setBandwidth(sr);
24042409

24052410
// not needed as long as we are not recording in iq_tool
@@ -2797,6 +2802,7 @@ void MainWindow::on_plotter_newFilterFreq(int low, int high)
27972802
/* Update filter range of plotter, in case this slot is triggered by
27982803
* switching to a bookmark */
27992804
ui->plotter->setHiLowCutFrequencies(low, high);
2805+
ui->plotter->updateOverlay();
28002806

28012807
if (retcode == receiver::STATUS_OK)
28022808
uiDockRxOpt->setFilterParam(low, high);
@@ -2962,6 +2968,7 @@ void MainWindow::onBookmarkActivated(BookmarkInfo & bm)
29622968
old_vfo->set_offset(old_offset);
29632969
old_vfo->set_freq_lock(true);
29642970
loadRxToGUI();
2971+
ui->plotter->updateOverlay();
29652972
}
29662973

29672974
void MainWindow::onBookmarkActivatedAddDemod(BookmarkInfo & bm)
@@ -3232,6 +3239,7 @@ void MainWindow::on_actionAddDemodulator_triggered()
32323239
ui->plotter->setCurrentVfo(rx->get_rx_count() - 1);
32333240
rxSpinBox->setMaximum(rx->get_rx_count() - 1);
32343241
rxSpinBox->setValue(n);
3242+
ui->plotter->updateOverlay();
32353243
}
32363244

32373245
void MainWindow::on_actionRemoveDemodulator_triggered()
@@ -3246,6 +3254,7 @@ void MainWindow::on_actionRemoveDemodulator_triggered()
32463254
if (old_current != n)
32473255
ui->plotter->removeVfo(rx->get_vfo(n));
32483256
ui->plotter->setCurrentVfo(n);
3257+
ui->plotter->updateOverlay();
32493258
}
32503259

32513260
void MainWindow::rxSpinBox_valueChanged(int i)
@@ -3258,6 +3267,7 @@ void MainWindow::rxSpinBox_valueChanged(int i)
32583267
ui->plotter->setCurrentVfo(i);
32593268
if (n == receiver::STATUS_OK)
32603269
loadRxToGUI();
3270+
ui->plotter->updateOverlay();
32613271
}
32623272

32633273
void MainWindow::on_plotter_selectVfo(int i)

src/qtgui/dockrxopt.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ DockRxOpt::~DockRxOpt()
154154
*/
155155
void DockRxOpt::setFilterOffset(qint64 freq_hz)
156156
{
157+
ui->filterFreq->blockSignals(true);
157158
ui->filterFreq->setFrequency(freq_hz);
159+
ui->filterFreq->blockSignals(false);
158160
}
159161

160162
/**
@@ -231,6 +233,7 @@ void DockRxOpt::setFilterParam(int lo, int hi)
231233
{
232234
int filter_index = filterIdxFromLoHi(lo, hi);
233235

236+
ui->filterCombo->blockSignals(true);
234237
ui->filterCombo->setCurrentIndex(filter_index);
235238
if (filter_index == FILTER_PRESET_USER)
236239
{
@@ -239,6 +242,7 @@ void DockRxOpt::setFilterParam(int lo, int hi)
239242
ui->filterCombo->setItemText(FILTER_PRESET_USER, QString("User (%1 k)")
240243
.arg((double)width_f));
241244
}
245+
ui->filterCombo->blockSignals(false);
242246
}
243247

244248
/**
@@ -247,7 +251,9 @@ void DockRxOpt::setFilterParam(int lo, int hi)
247251
*/
248252
void DockRxOpt::setCurrentFilter(int index)
249253
{
254+
ui->filterCombo->blockSignals(true);
250255
ui->filterCombo->setCurrentIndex(index);
256+
ui->filterCombo->blockSignals(false);
251257
}
252258

253259
/**
@@ -262,7 +268,9 @@ int DockRxOpt::currentFilter() const
262268
/** Select filter shape */
263269
void DockRxOpt::setCurrentFilterShape(int index)
264270
{
271+
ui->filterCombo->blockSignals(true);
265272
ui->filterShapeCombo->setCurrentIndex(index);
273+
ui->filterCombo->blockSignals(false);
266274
}
267275

268276
int DockRxOpt::currentFilterShape() const
@@ -278,7 +286,9 @@ void DockRxOpt::setCurrentDemod(Modulations::idx demod)
278286
{
279287
if ((demod >= Modulations::MODE_OFF) && (demod < Modulations::MODE_LAST))
280288
{
289+
ui->modeSelector->blockSignals(true);
281290
ui->modeSelector->setCurrentIndex(demod);
291+
ui->modeSelector->blockSignals(false);
282292
updateDemodOptPage(demod);
283293
}
284294
}

src/qtgui/plotter.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,6 @@ bool CPlotter::saveWaterfall(const QString & filename) const
726726
void CPlotter::setCurrentVfo(int current)
727727
{
728728
m_currentVfo = current;
729-
updateOverlay();
730729
}
731730

732731
void CPlotter::addVfo(vfo::sptr n_vfo)
@@ -2409,12 +2408,12 @@ void CPlotter::drawVfo(QPainter &painter, const int demodFreqX, const int demodL
24092408
QFontMetrics metrics(m_Font);
24102409
QRect br = metrics.boundingRect("+256+");
24112410
painter.setOpacity(0.3);
2412-
painter.fillRect(m_DemodLowCutFreqX, br.height(), dw, h,
2411+
painter.fillRect(demodLowCutFreqX, br.height(), dw, h,
24132412
QColor(PLOTTER_FILTER_BOX_COLOR));
24142413

24152414
painter.setOpacity(1.0);
24162415
painter.setPen(QPen(QColor(is_selected ? PLOTTER_FILTER_LINE_COLOR : PLOTTER_TEXT_COLOR), m_DPR));
2417-
painter.drawLine(demodFreqX, br.height(), m_DemodFreqX, h);
2416+
painter.drawLine(demodFreqX, br.height(), demodFreqX, h);
24182417
painter.drawText(demodFreqX - br.width() / 2, 0, br.width(), br.height(),
24192418
Qt::AlignVCenter | Qt::AlignHCenter,
24202419
QString::number(index));
@@ -2550,7 +2549,6 @@ void CPlotter::setDemodRanges(int FLowCmin, int FLowCmax,
25502549
m_FHiCmax=FHiCmax;
25512550
m_symetric=symetric;
25522551
clampDemodParameters();
2553-
updateOverlay();
25542552
}
25552553

25562554
void CPlotter::setCenterFreq(quint64 f)

src/qtgui/plotter.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ class CPlotter : public QFrame
6060
void setFilterOffset(qint64 freq_hz)
6161
{
6262
m_DemodCenterFreq = m_CenterFreq + freq_hz;
63-
updateOverlay();
6463
}
6564
qint64 getFilterOffset() const
6665
{
@@ -76,7 +75,6 @@ class CPlotter : public QFrame
7675
{
7776
m_DemodLowCutFreq = LowCut;
7877
m_DemodHiCutFreq = HiCut;
79-
updateOverlay();
8078
}
8179

8280
void getHiLowCutFrequencies(int *LowCut, int *HiCut) const
@@ -94,7 +92,6 @@ class CPlotter : public QFrame
9492
m_Span = (qint32)s;
9593
setFftCenterFreq(m_FftCenter);
9694
}
97-
updateOverlay();
9895
}
9996

10097
void setVdivDelta(int delta) { m_VdivDelta = delta; }

0 commit comments

Comments
 (0)