From f70a3c54141ab77eee743b03162a8a569f4bc1e5 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Thu, 3 Aug 2017 11:23:07 +0000 Subject: [PATCH] Fix an issue with VFO tuning while running Doppler correction Holding down the SHIFT key while tuning the rig should update the nominal sked frequency, not holding done the SHIFT key should not update the sked frequency. This is not yet perfect and sometimes a change to the nominal sked frequency can get through but it is a rare as yet unfound race condition. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7992 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 17a6b2dd6..fbf335f53 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -5578,7 +5578,12 @@ void MainWindow::handle_transceiver_update (Transceiver::TransceiverState const& } m_rigState = s; auto old_freqNominal = m_freqNominal; - m_freqNominal = s.frequency () - m_astroCorrection.rx; + if (!old_freqNominal) + { + // always take initial rig frequency to avoid start up problems + // with bogus Tx frequencies + m_freqNominal = s.frequency (); + } if (old_state.online () == false && s.online () == true) { // initializing @@ -5587,9 +5592,10 @@ void MainWindow::handle_transceiver_update (Transceiver::TransceiverState const& if (s.frequency () != old_state.frequency () || s.split () != m_splitMode) { m_splitMode = s.split (); - if (!s.ptt ()) //!m_transmitting) + if (!s.ptt ()) { - if (old_freqNominal != m_freqNominal) + m_freqNominal = s.frequency () - m_astroCorrection.rx; + if (old_freqNominal != m_freqNominal) { m_freqTxNominal = m_freqNominal; genCQMsg (); @@ -6461,14 +6467,14 @@ void MainWindow::astroUpdate () { if (m_astroWidget) { + // no Doppler correction while CTRL pressed allows manual tuning + if (Qt::ControlModifier & QApplication::queryKeyboardModifiers ()) return; + auto correction = m_astroWidget->astroUpdate(QDateTime::currentDateTimeUtc (), m_config.my_grid(), m_hisGrid, m_freqNominal, "Echo" == m_mode, m_transmitting, !m_config.tx_QSY_allowed (), m_TRperiod); - // no Doppler correction while CTRL pressed allows manual tuning - if (Qt::ControlModifier & QApplication::queryKeyboardModifiers ()) return; - // no Doppler correction in Tx if rig can't do it if (m_transmitting && !m_config.tx_QSY_allowed ()) return; if (!m_astroWidget->doppler_tracking ()) return;