From 5980dda8a90e5520fafd3753560f5e0e502e00b2 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 28 Jan 2023 12:29:58 +0100 Subject: [PATCH] FT8 demod: added message type column im nessages table --- ft8/unpack.cpp | 2 -- ft8/unpack.h | 8 +++++--- plugins/channelrx/demodft8/ft8demodgui.cpp | 9 +++++++++ plugins/channelrx/demodft8/ft8demodgui.h | 3 ++- plugins/channelrx/demodft8/ft8demodgui.ui | 16 ++++++++-------- plugins/channelrx/demodft8/ft8demodsettings.h | 1 + plugins/channelrx/demodft8/ft8demodworker.cpp | 2 +- plugins/channelrx/demodft8/readme.md | 11 +++++++++++ 8 files changed, 37 insertions(+), 15 deletions(-) diff --git a/ft8/unpack.cpp b/ft8/unpack.cpp index 3fabf64c1..65620eca8 100644 --- a/ft8/unpack.cpp +++ b/ft8/unpack.cpp @@ -367,8 +367,6 @@ std::string Packing::unpack_0_1(int a77[], std::string& call1str, std::string& c { // bit fields: c28 c28 h10 r5 int i = 0; - int tu = a77[i]; - i += 1; int call1 = un64(a77, i, 28); // c28 i += 28; int call2 = un64(a77, i, 28); // c28 diff --git a/ft8/unpack.h b/ft8/unpack.h index 7293eb397..bd6938c4e 100644 --- a/ft8/unpack.h +++ b/ft8/unpack.h @@ -40,12 +40,14 @@ private: std::string unpackcall(int x); std::string unpackgrid(int ng, int ir, int i3); void remember_call(std::string call); - std::string unpack_4(int a77[], std::string& call1str, std::string& call2str, std::string& locstr); - std::string unpack_1(int a77[], std::string& call1str, std::string& call2str, std::string& locstr); std::string unpack_0_0(int a77[], std::string& call1str, std::string& call2str, std::string& locstr); std::string unpack_0_1(int a77[], std::string& call1str, std::string& call2str, std::string& locstr); - std::string unpack_3(int a77[], std::string& call1str, std::string& call2str, std::string& locstr); + // 0.3 and 0.4 std::string unpack_0_3(int a77[], int n3, std::string& call1str, std::string& call2str, std::string& locstr); + // 1 and 2 + std::string unpack_1(int a77[], std::string& call1str, std::string& call2str, std::string& locstr); + std::string unpack_3(int a77[], std::string& call1str, std::string& call2str, std::string& locstr); + std::string unpack_4(int a77[], std::string& call1str, std::string& call2str, std::string& locstr); QRecursiveMutex hashes_mu; std::map hashes10; diff --git a/plugins/channelrx/demodft8/ft8demodgui.cpp b/plugins/channelrx/demodft8/ft8demodgui.cpp index d94aec581..9241af4fd 100644 --- a/plugins/channelrx/demodft8/ft8demodgui.cpp +++ b/plugins/channelrx/demodft8/ft8demodgui.cpp @@ -69,6 +69,8 @@ QVariant FT8MessagesTableModel::data(const QModelIndex &index, int role) const switch (index.column()) { case FT8DemodSettings::MESSAGE_COL_UTC: return ft8Message.m_utc; + case FT8DemodSettings::MESSAGE_COL_TYPE: + return ft8Message.m_type; case FT8DemodSettings::MESSAGE_COL_PASS: return ft8Message.m_pass; case FT8DemodSettings::MESSAGE_COL_OKBITS: @@ -95,6 +97,7 @@ QVariant FT8MessagesTableModel::data(const QModelIndex &index, int role) const if (role == Qt::TextAlignmentRole) { switch (index.column()) { + case FT8DemodSettings::MESSAGE_COL_TYPE: case FT8DemodSettings::MESSAGE_COL_DT: case FT8DemodSettings::MESSAGE_COL_DF: case FT8DemodSettings::MESSAGE_COL_SNR: @@ -114,6 +117,8 @@ QVariant FT8MessagesTableModel::headerData(int section, Qt::Orientation orientat switch (section) { case FT8DemodSettings::MESSAGE_COL_UTC: return tr("UTC"); + case FT8DemodSettings::MESSAGE_COL_TYPE: + return tr("Typ"); case FT8DemodSettings::MESSAGE_COL_PASS: return tr("P"); case FT8DemodSettings::MESSAGE_COL_OKBITS: @@ -142,6 +147,8 @@ QVariant FT8MessagesTableModel::headerData(int section, Qt::Orientation orientat switch (section) { case FT8DemodSettings::MESSAGE_COL_UTC: return tr("Sequence UTC time HHMMSS"); + case FT8DemodSettings::MESSAGE_COL_TYPE: + return tr("Message type (see documentation)"); case FT8DemodSettings::MESSAGE_COL_PASS: return tr("Successful decoder pass index"); case FT8DemodSettings::MESSAGE_COL_OKBITS: @@ -183,6 +190,7 @@ void FT8MessagesTableModel::messagesReceived(const QList& messages) { m_ft8Messages.push_back(FT8MesssageData{ message.ts.toString("HHmmss"), + message.type, message.pass, message.nbCorrectBits, message.dt, @@ -207,6 +215,7 @@ void FT8MessagesTableModel::setDefaultMessage() beginInsertRows(QModelIndex(), 0, 0); m_ft8Messages.push_back(FT8MesssageData{ "000000", + "0.0", 0, 174, -8.0, diff --git a/plugins/channelrx/demodft8/ft8demodgui.h b/plugins/channelrx/demodft8/ft8demodgui.h index df6ade98a..829135997 100644 --- a/plugins/channelrx/demodft8/ft8demodgui.h +++ b/plugins/channelrx/demodft8/ft8demodgui.h @@ -44,6 +44,7 @@ namespace Ui { struct FT8MesssageData { QString m_utc; + QString m_type; int m_pass; int m_okBits; float m_dt; @@ -73,7 +74,7 @@ public: private: QVector m_ft8Messages; - static const int m_columnCount = 10; + static const int m_columnCount = 11; }; class FT8DemodGUI : public ChannelGUI { diff --git a/plugins/channelrx/demodft8/ft8demodgui.ui b/plugins/channelrx/demodft8/ft8demodgui.ui index ef87a048b..c6a871528 100644 --- a/plugins/channelrx/demodft8/ft8demodgui.ui +++ b/plugins/channelrx/demodft8/ft8demodgui.ui @@ -6,7 +6,7 @@ 0 0 - 520 + 542 731 @@ -18,7 +18,7 @@ - 520 + 542 0 @@ -36,7 +36,7 @@ 0 0 - 501 + 531 181 @@ -648,9 +648,9 @@ - 10 + 0 193 - 218 + 531 261 @@ -719,12 +719,12 @@ - + 0 460 - 501 + 531 251 @@ -754,7 +754,7 @@ 3 - 2 + 0 3 diff --git a/plugins/channelrx/demodft8/ft8demodsettings.h b/plugins/channelrx/demodft8/ft8demodsettings.h index d6b13d014..0cd9bf8a6 100644 --- a/plugins/channelrx/demodft8/ft8demodsettings.h +++ b/plugins/channelrx/demodft8/ft8demodsettings.h @@ -52,6 +52,7 @@ struct FT8DemodSettings { enum MessageCol { MESSAGE_COL_UTC, + MESSAGE_COL_TYPE, MESSAGE_COL_PASS, MESSAGE_COL_OKBITS, MESSAGE_COL_DT, diff --git a/plugins/channelrx/demodft8/ft8demodworker.cpp b/plugins/channelrx/demodft8/ft8demodworker.cpp index c2f1d2d63..9a75aad0a 100644 --- a/plugins/channelrx/demodft8/ft8demodworker.cpp +++ b/plugins/channelrx/demodft8/ft8demodworker.cpp @@ -78,7 +78,7 @@ int FT8DemodWorker::FT8Callback::hcb( pass, (int) snr, correct_bits, - off - 0.5, + off - 0.5f, hz0, QString(call1.c_str()).simplified(), QString(call2.c_str()).simplified(), diff --git a/plugins/channelrx/demodft8/readme.md b/plugins/channelrx/demodft8/readme.md index e111f4e12..a781ceb08 100644 --- a/plugins/channelrx/demodft8/readme.md +++ b/plugins/channelrx/demodft8/readme.md @@ -183,6 +183,17 @@ Where date is the slot date in YYYYMMDD format (in WSJT-X this is YYMMDD) and ti Displays the received messages in a table which columns are the following: - **UTC**: UTC time in HHmmss format of the FT8 slot + - **Typ**: Message type according to the i3.n3 format described in the protocol (see reference at the top): + - **0.0**: Free text + - **0.1**: DXpedition. Message carries two compacted messages (one for RR73 and one for report to two different callees). They will be de-compacted for dispplay. + - **0.3**: ARRL field day + - **0.4**: ARRL field day + - **0.5**: Telemetry + - **1**: Standard message (the most common) + - **2**: European VHF (4 char locator) minor change to standard message + - **3**: Russian RTTY + - **4**: Non standard call + - **5**: European VHF (6 char locator) - **P**: LDPC decoder pass index that was successful (0 to 2) as there are 3 passes - **OKb**: Number of correct bits in the message before FEC correction. Maximum is 174 in which case no FEC would be needed. - **dt**: Message start time shift in seconds from standard FT8 time slot