From f4903ae1bd35cbe45a84204d7d6182aefaec2dd6 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Fri, 1 Sep 2017 21:29:02 +0000 Subject: [PATCH] Fix issues with type 2 compound calls in contest mode Message generation in contest mode now generates the correct Tx3 for type 2 calls. " 73" is a free text so needed special handling in message processing. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8064 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- decodedtext.cpp | 7 ++++++- mainwindow.cpp | 16 ++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/decodedtext.cpp b/decodedtext.cpp index da86d5212..e8a293fab 100644 --- a/decodedtext.cpp +++ b/decodedtext.cpp @@ -2,6 +2,7 @@ #include #include +#include extern "C" { bool stdmsg_(char const * msg, bool contest_mode, char const * mygrid, int len_msg, int len_grid); @@ -60,7 +61,11 @@ QStringList DecodedText::messageWords () const // extract up to the first four message words return words_re.match (message_).capturedTexts (); } - return message_.split (' '); // simple word split for free text messages + // simple word split for free text messages + auto words = message_.split (' ', QString::SkipEmptyParts); + // add whole message as item 0 to mimic RE capture list + words.prepend (message_); + return words; } QString DecodedText::CQersCall() const diff --git a/mainwindow.cpp b/mainwindow.cpp index f9292c066..890a1b845 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -4091,14 +4091,18 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) switch (m_config.type_2_msg_gen ()) { case Configuration::type_2_msg_1_full: - t="DE " + my_callsign + " " + my_grid; - msgtype(t, ui->tx1); + t="DE " + my_callsign + " "; + msgtype(t + my_grid, ui->tx1); if (!eme_short_codes) { - t=t0 + "R" + rpt; - msgtype(t, ui->tx3); + if ((m_mode=="MSK144" || m_mode=="FT8") + && m_config.contestMode()) { + msgtype(t + "R " + my_grid, ui->tx3); + } + else { + msgtype(t + "R" + rpt, ui->tx3); + } if ((m_mode != "JT4" && m_mode != "QRA64") || !m_bShMsgs) { - t="DE " + my_callsign + " 73"; - msgtype(t, ui->tx5->lineEdit ()); + msgtype(t + "73", ui->tx5->lineEdit ()); } } break;