BFM demod: implement button to control RDS activation

pull/6/head
f4exb 2015-12-09 04:13:13 +01:00
rodzic 274626d58f
commit 1b66b72a11
7 zmienionych plików z 60 dodań i 15 usunięć

Wyświetl plik

@ -75,9 +75,16 @@ void BFMDemod::configure(MessageQueue* messageQueue,
Real volume, Real volume,
Real squelch, Real squelch,
bool audioStereo, bool audioStereo,
bool showPilot) bool showPilot,
bool rdsActive)
{ {
Message* cmd = MsgConfigureBFMDemod::create(rfBandwidth, afBandwidth, volume, squelch, audioStereo, showPilot); Message* cmd = MsgConfigureBFMDemod::create(rfBandwidth,
afBandwidth,
volume,
squelch,
audioStereo,
showPilot,
rdsActive);
messageQueue->push(cmd); messageQueue->push(cmd);
} }
@ -256,6 +263,7 @@ bool BFMDemod::handleMessage(const Message& cmd)
m_config.m_squelch = cfg.getSquelch(); m_config.m_squelch = cfg.getSquelch();
m_config.m_audioStereo = cfg.getAudioStereo(); m_config.m_audioStereo = cfg.getAudioStereo();
m_config.m_showPilot = cfg.getShowPilot(); m_config.m_showPilot = cfg.getShowPilot();
m_config.m_rdsActive = cfg.getRDSActive();
apply(); apply();
@ -264,7 +272,8 @@ bool BFMDemod::handleMessage(const Message& cmd)
<< " m_volume: " << m_config.m_volume << " m_volume: " << m_config.m_volume
<< " m_squelch: " << m_config.m_squelch << " m_squelch: " << m_config.m_squelch
<< " m_audioStereo: " << m_config.m_audioStereo << " m_audioStereo: " << m_config.m_audioStereo
<< " m_showPilot: " << m_config.m_showPilot; << " m_showPilot: " << m_config.m_showPilot
<< " m_rdsActive: " << m_config.m_rdsActive;
return true; return true;
} }
@ -356,5 +365,5 @@ void BFMDemod::apply()
m_running.m_audioSampleRate = m_config.m_audioSampleRate; m_running.m_audioSampleRate = m_config.m_audioSampleRate;
m_running.m_audioStereo = m_config.m_audioStereo; m_running.m_audioStereo = m_config.m_audioStereo;
m_running.m_showPilot = m_config.m_showPilot; m_running.m_showPilot = m_config.m_showPilot;
m_running.m_rdsActive = m_config.m_rdsActive;
} }

Wyświetl plik

