2014-05-18 11:52:39 -04:00
|
|
|
#include <QDockWidget>
|
|
|
|
#include "plugin/pluginapi.h"
|
|
|
|
#include "plugin/pluginmanager.h"
|
|
|
|
#include "mainwindow.h"
|
|
|
|
|
2016-05-13 05:42:03 -04:00
|
|
|
// This was used in Tetra demod plugin which is not part of the build anymore
|
|
|
|
//QDockWidget* PluginAPI::createMainWindowDock(Qt::DockWidgetArea dockWidgetArea, const QString& title)
|
|
|
|
//{
|
|
|
|
// QDockWidget* dock = new QDockWidget(title, m_mainWindow);
|
|
|
|
// dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
|
|
|
// dock->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
// m_mainWindow->addDockWidget(dockWidgetArea, dock);
|
|
|
|
// m_mainWindow->addViewAction(dock->toggleViewAction());
|
|
|
|
// return dock;
|
|
|
|
//}
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
MessageQueue* PluginAPI::getMainWindowMessageQueue()
|
|
|
|
{
|
2015-08-17 20:47:14 -04:00
|
|
|
return m_mainWindow->getInputMessageQueue();
|
2014-05-18 11:52:39 -04:00
|
|
|
}
|
|
|
|
|
2016-05-14 22:38:37 -04:00
|
|
|
void PluginAPI::setInputGUI(QWidget* inputGUI, const QString& sourceDisplayName)
|
2014-05-18 11:52:39 -04:00
|
|
|
{
|
2016-05-14 22:38:37 -04:00
|
|
|
m_pluginManager->setInputGUI(inputGUI, sourceDisplayName);
|
2014-05-18 11:52:39 -04:00
|
|
|
}
|
|
|
|
|
2016-05-14 15:33:12 -04:00
|
|
|
void PluginAPI::registerChannel(const QString& channelName, PluginInterface* plugin)
|
2014-05-18 11:52:39 -04:00
|
|
|
{
|
2016-05-14 15:33:12 -04:00
|
|
|
m_pluginManager->registerChannel(channelName, plugin);
|
2014-05-18 11:52:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void PluginAPI::registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI)
|
|
|
|
{
|
|
|
|
m_pluginManager->registerChannelInstance(channelName, pluginGUI);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PluginAPI::addChannelRollup(QWidget* pluginGUI)
|
|
|
|
{
|
|
|
|
m_pluginManager->addChannelRollup(pluginGUI);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PluginAPI::removeChannelInstance(PluginGUI* pluginGUI)
|
|
|
|
{
|
|
|
|
m_pluginManager->removeChannelInstance(pluginGUI);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PluginAPI::addChannelMarker(ChannelMarker* channelMarker)
|
|
|
|
{
|
2016-05-15 05:26:48 -04:00
|
|
|
m_pluginManager->addChannelMarker(channelMarker);
|
2014-05-18 11:52:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void PluginAPI::removeChannelMarker(ChannelMarker* channelMarker)
|
|
|
|
{
|
2016-05-15 05:26:48 -04:00
|
|
|
m_pluginManager->removeChannelMarker(channelMarker);
|
2014-05-18 11:52:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void PluginAPI::registerSampleSource(const QString& sourceName, PluginInterface* plugin)
|
|
|
|
{
|
|
|
|
m_pluginManager->registerSampleSource(sourceName, plugin);
|
|
|
|
}
|
|
|
|
|
2016-05-12 04:31:57 -04:00
|
|
|
void PluginAPI::addSink(SampleSink* sink)
|
|
|
|
{
|
|
|
|
m_pluginManager->addSink(sink);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PluginAPI::removeSink(SampleSink* sink)
|
|
|
|
{
|
|
|
|
m_pluginManager->removeSink(sink);
|
|
|
|
}
|
|
|
|
|
2016-05-11 12:29:01 -04:00
|
|
|
void PluginAPI::addThreadedSink(ThreadedSampleSink* sink)
|
|
|
|
{
|
|
|
|
m_pluginManager->addThreadedSink(sink);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PluginAPI::removeThreadedSink(ThreadedSampleSink* sink)
|
|
|
|
{
|
|
|
|
m_pluginManager->removeThreadedSink(sink);
|
|
|
|
}
|
|
|
|
|
2016-05-12 18:50:29 -04:00
|
|
|
void PluginAPI::setSource(SampleSource* source)
|
|
|
|
{
|
|
|
|
m_pluginManager->setSource(source);
|
|
|
|
}
|
|
|
|
|
2016-05-11 17:35:16 -04:00
|
|
|
bool PluginAPI::initAcquisition()
|
|
|
|
{
|
|
|
|
return m_pluginManager->initAcquisition();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PluginAPI::startAcquisition()
|
|
|
|
{
|
|
|
|
return m_pluginManager->startAcquisition();
|
|
|
|
}
|
|
|
|
|
|
|
|
void PluginAPI::stopAcquistion()
|
|
|
|
{
|
|
|
|
m_pluginManager->stopAcquistion();
|
|
|
|
}
|
|
|
|
|
|
|
|
DSPDeviceEngine::State PluginAPI::state() const
|
|
|
|
{
|
|
|
|
return m_pluginManager->state();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString PluginAPI::errorMessage()
|
|
|
|
{
|
|
|
|
return m_pluginManager->errorMessage();
|
|
|
|
}
|
|
|
|
|
2016-05-12 04:31:57 -04:00
|
|
|
uint PluginAPI::getDeviceUID() const
|
|
|
|
{
|
|
|
|
return m_pluginManager->getDeviceUID();
|
|
|
|
}
|
|
|
|
|
|
|
|
MessageQueue *PluginAPI::getDeviceInputMessageQueue()
|
|
|
|
{
|
|
|
|
return m_pluginManager->getDeviceInputMessageQueue();
|
|
|
|
}
|
|
|
|
|
|
|
|
MessageQueue *PluginAPI::getDeviceOutputMessageQueue()
|
|
|
|
{
|
|
|
|
return m_pluginManager->getDeviceOutputMessageQueue();
|
|
|
|
}
|
|
|
|
|
2016-05-12 18:03:58 -04:00
|
|
|
void PluginAPI::configureCorrections(bool dcOffsetCorrection, bool iqImbalanceCorrection)
|
|
|
|
{
|
|
|
|
m_pluginManager->configureCorrections(dcOffsetCorrection, iqImbalanceCorrection);
|
|
|
|
}
|
|
|
|
|
2016-05-12 04:31:57 -04:00
|
|
|
GLSpectrum *PluginAPI::getSpectrum()
|
|
|
|
{
|
|
|
|
return m_pluginManager->getSpectrum();
|
|
|
|
}
|
|
|
|
|
2016-05-11 10:03:03 -04:00
|
|
|
PluginAPI::PluginAPI(PluginManager* pluginManager, MainWindow* mainWindow) :
|
2014-05-18 11:52:39 -04:00
|
|
|
QObject(mainWindow),
|
|
|
|
m_pluginManager(pluginManager),
|
2016-05-11 10:03:03 -04:00
|
|
|
m_mainWindow(mainWindow)
|
2014-05-18 11:52:39 -04:00
|
|
|
{
|
|
|
|
}
|
2016-05-13 05:42:03 -04:00
|
|
|
|
|
|
|
PluginAPI::~PluginAPI()
|
|
|
|
{
|
|
|
|
}
|