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

NFM demod: cpplint corrections

This commit is contained in:
f4exb 2017-12-29 03:03:28 +01:00
parent 14626393e6
commit 9cb1a774c6
4 changed files with 9 additions and 8 deletions

View File

@ -23,13 +23,13 @@
#include "SWGChannelSettings.h" #include "SWGChannelSettings.h"
#include "SWGNFMDemodSettings.h" #include "SWGNFMDemodSettings.h"
#include <dsp/downchannelizer.h> #include "dsp/downchannelizer.h"
#include "util/stepfunctions.h" #include "util/stepfunctions.h"
#include "audio/audiooutput.h" #include "audio/audiooutput.h"
#include "dsp/pidcontroller.h" #include "dsp/pidcontroller.h"
#include "dsp/dspengine.h" #include "dsp/dspengine.h"
#include "dsp/threadedbasebandsamplesink.h" #include "dsp/threadedbasebandsamplesink.h"
#include <device/devicesourceapi.h> #include "device/devicesourceapi.h"
#include "nfmdemodgui.h" #include "nfmdemodgui.h"
#include "nfmdemod.h" #include "nfmdemod.h"
@ -111,9 +111,11 @@ float arctan2(Real y, Real x)
Real r = (x + abs_y) / (abs_y - x); Real r = (x + abs_y) / (abs_y - x);
angle = coeff_2 - coeff_1 * r; angle = coeff_2 - coeff_1 * r;
} }
if(y < 0) if(y < 0) {
return(-angle); return(-angle);
else return(angle); } else {
return(angle);
}
} }
Real angleDist(Real a, Real b) Real angleDist(Real a, Real b)
@ -410,7 +412,7 @@ void NFMDemod::applySettings(const NFMDemodSettings& settings, bool force)
if ((settings.m_fmDeviation != m_settings.m_fmDeviation) || if ((settings.m_fmDeviation != m_settings.m_fmDeviation) ||
(settings.m_rfBandwidth != m_settings.m_rfBandwidth) || force) (settings.m_rfBandwidth != m_settings.m_rfBandwidth) || force)
{ {
m_phaseDiscri.setFMScaling((8.0f*settings.m_rfBandwidth) / (float) settings.m_fmDeviation); // integrate 4x factor m_phaseDiscri.setFMScaling((8.0f*settings.m_rfBandwidth) / static_cast<float>(settings.m_fmDeviation)); // integrate 4x factor
} }
if ((settings.m_afBandwidth != m_settings.m_afBandwidth) || if ((settings.m_afBandwidth != m_settings.m_afBandwidth) ||

View File

@ -31,7 +31,6 @@
#include "dsp/afsquelch.h" #include "dsp/afsquelch.h"
#include "dsp/agc.h" #include "dsp/agc.h"
#include "dsp/ctcssdetector.h" #include "dsp/ctcssdetector.h"
#include "dsp/afsquelch.h"
#include "audio/audiofifo.h" #include "audio/audiofifo.h"
#include "util/message.h" #include "util/message.h"

View File

@ -261,7 +261,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_nfmDemod = (NFMDemod*) rxChannel; //new NFMDemod(m_deviceUISet->m_deviceSourceAPI); m_nfmDemod = reinterpret_cast<NFMDemod*>(rxChannel); //new NFMDemod(m_deviceUISet->m_deviceSourceAPI);
m_nfmDemod->setMessageQueueToGUI(getInputMessageQueue()); m_nfmDemod->setMessageQueueToGUI(getInputMessageQueue());
connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));

View File

@ -65,7 +65,7 @@ QByteArray NFMDemodSettings::serialize() const
s.writeS32(2, getRFBWIndex(m_rfBandwidth)); s.writeS32(2, getRFBWIndex(m_rfBandwidth));
s.writeS32(3, m_afBandwidth/1000.0); s.writeS32(3, m_afBandwidth/1000.0);
s.writeS32(4, m_volume*10.0); s.writeS32(4, m_volume*10.0);
s.writeS32(5, (int) m_squelch); s.writeS32(5, static_cast<int>(m_squelch));
s.writeU32(7, m_rgbColor); s.writeU32(7, m_rgbColor);
s.writeS32(8, m_ctcssIndex); s.writeS32(8, m_ctcssIndex);
s.writeBool(9, m_ctcssOn); s.writeBool(9, m_ctcssOn);