@ -44,7 +44,8 @@ public:
Real volume, Real volume,
Real squelch, Real squelch,
bool audioStereo, bool audioStereo,
bool showPilot); bool showPilot,
bool rdsActive);
int getSampleRate() const { return m_config.m_inputSampleRate; } int getSampleRate() const { return m_config.m_inputSampleRate; }
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po); virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
@ -67,15 +68,23 @@ private:
Real getSquelch() const { return m_squelch; } Real getSquelch() const { return m_squelch; }
bool getAudioStereo() const { return m_audioStereo; } bool getAudioStereo() const { return m_audioStereo; }
bool getShowPilot() const { return m_showPilot; } bool getShowPilot() const { return m_showPilot; }
bool getRDSActive() const { return m_rdsActive; }
static MsgConfigureBFMDemod* create(Real rfBandwidth, static MsgConfigureBFMDemod* create(Real rfBandwidth,
Real afBandwidth, Real afBandwidth,
Real volume, Real volume,
Real squelch, Real squelch,
bool audioStereo, bool audioStereo,
bool showPilot) bool showPilot,
bool rdsActive)
{ {
return new MsgConfigureBFMDemod(rfBandwidth, afBandwidth, volume, squelch, audioStereo, showPilot); return new MsgConfigureBFMDemod(rfBandwidth,
afBandwidth,
volume,
squelch,
audioStereo,
showPilot,
rdsActive);
} }
private: private:
@ -85,20 +94,23 @@ private:
Real m_squelch; Real m_squelch;
bool m_audioStereo; bool m_audioStereo;
bool m_showPilot; bool m_showPilot;
bool m_rdsActive;
MsgConfigureBFMDemod(Real rfBandwidth, MsgConfigureBFMDemod(Real rfBandwidth,
Real afBandwidth, Real afBandwidth,
Real volume, Real volume,
Real squelch, Real squelch,
bool audioStereo, bool audioStereo,
bool showPilot) : bool showPilot,
bool rdsActive) :
Message(), Message(),
m_rfBandwidth(rfBandwidth), m_rfBandwidth(rfBandwidth),
m_afBandwidth(afBandwidth), m_afBandwidth(afBandwidth),
m_volume(volume), m_volume(volume),
m_squelch(squelch), m_squelch(squelch),
m_audioStereo(audioStereo), m_audioStereo(audioStereo),
m_showPilot(showPilot) m_showPilot(showPilot),
m_rdsActive(rdsActive)
{ } { }
}; };
@ -123,6 +135,7 @@ private:
quint32 m_audioSampleRate; quint32 m_audioSampleRate;
bool m_audioStereo; bool m_audioStereo;
bool m_showPilot; bool m_showPilot;
bool m_rdsActive;
Config() : Config() :
m_inputSampleRate(-1), m_inputSampleRate(-1),
@ -133,7 +146,8 @@ private:
m_volume(0), m_volume(0),
m_audioSampleRate(0), m_audioSampleRate(0),
m_audioStereo(false), m_audioStereo(false),
m_showPilot(false) m_showPilot(false),
m_rdsActive(false)
{ } { }
}; };

Wyświetl plik

@ -243,6 +243,11 @@ void BFMDemodGUI::on_showPilot_clicked()
applySettings(); applySettings();
} }
void BFMDemodGUI::on_rds_clicked()
{
applySettings();
}
void BFMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown) void BFMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
{ {
} }
@ -338,7 +343,8 @@ void BFMDemodGUI::applySettings()
ui->volume->value() / 10.0, ui->volume->value() / 10.0,
ui->squelch->value(), ui->squelch->value(),
ui->audioStereo->isChecked(), ui->audioStereo->isChecked(),
ui->showPilot->isChecked()); ui->showPilot->isChecked(),
ui->rds->isChecked());
} }
} }

Wyświetl plik

@ -63,6 +63,7 @@ private slots:
void on_squelch_valueChanged(int value); void on_squelch_valueChanged(int value);
void on_audioStereo_toggled(bool stereo); void on_audioStereo_toggled(bool stereo);
void on_showPilot_clicked(); void on_showPilot_clicked();
void on_rds_clicked();
void onWidgetRolled(QWidget* widget, bool rollDown); void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDoubleClicked(); void onMenuDoubleClicked();
void tick(); void tick();

Wyświetl plik

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>308</width> <width>335</width>
<height>333</height> <height>333</height>
</rect> </rect>
</property> </property>
@ -21,7 +21,7 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>20</y> <y>20</y>
<width>281</width> <width>311</width>
<height>121</height> <height>121</height>
</rect> </rect>
</property> </property>
@ -203,6 +203,20 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="ButtonSwitch" name="rds">
<property name="toolTip">
<string>Toggle RDS subsystem activation</string>
</property>
<property name="text">
<string>.</string>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/rds.png</normaloff>:/rds.png</iconset>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@ -386,12 +400,12 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>160</y> <y>160</y>
<width>281</width> <width>311</width>
<height>151</height> <height>151</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Channel Spectrum</string> <string>Baseband Spectrum</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing"> <property name="spacing">

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 416 B

Wyświetl plik

@ -46,5 +46,6 @@
<file>flip_lr.png</file> <file>flip_lr.png</file>
<file>flip_rl.png</file> <file>flip_rl.png</file>
<file>carrier.png</file> <file>carrier.png</file>
<file>rds.png</file>
</qresource> </qresource>
</RCC> </RCC>