diff --git a/CMakeLists.txt b/CMakeLists.txt index 81a981064..5bd002e56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1602,7 +1602,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 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/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/NEWS b/NEWS index 7402d4013..a591105d7 100644 --- a/NEWS +++ b/NEWS @@ -63,7 +63,7 @@ the RC1 release. 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 @@ -96,6 +96,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.4.0-rc1 Feb 3, 2021 diff --git a/Release_Notes.txt b/Release_Notes.txt index 3d3361e11..02ef83715 100644 --- a/Release_Notes.txt +++ b/Release_Notes.txt @@ -63,7 +63,7 @@ the RC1 release. 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 @@ -96,6 +96,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.4.0-rc1 Feb 3, 2021 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); } diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index fcf6b355b..260e38992 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 7ccc16857..346a5ee9c 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: diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 8824877ab..42f3706b7 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -5006,7 +5006,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(); @@ -5035,11 +5035,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) {