mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 10:05:46 -05:00
Use a name field in channels to be used in headless version to replace the GUI object name that was used as the name field
This commit is contained in:
parent
ef5cf18778
commit
9dd707896d
@ -33,9 +33,10 @@ const QString ChannelAnalyzer::m_channelIdURI = "org.f4exb.sdrangelove.channel.c
|
||||
const QString ChannelAnalyzer::m_channelId = "ChannelAnalyzer";
|
||||
|
||||
ChannelAnalyzer::ChannelAnalyzer(DeviceSourceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_sampleSink(0),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
ChannelSinkAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_sampleSink(0),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName(m_channelId);
|
||||
|
||||
|
@ -129,8 +129,6 @@ public:
|
||||
virtual int getDeltaFrequency() const { return m_frequency; }
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual void getTitle(QString& title) { title = objectName(); }
|
||||
virtual void setName(const QString& name) { setObjectName(name); }
|
||||
virtual QString getName() const { return objectName(); }
|
||||
virtual qint64 getCenterFrequency() const { return m_frequency; }
|
||||
|
||||
virtual QByteArray serialize() const { return QByteArray(); }
|
||||
|
@ -33,9 +33,10 @@ const QString ChannelAnalyzerNG::m_channelIdURI = "sdrangel.channel.chanalyzerng
|
||||
const QString ChannelAnalyzerNG::m_channelId = "ChannelAnalyzerNG";
|
||||
|
||||
ChannelAnalyzerNG::ChannelAnalyzerNG(DeviceSourceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_sampleSink(0),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
ChannelSinkAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_sampleSink(0),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName(m_channelId);
|
||||
|
||||
|
@ -148,8 +148,6 @@ public:
|
||||
virtual int getDeltaFrequency() const { return m_running.m_frequency; }
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual void getTitle(QString& title) { title = objectName(); }
|
||||
virtual void setName(const QString& name) { setObjectName(name); }
|
||||
virtual QString getName() const { return objectName(); }
|
||||
virtual qint64 getCenterFrequency() const { return m_running.m_frequency; }
|
||||
|
||||
virtual QByteArray serialize() const { return QByteArray(); }
|
||||
|
@ -37,16 +37,17 @@ const QString AMDemod::m_channelId = "AMDemod";
|
||||
const int AMDemod::m_udpBlockSize = 512;
|
||||
|
||||
AMDemod::AMDemod(DeviceSourceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_squelchOpen(false),
|
||||
m_magsqSum(0.0f),
|
||||
m_magsqPeak(0.0f),
|
||||
m_magsqCount(0),
|
||||
m_movingAverage(40, 0),
|
||||
m_volumeAGC(1200, 1.0),
|
||||
m_audioFifo(48000),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
ChannelSinkAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_squelchOpen(false),
|
||||
m_magsqSum(0.0f),
|
||||
m_magsqPeak(0.0f),
|
||||
m_magsqCount(0),
|
||||
m_movingAverage(40, 0),
|
||||
m_volumeAGC(1200, 1.0),
|
||||
m_audioFifo(48000),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName(m_channelId);
|
||||
|
||||
|
@ -96,8 +96,6 @@ public:
|
||||
virtual int getDeltaFrequency() const { return m_absoluteFrequencyOffset; }
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
||||
virtual void setName(const QString& name) { setObjectName(name); }
|
||||
virtual QString getName() const { return objectName(); }
|
||||
virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; }
|
||||
|
||||
virtual QByteArray serialize() const;
|
||||
|
@ -40,34 +40,35 @@ const QString ATVDemod::m_channelId = "ATVDemod";
|
||||
const int ATVDemod::m_ssbFftLen = 1024;
|
||||
|
||||
ATVDemod::ATVDemod(DeviceSourceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_scopeSink(0),
|
||||
m_registeredATVScreen(0),
|
||||
m_intNumberSamplePerTop(0),
|
||||
m_intImageIndex(0),
|
||||
m_intSynchroPoints(0),
|
||||
m_blnSynchroDetected(false),
|
||||
m_blnVerticalSynchroDetected(false),
|
||||
m_fltAmpLineAverage(0.0f),
|
||||
m_fltEffMin(2000000000.0f),
|
||||
m_fltEffMax(-2000000000.0f),
|
||||
m_fltAmpMin(-2000000000.0f),
|
||||
m_fltAmpMax(2000000000.0f),
|
||||
m_fltAmpDelta(1.0),
|
||||
m_intColIndex(0),
|
||||
m_intSampleIndex(0),
|
||||
m_intRowIndex(0),
|
||||
m_intLineIndex(0),
|
||||
m_objAvgColIndex(3),
|
||||
m_objMagSqAverage(40, 0),
|
||||
m_bfoPLL(200/1000000, 100/1000000, 0.01),
|
||||
m_bfoFilter(200.0, 1000000.0, 0.9),
|
||||
m_interpolatorDistance(1.0f),
|
||||
m_interpolatorDistanceRemain(0.0f),
|
||||
m_DSBFilter(0),
|
||||
m_DSBFilterBuffer(0),
|
||||
m_DSBFilterBufferIndex(0),
|
||||
m_objSettingsMutex(QMutex::Recursive)
|
||||
ChannelSinkAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_scopeSink(0),
|
||||
m_registeredATVScreen(0),
|
||||
m_intNumberSamplePerTop(0),
|
||||
m_intImageIndex(0),
|
||||
m_intSynchroPoints(0),
|
||||
m_blnSynchroDetected(false),
|
||||
m_blnVerticalSynchroDetected(false),
|
||||
m_fltAmpLineAverage(0.0f),
|
||||
m_fltEffMin(2000000000.0f),
|
||||
m_fltEffMax(-2000000000.0f),
|
||||
m_fltAmpMin(-2000000000.0f),
|
||||
m_fltAmpMax(2000000000.0f),
|
||||
m_fltAmpDelta(1.0),
|
||||
m_intColIndex(0),
|
||||
m_intSampleIndex(0),
|
||||
m_intRowIndex(0),
|
||||
m_intLineIndex(0),
|
||||
m_objAvgColIndex(3),
|
||||
m_objMagSqAverage(40, 0),
|
||||
m_bfoPLL(200/1000000, 100/1000000, 0.01),
|
||||
m_bfoFilter(200.0, 1000000.0, 0.9),
|
||||
m_interpolatorDistance(1.0f),
|
||||
m_interpolatorDistanceRemain(0.0f),
|
||||
m_DSBFilter(0),
|
||||
m_DSBFilterBuffer(0),
|
||||
m_DSBFilterBufferIndex(0),
|
||||
m_objSettingsMutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName(m_channelId);
|
||||
|
||||
|
@ -227,8 +227,6 @@ public:
|
||||
virtual int getDeltaFrequency() const { return m_rfRunning.m_intFrequencyOffset; }
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual void getTitle(QString& title) { title = objectName(); }
|
||||
virtual void setName(const QString& name) { setObjectName(name); }
|
||||
virtual QString getName() const { return objectName(); }
|
||||
virtual qint64 getCenterFrequency() const { return m_rfRunning.m_intFrequencyOffset; }
|
||||
|
||||
virtual QByteArray serialize() const { return QByteArray(); }
|
||||
|
@ -40,13 +40,14 @@ const Real BFMDemod::default_deemphasis = 50.0; // 50 us
|
||||
const int BFMDemod::m_udpBlockSize = 512;
|
||||
|
||||
BFMDemod::BFMDemod(DeviceSourceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_audioFifo(250000),
|
||||
m_settingsMutex(QMutex::Recursive),
|
||||
m_pilotPLL(19000/384000, 50/384000, 0.01),
|
||||
m_deemphasisFilterX(default_deemphasis * 48000 * 1.0e-6),
|
||||
m_deemphasisFilterY(default_deemphasis * 48000 * 1.0e-6),
|
||||
ChannelSinkAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_audioFifo(250000),
|
||||
m_settingsMutex(QMutex::Recursive),
|
||||
m_pilotPLL(19000/384000, 50/384000, 0.01),
|
||||
m_deemphasisFilterX(default_deemphasis * 48000 * 1.0e-6),
|
||||
m_deemphasisFilterY(default_deemphasis * 48000 * 1.0e-6),
|
||||
m_fmExcursion(default_excursion)
|
||||
{
|
||||
setObjectName(m_channelId);
|
||||
|
@ -126,8 +126,6 @@ public:
|
||||
virtual int getDeltaFrequency() const { return m_absoluteFrequencyOffset; }
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
||||
virtual void setName(const QString& name) { setObjectName(name); }
|
||||
virtual QString getName() const { return objectName(); }
|
||||
virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; }
|
||||
|
||||
virtual QByteArray serialize() const;
|
||||
|
@ -40,23 +40,24 @@ const QString DSDDemod::m_channelId = "DSDDemod";
|
||||
const int DSDDemod::m_udpBlockSize = 512;
|
||||
|
||||
DSDDemod::DSDDemod(DeviceSourceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_interpolatorDistance(0.0f),
|
||||
m_interpolatorDistanceRemain(0.0f),
|
||||
m_sampleCount(0),
|
||||
m_squelchCount(0),
|
||||
m_squelchGate(0),
|
||||
m_squelchLevel(1e-4),
|
||||
m_squelchOpen(false),
|
||||
m_movingAverage(40, 0),
|
||||
m_fmExcursion(24),
|
||||
m_audioFifo1(48000),
|
||||
m_audioFifo2(48000),
|
||||
m_scope(0),
|
||||
m_scopeEnabled(true),
|
||||
m_dsdDecoder(),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
ChannelSinkAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_interpolatorDistance(0.0f),
|
||||
m_interpolatorDistanceRemain(0.0f),
|
||||
m_sampleCount(0),
|
||||
m_squelchCount(0),
|
||||
m_squelchGate(0),
|
||||
m_squelchLevel(1e-4),
|
||||
m_squelchOpen(false),
|
||||
m_movingAverage(40, 0),
|
||||
m_fmExcursion(24),
|
||||
m_audioFifo1(48000),
|
||||
m_audioFifo2(48000),
|
||||
m_scope(0),
|
||||
m_scopeEnabled(true),
|
||||
m_dsdDecoder(),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName(m_channelId);
|
||||
|
||||
|
@ -105,8 +105,6 @@ public:
|
||||
virtual int getDeltaFrequency() const { return m_absoluteFrequencyOffset; }
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
||||
virtual void setName(const QString& name) { setObjectName(name); }
|
||||
virtual QString getName() const { return objectName(); }
|
||||
virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; }
|
||||
|
||||
virtual QByteArray serialize() const;
|
||||
|
@ -35,9 +35,10 @@ const QString LoRaDemod::m_channelIdURI = "de.maintech.sdrangelove.channel.lora"
|
||||
const QString LoRaDemod::m_channelId = "LoRaDemod";
|
||||
|
||||
LoRaDemod::LoRaDemod(DeviceSourceAPI* deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_sampleSink(0),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
ChannelSinkAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_sampleSink(0),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName(m_channelId);
|
||||
|
||||
|
@ -101,8 +101,6 @@ public:
|
||||
virtual int getDeltaFrequency() const { return 0; }
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
||||
virtual void setName(const QString& name) { setObjectName(name); }
|
||||
virtual QString getName() const { return objectName(); }
|
||||
virtual qint64 getCenterFrequency() const { return 0; }
|
||||
|
||||
virtual QByteArray serialize() const;
|
||||
|
@ -45,25 +45,26 @@ static const double afSqTones[2] = {1000.0, 6000.0}; // {1200.0, 8000.0};
|
||||
const int NFMDemod::m_udpBlockSize = 512;
|
||||
|
||||
NFMDemod::NFMDemod(DeviceSourceAPI *devieAPI) :
|
||||
m_deviceAPI(devieAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_ctcssIndex(0),
|
||||
m_sampleCount(0),
|
||||
m_squelchCount(0),
|
||||
m_squelchGate(2),
|
||||
m_audioMute(false),
|
||||
m_squelchLevel(-990),
|
||||
m_squelchOpen(false),
|
||||
m_afSquelchOpen(false),
|
||||
m_magsq(0.0f),
|
||||
m_magsqSum(0.0f),
|
||||
m_magsqPeak(0.0f),
|
||||
m_magsqCount(0),
|
||||
m_movingAverage(40, 0),
|
||||
m_afSquelch(2, afSqTones),
|
||||
m_fmExcursion(2400),
|
||||
m_audioFifo(48000),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
ChannelSinkAPI(m_channelIdURI),
|
||||
m_deviceAPI(devieAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_ctcssIndex(0),
|
||||
m_sampleCount(0),
|
||||
m_squelchCount(0),
|
||||
m_squelchGate(2),
|
||||
m_audioMute(false),
|
||||
m_squelchLevel(-990),
|
||||
m_squelchOpen(false),
|
||||
m_afSquelchOpen(false),
|
||||
m_magsq(0.0f),
|
||||
m_magsqSum(0.0f),
|
||||
m_magsqPeak(0.0f),
|
||||
m_magsqCount(0),
|
||||
m_movingAverage(40, 0),
|
||||
m_afSquelch(2, afSqTones),
|
||||
m_fmExcursion(2400),
|
||||
m_audioFifo(48000),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName(m_channelId);
|
||||
|
||||
|
@ -121,8 +121,6 @@ public:
|
||||
virtual int getDeltaFrequency() const { return m_absoluteFrequencyOffset; }
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
||||
virtual void setName(const QString& name) { setObjectName(name); }
|
||||
virtual QString getName() const { return objectName(); }
|
||||
virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; }
|
||||
|
||||
virtual QByteArray serialize() const;
|
||||
|
@ -39,21 +39,22 @@ const QString SSBDemod::m_channelId = "SSBDemod";
|
||||
const int SSBDemod::m_udpBlockSize = 512;
|
||||
|
||||
SSBDemod::SSBDemod(DeviceSourceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_audioBinaual(false),
|
||||
m_audioFlipChannels(false),
|
||||
m_dsb(false),
|
||||
m_audioMute(false),
|
||||
m_agc(12000, agcTarget, 1e-2),
|
||||
m_agcActive(false),
|
||||
m_agcClamping(false),
|
||||
m_agcNbSamples(12000),
|
||||
m_agcPowerThreshold(1e-2),
|
||||
m_agcThresholdGate(0),
|
||||
m_audioActive(false),
|
||||
m_sampleSink(0),
|
||||
m_audioFifo(24000),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
ChannelSinkAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_audioBinaual(false),
|
||||
m_audioFlipChannels(false),
|
||||
m_dsb(false),
|
||||
m_audioMute(false),
|
||||
m_agc(12000, agcTarget, 1e-2),
|
||||
m_agcActive(false),
|
||||
m_agcClamping(false),
|
||||
m_agcNbSamples(12000),
|
||||
m_agcPowerThreshold(1e-2),
|
||||
m_agcThresholdGate(0),
|
||||
m_audioActive(false),
|
||||
m_sampleSink(0),
|
||||
m_audioFifo(24000),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName(m_channelId);
|
||||
|
||||
|
@ -115,8 +115,6 @@ public:
|
||||
virtual int getDeltaFrequency() const { return m_absoluteFrequencyOffset; }
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
||||
virtual void setName(const QString& name) { setObjectName(name); }
|
||||
virtual QString getName() const { return objectName(); }
|
||||
virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; }
|
||||
|
||||
virtual QByteArray serialize() const;
|
||||
|
@ -38,18 +38,18 @@ const QString WFMDemod::m_channelId = "WFMDemod";
|
||||
const int WFMDemod::m_udpBlockSize = 512;
|
||||
|
||||
WFMDemod::WFMDemod(DeviceSourceAPI* deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_squelchOpen(false),
|
||||
m_magsq(0.0f),
|
||||
m_magsqSum(0.0f),
|
||||
m_magsqPeak(0.0f),
|
||||
m_magsqCount(0),
|
||||
m_movingAverage(40, 0),
|
||||
m_sampleSink(0),
|
||||
m_audioFifo(250000),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
|
||||
ChannelSinkAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_squelchOpen(false),
|
||||
m_magsq(0.0f),
|
||||
m_magsqSum(0.0f),
|
||||
m_magsqPeak(0.0f),
|
||||
m_magsqCount(0),
|
||||
m_movingAverage(40, 0),
|
||||
m_sampleSink(0),
|
||||
m_audioFifo(250000),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName(m_channelId);
|
||||
|
||||
|
@ -101,8 +101,6 @@ public:
|
||||
virtual int getDeltaFrequency() const { return m_absoluteFrequencyOffset; }
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
||||
virtual void setName(const QString& name) { setObjectName(name); }
|
||||
virtual QString getName() const { return objectName(); }
|
||||
virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; }
|
||||
|
||||
virtual QByteArray serialize() const;
|
||||
|
@ -34,9 +34,10 @@ const QString TCPSrc::m_channelIdURI = "sdrangel.channel.tcpsrc";
|
||||
const QString TCPSrc::m_channelId = "TCPSrc";
|
||||
|
||||
TCPSrc::TCPSrc(DeviceSourceAPI* deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
ChannelSinkAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName(m_channelId);
|
||||
|
||||
|
@ -118,8 +118,6 @@ public:
|
||||
virtual int getDeltaFrequency() const { return m_absoluteFrequencyOffset; }
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
||||
virtual void setName(const QString& name) { setObjectName(name); }
|
||||
virtual QString getName() const { return objectName(); }
|
||||
virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; }
|
||||
|
||||
virtual QByteArray serialize() const;
|
||||
|
@ -37,21 +37,22 @@ const QString UDPSrc::m_channelIdURI = "sdrangel.channel.udpsrc";
|
||||
const QString UDPSrc::m_channelId = "UDPSrc";
|
||||
|
||||
UDPSrc::UDPSrc(DeviceSourceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_outMovingAverage(480, 1e-10),
|
||||
m_inMovingAverage(480, 1e-10),
|
||||
m_amMovingAverage(1200, 1e-10),
|
||||
m_audioFifo(24000),
|
||||
m_spectrum(0),
|
||||
m_squelch(1e-6),
|
||||
m_squelchOpen(false),
|
||||
m_squelchOpenCount(0),
|
||||
m_squelchCloseCount(0),
|
||||
m_squelchGate(4800),
|
||||
m_squelchRelease(4800),
|
||||
m_agc(9600, m_agcTarget, 1e-6),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
ChannelSinkAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_outMovingAverage(480, 1e-10),
|
||||
m_inMovingAverage(480, 1e-10),
|
||||
m_amMovingAverage(1200, 1e-10),
|
||||
m_audioFifo(24000),
|
||||
m_spectrum(0),
|
||||
m_squelch(1e-6),
|
||||
m_squelchOpen(false),
|
||||
m_squelchOpenCount(0),
|
||||
m_squelchCloseCount(0),
|
||||
m_squelchGate(4800),
|
||||
m_squelchRelease(4800),
|
||||
m_agc(9600, m_agcTarget, 1e-6),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName(m_channelId);
|
||||
|
||||
|
@ -110,8 +110,6 @@ public:
|
||||
virtual int getDeltaFrequency() const { return m_absoluteFrequencyOffset; }
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
||||
virtual void setName(const QString& name) { setObjectName(name); }
|
||||
virtual QString getName() const { return objectName(); }
|
||||
virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; }
|
||||
|
||||
virtual QByteArray serialize() const;
|
||||
|
@ -41,6 +41,7 @@ const QString AMMod::m_channelId ="AMMod";
|
||||
const int AMMod::m_levelNbSamples = 480; // every 10ms
|
||||
|
||||
AMMod::AMMod(DeviceSinkAPI *deviceAPI) :
|
||||
ChannelSourceAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_movingAverage(40, 0),
|
||||
|
@ -50,6 +50,7 @@ const int ATVMod::m_cameraFPSTestNbFrames = 100;
|
||||
const int ATVMod::m_ssbFftLen = 1024;
|
||||
|
||||
ATVMod::ATVMod(DeviceSinkAPI *deviceAPI) :
|
||||
ChannelSourceAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_modPhasor(0.0f),
|
||||
|
@ -47,6 +47,7 @@ const QString NFMMod::m_channelId = "NFMMod";
|
||||
const int NFMMod::m_levelNbSamples = 480; // every 10ms
|
||||
|
||||
NFMMod::NFMMod(DeviceSinkAPI *deviceAPI) :
|
||||
ChannelSourceAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_modPhasor(0.0f),
|
||||
|
@ -43,6 +43,7 @@ const int SSBMod::m_levelNbSamples = 480; // every 10ms
|
||||
const int SSBMod::m_ssbFftLen = 1024;
|
||||
|
||||
SSBMod::SSBMod(DeviceSinkAPI *deviceAPI) :
|
||||
ChannelSourceAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_absoluteFrequencyOffset(0),
|
||||
m_SSBFilter(0),
|
||||
|
@ -45,6 +45,7 @@ const int WFMMod::m_levelNbSamples = 480; // every 10ms
|
||||
const int WFMMod::m_rfFilterFFTLength = 1024;
|
||||
|
||||
WFMMod::WFMMod(DeviceSinkAPI *deviceAPI) :
|
||||
ChannelSourceAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_modPhasor(0.0f),
|
||||
m_movingAverage(40, 0),
|
||||
|
@ -33,6 +33,7 @@ const QString UDPSink::m_channelIdURI = "sdrangel.channeltx.udpsink";
|
||||
const QString UDPSink::m_channelId = "UDPSink";
|
||||
|
||||
UDPSink::UDPSink(DeviceSinkAPI *deviceAPI) :
|
||||
ChannelSourceAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_squelch(1e-6),
|
||||
m_spectrum(0),
|
||||
|
@ -19,8 +19,9 @@
|
||||
#include "util/uid.h"
|
||||
#include "channelsinkapi.h"
|
||||
|
||||
ChannelSinkAPI::ChannelSinkAPI() :
|
||||
m_indexInDeviceSet(-1),
|
||||
m_uid(UidCalculator::getNewObjectId())
|
||||
ChannelSinkAPI::ChannelSinkAPI(const QString& name) :
|
||||
m_name(name),
|
||||
m_indexInDeviceSet(-1),
|
||||
m_uid(UidCalculator::getNewObjectId())
|
||||
{
|
||||
}
|
||||
|
@ -32,15 +32,15 @@ namespace SWGSDRangel
|
||||
|
||||
class SDRANGEL_API ChannelSinkAPI {
|
||||
public:
|
||||
ChannelSinkAPI();
|
||||
ChannelSinkAPI(const QString& name);
|
||||
virtual ~ChannelSinkAPI() {}
|
||||
virtual void destroy() = 0;
|
||||
|
||||
virtual int getDeltaFrequency() const = 0;
|
||||
virtual void getIdentifier(QString& id) = 0;
|
||||
virtual void getTitle(QString& title) = 0;
|
||||
virtual void setName(const QString& name) = 0;
|
||||
virtual QString getName() const = 0;
|
||||
virtual void setName(const QString& name) { m_name = name; }
|
||||
virtual const QString& getName() const { return m_name; }
|
||||
virtual qint64 getCenterFrequency() const = 0;
|
||||
|
||||
virtual QByteArray serialize() const = 0;
|
||||
@ -62,6 +62,11 @@ public:
|
||||
uint64_t getUID() const { return m_uid; }
|
||||
|
||||
private:
|
||||
/** Unique identifier in a device set used for sorting. Used when there is no GUI.
|
||||
* In GUI version it is supported by GUI object name accessed through PluginInstanceGUI.
|
||||
*/
|
||||
QString m_name;
|
||||
|
||||
int m_indexInDeviceSet;
|
||||
uint64_t m_uid;
|
||||
};
|
||||
|
@ -19,8 +19,9 @@
|
||||
#include "util/uid.h"
|
||||
#include "channelsourceapi.h"
|
||||
|
||||
ChannelSourceAPI::ChannelSourceAPI() :
|
||||
m_indexInDeviceSet(-1),
|
||||
m_uid(UidCalculator::getNewObjectId())
|
||||
ChannelSourceAPI::ChannelSourceAPI(const QString& name) :
|
||||
m_name(name),
|
||||
m_indexInDeviceSet(-1),
|
||||
m_uid(UidCalculator::getNewObjectId())
|
||||
{ }
|
||||
|
||||
|
@ -31,7 +31,7 @@ namespace SWGSDRangel
|
||||
|
||||
class SDRANGEL_API ChannelSourceAPI {
|
||||
public:
|
||||
ChannelSourceAPI();
|
||||
ChannelSourceAPI(const QString& name);
|
||||
virtual ~ChannelSourceAPI() {}
|
||||
virtual void destroy() = 0;
|
||||
|
||||
@ -61,6 +61,11 @@ public:
|
||||
uint64_t getUID() const { return m_uid; }
|
||||
|
||||
private:
|
||||
/** Unique identifier in a device set used for sorting. Used when there is no GUI.
|
||||
* In GUI version it is supported by GUI object name accessed through PluginInstanceGUI.
|
||||
*/
|
||||
QString m_name;
|
||||
|
||||
int m_indexInDeviceSet;
|
||||
uint64_t m_uid;
|
||||
};
|
||||
|
@ -36,6 +36,7 @@
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(MainCore::MsgDeleteInstance, Message)
|
||||
MESSAGE_CLASS_DEFINITION(MainCore::MsgLoadPreset, Message)
|
||||
MESSAGE_CLASS_DEFINITION(MainCore::MsgSavePreset, Message)
|
||||
MESSAGE_CLASS_DEFINITION(MainCore::MsgAddDeviceSet, Message)
|
||||
MESSAGE_CLASS_DEFINITION(MainCore::MsgRemoveLastDeviceSet, Message)
|
||||
|
||||
@ -103,6 +104,14 @@ bool MainCore::handleMessage(const Message& cmd)
|
||||
loadPresetSettings(notif.getPreset(), notif.getDeviceSetIndex());
|
||||
return true;
|
||||
}
|
||||
else if (MsgSavePreset::match(cmd))
|
||||
{
|
||||
MsgSavePreset& notif = (MsgSavePreset&) cmd;
|
||||
savePresetSettings(notif.getPreset(), notif.getDeviceSetIndex());
|
||||
m_settings.sortPresets();
|
||||
m_settings.save();
|
||||
return true;
|
||||
}
|
||||
else if (MsgAddDeviceSet::match(cmd))
|
||||
{
|
||||
MsgAddDeviceSet& notif = (MsgAddDeviceSet&) cmd;
|
||||
|
@ -93,6 +93,32 @@ private:
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgSavePreset : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
Preset *getPreset() const { return m_preset; }
|
||||
int getDeviceSetIndex() const { return m_deviceSetIndex; }
|
||||
bool isNewPreset() const { return m_newPreset; }
|
||||
|
||||
static MsgSavePreset* create(Preset *preset, int deviceSetIndex, bool newPreset)
|
||||
{
|
||||
return new MsgSavePreset(preset, deviceSetIndex, newPreset);
|
||||
}
|
||||
|
||||
private:
|
||||
Preset *m_preset;
|
||||
int m_deviceSetIndex;
|
||||
bool m_newPreset;
|
||||
|
||||
MsgSavePreset(Preset *preset, int deviceSetIndex, bool newPreset) :
|
||||
Message(),
|
||||
m_preset(preset),
|
||||
m_deviceSetIndex(deviceSetIndex),
|
||||
m_newPreset(newPreset)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgDeleteInstance : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
|
@ -539,6 +539,62 @@ int WebAPIAdapterSrv::instancePresetPatch(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int WebAPIAdapterSrv::instancePresetPut(
|
||||
SWGSDRangel::SWGPresetTransfer& query,
|
||||
SWGSDRangel::SWGPresetIdentifier& response,
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
int deviceSetIndex = query.getDeviceSetIndex();
|
||||
SWGSDRangel::SWGPresetIdentifier *presetIdentifier = query.getPreset();
|
||||
int nbDeviceSets = m_mainCore.m_deviceSets.size();
|
||||
|
||||
if (deviceSetIndex > nbDeviceSets)
|
||||
{
|
||||
*error.getMessage() = QString("There is no device set at index %1. Number of device sets is %2").arg(deviceSetIndex).arg(nbDeviceSets);
|
||||
return 404;
|
||||
}
|
||||
|
||||
const Preset *selectedPreset = m_mainCore.m_settings.getPreset(*presetIdentifier->getGroupName(),
|
||||
presetIdentifier->getCenterFrequency(),
|
||||
*presetIdentifier->getName());
|
||||
|
||||
if (selectedPreset == 0)
|
||||
{
|
||||
*error.getMessage() = QString("There is no preset [%1, %2, %3]")
|
||||
.arg(*presetIdentifier->getGroupName())
|
||||
.arg(presetIdentifier->getCenterFrequency())
|
||||
.arg(*presetIdentifier->getName());
|
||||
return 404;
|
||||
}
|
||||
else // update existing preset
|
||||
{
|
||||
DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex];
|
||||
|
||||
if (deviceSet->m_deviceSourceEngine && !selectedPreset->isSourcePreset())
|
||||
{
|
||||
*error.getMessage() = QString("Preset type (T) and device set type (Rx) mismatch");
|
||||
return 404;
|
||||
}
|
||||
|
||||
if (deviceSet->m_deviceSinkEngine && selectedPreset->isSourcePreset())
|
||||
{
|
||||
*error.getMessage() = QString("Preset type (R) and device set type (Tx) mismatch");
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
|
||||
MainCore::MsgSavePreset *msg = MainCore::MsgSavePreset::create(const_cast<Preset*>(selectedPreset), deviceSetIndex, false);
|
||||
m_mainCore.m_inputMessageQueue.push(msg);
|
||||
|
||||
response.init();
|
||||
response.setCenterFrequency(selectedPreset->getCenterFrequency());
|
||||
*response.getGroupName() = selectedPreset->getGroup();
|
||||
*response.getType() = selectedPreset->isSourcePreset() ? "R" : "T";
|
||||
*response.getName() = selectedPreset->getDescription();
|
||||
|
||||
return 200;
|
||||
}
|
||||
|
||||
int WebAPIAdapterSrv::instanceDeviceSetsPost(
|
||||
bool tx,
|
||||
SWGSDRangel::SWGSuccessResponse& response,
|
||||
|
@ -98,6 +98,11 @@ public:
|
||||
SWGSDRangel::SWGPresetIdentifier& response,
|
||||
SWGSDRangel::SWGErrorResponse& error);
|
||||
|
||||
virtual int instancePresetPut(
|
||||
SWGSDRangel::SWGPresetTransfer& query,
|
||||
SWGSDRangel::SWGPresetIdentifier& response,
|
||||
SWGSDRangel::SWGErrorResponse& error);
|
||||
|
||||
virtual int instanceDeviceSetsPost(
|
||||
bool tx,
|
||||
SWGSDRangel::SWGSuccessResponse& response,
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import requests
|
||||
import requests, traceback, sys
|
||||
from optparse import OptionParser
|
||||
|
||||
base_url = "http://127.0.0.1:8091/sdrangel"
|
||||
|
||||
@ -34,19 +35,50 @@ requests_methods = {
|
||||
"DELETE": requests.delete
|
||||
}
|
||||
|
||||
for command in commands:
|
||||
url = base_url + command[0]
|
||||
method = requests_methods.get(command[1], None)
|
||||
if method is not None:
|
||||
r = method(url=url, params=command[2], json=command[3])
|
||||
if r.status_code == 200:
|
||||
print("Done: %s" % command[4])
|
||||
else:
|
||||
print("Error %d:%s" % (r.status_code, command[4]))
|
||||
print(r.text)
|
||||
exit(1)
|
||||
else:
|
||||
print("requests method error")
|
||||
exit(1)
|
||||
# ======================================================================
|
||||
def getInputOptions():
|
||||
|
||||
parser = OptionParser(usage="usage: %%prog [-t]\n")
|
||||
parser.add_option("-a", "--address", dest="address", help="address and port", metavar="ADDRESS", type="string")
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
if (options.address == None):
|
||||
options.address = "127.0.0.1:8091"
|
||||
|
||||
return options
|
||||
|
||||
# ======================================================================
|
||||
def main():
|
||||
try:
|
||||
options = getInputOptions()
|
||||
|
||||
global base_url
|
||||
base_url = "http://%s/sdrangel" % options.address
|
||||
|
||||
for command in commands:
|
||||
url = base_url + command[0]
|
||||
method = requests_methods.get(command[1], None)
|
||||
if method is not None:
|
||||
r = method(url=url, params=command[2], json=command[3])
|
||||
if r.status_code == 200:
|
||||
print("Done: %s" % command[4])
|
||||
else:
|
||||
print("Error %d:%s" % (r.status_code, command[4]))
|
||||
print(r.text)
|
||||
exit(1)
|
||||
else:
|
||||
print("requests method error")
|
||||
exit(1)
|
||||
|
||||
print("All done!")
|
||||
|
||||
except Exception, msg:
|
||||
tb = traceback.format_exc()
|
||||
print >> sys.stderr, tb
|
||||
|
||||
|
||||
# ======================================================================
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
print("All done!")
|
||||
|
Loading…
Reference in New Issue
Block a user