From 6a44e68033e1088c0714adf39a050024635e157d Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Fri, 27 Nov 2020 12:36:24 +0000 Subject: [PATCH 1/8] Repair regression that stopped Best S&P transmitting on a match This change also ensures that second or subsequent matches in the same T/R period do not trigger a QSO with a new QSO partner. --- widgets/displaytext.cpp | 1 + widgets/displaytext.h | 3 +-- widgets/mainwindow.cpp | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/widgets/displaytext.cpp b/widgets/displaytext.cpp index d498f180e..b083defc0 100644 --- a/widgets/displaytext.cpp +++ b/widgets/displaytext.cpp @@ -15,6 +15,7 @@ #include #include "Configuration.hpp" +#include "Decoder/decodedtext.h" #include "Network/LotWUsers.hpp" #include "models/DecodeHighlightingModel.hpp" #include "logbook/logbook.h" diff --git a/widgets/displaytext.h b/widgets/displaytext.h index 3b577e619..773901cea 100644 --- a/widgets/displaytext.h +++ b/widgets/displaytext.h @@ -8,11 +8,10 @@ #include #include -#include "Decoder/decodedtext.h" - class QAction; class Configuration; class LogBook; +class DecodedText; class DisplayText : public QTextEdit diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index eafa76545..701649aa1 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -3441,19 +3441,21 @@ void MainWindow::readFromStdout() //readFromStdout ui->cbCQonly->isVisible() && ui->cbCQonly->isChecked(), haveFSpread, fSpread); - if(m_bBestSPArmed and m_mode=="FT4") { + if(m_bBestSPArmed && m_mode=="FT4" && CALLING == m_QSOProgress) { QString messagePriority=ui->decodedTextBrowser->CQPriority(); if(messagePriority!="") { if(messagePriority=="New Call on Band" and m_BestCQpriority!="New Call on Band" and m_BestCQpriority!="New Multiplier") { m_BestCQpriority="New Call on Band"; + m_bDoubleClicked = true; processMessage(decodedtext0); } if(messagePriority=="New DXCC" and m_BestCQpriority!="New DXCC" and m_BestCQpriority!="New Multiplier") { m_BestCQpriority="New DXCC"; + m_bDoubleClicked = true; processMessage(decodedtext0); } } From dc7803fe0d12160da489643bc1a6a85144e1a43d Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 28 Nov 2020 13:47:54 +0000 Subject: [PATCH 2/8] Install some example logging configuration files --- CMakeLists.txt | 7 +++++++ example_log_configurations/README | 5 +++++ .../wsjtx_log_config.ini.console | 14 ++++++++++++++ .../wsjtx_log_config.ini.debugger | 15 +++++++++++++++ .../wsjtx_log_config.ini.simple_verbose | 14 ++++++++++++++ 5 files changed, 55 insertions(+) create mode 100644 example_log_configurations/README create mode 100644 example_log_configurations/wsjtx_log_config.ini.console create mode 100644 example_log_configurations/wsjtx_log_config.ini.debugger create mode 100644 example_log_configurations/wsjtx_log_config.ini.simple_verbose diff --git a/CMakeLists.txt b/CMakeLists.txt index 84bbfbae5..709fc350f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1573,6 +1573,13 @@ install (FILES #COMPONENT runtime ) +install (DIRECTORY + example_log_configurations + DESTINATION ${CMAKE_INSTALL_DOCDIR} + FILES_MATCHING REGEX "^.*[^~]$" + #COMPONENT runtime + ) + # # Mac installer files # diff --git a/example_log_configurations/README b/example_log_configurations/README new file mode 100644 index 000000000..d7ed52f40 --- /dev/null +++ b/example_log_configurations/README @@ -0,0 +1,5 @@ +Example WSJT-X Logging Configuration Files +========================================== + +Here you will find some typical loggin configuration files. Pick a +suitable one and copy it to the WSJT-X log files directory. diff --git a/example_log_configurations/wsjtx_log_config.ini.console b/example_log_configurations/wsjtx_log_config.ini.console new file mode 100644 index 000000000..a1076b788 --- /dev/null +++ b/example_log_configurations/wsjtx_log_config.ini.console @@ -0,0 +1,14 @@ +# +# Example logging confguration file to send records to the console terminal +# + +[Core] +# Set DisableLogging to true to disable all logging. +DisableLogging="false" + +[Sinks.Console] +Destination="Console" +Asynchronous="false" +AutoFlush="true" +Format="[%TimeStamp(format=\"%H:%M:%S.%f\")%][%Channel%:%Severity%] %Message%" +Filter="(%Channel% matches \"SYSLOG\" & %Severity% >= trace) | (%Channel% matches \"RIGCTRL\" & %Severity% >= info)" \ No newline at end of file diff --git a/example_log_configurations/wsjtx_log_config.ini.debugger b/example_log_configurations/wsjtx_log_config.ini.debugger new file mode 100644 index 000000000..71056aee5 --- /dev/null +++ b/example_log_configurations/wsjtx_log_config.ini.debugger @@ -0,0 +1,15 @@ +# +# Example WSJT-X logging configuration for sending records to the +# attached Windows debugger (e.g. gdb) +# + +[Core] +# Set DisableLogging to true to disable all logging. +DisableLogging="false" + +[Sinks.Debugger] +Destination="Debugger" +Asynchronous="false" +AutoFlush="true" +Format="[%TimeStamp(format=\"%H:%M:%S.%f\")%][%Channel%][%Severity%] %File%(%Line%) %Function%: %Message%" +Filter="(%Channel% matches \"SYSLOG\" & %Severity% >= debug) | (%Channel% matches \"RIGCTRL\" & %Severity% >= info)" \ No newline at end of file diff --git a/example_log_configurations/wsjtx_log_config.ini.simple_verbose b/example_log_configurations/wsjtx_log_config.ini.simple_verbose new file mode 100644 index 000000000..26047ebb0 --- /dev/null +++ b/example_log_configurations/wsjtx_log_config.ini.simple_verbose @@ -0,0 +1,14 @@ +[Sinks.SYSLOG] +Destination="TextFile" +Asynchronous="true" +AutoFlush="true" +Format="[%TimeStamp(format=\"%Y-%m-%d %H:%M:%S.%f\")%][%Uptime(format=\"%O:%M:%S.%f\")%][%Channel%][%Severity%] %File%(%Line%) %Function%: %Message%" +RotationTimePoint="11:42:00" +Target="${AppLocalDataLocation}/logs" +FileName="${AppLocalDataLocation}/wsjtx_syslog.log" +TargetFileName="${AppLocalDataLocation}/logs/wsjtx_syslog_%Y-%m_%3N.log" +Append="true" +EnableFinalRotation="false" +ScanForFiles="Matching" +MaxSize=1073741824 +MaxFiles="10" From 462ef827c99dcc5614ecec64c34aec30f7e0dedc Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 28 Nov 2020 13:48:49 +0000 Subject: [PATCH 3/8] Shorten some diagnostic messages --- Configuration.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Configuration.cpp b/Configuration.cpp index f409e66e5..2b668f902 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -812,7 +812,7 @@ bool Configuration::is_dummy_rig () const bool Configuration::transceiver_online () { - LOG_TRACE ("transceiver_online: " << m_->cached_rig_state_); + LOG_TRACE (m_->cached_rig_state_); return m_->have_rig (); } @@ -823,37 +823,37 @@ int Configuration::transceiver_resolution () const void Configuration::transceiver_offline () { - LOG_TRACE ("transceiver_offline: " << m_->cached_rig_state_); + LOG_TRACE (m_->cached_rig_state_); m_->close_rig (); } void Configuration::transceiver_frequency (Frequency f) { - LOG_TRACE ("transceiver_frequency: " << f << m_->cached_rig_state_); + LOG_TRACE (f << ' ' << m_->cached_rig_state_); m_->transceiver_frequency (f); } void Configuration::transceiver_tx_frequency (Frequency f) { - LOG_TRACE ("transceiver_tx_frequency: " << f << m_->cached_rig_state_); + LOG_TRACE (f << ' ' << m_->cached_rig_state_); m_->transceiver_tx_frequency (f); } void Configuration::transceiver_mode (MODE mode) { - LOG_TRACE ("transceiver_mode: " << mode << " " << m_->cached_rig_state_); + LOG_TRACE (mode << ' ' << m_->cached_rig_state_); m_->transceiver_mode (mode); } void Configuration::transceiver_ptt (bool on) { - LOG_TRACE ("transceiver_ptt: " << on << " " << m_->cached_rig_state_); + LOG_TRACE (on << ' ' << m_->cached_rig_state_); m_->transceiver_ptt (on); } void Configuration::sync_transceiver (bool force_signal, bool enforce_mode_and_split) { - LOG_TRACE ("sync_transceiver: force signal: " << force_signal << " enforce_mode_and_split: " << enforce_mode_and_split << " " << m_->cached_rig_state_); + LOG_TRACE ("force signal: " << force_signal << " enforce_mode_and_split: " << enforce_mode_and_split << ' ' << m_->cached_rig_state_); m_->sync_transceiver (force_signal); if (!enforce_mode_and_split) { @@ -2838,7 +2838,7 @@ void Configuration::impl::sync_transceiver (bool /*force_signal*/) void Configuration::impl::handle_transceiver_update (TransceiverState const& state, unsigned sequence_number) { - LOG_TRACE ("handle_transceiver_update: Transceiver State #: " << sequence_number << " " << state); + LOG_TRACE ("#: " << sequence_number << ' ' << state); // only follow rig on some information, ignore other stuff cached_rig_state_.online (state.online ()); From 3352220715de61478bdfe54a9a092a0c6285fc41 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 28 Nov 2020 13:49:35 +0000 Subject: [PATCH 4/8] Clean up logging initialization and setup --- Logger.cpp | 1 - WSJTXLogging.cpp | 118 +++++++++++++++++++++++------------------------ WSJTXLogging.hpp | 12 ----- main.cpp | 8 ++-- 4 files changed, 60 insertions(+), 79 deletions(-) diff --git a/Logger.cpp b/Logger.cpp index 6c92ca407..00e5597b1 100644 --- a/Logger.cpp +++ b/Logger.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/WSJTXLogging.cpp b/WSJTXLogging.cpp index ffea213c8..bb6171609 100644 --- a/WSJTXLogging.cpp +++ b/WSJTXLogging.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -19,6 +18,7 @@ #include #include +#include #include #include #include @@ -60,12 +60,62 @@ namespace //throw; } }; + + // Reroute Qt messages to the system logger + void qt_log_handler (QtMsgType type, QMessageLogContext const& context, QString const& msg) + { + // Convert Qt message types to logger severities + auto severity = trivial::trace; + switch (type) + { + case QtDebugMsg: severity = trivial::debug; break; + case QtInfoMsg: severity = trivial::info; break; + case QtWarningMsg: severity = trivial::warning; break; + case QtCriticalMsg: severity = trivial::error; break; + case QtFatalMsg: severity = trivial::fatal; break; + } + // Map non-default Qt categories to logger channels, Qt logger + // context is mapped to the appropriate logger attributes. + auto log = sys::get (); + std::string file; + std::string function; + if (context.file) + { + file = context.file; + } + if (context.function) + { + function = context.function; + } + if (!context.category || !qstrcmp (context.category, "default")) + { + BOOST_LOG_SEV (log, severity) + << boost::log::add_value ("Line", context.line) + << boost::log::add_value ("File", file) + << boost::log::add_value ("Function", function) + << msg.toStdString (); + } + else + { + BOOST_LOG_CHANNEL_SEV (log, std::string {context.category}, severity) + << boost::log::add_value ("Line", context.line) + << boost::log::add_value ("File", file) + << boost::log::add_value ("Function", function) + << msg.toStdString (); + } + if (QtFatalMsg == type) + { + // bail out + throw std::runtime_error {"Fatal Qt Error"}; + } + } } WSJTXLogging::WSJTXLogging () { + auto core = logging::core::get (); // Catch relevant exceptions from logging. - logging::core::get ()->set_exception_handler + core->set_exception_handler ( logging::make_exception_handler (exception_handler {}) ); @@ -120,7 +170,6 @@ WSJTXLogging::WSJTXLogging () // Default log file location. QDir app_data {QStandardPaths::writableLocation (QStandardPaths::AppLocalDataLocation)}; Logger::init (); // Basic setup of attributes - auto core = logging::core::get (); // // Sink intended for general use that passes everything above @@ -175,70 +224,17 @@ WSJTXLogging::WSJTXLogging () ); core->add_sink (sys_sink); - -#if !defined (NDEBUG) && defined (Q_OS_WIN) - // auto windbg_sink = boost::make_shared> (); - // windbg_sink->set_filter (trivial::severity >= trivial::trace && expr::is_debugger_present ()); - // core->add_sink (windbg_sink); -#endif } + // Indicate start of logging LOG_INFO ("Log Start"); + ::qInstallMessageHandler (&qt_log_handler); } WSJTXLogging::~WSJTXLogging () { LOG_INFO ("Log Finish"); - auto lg = logging::core::get (); - lg->flush (); - lg->remove_all_sinks (); -} - -// Reroute Qt messages to the system logger -void WSJTXLogging::qt_log_handler (QtMsgType type, QMessageLogContext const& context, QString const& msg) -{ - // Convert Qt message types to logger severities - auto severity = trivial::trace; - switch (type) - { - case QtDebugMsg: severity = trivial::debug; break; - case QtInfoMsg: severity = trivial::info; break; - case QtWarningMsg: severity = trivial::warning; break; - case QtCriticalMsg: severity = trivial::error; break; - case QtFatalMsg: severity = trivial::fatal; break; - } - // Map non-default Qt categories to logger channels, Qt logger - // context is mapped to the appropriate logger attributes. - auto log = sys::get (); - std::string file; - std::string function; - if (context.file) - { - file = context.file; - } - if (context.function) - { - function = context.function; - } - if (!context.category || !qstrcmp (context.category, "default")) - { - BOOST_LOG_SEV (log, severity) - << boost::log::add_value ("Line", context.line) - << boost::log::add_value ("File", file) - << boost::log::add_value ("Function", function) - << msg.toStdString (); - } - else - { - BOOST_LOG_CHANNEL_SEV (log, std::string {context.category}, severity) - << boost::log::add_value ("Line", context.line) - << boost::log::add_value ("File", file) - << boost::log::add_value ("Function", function) - << msg.toStdString (); - } - if (QtFatalMsg == type) - { - // bail out - throw std::runtime_error {"Fatal Qt Error"}; - } + auto core = logging::core::get (); + core->flush (); + core->remove_all_sinks (); } diff --git a/WSJTXLogging.hpp b/WSJTXLogging.hpp index d36e9afd2..4ecedbf78 100644 --- a/WSJTXLogging.hpp +++ b/WSJTXLogging.hpp @@ -1,10 +1,6 @@ #ifndef WSJTX_LOGGING_HPP__ #define WSJTX_LOGGING_HPP__ -#include - -class QString; - // // Class WSJTXLogging - wraps application specific logging // @@ -13,14 +9,6 @@ class WSJTXLogging final public: explicit WSJTXLogging (); ~WSJTXLogging (); - - // - // Install this as the Qt message handler (qInstallMessageHandler) - // to integrate Qt messages. This handler can be installed at any - // time, it does not rely on an instance of WSJTXLogging existing, - // so logging occurring before the logging sinks, filters, and - // formatters, etc, are established can take place. - static void qt_log_handler (QtMsgType type, QMessageLogContext const& context, QString const&); }; #endif diff --git a/main.cpp b/main.cpp index 9e2403de1..c6dd0ccbf 100644 --- a/main.cpp +++ b/main.cpp @@ -104,7 +104,6 @@ namespace int main(int argc, char *argv[]) { - ::qInstallMessageHandler (&WSJTXLogging::qt_log_handler); init_random_seed (); // make the Qt type magic happen @@ -211,7 +210,9 @@ int main(int argc, char *argv[]) multiple = true; } - // now we have the application name we can open the settings + // now we have the application name we can open the logging and settings + WSJTXLogging lg; + LOG_INFO (program_title (revision ()) << " - Program startup"); MultiSettings multi_settings {parser.value (cfg_option)}; // find the temporary files path @@ -247,9 +248,6 @@ int main(int argc, char *argv[]) } } - WSJTXLogging lg; - LOG_INFO (program_title (revision ()) << " - Program startup"); - // load UI translations L10nLoader l10n {&a, locale, parser.value (lang_option)}; From 48cb207cd3f46ac5c77862dcb4b047699308f335 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sun, 29 Nov 2020 13:08:35 +0000 Subject: [PATCH 5/8] Bump RC number --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 709fc350f..1597eddca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ message (STATUS "******************************************************") include (set_build_type) # RC 0 or omitted is a development build, GA is a General Availability release build -set_build_type (RC 2) +set_build_type (RC 3) set (wsjtx_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${BUILD_TYPE_REVISION}") # From d186f7b14e995179a7fe24c1efc8dac670f92f1f Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Mon, 30 Nov 2020 02:13:16 +0000 Subject: [PATCH 6/8] Repair regression in message_aggregator decode filtering by client --- UDPExamples/ClientWidget.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/UDPExamples/ClientWidget.cpp b/UDPExamples/ClientWidget.cpp index 3be8c788c..75930b7e5 100644 --- a/UDPExamples/ClientWidget.cpp +++ b/UDPExamples/ClientWidget.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include "validators/MaidenheadLocatorValidator.hpp" @@ -73,7 +72,7 @@ bool ClientWidget::IdFilterModel::filterAcceptsRow (int source_row , QModelIndex const& source_parent) const { auto source_index_col0 = sourceModel ()->index (source_row, 0, source_parent); - return sourceModel ()->data (source_index_col0).value () == key_; + return sourceModel ()->data (source_index_col0, Qt::UserRole + 1).value () == key_; } void ClientWidget::IdFilterModel::de_call (QString const& call) From 2db2884c399d59170c81c88309dd460395a319d4 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 1 Dec 2020 15:11:36 +0000 Subject: [PATCH 7/8] Fix regression with selecting a working frequency when changing mode --- models/FrequencyList.cpp | 1 + widgets/mainwindow.cpp | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/models/FrequencyList.cpp b/models/FrequencyList.cpp index 3c4a43012..b14dae6f9 100644 --- a/models/FrequencyList.cpp +++ b/models/FrequencyList.cpp @@ -580,6 +580,7 @@ auto FrequencyList_v2::impl::frequency_list (FrequencyItems frequency_list) -> F return frequency_list; } +// add a frequency returning the new model index QModelIndex FrequencyList_v2::impl::add (Item f) { // Any Frequency that isn't in the list may be added diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 701649aa1..7e7bf0ebf 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -7609,10 +7609,6 @@ void MainWindow::on_sbTR_valueChanged(int value) progressBar.setMaximum (value); } if(m_mode=="FST4") chk_FST4_freq_range(); - if(m_monitoring) { - on_stopButton_clicked(); - on_monitorButton_clicked(true); - } if(m_transmitting) { on_stopTxButton_clicked(); } From 4492d8e977eab6c558b86f1a20665e6eada12ba7 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 1 Dec 2020 15:47:07 +0000 Subject: [PATCH 8/8] Add tool-tip for "Best S+P" push-button --- widgets/mainwindow.ui | 3 +++ 1 file changed, 3 insertions(+) diff --git a/widgets/mainwindow.ui b/widgets/mainwindow.ui index 61affd377..948bfc68f 100644 --- a/widgets/mainwindow.ui +++ b/widgets/mainwindow.ui @@ -1185,6 +1185,9 @@ Not available to nonstandard callsign holders. + + Enable auto response to the first decode from a new DXCC or new call on the current band. + QPushButton:checked { color: rgb(0, 0, 0);