From 62cb806eb1b40636c6c60c0d497493cecca156e4 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 16 Dec 2015 05:16:27 +0100 Subject: [PATCH] BFM demod: RDS GUI part #12: implemented group 3 generic decoding --- plugins/channel/bfm/bfmdemodgui.cpp | 9 ++- plugins/channel/bfm/bfmdemodgui.ui | 114 ++++++++++++++++++++++++---- plugins/channel/bfm/rdsparser.cpp | 16 +++- plugins/channel/bfm/rdsparser.h | 4 + 4 files changed, 122 insertions(+), 21 deletions(-) diff --git a/plugins/channel/bfm/bfmdemodgui.cpp b/plugins/channel/bfm/bfmdemodgui.cpp index 8629a7133..f019d11ed 100644 --- a/plugins/channel/bfm/bfmdemodgui.cpp +++ b/plugins/channel/bfm/bfmdemodgui.cpp @@ -503,7 +503,7 @@ void BFMDemodGUI::rdsUpdateFixedFields() ui->g00Label->setText(m_rdsParser.rds_group_acronym_tags[0].c_str()); ui->g01Label->setText(m_rdsParser.rds_group_acronym_tags[1].c_str()); ui->g02Label->setText(m_rdsParser.rds_group_acronym_tags[2].c_str()); - //ui->g03Label->setText(m_rdsParser.rds_group_acronym_tags[3].c_str()); + ui->g03Label->setText(m_rdsParser.rds_group_acronym_tags[3].c_str()); ui->g04Label->setText(m_rdsParser.rds_group_acronym_tags[4].c_str()); //ui->g05Label->setText(m_rdsParser.rds_group_acronym_tags[5].c_str()); //ui->g06Label->setText(m_rdsParser.rds_group_acronym_tags[6].c_str()); @@ -636,7 +636,14 @@ void BFMDemodGUI::rdsUpdate(bool force) // G3 group if (m_rdsParser.m_g3_updated || force) { + ui->g03Label->setStyleSheet("QLabel { background-color : green; }"); ui->g03CountText->setNum((int) m_rdsParser.m_g3_count); + std::string g3str = str(boost::format("%02X%c %04X %04X") % m_rdsParser.m_g3_appGroup % (m_rdsParser.m_g3_groupB ? 'B' : 'A') % m_rdsParser.m_g3_message % m_rdsParser.m_g3_aid); + ui->g03Data->setText(QString(g3str.c_str())); + } + else + { + ui->g03Label->setStyleSheet("QLabel { background:rgb(79,79,79); }"); } // G4 group diff --git a/plugins/channel/bfm/bfmdemodgui.ui b/plugins/channel/bfm/bfmdemodgui.ui index 692991431..76a75d981 100644 --- a/plugins/channel/bfm/bfmdemodgui.ui +++ b/plugins/channel/bfm/bfmdemodgui.ui @@ -6,7 +6,7 @@ 0 0 - 712 + 846 729 @@ -436,7 +436,7 @@ 10 150 - 661 + 791 301 @@ -979,9 +979,15 @@ + + + 20 + 0 + + - 30 + 16777215 16777215 @@ -1025,9 +1031,15 @@ - + 20 + 0 + + + + + 16777215 16777215 @@ -1244,9 +1256,15 @@ - + 20 + 0 + + + + + 16777215 16777215 @@ -1306,7 +1324,7 @@ - 50 + 70 0 @@ -1334,6 +1352,59 @@ + + + + Qt::Vertical + + + + + + + + 30 + 0 + + + + Group 3 updated + + + G03 + + + + + + + Qt::Vertical + + + + + + + + 85 + 0 + + + + Application Information data for Open Data + + + 00A 0000 0000 + + + + + + + Qt::Vertical + + + @@ -1342,6 +1413,9 @@ 0 + + Group 9 updated + G09 @@ -1358,22 +1432,18 @@ - 150 + 130 0 + + Emergency Warning System raw data + 00 0000 0000 00 0000 - - - - Qt::Vertical - - - @@ -1386,6 +1456,9 @@ 16777215 + + Group 2 updated + G02 @@ -1417,6 +1490,9 @@ 0 + + Group 4 updated + G04 @@ -1472,16 +1548,19 @@ - 0 + 30 0 - 30 + 16777215 16777215 + + Group 14 updated + G14 @@ -1545,6 +1624,9 @@ 16777215 + + Group 8 updated + G08 diff --git a/plugins/channel/bfm/rdsparser.cpp b/plugins/channel/bfm/rdsparser.cpp index 387056d74..a771f0c58 100644 --- a/plugins/channel/bfm/rdsparser.cpp +++ b/plugins/channel/bfm/rdsparser.cpp @@ -718,8 +718,9 @@ void RDSParser::decode_type3(unsigned int *group, bool B) m_g3_updated = true; m_g3_count++; + /* qDebug() << "RDSParser::decode_type3: aid group: " << application_group - << " " << (group_type ? 'B' : 'A'); + << " " << (group_type ? 'B' : 'A');*/ if ((application_group == 8) && (group_type == false)) { // 8A @@ -735,6 +736,7 @@ void RDSParser::decode_type3(unsigned int *group, bool B) bool R = (message >> 1) & 0x1; // regional bool U = message & 0x1; // urban + /* qDebug() << "RDSParser::decode_type3: location table: " << ltn << " - " << (afi ? "AFI-ON" : "AFI-OFF") << " - " << (M ? "enhanced mode" : "basic mode") << " - " @@ -742,19 +744,25 @@ void RDSParser::decode_type3(unsigned int *group, bool B) << (N ? "national " : "") << (R ? "regional " : "") << (U ? "urban" : "") - << " aid: " << aid; + << " aid: " << aid;*/ } else if (variant_code==1) { int G = (message >> 12) & 0x3; // gap int sid = (message >> 6) & 0x3f; // service identifier int gap_no[4] = {3, 5, 8, 11}; + /* qDebug() << "RDSParser::decode_type3: gap: " << gap_no[G] << " groups, SID: " - << sid << " "; + << sid << " ";*/ } } - qDebug() << "RDSParser::decode_type3: message: " << message << " - aid: " << aid; + m_g3_groupB = group_type; + m_g3_appGroup = application_group; + m_g3_message = message; + m_g3_aid = aid; + + //qDebug() << "RDSParser::decode_type3: message: " << message << " - aid: " << aid; } void RDSParser::decode_type4(unsigned int *group, bool B) diff --git a/plugins/channel/bfm/rdsparser.h b/plugins/channel/bfm/rdsparser.h index 94f803162..577ab55b3 100644 --- a/plugins/channel/bfm/rdsparser.h +++ b/plugins/channel/bfm/rdsparser.h @@ -82,6 +82,10 @@ public: // G3 data bool m_g3_updated; unsigned int m_g3_count; + bool m_g3_groupB; + unsigned int m_g3_appGroup; + unsigned int m_g3_message; + unsigned int m_g3_aid; // G4 data bool m_g4_updated;