From 70a472d4af44ecbfaa0cbf093e4940c93b4f1787 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Fri, 12 Jun 2015 00:26:36 +0000 Subject: [PATCH] Move >=50MHz check for Doppler tracking back to the main window git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5594 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- astro.cpp | 49 +++++++++++++++++++++++-------------------------- mainwindow.cpp | 3 ++- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/astro.cpp b/astro.cpp index 9c29a21c8..adbe56754 100644 --- a/astro.cpp +++ b/astro.cpp @@ -147,34 +147,31 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const ui_->text_label->setText(message); FrequencyDelta astro_correction {0}; - //Apply Doppler corrections only for 50 MHz and above - if (freq_moon >= 50000000) { - if (ui_->cbDopplerTracking->isChecked ()) { - switch (m_DopplerMethod) - { - case 1: - // All Doppler correction done here; DX station stays at nominal dial frequency. - if(dx_is_self) { - astro_correction = m_stepHz*qRound(double(ndop00)/m_stepHz); - } else { - astro_correction = m_stepHz*qRound(double(ndop)/m_stepHz); - } - break; - - case 2: - // Doppler correction to constant frequency on Moon - astro_correction = m_stepHz*qRound(double(ndop00/2.0)/m_stepHz); - break; - } - - if (bTx) { - astro_correction = 1000 * m_kHz + m_Hz - astro_correction; - } else { - if(dx_is_self && m_DopplerMethod==1) { - astro_correction = 1000*m_kHz + m_Hz; + if (ui_->cbDopplerTracking->isChecked ()) { + switch (m_DopplerMethod) + { + case 1: + // All Doppler correction done here; DX station stays at nominal dial frequency. + if(dx_is_self) { + astro_correction = m_stepHz*qRound(double(ndop00)/m_stepHz); } else { - astro_correction += 1000*m_kHz + m_Hz; + astro_correction = m_stepHz*qRound(double(ndop)/m_stepHz); } + break; + + case 2: + // Doppler correction to constant frequency on Moon + astro_correction = m_stepHz*qRound(double(ndop00/2.0)/m_stepHz); + break; + } + + if (bTx) { + astro_correction = 1000 * m_kHz + m_Hz - astro_correction; + } else { + if(dx_is_self && m_DopplerMethod==1) { + astro_correction = 1000*m_kHz + m_Hz; + } else { + astro_correction += 1000*m_kHz + m_Hz; } } } diff --git a/mainwindow.cpp b/mainwindow.cpp index d40c0e659..4610e603e 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -2151,7 +2151,8 @@ void MainWindow::guiUpdate() if (m_astroWidget) { auto astro_correction = m_astroWidget->astroUpdate(t, m_config.my_grid (), m_hisGrid , m_dialFreq, "Echo" == m_mode, m_transmitting); - if (!m_bSimplex) { // only adjust frequency if allowed by mode + if (!m_bSimplex // only adjust frequency if allowed by mode + && m_dialFreq >= 50000000) { // and above 50MHz if(m_transmitting) { m_dialFreqTx = m_freqNominal + astro_correction; ui->labDialFreq->setText (Radio::pretty_frequency_MHz_string (m_dialFreqTx));