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

Renamed MainCore to MainServer

This commit is contained in:
f4exb 2020-10-08 22:33:08 +02:00
parent d50f0659a6
commit d3ce9d49d0
8 changed files with 95 additions and 95 deletions

View File

@ -24,7 +24,7 @@
#include <vector> #include <vector>
#include "loggerwithfile.h" #include "loggerwithfile.h"
#include "maincore.h" #include "mainserver.h"
#include "dsp/dsptypes.h" #include "dsp/dsptypes.h"
void handler(int sig) { void handler(int sig) {
@ -91,7 +91,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
QCoreApplication::applicationPid()); QCoreApplication::applicationPid());
#endif #endif
MainCore m(logger, parser, &a); MainServer m(logger, parser, &a);
// This will cause the application to exit when the main core is finished // This will cause the application to exit when the main core is finished
QObject::connect(&m, SIGNAL(finished()), &a, SLOT(quit())); QObject::connect(&m, SIGNAL(finished()), &a, SLOT(quit()));

View File

@ -1,3 +1,3 @@
<h1>Plugins for SDRangel server</h1> <h1>Plugins for SDRangel server</h1>
This is a build only subdirectory using the same structure and sources as in the `plugins` subdirectory. The plugins here are compiled without GUI and reference to Qt Widgets and are to be used with the server (headless) version of SDRangel through the `MainCore` class. This is a build only subdirectory using the same structure and sources as in the `plugins` subdirectory. The plugins here are compiled without GUI and reference to Qt Widgets and are to be used with the server (headless) version of SDRangel through the `MainServer` class.

View File

@ -1,13 +1,13 @@
project (sdrsrv) project (sdrsrv)
set(sdrsrv_SOURCES set(sdrsrv_SOURCES
maincore.cpp mainserver.cpp
feature/featureset.cpp feature/featureset.cpp
webapi/webapiadaptersrv.cpp webapi/webapiadaptersrv.cpp
) )
set(sdrsrv_HEADERS set(sdrsrv_HEADERS
maincore.h mainserver.h
feature/featureset.h feature/featureset.h
webapi/webapiadaptersrv.h webapi/webapiadaptersrv.h
) )

View File

