From 220f03c7bebd9803c1f930bdc2565d38a4e67e06 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 3 Mar 2017 15:11:32 +0000 Subject: [PATCH] When operating in JT9+JT65 mode, changing band to 60 m has moved the "JT65 nnnn JT9" blue line to 0 Hz. Now it also moves the spinner to 0 Hz, as it should have done. Subsequent QSY to another band will reset the blue line and spinner to where they had been, before the QSY to 60 m. Thanks to W9MDB for this patch. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7595 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 16 ++++++++++++---- widegraph.cpp | 8 ++++++++ widegraph.h | 1 + 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index a5fcdd51e..6a5590fa6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1755,16 +1755,24 @@ void MainWindow::displayDialFrequency () ui->bandComboBox->setCurrentText (band_name); m_wideGraph->setRxBand (band_name); m_lastBand = band_name; - // For 60M we'll move the JT9 offset to zero + // For 60M we'll move the JT9 offset to zero and remember so we can restore static int saveRxRange = -1; - if (saveRxRange < 0) saveRxRange = m_wideGraph->Fmin(); + if (saveRxRange < 0) { + m_settings->beginGroup ("WideGraph"); + saveRxRange = m_settings->value ("FminSave", m_wideGraph->Fmin()).toInt (); + m_settings->endGroup(); + } if (band_name == "60m") { saveRxRange = m_wideGraph->Fmin(); - m_wideGraph->setRxRange(0); + // We need to remember our save value in case we restart on 60M + m_settings->beginGroup ("WideGraph"); + m_settings->setValue ("FminSave", saveRxRange); + m_settings->endGroup(); + m_wideGraph->setRxRangeAndSplitSpinBox(0); } else { - m_wideGraph->setRxRange(saveRxRange); + m_wideGraph->setRxRangeAndSplitSpinBox(saveRxRange); } } diff --git a/widegraph.cpp b/widegraph.cpp index b19ad3cb7..8b4e50639 100644 --- a/widegraph.cpp +++ b/widegraph.cpp @@ -312,6 +312,14 @@ void WideGraph::setRxRange(int fMin) //setRxRange ui->widePlot->update(); } +void WideGraph::setRxRangeAndSplitSpinBox(int fMin) +{ + // Need to ensure split box is set too + // e.g. For 60M we force the offset to 0 so this routine makes the split box match + // Otherwise we can't decode JT9 + ui->fSplitSpinBox->setValue(fMin); +} + int WideGraph::Fmin() //Fmin { return m_fMin; diff --git a/widegraph.h b/widegraph.h index ca7fb9cf8..aba5bd265 100644 --- a/widegraph.h +++ b/widegraph.h @@ -33,6 +33,7 @@ public: int fSpan(); void saveSettings(); void setRxRange(int fMin); + void setRxRangeAndSplitSpinBox(int fMin); void setFsample(int n); void setPeriod(int ntrperiod, int nsps); void setTxFreq(int n);