mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 18:15:45 -05:00
DSD demod plugin: added button to toggle between transition constellation and symbol synchronization displays
This commit is contained in:
parent
71379c837b
commit
a6782a2780
@ -84,7 +84,8 @@ void DSDDemod::configure(MessageQueue* messageQueue,
|
||||
int squelchGate,
|
||||
Real squelch,
|
||||
bool audioMute,
|
||||
bool enableCosineFiltering)
|
||||
bool enableCosineFiltering,
|
||||
bool syncOrConstellation)
|
||||
{
|
||||
Message* cmd = MsgConfigureDSDDemod::create(rfBandwidth,
|
||||
demodGain,
|
||||
@ -94,7 +95,8 @@ void DSDDemod::configure(MessageQueue* messageQueue,
|
||||
squelchGate,
|
||||
squelch,
|
||||
audioMute,
|
||||
enableCosineFiltering);
|
||||
enableCosineFiltering,
|
||||
syncOrConstellation);
|
||||
messageQueue->push(cmd);
|
||||
}
|
||||
|
||||
@ -175,8 +177,16 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
||||
delayedSample = m_sampleBuffer[m_sampleBufferIndex - samplesPerSymbol];
|
||||
}
|
||||
|
||||
Sample s(sample, delayedSample); // I=signal, Q=signal delayed by 20 samples (2400 baud: lowest rate)
|
||||
m_scopeSampleBuffer.push_back(s);
|
||||
if (m_running.m_syncOrConstellation)
|
||||
{
|
||||
Sample s(sample, m_dsdDecoder.getSymbolSyncSample());
|
||||
m_scopeSampleBuffer.push_back(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
Sample s(sample, delayedSample); // I=signal, Q=signal delayed by 20 samples (2400 baud: lowest rate)
|
||||
m_scopeSampleBuffer.push_back(s);
|
||||
}
|
||||
|
||||
if (DSPEngine::instance()->hasDVSerialSupport() && m_dsdDecoder.mbeDVReady())
|
||||
{
|
||||
@ -255,6 +265,7 @@ bool DSDDemod::handleMessage(const Message& cmd)
|
||||
m_config.m_squelch = cfg.getSquelch();
|
||||
m_config.m_audioMute = cfg.getAudioMute();
|
||||
m_config.m_enableCosineFiltering = cfg.getEnableCosineFiltering();
|
||||
m_config.m_syncOrConstellation = cfg.getSyncOrConstellation();
|
||||
|
||||
apply();
|
||||
|
||||
@ -266,7 +277,8 @@ bool DSDDemod::handleMessage(const Message& cmd)
|
||||
<< " m_squelchGate" << m_config.m_squelchGate
|
||||
<< " m_squelch: " << m_config.m_squelch
|
||||
<< " m_audioMute: " << m_config.m_audioMute
|
||||
<< " m_enableCosineFiltering: " << m_config.m_enableCosineFiltering;
|
||||
<< " m_enableCosineFiltering: " << m_config.m_enableCosineFiltering
|
||||
<< " m_syncOrConstellation: " << m_config.m_syncOrConstellation;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -340,4 +352,5 @@ void DSDDemod::apply()
|
||||
m_running.m_audioSampleRate = m_config.m_audioSampleRate;
|
||||
m_running.m_audioMute = m_config.m_audioMute;
|
||||
m_running.m_enableCosineFiltering = m_config.m_enableCosineFiltering;
|
||||
m_running.m_syncOrConstellation = m_config.m_syncOrConstellation;
|
||||
}
|
||||
|
@ -49,7 +49,8 @@ public:
|
||||
int squelchGate,
|
||||
Real squelch,
|
||||
bool audioMute,
|
||||
bool enableCosineFiltering);
|
||||
bool enableCosineFiltering,
|
||||
bool syncOrConstellation);
|
||||
|
||||
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
|
||||
virtual void start();
|
||||
@ -79,6 +80,7 @@ private:
|
||||
Real getSquelch() const { return m_squelch; }
|
||||
bool getAudioMute() const { return m_audioMute; }
|
||||
bool getEnableCosineFiltering() const { return m_enableCosineFiltering; }
|
||||
bool getSyncOrConstellation() const { return m_syncOrConstellation; }
|
||||
|
||||
static MsgConfigureDSDDemod* create(int rfBandwidth,
|
||||
int demodGain,
|
||||
@ -88,9 +90,19 @@ private:
|
||||
int squelchGate,
|
||||
Real squelch,
|
||||
bool audioMute,
|
||||
bool enableCosineFiltering)
|
||||
bool enableCosineFiltering,
|
||||
bool syncOrConstellation)
|
||||
{
|
||||
return new MsgConfigureDSDDemod(rfBandwidth, demodGain, fmDeviation, volume, baudRate, squelchGate, squelch, audioMute, enableCosineFiltering);
|
||||
return new MsgConfigureDSDDemod(rfBandwidth,
|
||||
demodGain,
|
||||
fmDeviation,
|
||||
volume,
|
||||
baudRate,
|
||||
squelchGate,
|
||||
squelch,
|
||||
audioMute,
|
||||
enableCosineFiltering,
|
||||
syncOrConstellation);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -103,6 +115,7 @@ private:
|
||||
Real m_squelch;
|
||||
bool m_audioMute;
|
||||
bool m_enableCosineFiltering;
|
||||
bool m_syncOrConstellation;
|
||||
|
||||
MsgConfigureDSDDemod(int rfBandwidth,
|
||||
int demodGain,
|
||||
@ -112,7 +125,8 @@ private:
|
||||
int squelchGate,
|
||||
Real squelch,
|
||||
bool audioMute,
|
||||
bool enableCosineFiltering) :
|
||||
bool enableCosineFiltering,
|
||||
bool syncOrConstellation) :
|
||||
Message(),
|
||||
m_rfBandwidth(rfBandwidth),
|
||||
m_demodGain(demodGain),
|
||||
@ -122,7 +136,8 @@ private:
|
||||
m_squelchGate(squelchGate),
|
||||
m_squelch(squelch),
|
||||
m_audioMute(audioMute),
|
||||
m_enableCosineFiltering(enableCosineFiltering)
|
||||
m_enableCosineFiltering(enableCosineFiltering),
|
||||
m_syncOrConstellation(syncOrConstellation)
|
||||
{ }
|
||||
};
|
||||
|
||||
@ -150,6 +165,7 @@ private:
|
||||
bool m_audioMute;
|
||||
quint32 m_audioSampleRate;
|
||||
bool m_enableCosineFiltering;
|
||||
bool m_syncOrConstellation;
|
||||
|
||||
Config() :
|
||||
m_inputSampleRate(-1),
|
||||
@ -163,7 +179,8 @@ private:
|
||||
m_squelch(0),
|
||||
m_audioMute(false),
|
||||
m_audioSampleRate(0),
|
||||
m_enableCosineFiltering(false)
|
||||
m_enableCosineFiltering(false),
|
||||
m_syncOrConstellation(false)
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -115,6 +115,7 @@ QByteArray DSDDemodGUI::serialize() const
|
||||
s.writeBlob(10, ui->scopeGUI->serialize());
|
||||
s.writeS32(11, ui->baudRate->currentIndex());
|
||||
s.writeBool(12, m_enableCosineFiltering);
|
||||
s.writeBool(13, m_syncOrConstellation);
|
||||
return s.final();
|
||||
}
|
||||
|
||||
@ -163,6 +164,7 @@ bool DSDDemodGUI::deserialize(const QByteArray& data)
|
||||
d.readS32(11, &tmp, 20);
|
||||
ui->baudRate->setCurrentIndex(tmp);
|
||||
d.readBool(12, &m_enableCosineFiltering, false);
|
||||
d.readBool(13, &m_syncOrConstellation, false);
|
||||
|
||||
blockApplySettings(false);
|
||||
m_channelMarker.blockSignals(false);
|
||||
@ -243,6 +245,12 @@ void DSDDemodGUI::on_enableCosineFiltering_toggled(bool enable)
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void DSDDemodGUI::on_syncOrConstellation_toggled(bool checked)
|
||||
{
|
||||
m_syncOrConstellation = checked;
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void DSDDemodGUI::on_squelchGate_valueChanged(int value)
|
||||
{
|
||||
applySettings();
|
||||
@ -288,6 +296,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa
|
||||
m_doApplySettings(true),
|
||||
m_signalFormat(signalFormatNone),
|
||||
m_enableCosineFiltering(false),
|
||||
m_syncOrConstellation(false),
|
||||
m_squelchOpen(false),
|
||||
m_channelPowerDbAvg(20,0),
|
||||
m_tickCount(0)
|
||||
@ -363,8 +372,7 @@ void DSDDemodGUI::applySettings()
|
||||
ui->squelchGateText->setText(QString("%1").arg(ui->squelchGate->value() * 10.0, 0, 'f', 0));
|
||||
ui->volumeText->setText(QString("%1").arg(ui->volume->value() / 10.0, 0, 'f', 1));
|
||||
ui->enableCosineFiltering->setChecked(m_enableCosineFiltering);
|
||||
|
||||
// TODO: pass m_enableCosineFiltering
|
||||
ui->syncOrConstellation->setChecked(m_syncOrConstellation);
|
||||
|
||||
m_dsdDemod->configure(m_dsdDemod->getInputMessageQueue(),
|
||||
ui->rfBW->value(),
|
||||
@ -375,7 +383,8 @@ void DSDDemodGUI::applySettings()
|
||||
ui->squelchGate->value(), // in 10ths of ms
|
||||
ui->squelch->value(),
|
||||
ui->audioMute->isChecked(),
|
||||
m_enableCosineFiltering);
|
||||
m_enableCosineFiltering,
|
||||
m_syncOrConstellation);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,6 +66,7 @@ private slots:
|
||||
void on_volume_valueChanged(int value);
|
||||
void on_baudRate_currentIndexChanged(int index);
|
||||
void on_enableCosineFiltering_toggled(bool enable);
|
||||
void on_syncOrConstellation_toggled(bool checked);
|
||||
void on_fmDeviation_valueChanged(int value);
|
||||
void on_squelchGate_valueChanged(int value);
|
||||
void on_squelch_valueChanged(int value);
|
||||
@ -98,6 +99,7 @@ private:
|
||||
|
||||
DSDDemod* m_dsdDemod;
|
||||
bool m_enableCosineFiltering;
|
||||
bool m_syncOrConstellation;
|
||||
bool m_audioMute;
|
||||
bool m_squelchOpen;
|
||||
MovingAverage<Real> m_channelPowerDbAvg;
|
||||
|
@ -59,16 +59,7 @@
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<property name="margin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -210,7 +201,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Symbol synchronization quality (%)</string>
|
||||
<string>Symbol synchronization rate (%)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>00</string>
|
||||
@ -253,6 +244,24 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="syncOrConstellation">
|
||||
<property name="toolTip">
|
||||
<string>Toggle between transition constellation and symbol synchronization displays</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../sdrbase/resources/res.qrc">
|
||||
<normaloff>:/constellation.png</normaloff>
|
||||
<normalon>:/slopep_icon.png</normalon>:/constellation.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="inCarrierPosText">
|
||||
<property name="minimumSize">
|
||||
@ -775,16 +784,7 @@
|
||||
<string>Discriminator Scope</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="scopeContainer">
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<property name="margin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
|
BIN
sdrbase/resources/constellation.png
Normal file
BIN
sdrbase/resources/constellation.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 838 B |
@ -57,5 +57,6 @@
|
||||
<file>rds.png</file>
|
||||
<file>recycle.png</file>
|
||||
<file>lsb.png</file>
|
||||
<file>constellation.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
Loading…
Reference in New Issue
Block a user