From 72bce860d87eecb96b12169a920efc895cc0f9b7 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 28 May 2019 11:25:28 +0100 Subject: [PATCH 1/4] Remove references to N1MM on the Settings dialog as it now uses the WSJT-X UDP messages The second UDP server and port are noted as deprecated since that channel is no longer used for its original purpose, namely N1MM Logger+ consumption of ADIF logged QSO records. This has been marked as deprecated rather than removing since other applications have unilaterally chosen to use this feed rather than the documented WSJT-X UDP message protocol which contains the same information and more. Expect this UDP channel to be removed in some future WSJT-X release. --- Configuration.ui | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Configuration.ui b/Configuration.ui index 9bc5f35aa..4fd9cc1d2 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -7,7 +7,7 @@ 0 0 546 - 536 + 553 @@ -1912,7 +1912,7 @@ for assessing propagation and system performance. - N1MM Logger+ Broadcasts + Secondary UDP Server (deprecated) @@ -1928,7 +1928,7 @@ for assessing propagation and system performance. - <html><head/><body><p>N1MM Server name or IP address:</p></body></html> + Server name or IP address: n1mm_server_name_line_edit @@ -1945,7 +1945,7 @@ for assessing propagation and system performance. - <html><head/><body><p>N1MM Server port number:</p></body></html> + Server port number: n1mm_server_port_spin_box From e3ecd552813818a83c4781158ac53b140a6e43bc Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 28 May 2019 18:28:12 +0100 Subject: [PATCH 2/4] Put EU VHF contest mode serial numbers into the ADIF SRX and STX fields --- logbook/logbook.cpp | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/logbook/logbook.cpp b/logbook/logbook.cpp index b84b65c1a..aa2b7e39e 100644 --- a/logbook/logbook.cpp +++ b/logbook/logbook.cpp @@ -89,24 +89,43 @@ QByteArray LogBook::QSOToADIF (QString const& hisCall, QString const& hisGrid, Q auto words = xSent.split (' ', QString::SkipEmptyParts); if (words.size () > 1) { - bool ok; - auto sn = words.back ().toUInt (&ok); - if (ok && sn) + if (words.back ().toUInt ()) { // assume last word is a serial if there are at least // two words and if it is positive numeric - t += " ' + words.back (); + t += " ' + words.back (); + } + else + { + if (words.front ().toUInt () && words.front ().size () > 3) // EU VHF contest mode + { + auto sn_text = words.front ().mid (2); + // assume first word is report+serial if there are + // at least two words and if the first word less the + // first two characters is a positive numeric + t += " ' + sn_text; + } } } } if (xRcvd.size ()) { - QString t1=""; - if(xRcvd.split(" ").size()==2) t1=xRcvd.split(" ").at(1); - if(t1.toInt()>0) { - t += " " + t1; - } else { - t += " " + t1; - } + auto words = xRcvd.split (' ', QString::SkipEmptyParts); + if (words.size () == 2) + { + if (words.at (1).toUInt ()) + { + t += " " + words.at (1); + } + else if (words.at (0).toUInt () && words.at (0).size () > 3) // EU VHF contest exchange + { + // strip report and set SRX to serial + t += " " + words.at (0).mid (2); + } + else + { + t += " " + words.at (1); + } + } } return t.toLatin1(); } From e1451202f45ca8ed6f6e0a06764e4c575a257d2e Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 28 May 2019 19:00:13 +0100 Subject: [PATCH 3/4] CMake updates to remove warnings when using recent CMake versions --- CMake/Modules/Findhamlib.cmake | 7 +++++-- CMakeLists.txt | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CMake/Modules/Findhamlib.cmake b/CMake/Modules/Findhamlib.cmake index 98419bda1..234083ae1 100644 --- a/CMake/Modules/Findhamlib.cmake +++ b/CMake/Modules/Findhamlib.cmake @@ -19,9 +19,12 @@ find_path (__hamlib_pc_path NAMES hamlib.pc PATH_SUFFIXES lib/pkgconfig lib64/pkgconfig ) if (__hamlib_pc_path) - set (ENV{PKG_CONFIG_PATH} "${__hamlib_pc_path}" "$ENV{PKG_CONFIG_PATH}") - unset (__hamlib_pc_path CACHE) + set (__pc_path $ENV{PKG_CONFIG_PATH}) + list (APPEND __pc_path "${__hamlib_pc_path}") + set (ENV{PKG_CONFIG_PATH} "${__pc_path}") + unset (__pc_path CACHE) endif () +unset (__hamlib_pc_path CACHE) # Use pkg-config to get hints about paths, libs and, flags unset (__pkg_config_checked_hamlib CACHE) diff --git a/CMakeLists.txt b/CMakeLists.txt index db716d464..418173a73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,10 @@ if (POLICY CMP0063) cmake_policy (SET CMP0063 NEW) # honour visibility properties for all library types endif (POLICY CMP0063) +if (POLICY CMP0071) + cmake_policy (SET CMP0071 NEW) # run automoc and autouic on generated sources +endif (POLICY CMP0071) + include (${PROJECT_SOURCE_DIR}/CMake/VersionCompute.cmake) message (STATUS "Building ${CMAKE_PROJECT_NAME}-${wsjtx_VERSION}") From df4e00605ac7ce787df470973b679afd0424d371 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Thu, 30 May 2019 23:21:41 +0100 Subject: [PATCH 4/4] Better handling of exceptions thrown from contructors --- main.cpp | 2 ++ models/CabrilloLog.cpp | 58 +++++++++++++++++++++++------------------- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/main.cpp b/main.cpp index fd510bffb..cd4129701 100644 --- a/main.cpp +++ b/main.cpp @@ -380,10 +380,12 @@ int main(int argc, char *argv[]) } catch (std::exception const& e) { + MessageBox::critical_message (nullptr, QApplication::translate ("main", "Fatal error"), e.what ()); std::cerr << "Error: " << e.what () << '\n'; } catch (...) { + MessageBox::critical_message (nullptr, QApplication::translate ("main", "Unexpected fatal error")); std::cerr << "Unexpected fatal error\n"; throw; // hoping the runtime might tell us more about the exception } diff --git a/models/CabrilloLog.cpp b/models/CabrilloLog.cpp index 1fee9b148..1ef2fcc30 100644 --- a/models/CabrilloLog.cpp +++ b/models/CabrilloLog.cpp @@ -22,6 +22,7 @@ public: impl (Configuration const *); QString cabrillo_frequency_string (Radio::Frequency frequency) const; + void create_table (); Configuration const * configuration_; QSqlQuery mutable dupe_query_; @@ -34,19 +35,25 @@ CabrilloLog::impl::impl (Configuration const * configuration) { if (!database ().tables ().contains ("cabrillo_log")) { - QSqlQuery query; - SQL_error_check (query, static_cast (&QSqlQuery::exec), - "CREATE TABLE cabrillo_log (" - " id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," - " frequency INTEGER NOT NULL," - " \"when\" DATETIME NOT NULL," - " call VARCHAR(20) NOT NULL," - " exchange_sent VARCHAR(32) NOT NULL," - " exchange_rcvd VARCHAR(32) NOT NULL," - " band VARCHAR(6) NOT NULL" - ")"); + create_table (); } + setTable ("cabrillo_log"); + setEditStrategy (QSqlTableModel::OnFieldChange); + setHeaderData (fieldIndex ("frequency"), Qt::Horizontal, tr ("Freq(kHz)")); + setHeaderData (fieldIndex ("when"), Qt::Horizontal, tr ("Date & Time(UTC)")); + setHeaderData (fieldIndex ("call"), Qt::Horizontal, tr ("Call")); + setHeaderData (fieldIndex ("exchange_sent"), Qt::Horizontal, tr ("Sent")); + setHeaderData (fieldIndex ("exchange_rcvd"), Qt::Horizontal, tr ("Rcvd")); + setHeaderData (fieldIndex ("band"), Qt::Horizontal, tr ("Band")); + + // This descending order by time is important, it makes the view + // place the latest row at the top, without this the model/view + // interactions are both sluggish and unhelpful. + setSort (fieldIndex ("when"), Qt::DescendingOrder); + + SQL_error_check (*this, &QSqlTableModel::select); + SQL_error_check (dupe_query_, &QSqlQuery::prepare, "SELECT " " COUNT(*) " @@ -67,22 +74,21 @@ CabrilloLog::impl::impl (Configuration const * configuration) " cabrillo_log " " ORDER BY " " \"when\""); - - setEditStrategy (QSqlTableModel::OnFieldChange); - setTable ("cabrillo_log"); - setHeaderData (fieldIndex ("frequency"), Qt::Horizontal, tr ("Freq(kHz)")); - setHeaderData (fieldIndex ("when"), Qt::Horizontal, tr ("Date & Time(UTC)")); - setHeaderData (fieldIndex ("call"), Qt::Horizontal, tr ("Call")); - setHeaderData (fieldIndex ("exchange_sent"), Qt::Horizontal, tr ("Sent")); - setHeaderData (fieldIndex ("exchange_rcvd"), Qt::Horizontal, tr ("Rcvd")); - setHeaderData (fieldIndex ("band"), Qt::Horizontal, tr ("Band")); +} - // This descending order by time is important, it makes the view - // place the latest row at the top, without this the model/view - // interactions are both sluggish and unhelpful. - setSort (fieldIndex ("when"), Qt::DescendingOrder); - - SQL_error_check (*this, &QSqlTableModel::select); +void CabrilloLog::impl::create_table () +{ + QSqlQuery query; + SQL_error_check (query, static_cast (&QSqlQuery::exec), + "CREATE TABLE cabrillo_log (" + " id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," + " frequency INTEGER NOT NULL," + " \"when\" DATETIME NOT NULL," + " call VARCHAR(20) NOT NULL," + " exchange_sent VARCHAR(32) NOT NULL," + " exchange_rcvd VARCHAR(32) NOT NULL," + " band VARCHAR(6) NOT NULL" + ")"); } // frequency here is in kHz