From c50133bcfcb13d0bee3b68ce77ff0c29bbbe679b Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 14 Oct 2020 20:59:32 +0100 Subject: [PATCH 1/8] Honour "Settings->General->Disable Tx after sending 73" if not auto-sequencing --- widgets/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index c83449e3b..0766b35d1 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -5747,7 +5747,8 @@ void MainWindow::on_genStdMsgsPushButton_clicked() //genStdMsgs button void MainWindow::on_logQSOButton_clicked() //Log QSO button { - if (SpecOp::FOX != m_config.special_op_id ()) + if (SpecOp::FOX != m_config.special_op_id () + && ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isEnabled () && ui->cbAutoSeq->isChecked ()) { // ensure that auto Tx is disabled even if clear DX call & grid // on 73 is not checked, unless in Fox mode where it is allowed From ccb7a1adf5e81710958a613f8cb0d2b47b2fce7a Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sun, 18 Oct 2020 02:09:17 +0100 Subject: [PATCH 2/8] Repair defect with response to UDP Reply(4) messages with AP markers --- widgets/mainwindow.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 0766b35d1..f11b928dd 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -7668,13 +7668,21 @@ void MainWindow::replyToCQ (QTime time, qint32 snr, float delta_time, quint32 de QString format_string {"%1 %2 %3 %4 %5 %6"}; auto const& time_string = time.toString ("~" == mode || "&" == mode || "+" == mode ? "hhmmss" : "hhmm"); + auto text = message_text; + auto ap_pos = text.lastIndexOf (QRegularExpression {R"((?:\?\s)?a[0-9]$)"}); + if (ap_pos >= 0) + { + // beware of decodes ending on shorter version of wanted call so + // add a space + text = text.left (ap_pos).trimmed () + ' '; + } auto message_line = format_string .arg (time_string) .arg (snr, 3) .arg (delta_time, 4, 'f', 1) .arg (delta_frequency, 4) .arg (mode, -2) - .arg (message_text); + .arg (text); QTextCursor start {ui->decodedTextBrowser->document ()}; start.movePosition (QTextCursor::End); auto cursor = ui->decodedTextBrowser->document ()->find (message_line, start, QTextDocument::FindBackward); @@ -7687,7 +7695,7 @@ void MainWindow::replyToCQ (QTime time, qint32 snr, float delta_time, quint32 de .arg ('-' + QString::number (delta_time, 'f', 1), 4) .arg (delta_frequency, 4) .arg (mode, -2) - .arg (message_text), start, QTextDocument::FindBackward); + .arg (text), start, QTextDocument::FindBackward); } if (!cursor.isNull ()) { @@ -7702,7 +7710,7 @@ void MainWindow::replyToCQ (QTime time, qint32 snr, float delta_time, quint32 de showNormal (); raise (); } - if (message_text.contains (QRegularExpression {R"(^(CQ |CQDX |QRZ ))"})) { + if (text.contains (QRegularExpression {R"(^(CQ |CQDX |QRZ ))"})) { // a message we are willing to accept and auto reply to m_bDoubleClicked = true; } From adcb0219414272d4c7ab823f1634f07a3342cd25 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 20 Oct 2020 02:21:08 +0100 Subject: [PATCH 3/8] Compatibility with older Qt versions --- widgets/LazyFillComboBox.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/widgets/LazyFillComboBox.hpp b/widgets/LazyFillComboBox.hpp index 7d9052673..37af60f0b 100644 --- a/widgets/LazyFillComboBox.hpp +++ b/widgets/LazyFillComboBox.hpp @@ -24,6 +24,7 @@ public: { } +#if QT_VERSION >= QT_VERSION_CHECK (5, 12, 0) void showPopup () override { Q_EMIT about_to_show_popup (); @@ -35,6 +36,19 @@ public: QComboBox::hidePopup (); Q_EMIT popup_hidden (); } +#else + void mousePressEvent (QMouseEvent * e) override + { + Q_EMIT about_to_show_popup (); + QComboBox::mousePressEvent (e); + } + + void mouseReleaseEvent (QMouseEvent * e) override + { + QComboBox::mouseReleaseEvent (e); + Q_EMIT popup_hidden (); + } +#endif }; #endif From f2bbf98cbbee79405a5673e45b5ed4587e858ab6 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 20 Oct 2020 12:43:45 +0100 Subject: [PATCH 4/8] Update WSPRnet.org posts to allow mode to be determined The sent/received 'mode' parameter posted to WSPRnet.org has been amended as follows: WSPR-2: "2" FST4W-120: "3" FST4W-300: "5" FST4W-900: "16" FST4W-1800: "30" this change is designed to maintain backwards compatibility with older versions of WSJT-X and other software like WSPR-X which already post these values: WSPR-2: "2" WSPR-15: "15" It is expected that the WSPRnet.org server side will be updated in sync with a WSJT-X v2.3.0 RC2 (or GA) release to account for this change. --- Network/wsprnet.cpp | 38 ++++++++++++++++++++++---------------- Network/wsprnet.h | 7 ++++--- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/Network/wsprnet.cpp b/Network/wsprnet.cpp index ba1e36c18..e01be1b5e 100644 --- a/Network/wsprnet.cpp +++ b/Network/wsprnet.cpp @@ -211,7 +211,7 @@ void WSPRNet::networkReply (QNetworkReply * reply) } } -bool WSPRNet::decodeLine (QString const& line, SpotQueue::value_type& query) +bool WSPRNet::decodeLine (QString const& line, SpotQueue::value_type& query) const { auto const& rx_match = wspr_re.match (line); if (rx_match.hasMatch ()) { @@ -271,7 +271,23 @@ bool WSPRNet::decodeLine (QString const& line, SpotQueue::value_type& query) return true; } -auto WSPRNet::urlEncodeNoSpot () -> SpotQueue::value_type +QString WSPRNet::encode_mode () const +{ + if (m_mode == "WSPR") return "2"; + if (m_mode == "WSPR-15") return "15"; + if (m_mode == "FST4W") + { + auto tr = static_cast ((TR_period_ / 60.)+.5); + if (2 == tr || 15 == tr) + { + tr += 1; // distinguish from WSPR-2 and WSPR-15 + } + return QString::number (tr); + } + return ""; +} + +auto WSPRNet::urlEncodeNoSpot () const -> SpotQueue::value_type { SpotQueue::value_type query; query.addQueryItem ("function", "wsprstat"); @@ -282,28 +298,18 @@ auto WSPRNet::urlEncodeNoSpot () -> SpotQueue::value_type query.addQueryItem ("tqrg", m_tfreq); query.addQueryItem ("dbm", m_dbm); query.addQueryItem ("version", m_vers); - if (m_mode == "WSPR") query.addQueryItem ("mode", "2"); - if (m_mode == "WSPR-15") query.addQueryItem ("mode", "15"); - if (m_mode == "FST4W") - { - query.addQueryItem ("mode", QString::number (static_cast ((TR_period_ / 60.)+.5))); - } + query.addQueryItem ("mode", encode_mode ()); return query;; } -auto WSPRNet::urlEncodeSpot (SpotQueue::value_type& query) -> SpotQueue::value_type +auto WSPRNet::urlEncodeSpot (SpotQueue::value_type& query) const -> SpotQueue::value_type { query.addQueryItem ("version", m_vers); query.addQueryItem ("rcall", m_call); query.addQueryItem ("rgrid", m_grid); query.addQueryItem ("rqrg", m_rfreq); - if (m_mode == "WSPR") query.addQueryItem ("mode", "2"); - if (m_mode == "WSPR-15") query.addQueryItem ("mode", "15"); - if (m_mode == "FST4W") - { - query.addQueryItem ("mode", QString::number (static_cast ((TR_period_ / 60.)+.5))); - } - return query; + query.addQueryItem ("mode", encode_mode ()); + return query; } void WSPRNet::work() diff --git a/Network/wsprnet.h b/Network/wsprnet.h index 29e5e58f8..a450d5827 100644 --- a/Network/wsprnet.h +++ b/Network/wsprnet.h @@ -34,9 +34,10 @@ public slots: void abortOutstandingRequests (); private: - bool decodeLine (QString const& line, SpotQueue::value_type& query); - SpotQueue::value_type urlEncodeNoSpot (); - SpotQueue::value_type urlEncodeSpot (SpotQueue::value_type& spot); + bool decodeLine (QString const& line, SpotQueue::value_type& query) const; + SpotQueue::value_type urlEncodeNoSpot () const; + SpotQueue::value_type urlEncodeSpot (SpotQueue::value_type& spot) const; + QString encode_mode () const; QNetworkAccessManager * network_manager_; QList m_outstandingRequests; From 6c077397dc13a58d511fcdca1f47166c6cc46a51 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 21 Oct 2020 01:36:00 +0100 Subject: [PATCH 5/8] Adjust Windows stack and heap reservations for FST4(W) code --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 71589a073..2158cf0dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1170,6 +1170,11 @@ target_link_libraries (ft4sim_mult wsjt_fort wsjt_cxx) add_executable (fst4sim lib/fst4/fst4sim.f90) target_link_libraries (fst4sim wsjt_fort wsjt_cxx) +if (WIN32) + set_target_properties (fst4sim PROPERTIES + LINK_FLAGS -Wl,--stack,0x4000000,--heap,0x6000000 + ) +endif () add_executable (ldpcsim240_101 lib/fst4/ldpcsim240_101.f90) target_link_libraries (ldpcsim240_101 wsjt_fort wsjt_cxx) @@ -1432,7 +1437,7 @@ else () ) if (WIN32) set_target_properties (wsjtx PROPERTIES - LINK_FLAGS -Wl,--stack,16777216 + LINK_FLAGS -Wl,--stack,0x400000,--heap,0x20000000 ) endif () endif () From 5e3b931086fe625888a2f41e6a6b4b4759935848 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 21 Oct 2020 11:46:45 +0100 Subject: [PATCH 6/8] Better executable description for jt9 This maintains the sort order in the Windows Task Manager summary background applications list. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2158cf0dc..396473e84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1348,7 +1348,7 @@ generate_version_info (jt9_VERSION_RESOURCES NAME jt9 BUNDLE ${PROJECT_BUNDLE_NAME} ICON ${WSJTX_ICON_FILE} - FILE_DESCRIPTION "Slow mode decoder" + FILE_DESCRIPTION "jt9 - WSJT-X slow mode decoder" ) add_executable (jt9 ${jt9_FSRCS} ${jt9_VERSION_RESOURCES}) From e99f22a5d2573eaae46fcb50ddd159eed21a2726 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 21 Oct 2020 13:08:03 +0100 Subject: [PATCH 7/8] Revert to previous stack reservation on Windows to accommodate F/H --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 396473e84..331194711 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1437,7 +1437,7 @@ else () ) if (WIN32) set_target_properties (wsjtx PROPERTIES - LINK_FLAGS -Wl,--stack,0x400000,--heap,0x20000000 + LINK_FLAGS -Wl,--stack,0x1000000,--heap,0x20000000 ) endif () endif () From 2a2e120d7cf4f38f51ec879ddcc032510baf9721 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 21 Oct 2020 13:09:10 +0100 Subject: [PATCH 8/8] Repair invalid string references --- widgets/mainwindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index f11b928dd..64f7f4ec4 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -9117,15 +9117,15 @@ void MainWindow::write_all(QString txRx, QString message) QString msg; QString mode_string; - if (message[4]==' ') { + if (message.size () > 5 && message[4]==' ') { msg=message.mid(4,-1); } else { msg=message.mid(6,-1); } - if (message[19]=='#') { + if (message.size () > 19 && message[19]=='#') { mode_string="JT65 "; - } else if (message[19]=='@') { + } else if (message.size () > 19 && message[19]=='@') { mode_string="JT9 "; } else { mode_string=m_mode.leftJustified(6,' ');