@ -35,27 +35,27 @@
#include "webapi/webapiserver.h" #include "webapi/webapiserver.h"
#include "webapi/webapiadaptersrv.h" #include "webapi/webapiadaptersrv.h"
#include "maincore.h" #include "mainserver.h"
MESSAGE_CLASS_DEFINITION(MainCore::MsgDeleteInstance, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgDeleteInstance, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgLoadPreset, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgLoadPreset, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgSavePreset, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgSavePreset, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgDeletePreset, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgDeletePreset, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgLoadFeatureSetPreset, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgLoadFeatureSetPreset, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgSaveFeatureSetPreset, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgSaveFeatureSetPreset, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgDeleteFeatureSetPreset, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgDeleteFeatureSetPreset, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgAddDeviceSet, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgAddDeviceSet, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgRemoveLastDeviceSet, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgRemoveLastDeviceSet, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgSetDevice, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgSetDevice, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgAddChannel, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgAddChannel, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgDeleteChannel, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgDeleteChannel, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgApplySettings, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgApplySettings, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgAddFeature, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgAddFeature, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgDeleteFeature, Message) MESSAGE_CLASS_DEFINITION(MainServer::MsgDeleteFeature, Message)
MainCore *MainCore::m_instance = 0; MainServer *MainServer::m_instance = 0;
MainCore::MainCore(qtwebapp::LoggerWithFile *logger, const MainParser& parser, QObject *parent) : MainServer::MainServer(qtwebapp::LoggerWithFile *logger, const MainParser& parser, QObject *parent) :
QObject(parent), QObject(parent),
m_settings(), m_settings(),
m_masterTabIndex(-1), m_masterTabIndex(-1),
@ -63,26 +63,26 @@ MainCore::MainCore(qtwebapp::LoggerWithFile *logger, const MainParser& parser, Q
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted), m_lastEngineState(DSPDeviceSourceEngine::StNotStarted),
m_logger(logger) m_logger(logger)
{ {
qDebug() << "MainCore::MainCore: start"; qDebug() << "MainServer::MainServer: start";
m_instance = this; m_instance = this;
m_settings.setAudioDeviceManager(m_dspEngine->getAudioDeviceManager()); m_settings.setAudioDeviceManager(m_dspEngine->getAudioDeviceManager());
m_settings.setAMBEEngine(m_dspEngine->getAMBEEngine()); m_settings.setAMBEEngine(m_dspEngine->getAMBEEngine());
qDebug() << "MainCore::MainCore: create FFT factory..."; qDebug() << "MainServer::MainServer: create FFT factory...";
m_dspEngine->createFFTFactory(parser.getFFTWFWisdomFileName()); m_dspEngine->createFFTFactory(parser.getFFTWFWisdomFileName());
qDebug() << "MainCore::MainCore: load plugins..."; qDebug() << "MainServer::MainServer: load plugins...";
m_pluginManager = new PluginManager(this); m_pluginManager = new PluginManager(this);
m_pluginManager->loadPlugins(QString("pluginssrv")); m_pluginManager->loadPlugins(QString("pluginssrv"));
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleMessages()), Qt::QueuedConnection); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleMessages()), Qt::QueuedConnection);
m_masterTimer.start(50); m_masterTimer.start(50);
qDebug() << "MainCore::MainCore: load setings..."; qDebug() << "MainServer::MainServer: load setings...";
loadSettings(); loadSettings();
qDebug() << "MainCore::MainCore: finishing..."; qDebug() << "MainServer::MainServer: finishing...";
QString applicationDirPath = QCoreApplication::instance()->applicationDirPath(); QString applicationDirPath = QCoreApplication::instance()->applicationDirPath();
m_apiAdapter = new WebAPIAdapterSrv(*this); m_apiAdapter = new WebAPIAdapterSrv(*this);
@ -95,10 +95,10 @@ MainCore::MainCore(qtwebapp::LoggerWithFile *logger, const MainParser& parser, Q
m_dspEngine->setMIMOSupport(parser.getMIMOSupport()); m_dspEngine->setMIMOSupport(parser.getMIMOSupport());
qDebug() << "MainCore::MainCore: end"; qDebug() << "MainServer::MainServer: end";
} }
MainCore::~MainCore() MainServer::~MainServer()
{ {
while (m_deviceSets.size() > 0) { while (m_deviceSets.size() > 0) {
removeLastDevice(); removeLastDevice();
@ -112,11 +112,11 @@ MainCore::~MainCore()
delete m_pluginManager; delete m_pluginManager;
qDebug() << "MainCore::~MainCore: end"; qDebug() << "MainServer::~MainServer: end";
delete m_logger; delete m_logger;
} }
bool MainCore::handleMessage(const Message& cmd) bool MainServer::handleMessage(const Message& cmd)
{ {
if (MsgDeleteInstance::match(cmd)) if (MsgDeleteInstance::match(cmd))
{ {
@ -242,34 +242,34 @@ bool MainCore::handleMessage(const Message& cmd)
} }
} }
void MainCore::handleMessages() void MainServer::handleMessages()
{ {
Message* message; Message* message;
while ((message = m_inputMessageQueue.pop()) != 0) while ((message = m_inputMessageQueue.pop()) != 0)
{ {
qDebug("MainCore::handleMessages: message: %s", message->getIdentifier()); qDebug("MainServer::handleMessages: message: %s", message->getIdentifier());
handleMessage(*message); handleMessage(*message);
delete message; delete message;
} }
} }
void MainCore::loadSettings() void MainServer::loadSettings()
{ {
qDebug() << "MainCore::loadSettings"; qDebug() << "MainServer::loadSettings";
m_settings.load(); m_settings.load();
m_settings.sortPresets(); m_settings.sortPresets();
setLoggingOptions(); setLoggingOptions();
} }
void MainCore::applySettings() void MainServer::applySettings()
{ {
m_settings.sortPresets(); m_settings.sortPresets();
setLoggingOptions(); setLoggingOptions();
} }
void MainCore::setLoggingOptions() void MainServer::setLoggingOptions()
{ {
m_logger->setConsoleMinMessageLevel(m_settings.getConsoleMinLogLevel()); m_logger->setConsoleMinMessageLevel(m_settings.getConsoleMinLogLevel());
@ -318,7 +318,7 @@ void MainCore::setLoggingOptions()
} }
} }
void MainCore::addSinkDevice() void MainServer::addSinkDevice()
{ {
DSPDeviceSinkEngine *dspDeviceSinkEngine = m_dspEngine->addDeviceSinkEngine(); DSPDeviceSinkEngine *dspDeviceSinkEngine = m_dspEngine->addDeviceSinkEngine();
dspDeviceSinkEngine->start(); dspDeviceSinkEngine->start();
@ -364,7 +364,7 @@ void MainCore::addSinkDevice()
m_deviceSets.back()->m_deviceAPI->setSampleSink(sink); m_deviceSets.back()->m_deviceAPI->setSampleSink(sink);
} }
void MainCore::addSourceDevice() void MainServer::addSourceDevice()
{ {
DSPDeviceSourceEngine *dspDeviceSourceEngine = m_dspEngine->addDeviceSourceEngine(); DSPDeviceSourceEngine *dspDeviceSourceEngine = m_dspEngine->addDeviceSourceEngine();
dspDeviceSourceEngine->start(); dspDeviceSourceEngine->start();
@ -409,7 +409,7 @@ void MainCore::addSourceDevice()
m_deviceSets.back()->m_deviceAPI->setSampleSource(source); m_deviceSets.back()->m_deviceAPI->setSampleSource(source);
} }
void MainCore::removeLastDevice() void MainServer::removeLastDevice()
{ {
if (m_deviceSets.back()->m_deviceSourceEngine) // source set if (m_deviceSets.back()->m_deviceSourceEngine) // source set
{ {
@ -455,11 +455,11 @@ void MainCore::removeLastDevice()
m_deviceSets.pop_back(); m_deviceSets.pop_back();
} }
void MainCore::changeSampleSource(int deviceSetIndex, int selectedDeviceIndex) void MainServer::changeSampleSource(int deviceSetIndex, int selectedDeviceIndex)
{ {
if (deviceSetIndex >= 0) if (deviceSetIndex >= 0)
{ {
qDebug("MainCore::changeSampleSource: deviceSet at %d", deviceSetIndex); qDebug("MainServer::changeSampleSource: deviceSet at %d", deviceSetIndex);
DeviceSet *deviceSet = m_deviceSets[deviceSetIndex]; DeviceSet *deviceSet = m_deviceSets[deviceSetIndex];
deviceSet->m_deviceAPI->saveSamplingDeviceSettings(m_settings.getWorkingPreset()); // save old API settings deviceSet->m_deviceAPI->saveSamplingDeviceSettings(m_settings.getWorkingPreset()); // save old API settings
deviceSet->m_deviceAPI->stopDeviceEngine(); deviceSet->m_deviceAPI->stopDeviceEngine();
@ -482,7 +482,7 @@ void MainCore::changeSampleSource(int deviceSetIndex, int selectedDeviceIndex)
if (deviceSet->m_deviceAPI->getSamplingDeviceId().size() == 0) // non existent device => replace by default if (deviceSet->m_deviceAPI->getSamplingDeviceId().size() == 0) // non existent device => replace by default
{ {
qDebug("MainCore::changeSampleSource: non existent device replaced by File Input"); qDebug("MainServer::changeSampleSource: non existent device replaced by File Input");
int deviceIndex = DeviceEnumerator::instance()->getFileInputDeviceIndex(); int deviceIndex = DeviceEnumerator::instance()->getFileInputDeviceIndex();
samplingDevice = DeviceEnumerator::instance()->getRxSamplingDevice(deviceIndex); samplingDevice = DeviceEnumerator::instance()->getRxSamplingDevice(deviceIndex);
deviceSet->m_deviceAPI->setSamplingDeviceSequence(samplingDevice->sequence); deviceSet->m_deviceAPI->setSamplingDeviceSequence(samplingDevice->sequence);
@ -538,11 +538,11 @@ void MainCore::changeSampleSource(int deviceSetIndex, int selectedDeviceIndex)
} }
} }
void MainCore::changeSampleSink(int deviceSetIndex, int selectedDeviceIndex) void MainServer::changeSampleSink(int deviceSetIndex, int selectedDeviceIndex)
{ {
if (deviceSetIndex >= 0) if (deviceSetIndex >= 0)
{ {
qDebug("MainCore::changeSampleSink: device set at %d", deviceSetIndex); qDebug("MainServer::changeSampleSink: device set at %d", deviceSetIndex);
DeviceSet *deviceSet = m_deviceSets[deviceSetIndex]; DeviceSet *deviceSet = m_deviceSets[deviceSetIndex];
deviceSet->m_deviceAPI->saveSamplingDeviceSettings(m_settings.getWorkingPreset()); // save old API settings deviceSet->m_deviceAPI->saveSamplingDeviceSettings(m_settings.getWorkingPreset()); // save old API settings
deviceSet->m_deviceAPI->stopDeviceEngine(); deviceSet->m_deviceAPI->stopDeviceEngine();
@ -565,7 +565,7 @@ void MainCore::changeSampleSink(int deviceSetIndex, int selectedDeviceIndex)
if (deviceSet->m_deviceAPI->getSamplingDeviceId().size() == 0) // non existent device => replace by default if (deviceSet->m_deviceAPI->getSamplingDeviceId().size() == 0) // non existent device => replace by default
{ {
qDebug("MainCore::changeSampleSink: non existent device replaced by File Sink"); qDebug("MainServer::changeSampleSink: non existent device replaced by File Sink");
int fileSinkDeviceIndex = DeviceEnumerator::instance()->getFileOutputDeviceIndex(); int fileSinkDeviceIndex = DeviceEnumerator::instance()->getFileOutputDeviceIndex();
const PluginInterface::SamplingDevice *samplingDevice = DeviceEnumerator::instance()->getTxSamplingDevice(fileSinkDeviceIndex); const PluginInterface::SamplingDevice *samplingDevice = DeviceEnumerator::instance()->getTxSamplingDevice(fileSinkDeviceIndex);
deviceSet->m_deviceAPI->setSamplingDeviceSequence(samplingDevice->sequence); deviceSet->m_deviceAPI->setSamplingDeviceSequence(samplingDevice->sequence);
@ -621,11 +621,11 @@ void MainCore::changeSampleSink(int deviceSetIndex, int selectedDeviceIndex)
} }
} }
void MainCore::changeSampleMIMO(int deviceSetIndex, int selectedDeviceIndex) void MainServer::changeSampleMIMO(int deviceSetIndex, int selectedDeviceIndex)
{ {
if (deviceSetIndex >= 0) if (deviceSetIndex >= 0)
{ {
qDebug("MainCore::changeSampleMIMO: device set at %d", deviceSetIndex); qDebug("MainServer::changeSampleMIMO: device set at %d", deviceSetIndex);
DeviceSet *deviceSet = m_deviceSets[deviceSetIndex]; DeviceSet *deviceSet = m_deviceSets[deviceSetIndex];
deviceSet->m_deviceAPI->saveSamplingDeviceSettings(m_settings.getWorkingPreset()); // save old API settings deviceSet->m_deviceAPI->saveSamplingDeviceSettings(m_settings.getWorkingPreset()); // save old API settings
deviceSet->m_deviceAPI->stopDeviceEngine(); deviceSet->m_deviceAPI->stopDeviceEngine();
@ -660,7 +660,7 @@ void MainCore::changeSampleMIMO(int deviceSetIndex, int selectedDeviceIndex)
} }
} }
void MainCore::addChannel(int deviceSetIndex, int selectedChannelIndex) void MainServer::addChannel(int deviceSetIndex, int selectedChannelIndex)
{ {
if (deviceSetIndex >= 0) if (deviceSetIndex >= 0)
{ {
@ -677,7 +677,7 @@ void MainCore::addChannel(int deviceSetIndex, int selectedChannelIndex)
} }
} }
void MainCore::deleteChannel(int deviceSetIndex, int channelIndex) void MainServer::deleteChannel(int deviceSetIndex, int channelIndex)
{ {
if (deviceSetIndex >= 0) if (deviceSetIndex >= 0)
{ {
@ -686,7 +686,7 @@ void MainCore::deleteChannel(int deviceSetIndex, int channelIndex)
} }
} }
void MainCore::addFeature(int featureSetIndex, int featureIndex) void MainServer::addFeature(int featureSetIndex, int featureIndex)
{ {
if (featureSetIndex >= 0) if (featureSetIndex >= 0)
{ {
@ -695,7 +695,7 @@ void MainCore::addFeature(int featureSetIndex, int featureIndex)
} }
} }
void MainCore::deleteFeature(int featureSetIndex, int featureIndex) void MainServer::deleteFeature(int featureSetIndex, int featureIndex)
{ {
if ((featureSetIndex >= 0) && (featureSetIndex < (int) m_featureSets.size())) if ((featureSetIndex >= 0) && (featureSetIndex < (int) m_featureSets.size()))
{ {
@ -704,9 +704,9 @@ void MainCore::deleteFeature(int featureSetIndex, int featureIndex)
} }
} }
void MainCore::loadPresetSettings(const Preset* preset, int tabIndex) void MainServer::loadPresetSettings(const Preset* preset, int tabIndex)
{ {
qDebug("MainCore::loadPresetSettings: preset [%s | %s]", qDebug("MainServer::loadPresetSettings: preset [%s | %s]",
qPrintable(preset->getGroup()), qPrintable(preset->getGroup()),
qPrintable(preset->getDescription())); qPrintable(preset->getDescription()));
@ -725,9 +725,9 @@ void MainCore::loadPresetSettings(const Preset* preset, int tabIndex)
} }
} }
void MainCore::savePresetSettings(Preset* preset, int tabIndex) void MainServer::savePresetSettings(Preset* preset, int tabIndex)
{ {
qDebug("MainCore::savePresetSettings: preset [%s | %s]", qDebug("MainServer::savePresetSettings: preset [%s | %s]",
qPrintable(preset->getGroup()), qPrintable(preset->getGroup()),
qPrintable(preset->getDescription())); qPrintable(preset->getDescription()));
@ -758,9 +758,9 @@ void MainCore::savePresetSettings(Preset* preset, int tabIndex)
} }
} }
void MainCore::loadFeatureSetPresetSettings(const FeatureSetPreset* preset, int featureSetIndex) void MainServer::loadFeatureSetPresetSettings(const FeatureSetPreset* preset, int featureSetIndex)
{ {
qDebug("MainCore::loadFeatureSetPresetSettings: preset [%s | %s]", qDebug("MainServer::loadFeatureSetPresetSettings: preset [%s | %s]",
qPrintable(preset->getGroup()), qPrintable(preset->getGroup()),
qPrintable(preset->getDescription())); qPrintable(preset->getDescription()));
@ -771,9 +771,9 @@ void MainCore::loadFeatureSetPresetSettings(const FeatureSetPreset* preset, int
} }
} }
void MainCore::saveFeatureSetPresetSettings(FeatureSetPreset* preset, int featureSetIndex) void MainServer::saveFeatureSetPresetSettings(FeatureSetPreset* preset, int featureSetIndex)
{ {
qDebug("MainCore::saveFeatureSetPresetSettings: preset [%s | %s]", qDebug("MainServer::saveFeatureSetPresetSettings: preset [%s | %s]",
qPrintable(preset->getGroup()), qPrintable(preset->getGroup()),
qPrintable(preset->getDescription())); qPrintable(preset->getDescription()));

View File

@ -46,13 +46,13 @@ namespace qtwebapp {
class LoggerWithFile; class LoggerWithFile;
} }
class SDRSRV_API MainCore : public QObject { class SDRSRV_API MainServer : public QObject {
Q_OBJECT Q_OBJECT
public: public:
explicit MainCore(qtwebapp::LoggerWithFile *logger, const MainParser& parser, QObject *parent = 0); explicit MainServer(qtwebapp::LoggerWithFile *logger, const MainParser& parser, QObject *parent = 0);
~MainCore(); ~MainServer();
static MainCore *getInstance() { return m_instance; } // Main Core is de facto a singleton so this just returns its reference static MainServer *getInstance() { return m_instance; } // Main Core is de facto a singleton so this just returns its reference
MessageQueue* getInputMessageQueue() { return &m_inputMessageQueue; } MessageQueue* getInputMessageQueue() { return &m_inputMessageQueue; }
@ -401,7 +401,7 @@ private:
{ } { }
}; };
static MainCore *m_instance; static MainServer *m_instance;
MainSettings m_settings; MainSettings m_settings;
int m_masterTabIndex; int m_masterTabIndex;
DSPEngine* m_dspEngine; DSPEngine* m_dspEngine;

View File

@ -1,6 +1,6 @@
<h1>SDRangel Server</h1> <h1>SDRangel Server</h1>
This folder holds the objects specific to the server (headless) version of SDRangel. The `MainCore` class is the headless equivalent of the `MainWindow` class in the GUI version and plays the same central role. Plugins are built specifically without GUI and are located in the `pluginssrv` folder. This folder holds the objects specific to the server (headless) version of SDRangel. The `MainServer` class is the headless equivalent of the `MainWindow` class in the GUI version and plays the same central role. Plugins are built specifically without GUI and are located in the `pluginssrv` folder.
This document focuses on the functional description of SDRangel server. More details on the technical architecture can be found in the developer's documentation. This document focuses on the functional description of SDRangel server. More details on the technical architecture can be found in the developer's documentation.

View File

@ -53,7 +53,7 @@
#include "SWGFeatureReport.h" #include "SWGFeatureReport.h"
#include "SWGFeatureActions.h" #include "SWGFeatureActions.h"
#include "maincore.h" #include "mainserver.h"
#include "loggerwithfile.h" #include "loggerwithfile.h"
#include "device/deviceset.h" #include "device/deviceset.h"
#include "device/deviceapi.h" #include "device/deviceapi.h"
@ -78,7 +78,7 @@
#include "limerfe/limerfecontroller.h" #include "limerfe/limerfecontroller.h"
#endif #endif
WebAPIAdapterSrv::WebAPIAdapterSrv(MainCore& mainCore) : WebAPIAdapterSrv::WebAPIAdapterSrv(MainServer& mainCore) :
m_mainCore(mainCore) m_mainCore(mainCore)
{ {
} }
@ -124,7 +124,7 @@ int WebAPIAdapterSrv::instanceDelete(
SWGSDRangel::SWGSuccessResponse& response, SWGSDRangel::SWGSuccessResponse& response,
SWGSDRangel::SWGErrorResponse& error) SWGSDRangel::SWGErrorResponse& error)
{ {
MainCore::MsgDeleteInstance *msg = MainCore::MsgDeleteInstance::create(); MainServer::MsgDeleteInstance *msg = MainServer::MsgDeleteInstance::create();
m_mainCore.getInputMessageQueue()->push(msg); m_mainCore.getInputMessageQueue()->push(msg);
response.init(); response.init();
@ -234,7 +234,7 @@ int WebAPIAdapterSrv::instanceConfigPutPatch(
m_mainCore.m_settings.addFeatureSetPreset(newPreset); m_mainCore.m_settings.addFeatureSetPreset(newPreset);
} }
MainCore::MsgApplySettings *msg = MainCore::MsgApplySettings::create(); MainServer::MsgApplySettings *msg = MainServer::MsgApplySettings::create();
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
return 200; return 200;
@ -1284,7 +1284,7 @@ int WebAPIAdapterSrv::instancePresetPatch(
return 404; return 404;
} }
MainCore::MsgLoadPreset *msg = MainCore::MsgLoadPreset::create(selectedPreset, deviceSetIndex); MainServer::MsgLoadPreset *msg = MainServer::MsgLoadPreset::create(selectedPreset, deviceSetIndex);
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
response.init(); response.init();
@ -1353,7 +1353,7 @@ int WebAPIAdapterSrv::instancePresetPut(
} }
} }
MainCore::MsgSavePreset *msg = MainCore::MsgSavePreset::create(const_cast<Preset*>(selectedPreset), deviceSetIndex, false); MainServer::MsgSavePreset *msg = MainServer::MsgSavePreset::create(const_cast<Preset*>(selectedPreset), deviceSetIndex, false);
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
response.init(); response.init();
@ -1420,7 +1420,7 @@ int WebAPIAdapterSrv::instancePresetPost(
return 409; return 409;
} }
MainCore::MsgSavePreset *msg = MainCore::MsgSavePreset::create(const_cast<Preset*>(selectedPreset), deviceSetIndex, true); MainServer::MsgSavePreset *msg = MainServer::MsgSavePreset::create(const_cast<Preset*>(selectedPreset), deviceSetIndex, true);
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
response.init(); response.init();
@ -1457,7 +1457,7 @@ int WebAPIAdapterSrv::instancePresetDelete(
*response.getType() = selectedPreset->isSourcePreset() ? "R" : selectedPreset->isSinkPreset() ? "T" : selectedPreset->isMIMOPreset() ? "M" : "X"; *response.getType() = selectedPreset->isSourcePreset() ? "R" : selectedPreset->isSinkPreset() ? "T" : selectedPreset->isMIMOPreset() ? "M" : "X";
*response.getName() = selectedPreset->getDescription(); *response.getName() = selectedPreset->getDescription();
MainCore::MsgDeletePreset *msg = MainCore::MsgDeletePreset::create(const_cast<Preset*>(selectedPreset)); MainServer::MsgDeletePreset *msg = MainServer::MsgDeletePreset::create(const_cast<Preset*>(selectedPreset));
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
return 202; return 202;
@ -1485,7 +1485,7 @@ int WebAPIAdapterSrv::instanceDeviceSetPost(
SWGSDRangel::SWGSuccessResponse& response, SWGSDRangel::SWGSuccessResponse& response,
SWGSDRangel::SWGErrorResponse& error) SWGSDRangel::SWGErrorResponse& error)
{ {
MainCore::MsgAddDeviceSet *msg = MainCore::MsgAddDeviceSet::create(direction); MainServer::MsgAddDeviceSet *msg = MainServer::MsgAddDeviceSet::create(direction);
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
response.init(); response.init();
@ -1500,7 +1500,7 @@ int WebAPIAdapterSrv::instanceDeviceSetDelete(
{ {
if (m_mainCore.m_deviceSets.size() > 0) if (m_mainCore.m_deviceSets.size() > 0)
{ {
MainCore::MsgRemoveLastDeviceSet *msg = MainCore::MsgRemoveLastDeviceSet::create(); MainServer::MsgRemoveLastDeviceSet *msg = MainServer::MsgRemoveLastDeviceSet::create();
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
response.init(); response.init();
@ -1635,7 +1635,7 @@ int WebAPIAdapterSrv::devicesetDevicePut(
continue; continue;
} }
MainCore::MsgSetDevice *msg = MainCore::MsgSetDevice::create(deviceSetIndex, i, query.getDirection()); MainServer::MsgSetDevice *msg = MainServer::MsgSetDevice::create(deviceSetIndex, i, query.getDirection());
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
response.init(); response.init();
@ -2192,7 +2192,7 @@ int WebAPIAdapterSrv::devicesetChannelPost(
if (index < nbRegistrations) if (index < nbRegistrations)
{ {
MainCore::MsgAddChannel *msg = MainCore::MsgAddChannel::create(deviceSetIndex, index, false); MainServer::MsgAddChannel *msg = MainServer::MsgAddChannel::create(deviceSetIndex, index, false);
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
response.init(); response.init();
@ -2228,7 +2228,7 @@ int WebAPIAdapterSrv::devicesetChannelPost(
if (index < nbRegistrations) if (index < nbRegistrations)
{ {
MainCore::MsgAddChannel *msg = MainCore::MsgAddChannel::create(deviceSetIndex, index, true); MainServer::MsgAddChannel *msg = MainServer::MsgAddChannel::create(deviceSetIndex, index, true);
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
response.init(); response.init();
@ -2264,7 +2264,7 @@ int WebAPIAdapterSrv::devicesetChannelPost(
if (index < nbRegistrations) if (index < nbRegistrations)
{ {
MainCore::MsgAddChannel *msg = MainCore::MsgAddChannel::create(deviceSetIndex, index, true); MainServer::MsgAddChannel *msg = MainServer::MsgAddChannel::create(deviceSetIndex, index, true);
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
response.init(); response.init();
@ -2306,7 +2306,7 @@ int WebAPIAdapterSrv::devicesetChannelDelete(
if (channelIndex < deviceSet->getNumberOfChannels()) if (channelIndex < deviceSet->getNumberOfChannels())
{ {
MainCore::MsgDeleteChannel *msg = MainCore::MsgDeleteChannel::create(deviceSetIndex, channelIndex); MainServer::MsgDeleteChannel *msg = MainServer::MsgDeleteChannel::create(deviceSetIndex, channelIndex);
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
response.init(); response.init();
@ -2842,7 +2842,7 @@ int WebAPIAdapterSrv::featuresetFeaturePost(
if (index < nbRegistrations) if (index < nbRegistrations)
{ {
MainCore::MsgAddFeature *msg = MainCore::MsgAddFeature::create(featureSetIndex, index); MainServer::MsgAddFeature *msg = MainServer::MsgAddFeature::create(featureSetIndex, index);
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
response.init(); response.init();
@ -2877,7 +2877,7 @@ int WebAPIAdapterSrv::featuresetFeatureDelete(
if (featureIndex < featureSet->getNumberOfFeatures()) if (featureIndex < featureSet->getNumberOfFeatures())
{ {
MainCore::MsgDeleteFeature *msg = MainCore::MsgDeleteFeature::create(featureSetIndex, featureIndex); MainServer::MsgDeleteFeature *msg = MainServer::MsgDeleteFeature::create(featureSetIndex, featureIndex);
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
response.init(); response.init();

View File

@ -24,14 +24,14 @@
#include "webapi/webapiadapterinterface.h" #include "webapi/webapiadapterinterface.h"
class MainCore; class MainServer;
class DeviceSet; class DeviceSet;
class FeatureSet; class FeatureSet;
class WebAPIAdapterSrv: public WebAPIAdapterInterface class WebAPIAdapterSrv: public WebAPIAdapterInterface
{ {
public: public:
WebAPIAdapterSrv(MainCore& mainCore); WebAPIAdapterSrv(MainServer& mainCore);
virtual ~WebAPIAdapterSrv(); virtual ~WebAPIAdapterSrv();
virtual int instanceSummary( virtual int instanceSummary(
@ -399,7 +399,7 @@ public:
SWGSDRangel::SWGErrorResponse& error); SWGSDRangel::SWGErrorResponse& error);
private: private:
MainCore& m_mainCore; MainServer& m_mainCore;
void getDeviceSetList(SWGSDRangel::SWGDeviceSetList* deviceSetList); void getDeviceSetList(SWGSDRangel::SWGDeviceSetList* deviceSetList);
void getDeviceSet(SWGSDRangel::SWGDeviceSet *swgDeviceSet, const DeviceSet* deviceSet, int deviceUISetIndex); void getDeviceSet(SWGSDRangel::SWGDeviceSet *swgDeviceSet, const DeviceSet* deviceSet, int deviceUISetIndex);