mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 09:48:45 -05:00
FreeDV demod: added a resync button
This commit is contained in:
parent
96b72667b5
commit
1e4d563ae6
@ -40,6 +40,7 @@
|
|||||||
#include "freedvdemod.h"
|
#include "freedvdemod.h"
|
||||||
|
|
||||||
MESSAGE_CLASS_DEFINITION(FreeDVDemod::MsgConfigureFreeDVDemod, Message)
|
MESSAGE_CLASS_DEFINITION(FreeDVDemod::MsgConfigureFreeDVDemod, Message)
|
||||||
|
MESSAGE_CLASS_DEFINITION(FreeDVDemod::MsgResyncFreeDVDemod, Message)
|
||||||
MESSAGE_CLASS_DEFINITION(FreeDVDemod::MsgConfigureFreeDVDemodPrivate, Message)
|
MESSAGE_CLASS_DEFINITION(FreeDVDemod::MsgConfigureFreeDVDemodPrivate, Message)
|
||||||
MESSAGE_CLASS_DEFINITION(FreeDVDemod::MsgConfigureChannelizer, Message)
|
MESSAGE_CLASS_DEFINITION(FreeDVDemod::MsgConfigureChannelizer, Message)
|
||||||
|
|
||||||
@ -84,13 +85,13 @@ void FreeDVDemod::FreeDVStats::collect(struct freedv *freeDV)
|
|||||||
m_ber = m_ber < 0 ? 0 : m_ber;
|
m_ber = m_ber < 0 ? 0 : m_ber;
|
||||||
m_berFrameCount = 0;
|
m_berFrameCount = 0;
|
||||||
m_lastTotalBitErrors = m_totalBitErrors;
|
m_lastTotalBitErrors = m_totalBitErrors;
|
||||||
|
qDebug("FreeDVStats::collect: demod sync: %d sync metric: %f demod snr: %3.2f dB BER: %d clock offset: %f freq offset: %f",
|
||||||
|
m_sync, m_syncMetric, m_snrEst, m_ber, m_clockOffset, m_freqOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_berFrameCount++;
|
m_berFrameCount++;
|
||||||
m_frameCount++;
|
m_frameCount++;
|
||||||
|
|
||||||
qDebug("FreeDVStats::collect: demod sync: %d sync metric: %f demod snr: %3.2f dB BER: %d clock offset: %f freq offset: %f",
|
|
||||||
m_sync, m_syncMetric, m_snrEst, m_ber, m_clockOffset, m_freqOffset);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,6 +328,14 @@ bool FreeDVDemod::handleMessage(const Message& cmd)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (MsgResyncFreeDVDemod::match(cmd))
|
||||||
|
{
|
||||||
|
qDebug("FreeDVDemod::handleMessage: MsgResyncFreeDVDemod");
|
||||||
|
m_settingsMutex.lock();
|
||||||
|
freedv_set_sync(m_freeDV, unsync);
|
||||||
|
m_settingsMutex.unlock();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else if (BasebandSampleSink::MsgThreadedSink::match(cmd))
|
else if (BasebandSampleSink::MsgThreadedSink::match(cmd))
|
||||||
{
|
{
|
||||||
BasebandSampleSink::MsgThreadedSink& cfg = (BasebandSampleSink::MsgThreadedSink&) cmd;
|
BasebandSampleSink::MsgThreadedSink& cfg = (BasebandSampleSink::MsgThreadedSink&) cmd;
|
||||||
|
@ -71,6 +71,19 @@ public:
|
|||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class MsgResyncFreeDVDemod : public Message {
|
||||||
|
MESSAGE_CLASS_DECLARATION
|
||||||
|
|
||||||
|
public:
|
||||||
|
static MsgResyncFreeDVDemod* create() {
|
||||||
|
return new MsgResyncFreeDVDemod();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
MsgResyncFreeDVDemod()
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
class MsgConfigureChannelizer : public Message {
|
class MsgConfigureChannelizer : public Message {
|
||||||
MESSAGE_CLASS_DECLARATION
|
MESSAGE_CLASS_DECLARATION
|
||||||
|
|
||||||
|
@ -151,6 +151,12 @@ void FreeDVDemodGUI::on_deltaFrequency_changed(qint64 value)
|
|||||||
applySettings();
|
applySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FreeDVDemodGUI::on_reSync_clicked(bool checked)
|
||||||
|
{
|
||||||
|
FreeDVDemod::MsgResyncFreeDVDemod* message = FreeDVDemod::MsgResyncFreeDVDemod::create();
|
||||||
|
m_freeDVDemod->getInputMessageQueue()->push(message);
|
||||||
|
}
|
||||||
|
|
||||||
void FreeDVDemodGUI::on_freeDVMode_currentIndexChanged(int index)
|
void FreeDVDemodGUI::on_freeDVMode_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
m_settings.m_freeDVMode = (FreeDVDemodSettings::FreeDVMode) index;
|
m_settings.m_freeDVMode = (FreeDVDemodSettings::FreeDVMode) index;
|
||||||
|
@ -96,6 +96,7 @@ private:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_deltaFrequency_changed(qint64 value);
|
void on_deltaFrequency_changed(qint64 value);
|
||||||
|
void on_reSync_clicked(bool checked);
|
||||||
void on_freeDVMode_currentIndexChanged(int index);
|
void on_freeDVMode_currentIndexChanged(int index);
|
||||||
void on_volume_valueChanged(int value);
|
void on_volume_valueChanged(int value);
|
||||||
void on_agc_toggled(bool checked);
|
void on_agc_toggled(bool checked);
|
||||||
|
@ -172,6 +172,28 @@
|
|||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="reSync">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>22</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>22</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Force re-synchronization</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>S</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="freeDVMode">
|
<widget class="QComboBox" name="freeDVMode">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
|
Loading…
Reference in New Issue
Block a user