diff --git a/plugins/channel/chanalyzer/chanalyzergui.cpp b/plugins/channel/chanalyzer/chanalyzergui.cpp index 6a1c95189..0ab7ad095 100644 --- a/plugins/channel/chanalyzer/chanalyzergui.cpp +++ b/plugins/channel/chanalyzer/chanalyzergui.cpp @@ -35,6 +35,8 @@ #include "chanalyzer.h" #include "chanalyzergui.h" +const QString ChannelAnalyzerGUI::m_channelID = "org.f4exb.sdrangelove.channel.chanalyzer"; + ChannelAnalyzerGUI* ChannelAnalyzerGUI::create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI) { ChannelAnalyzerGUI* gui = new ChannelAnalyzerGUI(pluginAPI, deviceAPI); @@ -347,7 +349,10 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAP m_channelMarker.setSidebands(ChannelMarker::usb); m_channelMarker.setCenterFrequency(0); m_channelMarker.setVisible(true); + connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged())); + + m_deviceAPI->registerChannelInstance(m_channelID, this); m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addRollupWidget(this); @@ -360,7 +365,7 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAP ChannelAnalyzerGUI::~ChannelAnalyzerGUI() { - m_pluginAPI->removeChannelInstance(this); + m_deviceAPI->removeChannelInstance(this); m_deviceAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; diff --git a/plugins/channel/chanalyzer/chanalyzergui.h b/plugins/channel/chanalyzer/chanalyzergui.h index 760951756..aa9909a7c 100644 --- a/plugins/channel/chanalyzer/chanalyzergui.h +++ b/plugins/channel/chanalyzer/chanalyzergui.h @@ -54,6 +54,8 @@ public: virtual bool handleMessage(const Message& message); + static const QString m_channelID; + private slots: void viewChanged(); void channelSampleRateChanged(); diff --git a/plugins/channel/chanalyzer/chanalyzerplugin.cpp b/plugins/channel/chanalyzer/chanalyzerplugin.cpp index 1bb057e33..c85039f43 100644 --- a/plugins/channel/chanalyzer/chanalyzerplugin.cpp +++ b/plugins/channel/chanalyzer/chanalyzerplugin.cpp @@ -27,14 +27,15 @@ void ChannelAnalyzerPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI = pluginAPI; // register demodulator - m_pluginAPI->registerChannel("org.f4exb.sdrangelove.channel.chanalyzer", this); + m_pluginAPI->registerChannel(ChannelAnalyzerGUI::m_channelID, this); } PluginGUI* ChannelAnalyzerPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI) { - if(channelName == "org.f4exb.sdrangelove.channel.chanalyzer") { + if(channelName == ChannelAnalyzerGUI::m_channelID) + { ChannelAnalyzerGUI* gui = ChannelAnalyzerGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("org.f4exb.sdrangelove.channel.chanalyzer", gui); +// deviceAPI->registerChannelInstance("org.f4exb.sdrangelove.channel.chanalyzer", gui); // m_pluginAPI->addChannelRollup(gui); return gui; } else { @@ -45,6 +46,6 @@ PluginGUI* ChannelAnalyzerPlugin::createChannel(const QString& channelName, Devi void ChannelAnalyzerPlugin::createInstanceChannelAnalyzer(DeviceAPI *deviceAPI) { ChannelAnalyzerGUI* gui = ChannelAnalyzerGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("org.f4exb.sdrangelove.channel.chanalyzer", gui); +// deviceAPI->registerChannelInstance("org.f4exb.sdrangelove.channel.chanalyzer", gui); // m_pluginAPI->addChannelRollup(gui); } diff --git a/plugins/channel/demodam/amdemodgui.cpp b/plugins/channel/demodam/amdemodgui.cpp index f79eeb360..d9828a677 100644 --- a/plugins/channel/demodam/amdemodgui.cpp +++ b/plugins/channel/demodam/amdemodgui.cpp @@ -15,6 +15,8 @@ #include "amdemod.h" +const QString AMDemodGUI::m_channelID = "de.maintech.sdrangelove.channel.am"; + const int AMDemodGUI::m_rfBW[] = { 5000, 6250, 8330, 10000, 12500, 15000, 20000, 25000, 40000 }; @@ -232,10 +234,11 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pare m_channelMarker.setBandwidth(12500); m_channelMarker.setCenterFrequency(0); m_channelMarker.setVisible(true); - connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged())); - //m_pluginAPI->addChannelMarker(&m_channelMarker); - m_deviceAPI->addChannelMarker(&m_channelMarker); + connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged())); + + m_deviceAPI->registerChannelInstance(m_channelID, this); + m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addRollupWidget(this); applySettings(); @@ -243,7 +246,7 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pare AMDemodGUI::~AMDemodGUI() { - m_pluginAPI->removeChannelInstance(this); + m_deviceAPI->removeChannelInstance(this); m_deviceAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; diff --git a/plugins/channel/demodam/amdemodgui.h b/plugins/channel/demodam/amdemodgui.h index be1081c8c..e283ae5e9 100644 --- a/plugins/channel/demodam/amdemodgui.h +++ b/plugins/channel/demodam/amdemodgui.h @@ -35,6 +35,8 @@ public: virtual bool handleMessage(const Message& message); + static const QString m_channelID; + private slots: void viewChanged(); void on_deltaFrequency_changed(quint64 value); diff --git a/plugins/channel/demodam/amplugin.cpp b/plugins/channel/demodam/amplugin.cpp index 05ac443f1..51a9c74a0 100644 --- a/plugins/channel/demodam/amplugin.cpp +++ b/plugins/channel/demodam/amplugin.cpp @@ -29,14 +29,15 @@ void AMPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI = pluginAPI; // register AM demodulator - m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.am", this); + m_pluginAPI->registerChannel(AMDemodGUI::m_channelID, this); } PluginGUI* AMPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI) { - if(channelName == "de.maintech.sdrangelove.channel.am") { + if(channelName == AMDemodGUI::m_channelID) + { AMDemodGUI* gui = AMDemodGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.am", gui); +// deviceAPI->registerChannelInstance("de.maintech.sdrangelove.channel.am", gui); // m_pluginAPI->addChannelRollup(gui); return gui; } else { @@ -47,6 +48,6 @@ PluginGUI* AMPlugin::createChannel(const QString& channelName, DeviceAPI *device void AMPlugin::createInstanceAM(DeviceAPI *deviceAPI) { AMDemodGUI* gui = AMDemodGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.am", gui); +// deviceAPI->registerChannelInstance("de.maintech.sdrangelove.channel.am", gui); // m_pluginAPI->addChannelRollup(gui); } diff --git a/plugins/channel/demodbfm/bfmdemodgui.cpp b/plugins/channel/demodbfm/bfmdemodgui.cpp index 6df99ec23..f030834c9 100644 --- a/plugins/channel/demodbfm/bfmdemodgui.cpp +++ b/plugins/channel/demodbfm/bfmdemodgui.cpp @@ -40,6 +40,8 @@ #include "bfmdemod.h" #include "rdstmc.h" +const QString BFMDemodGUI::m_channelID = "sdrangel.channel.bfm"; + const int BFMDemodGUI::m_rfBW[] = { 80000, 100000, 120000, 140000, 160000, 180000, 200000, 220000, 250000 }; @@ -397,7 +399,10 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa m_channelMarker.setBandwidth(12500); m_channelMarker.setCenterFrequency(0); m_channelMarker.setVisible(true); + connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged())); + + m_deviceAPI->registerChannelInstance(m_channelID, this); m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addRollupWidget(this); @@ -415,7 +420,7 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa BFMDemodGUI::~BFMDemodGUI() { - m_pluginAPI->removeChannelInstance(this); + m_deviceAPI->removeChannelInstance(this); m_deviceAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; diff --git a/plugins/channel/demodbfm/bfmdemodgui.h b/plugins/channel/demodbfm/bfmdemodgui.h index 923367efe..e2725934d 100644 --- a/plugins/channel/demodbfm/bfmdemodgui.h +++ b/plugins/channel/demodbfm/bfmdemodgui.h @@ -54,6 +54,8 @@ public: virtual bool handleMessage(const Message& message); + static const QString m_channelID; + private slots: void viewChanged(); void channelSampleRateChanged(); diff --git a/plugins/channel/demodbfm/bfmplugin.cpp b/plugins/channel/demodbfm/bfmplugin.cpp index 999f01ca7..4a01f2d18 100644 --- a/plugins/channel/demodbfm/bfmplugin.cpp +++ b/plugins/channel/demodbfm/bfmplugin.cpp @@ -46,14 +46,15 @@ void BFMPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI = pluginAPI; // register BFM demodulator - m_pluginAPI->registerChannel("sdrangel.channel.bfm", this); + m_pluginAPI->registerChannel(BFMDemodGUI::m_channelID, this); } PluginGUI* BFMPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI) { - if(channelName == "sdrangel.channel.bfm") { + if(channelName == BFMDemodGUI::m_channelID) + { BFMDemodGUI* gui = BFMDemodGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("sdrangel.channel.bfm", gui); +// deviceAPI->registerChannelInstance("sdrangel.channel.bfm", gui); // m_pluginAPI->addChannelRollup(gui); return gui; } else { @@ -64,6 +65,6 @@ PluginGUI* BFMPlugin::createChannel(const QString& channelName, DeviceAPI *devic void BFMPlugin::createInstanceBFM(DeviceAPI *deviceAPI) { BFMDemodGUI* gui = BFMDemodGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("sdrangel.channel.bfm", gui); +// deviceAPI->registerChannelInstance("sdrangel.channel.bfm", gui); // m_pluginAPI->addChannelRollup(gui); } diff --git a/plugins/channel/demoddsd/dsddemodgui.cpp b/plugins/channel/demoddsd/dsddemodgui.cpp index afa09b448..2cf534819 100644 --- a/plugins/channel/demoddsd/dsddemodgui.cpp +++ b/plugins/channel/demoddsd/dsddemodgui.cpp @@ -34,6 +34,8 @@ #include "dsddemod.h" #include "dsddemodgui.h" +const QString DSDDemodGUI::m_channelID = "sdrangel.channel.dsddemod"; + DSDDemodGUI* DSDDemodGUI::create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI) { DSDDemodGUI* gui = new DSDDemodGUI(pluginAPI, deviceAPI); @@ -288,6 +290,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged())); + m_deviceAPI->registerChannelInstance(m_channelID, this); m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addRollupWidget(this); @@ -298,7 +301,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa DSDDemodGUI::~DSDDemodGUI() { - m_pluginAPI->removeChannelInstance(this); + m_deviceAPI->removeChannelInstance(this); m_deviceAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; diff --git a/plugins/channel/demoddsd/dsddemodgui.h b/plugins/channel/demoddsd/dsddemodgui.h index 50f2d2ba0..a8e556220 100644 --- a/plugins/channel/demoddsd/dsddemodgui.h +++ b/plugins/channel/demoddsd/dsddemodgui.h @@ -54,6 +54,8 @@ public: virtual bool handleMessage(const Message& message); + static const QString m_channelID; + private slots: void viewChanged(); void formatStatusText(); diff --git a/plugins/channel/demoddsd/dsddemodplugin.cpp b/plugins/channel/demoddsd/dsddemodplugin.cpp index a126a5fe2..fa356ff4b 100644 --- a/plugins/channel/demoddsd/dsddemodplugin.cpp +++ b/plugins/channel/demoddsd/dsddemodplugin.cpp @@ -45,14 +45,15 @@ void DSDDemodPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI = pluginAPI; // register DSD demodulator - m_pluginAPI->registerChannel("sdrangel.channel.dsddemod", this); + m_pluginAPI->registerChannel(DSDDemodGUI::m_channelID, this); } PluginGUI* DSDDemodPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI) { - if(channelName == "sdrangel.channel.dsddemod") { + if(channelName == DSDDemodGUI::m_channelID) + { DSDDemodGUI* gui = DSDDemodGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("sdrangel.channel.dsddemod", gui); +// deviceAPI->registerChannelInstance("sdrangel.channel.dsddemod", gui); // m_pluginAPI->addChannelRollup(gui); return gui; } else { @@ -63,6 +64,6 @@ PluginGUI* DSDDemodPlugin::createChannel(const QString& channelName, DeviceAPI * void DSDDemodPlugin::createInstanceDSDDemod(DeviceAPI *deviceAPI) { DSDDemodGUI* gui = DSDDemodGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("sdrangel.channel.dsddemod", gui); +// deviceAPI->registerChannelInstance("sdrangel.channel.dsddemod", gui); // m_pluginAPI->addChannelRollup(gui); } diff --git a/plugins/channel/demodlora/lorademodgui.cpp b/plugins/channel/demodlora/lorademodgui.cpp index fa8256484..b004ff3c1 100644 --- a/plugins/channel/demodlora/lorademodgui.cpp +++ b/plugins/channel/demodlora/lorademodgui.cpp @@ -15,6 +15,8 @@ #include "gui/basicchannelsettingswidget.h" #include "dsp/dspengine.h" +const QString LoRaDemodGUI::m_channelID = "de.maintech.sdrangelove.channel.lora"; + LoRaDemodGUI* LoRaDemodGUI::create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI) { LoRaDemodGUI* gui = new LoRaDemodGUI(pluginAPI, deviceAPI); @@ -179,7 +181,10 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* m_channelMarker.setBandwidth(7813); m_channelMarker.setCenterFrequency(0); m_channelMarker.setVisible(true); + connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged())); + + m_deviceAPI->registerChannelInstance(m_channelID, this); m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addRollupWidget(this); @@ -190,7 +195,7 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* LoRaDemodGUI::~LoRaDemodGUI() { - m_pluginAPI->removeChannelInstance(this); + m_deviceAPI->removeChannelInstance(this); m_deviceAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; diff --git a/plugins/channel/demodlora/lorademodgui.h b/plugins/channel/demodlora/lorademodgui.h index b79d6574e..a62e5df27 100644 --- a/plugins/channel/demodlora/lorademodgui.h +++ b/plugins/channel/demodlora/lorademodgui.h @@ -36,6 +36,8 @@ public: virtual bool handleMessage(const Message& message); + static const QString m_channelID; + private slots: void viewChanged(); void on_BW_valueChanged(int value); diff --git a/plugins/channel/demodlora/loraplugin.cpp b/plugins/channel/demodlora/loraplugin.cpp index 795858b30..ff11b6b17 100644 --- a/plugins/channel/demodlora/loraplugin.cpp +++ b/plugins/channel/demodlora/loraplugin.cpp @@ -27,14 +27,15 @@ void LoRaPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI = pluginAPI; // register demodulator - m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.lora", this); + m_pluginAPI->registerChannel(LoRaDemodGUI::m_channelID, this); } PluginGUI* LoRaPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI) { - if(channelName == "de.maintech.sdrangelove.channel.lora") { + if(channelName == LoRaDemodGUI::m_channelID) + { LoRaDemodGUI* gui = LoRaDemodGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.lora", gui); +// deviceAPI->registerChannelInstance("de.maintech.sdrangelove.channel.lora", gui); // m_pluginAPI->addChannelRollup(gui); return gui; } else { @@ -45,6 +46,6 @@ PluginGUI* LoRaPlugin::createChannel(const QString& channelName, DeviceAPI *devi void LoRaPlugin::createInstanceLoRa(DeviceAPI *deviceAPI) { LoRaDemodGUI* gui = LoRaDemodGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.lora", gui); +// deviceAPI->registerChannelInstance("de.maintech.sdrangelove.channel.lora", gui); // m_pluginAPI->addChannelRollup(gui); } diff --git a/plugins/channel/demodnfm/nfmdemodgui.cpp b/plugins/channel/demodnfm/nfmdemodgui.cpp index 440561916..74af895f1 100644 --- a/plugins/channel/demodnfm/nfmdemodgui.cpp +++ b/plugins/channel/demodnfm/nfmdemodgui.cpp @@ -15,6 +15,8 @@ #include "dsp/dspengine.h" #include "mainwindow.h" +const QString NFMDemodGUI::m_channelID = "de.maintech.sdrangelove.channel.nfm"; + const int NFMDemodGUI::m_rfBW[] = { 5000, 6250, 8330, 10000, 12500, 15000, 20000, 25000, 40000 }; @@ -301,6 +303,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged())); + m_deviceAPI->registerChannelInstance(m_channelID, this); m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addRollupWidget(this); @@ -309,7 +312,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa NFMDemodGUI::~NFMDemodGUI() { - m_pluginAPI->removeChannelInstance(this); + m_deviceAPI->removeChannelInstance(this); m_deviceAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; diff --git a/plugins/channel/demodnfm/nfmdemodgui.h b/plugins/channel/demodnfm/nfmdemodgui.h index 19e8040fd..84225054b 100644 --- a/plugins/channel/demodnfm/nfmdemodgui.h +++ b/plugins/channel/demodnfm/nfmdemodgui.h @@ -37,6 +37,8 @@ public: virtual bool handleMessage(const Message& message); void setCtcssFreq(Real ctcssFreq); + static const QString m_channelID; + private slots: void viewChanged(); void on_deltaFrequency_changed(quint64 value); diff --git a/plugins/channel/demodnfm/nfmplugin.cpp b/plugins/channel/demodnfm/nfmplugin.cpp index 438244e8d..66cd51306 100644 --- a/plugins/channel/demodnfm/nfmplugin.cpp +++ b/plugins/channel/demodnfm/nfmplugin.cpp @@ -27,14 +27,14 @@ void NFMPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI = pluginAPI; // register NFM demodulator - m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.nfm", this); + m_pluginAPI->registerChannel(NFMDemodGUI::m_channelID, this); } PluginGUI* NFMPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI) { - if(channelName == "de.maintech.sdrangelove.channel.nfm") { + if(channelName == NFMDemodGUI::m_channelID) { NFMDemodGUI* gui = NFMDemodGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.nfm", gui); +// deviceAPI->registerChannelInstance(NFMDemodGUI::m_channelID, gui); // m_pluginAPI->addChannelRollup(gui); return gui; } else { @@ -45,6 +45,6 @@ PluginGUI* NFMPlugin::createChannel(const QString& channelName, DeviceAPI *devic void NFMPlugin::createInstanceNFM(DeviceAPI *deviceAPI) { NFMDemodGUI* gui = NFMDemodGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.nfm", gui); +// deviceAPI->registerChannelInstance(NFMDemodGUI::m_channelID, gui); // m_pluginAPI->addChannelRollup(gui); } diff --git a/plugins/channel/demodssb/ssbdemodgui.cpp b/plugins/channel/demodssb/ssbdemodgui.cpp index 7dddba95b..fbbf19d73 100644 --- a/plugins/channel/demodssb/ssbdemodgui.cpp +++ b/plugins/channel/demodssb/ssbdemodgui.cpp @@ -17,6 +17,8 @@ #include "dsp/dspengine.h" #include "mainwindow.h" +const QString SSBDemodGUI::m_channelID = "de.maintech.sdrangelove.channel.ssb"; + SSBDemodGUI* SSBDemodGUI::create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI) { SSBDemodGUI* gui = new SSBDemodGUI(pluginAPI, deviceAPI); @@ -359,7 +361,10 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa m_channelMarker.setSidebands(ChannelMarker::usb); m_channelMarker.setCenterFrequency(0); m_channelMarker.setVisible(true); + connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged())); + + m_deviceAPI->registerChannelInstance(m_channelID, this); m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addRollupWidget(this); @@ -371,7 +376,7 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa SSBDemodGUI::~SSBDemodGUI() { - m_pluginAPI->removeChannelInstance(this); + m_deviceAPI->removeChannelInstance(this); m_deviceAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; diff --git a/plugins/channel/demodssb/ssbdemodgui.h b/plugins/channel/demodssb/ssbdemodgui.h index db4f69431..b9e784a08 100644 --- a/plugins/channel/demodssb/ssbdemodgui.h +++ b/plugins/channel/demodssb/ssbdemodgui.h @@ -37,6 +37,8 @@ public: virtual bool handleMessage(const Message& message); + static const QString m_channelID; + private slots: void viewChanged(); void on_deltaFrequency_changed(quint64 value); diff --git a/plugins/channel/demodssb/ssbplugin.cpp b/plugins/channel/demodssb/ssbplugin.cpp index ed0efaad6..bc15efe85 100644 --- a/plugins/channel/demodssb/ssbplugin.cpp +++ b/plugins/channel/demodssb/ssbplugin.cpp @@ -28,14 +28,15 @@ void SSBPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI = pluginAPI; // register demodulator - m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.ssb", this); + m_pluginAPI->registerChannel(SSBDemodGUI::m_channelID, this); } PluginGUI* SSBPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI) { - if(channelName == "de.maintech.sdrangelove.channel.ssb") { + if(channelName == SSBDemodGUI::m_channelID) + { SSBDemodGUI* gui = SSBDemodGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.ssb", gui); +// deviceAPI->registerChannelInstance("de.maintech.sdrangelove.channel.ssb", gui); // m_pluginAPI->addChannelRollup(gui); return gui; } else { @@ -46,6 +47,6 @@ PluginGUI* SSBPlugin::createChannel(const QString& channelName, DeviceAPI *devic void SSBPlugin::createInstanceSSB(DeviceAPI *deviceAPI) { SSBDemodGUI* gui = SSBDemodGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.ssb", gui); +// deviceAPI->registerChannelInstance("de.maintech.sdrangelove.channel.ssb", gui); // m_pluginAPI->addChannelRollup(gui); } diff --git a/plugins/channel/demodwfm/wfmdemodgui.cpp b/plugins/channel/demodwfm/wfmdemodgui.cpp index 3d6c7d453..c4b0d3c01 100644 --- a/plugins/channel/demodwfm/wfmdemodgui.cpp +++ b/plugins/channel/demodwfm/wfmdemodgui.cpp @@ -15,6 +15,8 @@ #include "wfmdemod.h" #include "wfmdemodgui.h" +const QString WFMDemodGUI::m_channelID = "de.maintech.sdrangelove.channel.wfm"; + const int WFMDemodGUI::m_rfBW[] = { 48000, 80000, 120000, 140000, 160000, 180000, 200000, 220000, 250000 }; @@ -243,7 +245,10 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa m_channelMarker.setBandwidth(12500); m_channelMarker.setCenterFrequency(0); m_channelMarker.setVisible(true); + connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged())); + + m_deviceAPI->registerChannelInstance(m_channelID, this); m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addRollupWidget(this); @@ -252,7 +257,7 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa WFMDemodGUI::~WFMDemodGUI() { - m_pluginAPI->removeChannelInstance(this); + m_deviceAPI->removeChannelInstance(this); m_deviceAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; diff --git a/plugins/channel/demodwfm/wfmdemodgui.h b/plugins/channel/demodwfm/wfmdemodgui.h index e54f44edb..df44c4682 100644 --- a/plugins/channel/demodwfm/wfmdemodgui.h +++ b/plugins/channel/demodwfm/wfmdemodgui.h @@ -35,6 +35,8 @@ public: virtual bool handleMessage(const Message& message); + static const QString m_channelID; + private slots: void viewChanged(); void on_deltaFrequency_changed(quint64 value); diff --git a/plugins/channel/demodwfm/wfmplugin.cpp b/plugins/channel/demodwfm/wfmplugin.cpp index 69801d3a8..9cac8a8f6 100644 --- a/plugins/channel/demodwfm/wfmplugin.cpp +++ b/plugins/channel/demodwfm/wfmplugin.cpp @@ -28,14 +28,15 @@ void WFMPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI = pluginAPI; // register WFM demodulator - m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.wfm", this); + m_pluginAPI->registerChannel(WFMDemodGUI::m_channelID, this); } PluginGUI* WFMPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI) { - if(channelName == "de.maintech.sdrangelove.channel.wfm") { + if(channelName == WFMDemodGUI::m_channelID) + { WFMDemodGUI* gui = WFMDemodGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.wfm", gui); +// deviceAPI->registerChannelInstance("de.maintech.sdrangelove.channel.wfm", gui); // m_pluginAPI->addChannelRollup(gui); return gui; } else { @@ -46,6 +47,6 @@ PluginGUI* WFMPlugin::createChannel(const QString& channelName, DeviceAPI *devic void WFMPlugin::createInstanceWFM(DeviceAPI *deviceAPI) { WFMDemodGUI* gui = WFMDemodGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.wfm", gui); +// deviceAPI->registerChannelInstance("de.maintech.sdrangelove.channel.wfm", gui); // m_pluginAPI->addChannelRollup(gui); } diff --git a/plugins/channel/tcpsrc/tcpsrcgui.cpp b/plugins/channel/tcpsrc/tcpsrcgui.cpp index 8933027b5..5248e51d6 100644 --- a/plugins/channel/tcpsrc/tcpsrcgui.cpp +++ b/plugins/channel/tcpsrc/tcpsrcgui.cpp @@ -12,6 +12,8 @@ #include "ui_tcpsrcgui.h" #include "mainwindow.h" +const QString TCPSrcGUI::m_channelID = "sdrangel.channel.tcpsrc"; + TCPSrcGUI* TCPSrcGUI::create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI) { TCPSrcGUI* gui = new TCPSrcGUI(pluginAPI, deviceAPI); @@ -220,7 +222,10 @@ TCPSrcGUI::TCPSrcGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent m_channelMarker.setCenterFrequency(0); m_channelMarker.setColor(Qt::green); m_channelMarker.setVisible(true); + connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged())); + + m_deviceAPI->registerChannelInstance(m_channelID, this); m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addRollupWidget(this); @@ -231,7 +236,7 @@ TCPSrcGUI::TCPSrcGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent TCPSrcGUI::~TCPSrcGUI() { - m_pluginAPI->removeChannelInstance(this); + m_deviceAPI->removeChannelInstance(this); m_deviceAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; diff --git a/plugins/channel/tcpsrc/tcpsrcgui.h b/plugins/channel/tcpsrc/tcpsrcgui.h index 327a13690..5319bb83b 100644 --- a/plugins/channel/tcpsrc/tcpsrcgui.h +++ b/plugins/channel/tcpsrc/tcpsrcgui.h @@ -37,6 +37,8 @@ public: virtual bool handleMessage(const Message& message); + static const QString m_channelID; + private slots: void channelMarkerChanged(); void on_deltaFrequency_changed(quint64 value); diff --git a/plugins/channel/tcpsrc/tcpsrcplugin.cpp b/plugins/channel/tcpsrc/tcpsrcplugin.cpp index 88d64b7ed..77fe21f65 100644 --- a/plugins/channel/tcpsrc/tcpsrcplugin.cpp +++ b/plugins/channel/tcpsrc/tcpsrcplugin.cpp @@ -27,14 +27,15 @@ void TCPSrcPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI = pluginAPI; // register TCP Channel Source - m_pluginAPI->registerChannel("sdrangel.channel.tcpsrc", this); + m_pluginAPI->registerChannel(TCPSrcGUI::m_channelID, this); } PluginGUI* TCPSrcPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI) { - if(channelName == "sdrangel.channel.tcpsrc") { + if(channelName == TCPSrcGUI::m_channelID) + { TCPSrcGUI* gui = TCPSrcGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("sdrangel.channel.tcpsrc", gui); +// deviceAPI->registerChannelInstance("sdrangel.channel.tcpsrc", gui); // m_pluginAPI->addChannelRollup(gui); return gui; } else { @@ -45,6 +46,6 @@ PluginGUI* TCPSrcPlugin::createChannel(const QString& channelName, DeviceAPI *de void TCPSrcPlugin::createInstanceTCPSrc(DeviceAPI *deviceAPI) { TCPSrcGUI* gui = TCPSrcGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("sdrangel.channel.tcpsrc", gui); +// deviceAPI->registerChannelInstance("sdrangel.channel.tcpsrc", gui); // m_pluginAPI->addChannelRollup(gui); } diff --git a/plugins/channel/udpsrc/udpsrcgui.cpp b/plugins/channel/udpsrc/udpsrcgui.cpp index 427743429..28d457cb0 100644 --- a/plugins/channel/udpsrc/udpsrcgui.cpp +++ b/plugins/channel/udpsrc/udpsrcgui.cpp @@ -30,6 +30,8 @@ #include "mainwindow.h" #include "udpsrc.h" +const QString UDPSrcGUI::m_channelID = "sdrangel.channel.udpsrc"; + UDPSrcGUI* UDPSrcGUI::create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI) { UDPSrcGUI* gui = new UDPSrcGUI(pluginAPI, deviceAPI); @@ -260,7 +262,10 @@ UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent m_channelMarker.setCenterFrequency(0); m_channelMarker.setColor(Qt::green); m_channelMarker.setVisible(true); + connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged())); + + m_deviceAPI->registerChannelInstance(m_channelID, this); m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addRollupWidget(this); @@ -272,7 +277,7 @@ UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent UDPSrcGUI::~UDPSrcGUI() { - m_pluginAPI->removeChannelInstance(this); + m_deviceAPI->removeChannelInstance(this); m_deviceAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; diff --git a/plugins/channel/udpsrc/udpsrcgui.h b/plugins/channel/udpsrc/udpsrcgui.h index 41ee51c45..803ca59e2 100644 --- a/plugins/channel/udpsrc/udpsrcgui.h +++ b/plugins/channel/udpsrc/udpsrcgui.h @@ -55,6 +55,8 @@ public: virtual bool handleMessage(const Message& message); + static const QString m_channelID; + private slots: void channelMarkerChanged(); void on_deltaFrequency_changed(quint64 value); diff --git a/plugins/channel/udpsrc/udpsrcplugin.cpp b/plugins/channel/udpsrc/udpsrcplugin.cpp index c91f90724..feb4e5a14 100644 --- a/plugins/channel/udpsrc/udpsrcplugin.cpp +++ b/plugins/channel/udpsrc/udpsrcplugin.cpp @@ -46,14 +46,15 @@ void UDPSrcPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI = pluginAPI; // register TCP Channel Source - m_pluginAPI->registerChannel("sdrangel.channel.udpsrc", this); + m_pluginAPI->registerChannel(UDPSrcGUI::m_channelID, this); } PluginGUI* UDPSrcPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI) { - if(channelName == "sdrangel.channel.udpsrc") { + if(channelName == UDPSrcGUI::m_channelID) + { UDPSrcGUI* gui = UDPSrcGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("sdrangel.channel.udpsrc", gui); +// deviceAPI->registerChannelInstance("sdrangel.channel.udpsrc", gui); // m_pluginAPI->addChannelRollup(gui); return gui; } else { @@ -64,6 +65,6 @@ PluginGUI* UDPSrcPlugin::createChannel(const QString& channelName, DeviceAPI *de void UDPSrcPlugin::createInstanceUDPSrc(DeviceAPI *deviceAPI) { UDPSrcGUI* gui = UDPSrcGUI::create(m_pluginAPI, deviceAPI); - m_pluginAPI->registerChannelInstance("sdrangel.channel.udpsrc", gui); +// deviceAPI->registerChannelInstance("sdrangel.channel.udpsrc", gui); // m_pluginAPI->addChannelRollup(gui); } diff --git a/sdrbase/plugin/pluginapi.cpp b/sdrbase/plugin/pluginapi.cpp index 22d399b43..2eb1e026c 100644 --- a/sdrbase/plugin/pluginapi.cpp +++ b/sdrbase/plugin/pluginapi.cpp @@ -13,15 +13,15 @@ void PluginAPI::registerChannel(const QString& channelName, PluginInterface* plu m_pluginManager->registerChannel(channelName, plugin); } -void PluginAPI::registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI) -{ - m_pluginManager->registerChannelInstance(channelName, pluginGUI); -} - -void PluginAPI::removeChannelInstance(PluginGUI* pluginGUI) -{ - m_pluginManager->removeChannelInstance(pluginGUI); -} +//void PluginAPI::registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI) +//{ +// m_pluginManager->registerChannelInstance(channelName, pluginGUI); +//} +// +//void PluginAPI::removeChannelInstance(PluginGUI* pluginGUI) +//{ +// m_pluginManager->removeChannelInstance(pluginGUI); +//} void PluginAPI::registerSampleSource(const QString& sourceName, PluginInterface* plugin) { diff --git a/sdrbase/plugin/pluginapi.h b/sdrbase/plugin/pluginapi.h index dbf4890a9..0c26cd969 100644 --- a/sdrbase/plugin/pluginapi.h +++ b/sdrbase/plugin/pluginapi.h @@ -35,8 +35,8 @@ public: // Channel stuff void registerChannel(const QString& channelName, PluginInterface* plugin); - void registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI); - void removeChannelInstance(PluginGUI* pluginGUI); +// void registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI); +// void removeChannelInstance(PluginGUI* pluginGUI); ChannelRegistrations *getChannelRegistrations(); // Sample Source stuff diff --git a/sdrbase/plugin/pluginmanager.cpp b/sdrbase/plugin/pluginmanager.cpp index 9627c19da..632b6b3bc 100644 --- a/sdrbase/plugin/pluginmanager.cpp +++ b/sdrbase/plugin/pluginmanager.cpp @@ -59,22 +59,22 @@ void PluginManager::registerChannel(const QString& channelName, PluginInterface* m_channelRegistrations.append(PluginAPI::ChannelRegistration(channelName, plugin)); } -void PluginManager::registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI) -{ - m_channelInstanceRegistrations.append(ChannelInstanceRegistration(channelName, pluginGUI)); - renameChannelInstances(); -} - -void PluginManager::removeChannelInstance(PluginGUI* pluginGUI) -{ - for(ChannelInstanceRegistrations::iterator it = m_channelInstanceRegistrations.begin(); it != m_channelInstanceRegistrations.end(); ++it) { - if(it->m_gui == pluginGUI) { - m_channelInstanceRegistrations.erase(it); - break; - } - } - renameChannelInstances(); -} +//void PluginManager::registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI) +//{ +// m_channelInstanceRegistrations.append(ChannelInstanceRegistration(channelName, pluginGUI)); +// renameChannelInstances(); +//} +// +//void PluginManager::removeChannelInstance(PluginGUI* pluginGUI) +//{ +// for(ChannelInstanceRegistrations::iterator it = m_channelInstanceRegistrations.begin(); it != m_channelInstanceRegistrations.end(); ++it) { +// if(it->m_gui == pluginGUI) { +// m_channelInstanceRegistrations.erase(it); +// break; +// } +// } +// renameChannelInstances(); +//} void PluginManager::registerSampleSource(const QString& sourceName, PluginInterface* plugin) { diff --git a/sdrbase/plugin/pluginmanager.h b/sdrbase/plugin/pluginmanager.h index 688465978..2174e28b6 100644 --- a/sdrbase/plugin/pluginmanager.h +++ b/sdrbase/plugin/pluginmanager.h @@ -43,8 +43,8 @@ public: // Callbacks from the plugins void registerChannel(const QString& channelName, PluginInterface* plugin); - void registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI); - void removeChannelInstance(PluginGUI* pluginGUI); +// void registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI); +// void removeChannelInstance(PluginGUI* pluginGUI); void registerSampleSource(const QString& sourceName, PluginInterface* plugin); PluginAPI::ChannelRegistrations *getChannelRegistrations() { return &m_channelRegistrations; }