1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-16 05:11:49 -05:00

Channel Analyzer NG: reviewed deserialization sequence

This commit is contained in:
f4exb 2017-02-21 04:57:44 +01:00
parent 946d1cf68a
commit 1174875551
2 changed files with 30 additions and 25 deletions

View File

@ -132,9 +132,7 @@ void ChannelAnalyzerNG::stop()
bool ChannelAnalyzerNG::handleMessage(const Message& cmd)
{
float band, lowCutoff;
qDebug() << "ChannelAnalyzerNG::handleMessage";
float bandwidth, lowCutoff;
if (DownChannelizer::MsgChannelizerNotification::match(cmd))
{
@ -142,6 +140,8 @@ bool ChannelAnalyzerNG::handleMessage(const Message& cmd)
m_sampleRate = notif.getSampleRate();
m_nco.setFreq(-notif.getFrequencyOffset(), m_sampleRate);
SSBFilter->create_filter(m_LowCutoff / m_sampleRate, m_Bandwidth / m_sampleRate);
DSBFilter->create_dsb_filter(m_Bandwidth / m_sampleRate);
qDebug() << "ChannelAnalyzerNG::handleMessage: MsgChannelizerNotification: m_sampleRate: " << m_sampleRate
<< " frequencyOffset: " << notif.getFrequencyOffset();
@ -152,12 +152,12 @@ bool ChannelAnalyzerNG::handleMessage(const Message& cmd)
{
MsgConfigureChannelAnalyzer& cfg = (MsgConfigureChannelAnalyzer&) cmd;
band = cfg.getBandwidth();
bandwidth = cfg.getBandwidth();
lowCutoff = cfg.getLoCutoff();
if (band < 0)
if (bandwidth < 0)
{
band = -band;
bandwidth = -bandwidth;
lowCutoff = -lowCutoff;
m_usb = false;
}
@ -166,15 +166,15 @@ bool ChannelAnalyzerNG::handleMessage(const Message& cmd)
m_usb = true;
}
if (band < 100.0f)
if (bandwidth < 100.0f)
{
band = 100.0f;
bandwidth = 100.0f;
lowCutoff = 0;
}
m_settingsMutex.lock();
m_Bandwidth = band;
m_Bandwidth = bandwidth;
m_LowCutoff = lowCutoff;
SSBFilter->create_filter(m_LowCutoff / m_sampleRate, m_Bandwidth / m_sampleRate);
@ -185,7 +185,8 @@ bool ChannelAnalyzerNG::handleMessage(const Message& cmd)
m_settingsMutex.unlock();
qDebug() << " - MsgConfigureChannelAnalyzer: m_Bandwidth: " << m_Bandwidth
qDebug() << "ChannelAnalyzerNG::handleMessage: MsgConfigureChannelAnalyzer:"
<< " m_Bandwidth: " << m_Bandwidth
<< " m_LowCutoff: " << m_LowCutoff
<< " m_spanLog2: " << m_spanLog2
<< " m_ssb: " << m_ssb;

View File

@ -111,7 +111,7 @@ bool ChannelAnalyzerNGGUI::deserialize(const QByteArray& data)
{
QByteArray bytetmp;
quint32 u32tmp;
qint32 tmp, bw, lowCut;
qint32 tmp, spanLog2, bw, lowCut;
bool tmpBool;
blockApplySettings(true);
@ -131,9 +131,8 @@ bool ChannelAnalyzerNGGUI::deserialize(const QByteArray& data)
d.readS32(5, &lowCut, 3);
ui->lowCut->setValue(lowCut);
d.readS32(6, &tmp, 20);
ui->spanLog2->setValue(tmp);
setNewRate(tmp);
d.readS32(6, &spanLog2, 3);
ui->spanLog2->setValue(spanLog2);
d.readBool(7, &tmpBool, false);
ui->ssb->setChecked(tmpBool);
d.readBlob(8, &bytetmp);
@ -142,8 +141,14 @@ bool ChannelAnalyzerNGGUI::deserialize(const QByteArray& data)
blockApplySettings(false);
m_channelMarker.blockSignals(false);
// qDebug() << "ChannelAnalyzerNGGUI::deserialize:"
// << " spanLog2: " << spanLog2
// << " bw: " << bw
// << " lowCut: " << lowCut;
setNewRate(spanLog2);
ui->BW->setValue(bw);
ui->lowCut->setValue(lowCut); // does applySettings();
ui->lowCut->setValue(lowCut);
return true;
}
@ -258,7 +263,6 @@ void ChannelAnalyzerNGGUI::on_spanLog2_valueChanged(int value)
if (setNewRate(value)) {
applySettings();
}
}
void ChannelAnalyzerNGGUI::on_ssb_toggled(bool checked)