From e19c93a3cdcace05936f7a6ea674bb79aace3273 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sun, 18 Mar 2018 20:30:55 +0000 Subject: [PATCH] Only accept CQ calls with listening frequency when QRG between 10kHz and 999kHz Thanks to Mike, W9MDB, for this contribution. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8571 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 3c758658d..1f6c720a6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -4020,21 +4020,6 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie return; } - if(m_bFastMode or m_mode=="FT8") { - auto i1=message.string ().indexOf(" CQ "); - if(i1>10) { - bool ok; - Frequency kHz {message.string ().mid (i1+4,3).toUInt (&ok)}; - if(ok && kHz >= 10 && kHz <= 999) { - if (m_config.is_transceiver_online ()) { - //QSY Freq for answering CQ nnn - setRig (m_freqNominal / 1000000 * 1000000 + 1000 * kHz); - ui->decodedTextBrowser2->displayQSY (QString {"QSY %1"}.arg (m_freqNominal / 1e6, 7, 'f', 3)); - } - } - } - } - //Skip the rest if no decoded text extracted int frequency = message.frequencyOffset(); if (message.isTX()) { @@ -4047,6 +4032,20 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie return; } + // check for CQ with listening frequency + if (parts.size () >= 7 + && (m_bFastMode || m_mode=="FT8") + && "CQ" == parts[5] + && m_config.is_transceiver_online ()) { + bool ok; + auto kHz = parts[6].toUInt (&ok); + if (ok && kHz >= 10 && kHz <= 999) { + // QSY Freq for answering CQ nnn + setRig (m_freqNominal / 1000000 * 1000000 + 1000 * kHz); + ui->decodedTextBrowser2->displayQSY (QString {"QSY %1"}.arg (m_freqNominal / 1e6, 7, 'f', 3)); + } + } + int nmod = message.timeInSeconds () % (2*m_TRperiod); m_txFirst=(nmod!=0); ui->txFirstCheckBox->setChecked(m_txFirst);