From ec61291cb054f0102d407e08bb61f82f75b31ea2 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 6 Mar 2021 18:12:40 +0000 Subject: [PATCH 1/7] Updates for latest Acsiidoctor version and default style sheet --- doc/CMakeLists.txt | 2 +- doc/user_guide/en/docinfo.html | 8 ++++---- doc/user_guide/en/wsjtx-main.adoc | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 9806708c4..7a86d6638 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -224,7 +224,7 @@ foreach (lang ${LANGUAGES}) SOURCE user_guide/wsjtx-main.adoc LANG "${lang}" OUTPUT html - ASCIIDOCTOR_OPTIONS -d book -a data-uri -a toc=left -a max-width=1024px + ASCIIDOCTOR_OPTIONS -d book -a data-uri -a toc=left DEPENDS ${common_SRCS} ${_sources} ) document( diff --git a/doc/user_guide/en/docinfo.html b/doc/user_guide/en/docinfo.html index 8a05192b7..dbbfc1668 100644 --- a/doc/user_guide/en/docinfo.html +++ b/doc/user_guide/en/docinfo.html @@ -1,17 +1,17 @@ diff --git a/doc/user_guide/en/wsjtx-main.adoc b/doc/user_guide/en/wsjtx-main.adoc index f0d296705..27443a11b 100644 --- a/doc/user_guide/en/wsjtx-main.adoc +++ b/doc/user_guide/en/wsjtx-main.adoc @@ -6,7 +6,7 @@ Joseph H Taylor, Jr, K1JT // package building .deb, .rpm, etc as it exposes the IP address and the images // are non-free, so can't be included as part of the Debian package. // :badges: -:docinfo1: +:docinfo: shared :imagesdir: {docdir}/images :icons: font :numbered: From c080a9ae40a9890219c3c462bb6aafbaba31635a Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 6 Mar 2021 18:20:27 +0000 Subject: [PATCH 2/7] Switch to using a launchd plist for macOS shared memory config Tnx to Steve, W1SEG, and John, G4KLA. --- CMakeLists.txt | 2 +- Darwin/ReadMe.txt | 46 +++++++---------------------------- Darwin/com.wsjtx.sysctl.plist | 18 ++++++++++++++ Darwin/sysctl.conf | 5 ---- 4 files changed, 28 insertions(+), 43 deletions(-) create mode 100644 Darwin/com.wsjtx.sysctl.plist delete mode 100644 Darwin/sysctl.conf diff --git a/CMakeLists.txt b/CMakeLists.txt index 53337a92c..649c5209e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1599,7 +1599,7 @@ install (DIRECTORY if (APPLE) install (FILES Darwin/ReadMe.txt - Darwin/sysctl.conf + Darwin/com.wsjtx.sysctl.plist DESTINATION . #COMPONENT runtime ) diff --git a/Darwin/ReadMe.txt b/Darwin/ReadMe.txt index 7bb73d262..69d8e03ea 100644 --- a/Darwin/ReadMe.txt +++ b/Darwin/ReadMe.txt @@ -1,42 +1,21 @@ Notes on WSJT-X Installation for Mac OS X ----------------------------------------- -Important: If you are using the new Mac with the M1 chip then please read -the section marked: BEGIN M1. Otherwise BEGIN INTEL applies. - If you have already downloaded a previous version of WSJT-X then I suggest you change the name in the Applications folder from WSJT-X to WSJT-X_previous before proceeding. I recommend that you follow the installation instructions especially if you -are moving from v2.2 to v2.3 of WSJT-X or you have upgraded macOS. - -BEGIN M1: +are moving from v2.2 to v2.3 or later, of WSJT-X or you have upgraded macOS. Double-click on the wsjtx-...-Darwin.dmg file you have downloaded from K1JT's web-site. Now open a Terminal window by going to Applications->Utilities and clicking on Terminal. -There are two system variables that must be set manually since the M1 Macs do not recognise -automatic parameter settings by means of the sysctl.conf file present in the download. -Type these commands - you will be asked for your password which will not be echoed: - - sudo sysctl -w kern.sysv.shmmax=52428800 - sudo sysctl -w kern.sysv.shmall=25600 - -It is important to note that these parameter settings will not survive a reboot. If you -need to reboot your Mac, then these commands must be re-entered. Now proceed to NEXT. - -BEGIN INTEL: - -Double-click on the wsjtx-...-Darwin.dmg file you have downloaded from K1JT's web-site. - -Now open a Terminal window by going to Applications->Utilities and clicking on Terminal. - -Along with this ReadMe file there is a file: sysctl.conf which must be copied to a +Along with this ReadMe file there is a file: com.wsjtx.sysctl.plist which must be copied to a system area by typing this line in the Terminal window and then pressing the Return key. - sudo cp /Volumes/WSJT-X/sysctl.conf /etc + sudo cp /Volumes/WSJT-X/com.wsjtx.sysctl.plist /Library/LaunchDaemons you will be asked for your normal password because authorisation is needed to copy this file. (Your password will not be echoed but press the Return key when completed.) @@ -53,8 +32,6 @@ You can now close the Terminal window. It will not be necessary to repeat this again, even when you download an updated version of WSJT-X. It might be necessary if you upgrade macOS. -NEXT: - Drag the WSJT-X app to your preferred location, such as Applications. You need to configure your sound card. Visit Applications > Utilities > Audio MIDI @@ -95,27 +72,22 @@ Please email me if you have problems. --- John G4KLA (g4kla@rmnjmn.co.uk) -Addendum: Information about sysctl.conf and multiple instances of WSJT-X. +Addendum: Information about com.wsjtx.sysctl.plist and multiple instances of WSJT-X. WSJT-X makes use of a block of memory which is shared between different parts of the code. The normal allocation of shared memory on a Mac is insufficient and this -has to be increased. The sysctl.conf file is used for this purpose. You can -use a Mac editor to examine sysctl.conf. (Do not use another editor - the file +has to be increased. The com.wsjtx.sysctl.plist file is used for this purpose. You can +use a Mac editor to examine the file. (Do not use another editor - the file would probably be corrupted.) It is possible to run two instances of WSJT-X simultaneously. See "Section 16.2 Frequently asked Questions" in the User Guide. If you wish to run more than two instances -simultaneously, the shmall parameter in the sysctl.conf file needs to be modified as follows. +simultaneously, the shmall parameter in the com.wsjtx.sysctl.plist file needs to be modified as follows. The shmall parameter determines the amount of shared memory which is allocated in 4096 byte pages with 50MB (52428800) required for each instance. The shmall parameter is calculated as: -(n * 52428800)/4096 where 'n' is the number of instances required to run simultaneously. If -you are using an Intel Mac, modify the shmall parameter in the sysctl.conf file using a Mac editor -and then install in the /etc directory using the installation procedure described above for an -Intel Mac. Remember to reboot your Mac afterwards. - -If you are using an M1 Mac, then simply issue the sudo sysctl -w kern.sysv.shmall=xxx command where -xxx is the new value of shmall that is required. +(n * 52428800)/4096 where 'n' is the number of instances required to run simultaneously. +Remember to reboot your Mac afterwards. Note that the shmmax parameter remains unchanged. This is the maximum amount of shared memory that any one instance is allowed to request from the total shared memory allocation and should not diff --git a/Darwin/com.wsjtx.sysctl.plist b/Darwin/com.wsjtx.sysctl.plist new file mode 100644 index 000000000..069e19764 --- /dev/null +++ b/Darwin/com.wsjtx.sysctl.plist @@ -0,0 +1,18 @@ + + + + + Label + com.wsjtx.sysctl + Program + /usr/sbin/sysctl + ProgramArguments + + /usr/sbin/sysctl + kern.sysv.shmmax=52428800 + kern.sysv.shmall=25600 + + RunAtLoad + + + diff --git a/Darwin/sysctl.conf b/Darwin/sysctl.conf deleted file mode 100644 index 09ab36540..000000000 --- a/Darwin/sysctl.conf +++ /dev/null @@ -1,5 +0,0 @@ -kern.sysv.shmmax=52428800 -kern.sysv.shmmin=1 -kern.sysv.shmmni=128 -kern.sysv.shmseg=32 -kern.sysv.shmall=25600 From 24b4e4a540e0207b12dc53b67aa4e7a156f4ccdc Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Thu, 11 Mar 2021 01:18:38 +0000 Subject: [PATCH 3/7] Make sure diagnostic log configuration file parse errors are logged Parse errors revert to default logging to wsjtx_syslog.log with a suitable error message therein. --- Logger.cpp | 2 +- WSJTXLogging.cpp | 149 ++++++++++++++++++++++++++--------------------- 2 files changed, 84 insertions(+), 67 deletions(-) diff --git a/Logger.cpp b/Logger.cpp index e92c7aa2a..b1207676e 100644 --- a/Logger.cpp +++ b/Logger.cpp @@ -142,8 +142,8 @@ namespace Logger err += e.what (); // Since we cannot be sure of boost log state, output to cerr and cout. std::cerr << "ERROR: " << err << std::endl; - std::cout << "ERROR: " << err << std::endl; LOG_ERROR (err); + throw; } } diff --git a/WSJTXLogging.cpp b/WSJTXLogging.cpp index 93bcb833b..9cf5da31c 100644 --- a/WSJTXLogging.cpp +++ b/WSJTXLogging.cpp @@ -104,6 +104,77 @@ namespace << context.category << ": " << msg.toStdWString (); } } + + void default_log_config () + { + auto core = logging::core::get (); + + // + // Define sinks, filters, and formatters using expression + // templates for efficiency. + // + + // Default log file location. + QDir app_data {QStandardPaths::writableLocation (QStandardPaths::AppLocalDataLocation)}; + Logger::init (); // Basic setup of attributes + + // + // Sink intended for general use that passes everything above + // selected severity levels per channel. Log file is appended + // between sessions and rotated to limit storage space usage. + // + auto sys_sink = boost::make_shared> + ( + keywords::auto_flush = false +#if BOOST_VERSION / 100 >= 1070 + , keywords::file_name = app_data.absoluteFilePath ("wsjtx_syslog.log").toStdWString () + , keywords::target_file_name = +#else + , keywords::file_name = +#endif + app_data.absoluteFilePath ("logs/wsjtx_syslog_%Y-%m.log").toStdString () + , keywords::time_based_rotation = sinks::file::rotation_at_time_point (gregorian::greg_day (1), 0, 0, 0) + , keywords::open_mode = std::ios_base::out | std::ios_base::app +#if BOOST_VERSION / 100 >= 1063 + , keywords::enable_final_rotation = false +#endif + ); + + sys_sink->locked_backend ()->set_file_collector + ( + sinks::file::make_collector + ( + keywords::max_size = 5 * 1024 * 1024 + , keywords::min_free_space = 1024 * 1024 * 1024 + , keywords::max_files = 12 + , keywords::target = app_data.absoluteFilePath ("logs").toStdWString () + ) + ); + sys_sink->locked_backend ()->scan_for_files (); + + // Per channel severity level filter + using min_severity_filter = expr::channel_severity_filter_actor; + min_severity_filter min_severity = expr::channel_severity_filter (channel, severity); + min_severity["SYSLOG"] = trivial::info; + min_severity["RIGCTRL"] = trivial::info; + min_severity["DATALOG"] = trivial::info; + sys_sink->set_filter (min_severity || severity >= trivial::fatal); + + sys_sink->set_formatter + ( + expr::stream + << "[" << channel + << "][" << expr::format_date_time ("TimeStamp", "%Y-%m-%d %H:%M:%S.%f") + << "][" << expr::format_date_time ("Uptime", "%O:%M:%S.%f") + << "][" << trivial::severity + << "] " << expr::message + ); + + core->add_sink (sys_sink); + + // Indicate start of logging + LOG_INFO ("Log Start"); + } } WSJTXLogging::WSJTXLogging () @@ -152,77 +223,23 @@ WSJTXLogging::WSJTXLogging () new_config += config.mid (pos); std::wstringbuf buffer {new_config.toStdWString (), std::ios_base::in}; std::wistream stream {&buffer}; - Logger::init_from_config (stream); - LOG_INFO ("Read logging configuration file: " << log_config.fileName ()); + try + { + Logger::init_from_config (stream); + LOG_INFO ("Read logging configuration file: " << log_config.fileName ()); + } + catch (std::exception const& e) + { + default_log_config (); + LOG_ERROR ("Reading logging configuration file: " << log_config.fileName () << " - " << e.what ()); + LOG_INFO ("Reverting to default logging configuration"); + } } else // Default setup { - // - // Define sinks, filters, and formatters using expression - // templates for efficiency. - // - - // Default log file location. - QDir app_data {QStandardPaths::writableLocation (QStandardPaths::AppLocalDataLocation)}; - Logger::init (); // Basic setup of attributes - - // - // Sink intended for general use that passes everything above - // selected severity levels per channel. Log file is appended - // between sessions and rotated to limit storage space usage. - // - auto sys_sink = boost::make_shared> - ( - keywords::auto_flush = false -#if BOOST_VERSION / 100 >= 1070 - , keywords::file_name = app_data.absoluteFilePath ("wsjtx_syslog.log").toStdWString () - , keywords::target_file_name = -#else - , keywords::file_name = -#endif - app_data.absoluteFilePath ("logs/wsjtx_syslog_%Y-%m.log").toStdString () - , keywords::time_based_rotation = sinks::file::rotation_at_time_point (gregorian::greg_day (1), 0, 0, 0) - , keywords::open_mode = std::ios_base::out | std::ios_base::app -#if BOOST_VERSION / 100 >= 1063 - , keywords::enable_final_rotation = false -#endif - ); - - sys_sink->locked_backend ()->set_file_collector - ( - sinks::file::make_collector - ( - keywords::max_size = 5 * 1024 * 1024 - , keywords::min_free_space = 1024 * 1024 * 1024 - , keywords::max_files = 12 - , keywords::target = app_data.absoluteFilePath ("logs").toStdWString () - ) - ); - sys_sink->locked_backend ()->scan_for_files (); - - // Per channel severity level filter - using min_severity_filter = expr::channel_severity_filter_actor; - min_severity_filter min_severity = expr::channel_severity_filter (channel, severity); - min_severity["SYSLOG"] = trivial::info; - min_severity["RIGCTRL"] = trivial::info; - min_severity["DATALOG"] = trivial::info; - sys_sink->set_filter (min_severity || severity >= trivial::fatal); - - sys_sink->set_formatter - ( - expr::stream - << "[" << channel - << "][" << expr::format_date_time ("TimeStamp", "%Y-%m-%d %H:%M:%S.%f") - << "][" << expr::format_date_time ("Uptime", "%O:%M:%S.%f") - << "][" << trivial::severity - << "] " << expr::message - ); - - core->add_sink (sys_sink); + default_log_config (); } - // Indicate start of logging - LOG_INFO ("Log Start"); ::qInstallMessageHandler (&qt_log_handler); } From 834630e2d46a9128ba3a899e1a17c83b31010795 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Fri, 12 Mar 2021 23:28:33 +0000 Subject: [PATCH 4/7] Repair some QSO sequencing defects --- Decoder/decodedtext.cpp | 2 +- widgets/mainwindow.cpp | 24 ++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Decoder/decodedtext.cpp b/Decoder/decodedtext.cpp index ccbf56621..621aeea18 100644 --- a/Decoder/decodedtext.cpp +++ b/Decoder/decodedtext.cpp @@ -23,7 +23,7 @@ DecodedText::DecodedText (QString const& the_string) , is_standard_ {false} { // discard appended AP info - clean_string_.replace (QRegularExpression {R"(^(.*)(?:(?:\?\s)?a[0-9].*)$)"}, "\\1"); + clean_string_.replace (QRegularExpression {R"(^(.*?)(?:\?\s)?a[0-9].*$)"}, "\\1"); // qDebug () << "DecodedText: the_string:" << the_string << "Nbsp pos:" << the_string.indexOf (QChar::Nbsp); if (message_.length() >= 1) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 0d15ae14c..201adfe22 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -4984,7 +4984,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie auto const& word_3 = message_words.at (3); auto word_3_as_number = word_3.toInt (); if (("RRR" == word_3 - || word_3_as_number == 73 + || (word_3_as_number == 73 && ROGERS == m_QSOProgress) || "RR73" == word_3 || ("R" == word_3 && m_QSOProgress != REPORT))) { if(m_mode=="FT4" and "RR73" == word_3) m_dateTimeRcvdRR73=QDateTime::currentDateTimeUtc(); @@ -5013,11 +5013,31 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie m_ntx=4; ui->txrb4->setChecked(true); } - else + else if ((m_QSOProgress > CALLING && m_QSOProgress < ROGERS) + || word_3.contains (QRegularExpression {"^RR(?:R|73)$"})) { m_ntx=5; ui->txrb5->setChecked(true); } + else if (ROGERS == m_QSOProgress) + { + logQSOTimer.start(0); + m_ntx=6; + ui->txrb6->setChecked(true); + } + else + { + // just work them (again) + if (ui->tx1->isEnabled ()) { + m_ntx = 1; + m_QSOProgress = REPLYING; + ui->txrb1->setChecked (true); + } else { + m_ntx=2; + m_QSOProgress = REPORT; + ui->txrb2->setChecked (true); + } + } } if (m_QSOProgress >= ROGER_REPORT) { From b5d4440a8f0c90c9ba971598b5f0841f4dc1b8b3 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 9 Mar 2021 11:43:28 -0500 Subject: [PATCH 5/7] Fix "Save Decoded". Seems it has been broken for a while, in all modes. --- widgets/mainwindow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 201adfe22..67f0dcecc 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -3292,8 +3292,6 @@ void MainWindow::to_jt9(qint32 n, qint32 istart, qint32 idone) void MainWindow::decodeDone () { - if(m_mode!="FT8" or dec_data.params.nzhsym==50) m_nDecodes=0; - if(m_mode=="QRA64") m_wideGraph->drawRed(0,0); if ("FST4W" == m_mode) { if (m_uploadWSPRSpots @@ -3313,7 +3311,10 @@ void MainWindow::decodeDone () } else { mswait = 1000.0 * ( 1.75 * m_TRperiod - tdone ); } - if(!m_diskData) killFileTimer.start(mswait); //Kill at 3/4 period + if(!m_diskData and !m_saveAll) { + if(m_saveDecoded and (m_nDecodes==0)) killFileTimer.start(mswait); //Kill at 3/4 period + } + if(m_mode!="FT8" or dec_data.params.nzhsym==50) m_nDecodes=0; dec_data.params.nagain=0; dec_data.params.ndiskdat=0; From b869f831b31b0314285e0ae5121025a882081c2e Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 10 Mar 2021 16:09:53 -0500 Subject: [PATCH 6/7] Another try at getting "Save Decoded" right for all modes. --- widgets/mainwindow.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 67f0dcecc..f04f212de 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -3307,12 +3307,18 @@ void MainWindow::decodeDone () double tdone = fmod(double(tnow.time().second()),m_TRperiod); int mswait; if( tdone < 0.5*m_TRperiod ) { - mswait = 1000.0 * ( 0.75 * m_TRperiod - tdone ); + mswait = 1000.0 * ( 0.6 * m_TRperiod - tdone ); } else { - mswait = 1000.0 * ( 1.75 * m_TRperiod - tdone ); + mswait = 1000.0 * ( 1.6 * m_TRperiod - tdone ); } + m_bDecoded=m_nDecodes>0; +// qDebug() << "aa 3316" << m_saveDecoded << m_saveAll << m_bDecoded << m_nDecodes +// << m_TRperiod << tdone << mswait; if(!m_diskData and !m_saveAll) { - if(m_saveDecoded and (m_nDecodes==0)) killFileTimer.start(mswait); //Kill at 3/4 period + if(m_saveDecoded and (m_nDecodes==0)) { +// qDebug() << "bb 3319" << mswait; + killFileTimer.start(mswait); //Kill at 3/4 period + } } if(m_mode!="FT8" or dec_data.params.nzhsym==50) m_nDecodes=0; @@ -3710,6 +3716,7 @@ void MainWindow::pskPost (DecodedText const& decodedtext) void MainWindow::killFile () { +// qDebug() << "cc 3725" << m_saveDecoded << m_saveAll << m_bDecoded << m_nDecodes << m_fnameWE; if (m_fnameWE.size () && !(m_saveAll || (m_saveDecoded && m_bDecoded))) { QFile f1 {m_fnameWE + ".wav"}; if(f1.exists()) f1.remove(); From 76e1455e352146d132924bd7d7b0da06047066fb Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 13 Mar 2021 00:02:02 +0000 Subject: [PATCH 7/7] Update release notes --- NEWS | 6 +++++- Release_Notes.txt | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index ea8daea37..4a2d2e856 100644 --- a/NEWS +++ b/NEWS @@ -13,7 +13,7 @@ Copyright 2001 - 2021 by Joe Taylor, K1JT. Release: WSJT-X 2.3.1 - Mar 8, 2021 + Mar 18, 2021 --------------------- WSJT-X 2.3.1 General Availability release updates the User Guide to @@ -46,6 +46,10 @@ below. - Repair a defect that could caused incorrect log entry fields when using FT4 mode and a priori (AP) decoding. + - Repair defects saving .WAV files for periods with decodes. + + - Offer a new scheme for adjusting macOS shared memory parameters. + Release: WSJT-X 2.3.0 Feb 2, 2021 diff --git a/Release_Notes.txt b/Release_Notes.txt index 284979e53..902abc5ab 100644 --- a/Release_Notes.txt +++ b/Release_Notes.txt @@ -14,7 +14,7 @@ Copyright 2001 - 2021 by Joe Taylor, K1JT. Release: WSJT-X 2.3.1 - Mar 8, 2021 + Mar 18, 2021 --------------------- WSJT-X 2.3.1 General Availability release updates the User Guide to @@ -47,6 +47,10 @@ below. - Repair a defect that could caused incorrect log entry fields when using FT4 mode and a priori (AP) decoding. + - Repair defects saving .WAV files for periods with decodes. + + - Offer a new scheme for adjusting macOS shared memory parameters. + Release: WSJT-X 2.3.0 Feb 2, 2021