1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 18:15:45 -05:00

BFM demod: RDS GUI part #12: implemented group 3 generic decoding

This commit is contained in:
f4exb 2015-12-16 05:16:27 +01:00
parent 729ac9cf3c
commit 62cb806eb1
4 changed files with 122 additions and 21 deletions

View File

@ -503,7 +503,7 @@ void BFMDemodGUI::rdsUpdateFixedFields()
ui->g00Label->setText(m_rdsParser.rds_group_acronym_tags[0].c_str()); 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->g01Label->setText(m_rdsParser.rds_group_acronym_tags[1].c_str());
ui->g02Label->setText(m_rdsParser.rds_group_acronym_tags[2].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->g04Label->setText(m_rdsParser.rds_group_acronym_tags[4].c_str());
//ui->g05Label->setText(m_rdsParser.rds_group_acronym_tags[5].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()); //ui->g06Label->setText(m_rdsParser.rds_group_acronym_tags[6].c_str());
@ -636,7 +636,14 @@ void BFMDemodGUI::rdsUpdate(bool force)
// G3 group // G3 group
if (m_rdsParser.m_g3_updated || force) if (m_rdsParser.m_g3_updated || force)
{ {
ui->g03Label->setStyleSheet("QLabel { background-color : green; }");
ui->g03CountText->setNum((int) m_rdsParser.m_g3_count); 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 // G4 group

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>712</width> <width>846</width>
<height>729</height> <height>729</height>
</rect> </rect>
</property> </property>
@ -436,7 +436,7 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>150</y> <y>150</y>
<width>661</width> <width>791</width>
<height>301</height> <height>301</height>
</rect> </rect>
</property> </property>
@ -979,9 +979,15 @@
<layout class="QHBoxLayout" name="row1DataLayout"> <layout class="QHBoxLayout" name="row1DataLayout">
<item> <item>
<widget class="QLabel" name="piLabel"> <widget class="QLabel" name="piLabel">
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>30</width> <width>16777215</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
@ -1025,9 +1031,15 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="piTPIndicator"> <widget class="QLabel" name="piTPIndicator">
<property name="maximumSize"> <property name="minimumSize">
<size> <size>
<width>20</width> <width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
@ -1244,9 +1256,15 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="g00TrafficAnnouncement"> <widget class="QLabel" name="g00TrafficAnnouncement">
<property name="maximumSize"> <property name="minimumSize">
<size> <size>
<width>20</width> <width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
@ -1306,7 +1324,7 @@
<widget class="QComboBox" name="g00AltFrequenciesBox"> <widget class="QComboBox" name="g00AltFrequenciesBox">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>50</width> <width>70</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@ -1334,6 +1352,59 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="Line" name="row2Separator6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="g03Label">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Group 3 updated</string>
</property>
<property name="text">
<string>G03</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="row2Separator5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="g03Data">
<property name="minimumSize">
<size>
<width>85</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Application Information data for Open Data</string>
</property>
<property name="text">
<string>00A 0000 0000</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="row2Separator7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="g09Label"> <widget class="QLabel" name="g09Label">
<property name="minimumSize"> <property name="minimumSize">
@ -1342,6 +1413,9 @@
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>Group 9 updated</string>
</property>
<property name="text"> <property name="text">
<string>G09</string> <string>G09</string>
</property> </property>
@ -1358,22 +1432,18 @@
<widget class="QLabel" name="g09Data"> <widget class="QLabel" name="g09Data">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>150</width> <width>130</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>Emergency Warning System raw data</string>
</property>
<property name="text"> <property name="text">
<string>00 0000 0000 00 0000</string> <string>00 0000 0000 00 0000</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="Line" name="row2Separator4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>
@ -1386,6 +1456,9 @@
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>Group 2 updated</string>
</property>
<property name="text"> <property name="text">
<string>G02</string> <string>G02</string>
</property> </property>
@ -1417,6 +1490,9 @@
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>Group 4 updated</string>
</property>
<property name="text"> <property name="text">
<string>G04</string> <string>G04</string>
</property> </property>
@ -1472,16 +1548,19 @@
<widget class="QLabel" name="g14Label"> <widget class="QLabel" name="g14Label">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>30</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>30</width> <width>16777215</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>Group 14 updated</string>
</property>
<property name="text"> <property name="text">
<string>G14</string> <string>G14</string>
</property> </property>
@ -1545,6 +1624,9 @@
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>Group 8 updated</string>
</property>
<property name="text"> <property name="text">
<string>G08</string> <string>G08</string>
</property> </property>

View File

@ -718,8 +718,9 @@ void RDSParser::decode_type3(unsigned int *group, bool B)
m_g3_updated = true; m_g3_updated = true;
m_g3_count++; m_g3_count++;
/*
qDebug() << "RDSParser::decode_type3: aid group: " << application_group qDebug() << "RDSParser::decode_type3: aid group: " << application_group
<< " " << (group_type ? 'B' : 'A'); << " " << (group_type ? 'B' : 'A');*/
if ((application_group == 8) && (group_type == false)) if ((application_group == 8) && (group_type == false))
{ // 8A { // 8A
@ -735,6 +736,7 @@ void RDSParser::decode_type3(unsigned int *group, bool B)
bool R = (message >> 1) & 0x1; // regional bool R = (message >> 1) & 0x1; // regional
bool U = message & 0x1; // urban bool U = message & 0x1; // urban
/*
qDebug() << "RDSParser::decode_type3: location table: " << ltn << " - " qDebug() << "RDSParser::decode_type3: location table: " << ltn << " - "
<< (afi ? "AFI-ON" : "AFI-OFF") << " - " << (afi ? "AFI-ON" : "AFI-OFF") << " - "
<< (M ? "enhanced mode" : "basic mode") << " - " << (M ? "enhanced mode" : "basic mode") << " - "
@ -742,19 +744,25 @@ void RDSParser::decode_type3(unsigned int *group, bool B)
<< (N ? "national " : "") << (N ? "national " : "")
<< (R ? "regional " : "") << (R ? "regional " : "")
<< (U ? "urban" : "") << (U ? "urban" : "")
<< " aid: " << aid; << " aid: " << aid;*/
} }
else if (variant_code==1) else if (variant_code==1)
{ {
int G = (message >> 12) & 0x3; // gap int G = (message >> 12) & 0x3; // gap
int sid = (message >> 6) & 0x3f; // service identifier int sid = (message >> 6) & 0x3f; // service identifier
int gap_no[4] = {3, 5, 8, 11}; int gap_no[4] = {3, 5, 8, 11};
/*
qDebug() << "RDSParser::decode_type3: gap: " << gap_no[G] << " groups, SID: " 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) void RDSParser::decode_type4(unsigned int *group, bool B)

View File

@ -82,6 +82,10 @@ public:
// G3 data // G3 data
bool m_g3_updated; bool m_g3_updated;
unsigned int m_g3_count; 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 // G4 data
bool m_g4_updated; bool m_g4_updated;