mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-03 21:43:24 -05:00
Channel Analyzer NG: deserialization: set decimation and filters in appropriate order
This commit is contained in:
parent
4894c8d3ba
commit
91377b8a59
@ -132,7 +132,7 @@ void ChannelAnalyzerNG::stop()
|
|||||||
|
|
||||||
bool ChannelAnalyzerNG::handleMessage(const Message& cmd)
|
bool ChannelAnalyzerNG::handleMessage(const Message& cmd)
|
||||||
{
|
{
|
||||||
float band, lowCutoff;
|
float bandwidth, lowCutoff;
|
||||||
|
|
||||||
qDebug() << "ChannelAnalyzerNG::handleMessage";
|
qDebug() << "ChannelAnalyzerNG::handleMessage";
|
||||||
|
|
||||||
@ -152,12 +152,12 @@ bool ChannelAnalyzerNG::handleMessage(const Message& cmd)
|
|||||||
{
|
{
|
||||||
MsgConfigureChannelAnalyzer& cfg = (MsgConfigureChannelAnalyzer&) cmd;
|
MsgConfigureChannelAnalyzer& cfg = (MsgConfigureChannelAnalyzer&) cmd;
|
||||||
|
|
||||||
band = cfg.getBandwidth();
|
bandwidth = cfg.getBandwidth();
|
||||||
lowCutoff = cfg.getLoCutoff();
|
lowCutoff = cfg.getLoCutoff();
|
||||||
|
|
||||||
if (band < 0)
|
if (bandwidth < 0)
|
||||||
{
|
{
|
||||||
band = -band;
|
bandwidth = -bandwidth;
|
||||||
lowCutoff = -lowCutoff;
|
lowCutoff = -lowCutoff;
|
||||||
m_usb = false;
|
m_usb = false;
|
||||||
}
|
}
|
||||||
@ -166,15 +166,15 @@ bool ChannelAnalyzerNG::handleMessage(const Message& cmd)
|
|||||||
m_usb = true;
|
m_usb = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (band < 100.0f)
|
if (bandwidth < 100.0f)
|
||||||
{
|
{
|
||||||
band = 100.0f;
|
bandwidth = 100.0f;
|
||||||
lowCutoff = 0;
|
lowCutoff = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_settingsMutex.lock();
|
m_settingsMutex.lock();
|
||||||
|
|
||||||
m_Bandwidth = band;
|
m_Bandwidth = bandwidth;
|
||||||
m_LowCutoff = lowCutoff;
|
m_LowCutoff = lowCutoff;
|
||||||
|
|
||||||
SSBFilter->create_filter(m_LowCutoff / m_sampleRate, m_Bandwidth / m_sampleRate);
|
SSBFilter->create_filter(m_LowCutoff / m_sampleRate, m_Bandwidth / m_sampleRate);
|
||||||
|
@ -111,7 +111,7 @@ bool ChannelAnalyzerNGGUI::deserialize(const QByteArray& data)
|
|||||||
{
|
{
|
||||||
QByteArray bytetmp;
|
QByteArray bytetmp;
|
||||||
quint32 u32tmp;
|
quint32 u32tmp;
|
||||||
qint32 tmp, bw, lowCut;
|
qint32 tmp, spanLog2, bw, lowCut;
|
||||||
bool tmpBool;
|
bool tmpBool;
|
||||||
|
|
||||||
blockApplySettings(true);
|
blockApplySettings(true);
|
||||||
@ -120,7 +120,6 @@ bool ChannelAnalyzerNGGUI::deserialize(const QByteArray& data)
|
|||||||
d.readS32(1, &tmp, 0);
|
d.readS32(1, &tmp, 0);
|
||||||
m_channelMarker.setCenterFrequency(tmp);
|
m_channelMarker.setCenterFrequency(tmp);
|
||||||
d.readS32(2, &bw, 30);
|
d.readS32(2, &bw, 30);
|
||||||
ui->BW->setValue(bw);
|
|
||||||
d.readBlob(3, &bytetmp);
|
d.readBlob(3, &bytetmp);
|
||||||
ui->spectrumGUI->deserialize(bytetmp);
|
ui->spectrumGUI->deserialize(bytetmp);
|
||||||
|
|
||||||
@ -130,10 +129,7 @@ bool ChannelAnalyzerNGGUI::deserialize(const QByteArray& data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
d.readS32(5, &lowCut, 3);
|
d.readS32(5, &lowCut, 3);
|
||||||
ui->lowCut->setValue(lowCut);
|
d.readS32(6, &spanLog2, 3);
|
||||||
d.readS32(6, &tmp, 20);
|
|
||||||
ui->spanLog2->setValue(tmp);
|
|
||||||
setNewRate(tmp);
|
|
||||||
d.readBool(7, &tmpBool, false);
|
d.readBool(7, &tmpBool, false);
|
||||||
ui->ssb->setChecked(tmpBool);
|
ui->ssb->setChecked(tmpBool);
|
||||||
d.readBlob(8, &bytetmp);
|
d.readBlob(8, &bytetmp);
|
||||||
@ -142,6 +138,8 @@ bool ChannelAnalyzerNGGUI::deserialize(const QByteArray& data)
|
|||||||
blockApplySettings(false);
|
blockApplySettings(false);
|
||||||
m_channelMarker.blockSignals(false);
|
m_channelMarker.blockSignals(false);
|
||||||
|
|
||||||
|
ui->spanLog2->setValue(spanLog2);
|
||||||
|
setNewRate(spanLog2);
|
||||||
ui->BW->setValue(bw);
|
ui->BW->setValue(bw);
|
||||||
ui->lowCut->setValue(lowCut); // does applySettings();
|
ui->lowCut->setValue(lowCut); // does applySettings();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user