From 729ac9cf3c0728ad11cae2e0d83ae27237f41ced Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 16 Dec 2015 04:43:29 +0100 Subject: [PATCH] BFM demod: RDS GUI part #11: implemented group8 generic decoding --- plugins/channel/bfm/bfmdemodgui.cpp | 9 +++++- plugins/channel/bfm/bfmdemodgui.ui | 48 ++++++++++++++++++++++++++++- plugins/channel/bfm/rdsparser.cpp | 23 ++++++++++++-- plugins/channel/bfm/rdsparser.h | 11 +++++-- 4 files changed, 85 insertions(+), 6 deletions(-) diff --git a/plugins/channel/bfm/bfmdemodgui.cpp b/plugins/channel/bfm/bfmdemodgui.cpp index 377462786..8629a7133 100644 --- a/plugins/channel/bfm/bfmdemodgui.cpp +++ b/plugins/channel/bfm/bfmdemodgui.cpp @@ -509,7 +509,7 @@ void BFMDemodGUI::rdsUpdateFixedFields() //ui->g06Label->setText(m_rdsParser.rds_group_acronym_tags[6].c_str()); //ui->g07Label->setText(m_rdsParser.rds_group_acronym_tags[7].c_str()); ui->g08Label->setText(m_rdsParser.rds_group_acronym_tags[8].c_str()); - //ui->g09Label->setText(m_rdsParser.rds_group_acronym_tags[9].c_str()); + ui->g09Label->setText(m_rdsParser.rds_group_acronym_tags[9].c_str()); ui->g14Label->setText(m_rdsParser.rds_group_acronym_tags[14].c_str()); ui->g00CountLabel->setText(m_rdsParser.rds_group_acronym_tags[0].c_str()); @@ -699,7 +699,14 @@ void BFMDemodGUI::rdsUpdate(bool force) // G9 group if (m_rdsParser.m_g9_updated || force) { + ui->g09Label->setStyleSheet("QLabel { background-color : green; }"); ui->g09CountText->setNum((int) m_rdsParser.m_g9_count); + std::string g9str = str(boost::format("%02X %04X %04X %02X %04X") % m_rdsParser.m_g9_varA % m_rdsParser.m_g9_cA % m_rdsParser.m_g9_dA % m_rdsParser.m_g9_varB % m_rdsParser.m_g9_dB); + ui->g09Data->setText(QString(g9str.c_str())); + } + else + { + ui->g09Label->setStyleSheet("QLabel { background:rgb(79,79,79); }"); } // G14 group diff --git a/plugins/channel/bfm/bfmdemodgui.ui b/plugins/channel/bfm/bfmdemodgui.ui index 923a63664..692991431 100644 --- a/plugins/channel/bfm/bfmdemodgui.ui +++ b/plugins/channel/bfm/bfmdemodgui.ui @@ -1186,9 +1186,15 @@ - + 30 + 0 + + + + + 16777215 16777215 @@ -1328,6 +1334,46 @@ + + + + + 30 + 0 + + + + G09 + + + + + + + Qt::Vertical + + + + + + + + 150 + 0 + + + + 00 0000 0000 00 0000 + + + + + + + Qt::Vertical + + + diff --git a/plugins/channel/bfm/rdsparser.cpp b/plugins/channel/bfm/rdsparser.cpp index 09e669b88..387056d74 100644 --- a/plugins/channel/bfm/rdsparser.cpp +++ b/plugins/channel/bfm/rdsparser.cpp @@ -322,7 +322,14 @@ void RDSParser::clearAllFields() m_g8_label_index = -1; m_g8_content = 0; - // Group 09..13 data + // Group 09 data + m_g9_varA = 0; + m_g9_cA = 0; + m_g9_dA = 0; + m_g9_varB = 0; + m_g9_dB = 0; + + // Group 10..13 data m_g9_count = 0; m_g10_count = 0; m_g11_count = 0; @@ -910,7 +917,19 @@ void RDSParser::decode_optional_content(int no_groups, unsigned long int *free_f } void RDSParser::decode_type9(unsigned int *group, bool B){ - qDebug() << "RDSParser::decode_type9: type 9 not implemented yet"; + + if (B) + { + m_g9_varB = group[1] & 0x1f; + m_g9_dB = group[3]; + } + else + { + m_g9_varA = group[1] & 0x1f; + m_g9_cA = group[2]; + m_g9_dA = group[3]; + } + m_g9_updated = true; m_g9_count++; } diff --git a/plugins/channel/bfm/rdsparser.h b/plugins/channel/bfm/rdsparser.h index 934845951..94f803162 100644 --- a/plugins/channel/bfm/rdsparser.h +++ b/plugins/channel/bfm/rdsparser.h @@ -114,13 +114,20 @@ public: int m_g8_label_index; //!< negative if not received int m_g8_content; - // G9..G13 data + // G9 data bool m_g9_updated; + unsigned int m_g9_count; + unsigned int m_g9_varA; + unsigned int m_g9_cA; + unsigned int m_g9_dA; + unsigned int m_g9_varB; + unsigned int m_g9_dB; + + // G10..G13 data bool m_g10_updated; bool m_g11_updated; bool m_g12_updated; bool m_g13_updated; - unsigned int m_g9_count; unsigned int m_g10_count; unsigned int m_g11_count; unsigned int m_g12_count;