From e4d317f40e0d81c2b9d7d10dbbbe8ce5d6f1e5ce Mon Sep 17 00:00:00 2001 From: cranphin Date: Wed, 22 Sep 2010 19:57:02 +0000 Subject: [PATCH] GCS: Drop read support for binary plugin configuration. If you haven't converted your old ini yet, load it up once in a revision built from source before this change. See also: http://forums.openpilot.org/topic/1850-existing-configuration-files-read-this-if-you-have-them/ Note: Reading binary layout (which gadgets are shown in each workspace and how they are split) still is available, since that was a later change. That'll get done somewhere in the future :) git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1720 ebee16cc-31ac-478f-84a7-5cbb03baadba --- .../config/configgadgetconfiguration.cpp | 8 --- .../config/configgadgetconfiguration.h | 1 - .../plugins/config/configgadgetfactory.cpp | 5 -- .../src/plugins/config/configgadgetfactory.h | 1 - .../plugins/coreplugin/iuavgadgetfactory.h | 1 - .../coreplugin/uavgadgetinstancemanager.cpp | 72 +++++-------------- .../plugins/dial/dialgadgetconfiguration.cpp | 61 ---------------- .../plugins/dial/dialgadgetconfiguration.h | 1 - ground/src/plugins/dial/dialgadgetfactory.cpp | 5 -- ground/src/plugins/dial/dialgadgetfactory.h | 1 - .../gpsdisplaygadgetconfiguration.cpp | 56 --------------- .../gpsdisplaygadgetconfiguration.h | 1 - .../gpsdisplay/gpsdisplaygadgetfactory.cpp | 5 -- .../gpsdisplay/gpsdisplaygadgetfactory.h | 1 - .../src/plugins/hitlnew/hitlconfiguration.cpp | 29 -------- .../src/plugins/hitlnew/hitlconfiguration.h | 1 - ground/src/plugins/hitlnew/hitlfactory.cpp | 5 -- ground/src/plugins/hitlnew/hitlfactory.h | 1 - .../importexportgadgetconfiguration.cpp | 16 ----- .../importexportgadgetconfiguration.h | 1 - .../importexportgadgetfactory.cpp | 6 -- .../importexport/importexportgadgetfactory.h | 1 - .../ipconnectionconfiguration.cpp | 10 --- .../ipconnection/ipconnectionconfiguration.h | 1 - .../lineardialgadgetconfiguration.cpp | 43 ----------- .../lineardialgadgetconfiguration.h | 1 - .../lineardial/lineardialgadgetfactory.cpp | 5 -- .../lineardial/lineardialgadgetfactory.h | 1 - .../modelviewgadgetconfiguration.cpp | 19 ----- .../modelview/modelviewgadgetconfiguration.h | 1 - .../modelview/modelviewgadgetfactory.cpp | 5 -- .../modelview/modelviewgadgetfactory.h | 1 - .../opmap/opmapgadgetconfiguration.cpp | 51 ------------- .../plugins/opmap/opmapgadgetconfiguration.h | 1 - .../src/plugins/opmap/opmapgadgetfactory.cpp | 5 -- ground/src/plugins/opmap/opmapgadgetfactory.h | 1 - .../plugins/pfd/pfdgadgetconfiguration.cpp | 20 ------ .../src/plugins/pfd/pfdgadgetconfiguration.h | 1 - ground/src/plugins/pfd/pfdgadgetfactory.cpp | 5 -- ground/src/plugins/pfd/pfdgadgetfactory.h | 1 - .../scope/scopegadgetconfiguration.cpp | 51 ------------- .../plugins/scope/scopegadgetconfiguration.h | 1 - .../src/plugins/scope/scopegadgetfactory.cpp | 5 -- ground/src/plugins/scope/scopegadgetfactory.h | 1 - .../systemhealthgadgetconfiguration.cpp | 18 ----- .../systemhealthgadgetconfiguration.h | 1 - .../systemhealthgadgetfactory.cpp | 5 -- .../systemhealth/systemhealthgadgetfactory.h | 1 - .../uavobjectbrowserconfiguration.cpp | 21 ------ .../uavobjectbrowserconfiguration.h | 1 - .../uavobjectbrowserfactory.cpp | 5 -- .../uavobjectbrowserfactory.h | 1 - .../uploader/uploadergadgetconfiguration.cpp | 54 -------------- .../uploader/uploadergadgetconfiguration.h | 1 - .../uploader/uploadergadgetfactory.cpp | 5 -- .../plugins/uploader/uploadergadgetfactory.h | 1 - 56 files changed, 19 insertions(+), 604 deletions(-) diff --git a/ground/src/plugins/config/configgadgetconfiguration.cpp b/ground/src/plugins/config/configgadgetconfiguration.cpp index cb1f75ec0..15a2aadcf 100644 --- a/ground/src/plugins/config/configgadgetconfiguration.cpp +++ b/ground/src/plugins/config/configgadgetconfiguration.cpp @@ -26,14 +26,6 @@ */ #include "configgadgetconfiguration.h" -#include - -ConfigGadgetConfiguration::ConfigGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent) : - IUAVGadgetConfiguration(classId, parent) -{ - -} - ConfigGadgetConfiguration::ConfigGadgetConfiguration(QString classId, QSettings* qSettings, QObject *parent) : IUAVGadgetConfiguration(classId, parent) { diff --git a/ground/src/plugins/config/configgadgetconfiguration.h b/ground/src/plugins/config/configgadgetconfiguration.h index d7f801414..1cb8d6931 100644 --- a/ground/src/plugins/config/configgadgetconfiguration.h +++ b/ground/src/plugins/config/configgadgetconfiguration.h @@ -36,7 +36,6 @@ class ConfigGadgetConfiguration : public IUAVGadgetConfiguration Q_OBJECT public: - explicit ConfigGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent = 0); explicit ConfigGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); void saveConfig(QSettings* settings) const; IUAVGadgetConfiguration *clone(); diff --git a/ground/src/plugins/config/configgadgetfactory.cpp b/ground/src/plugins/config/configgadgetfactory.cpp index f48e7ce9e..173191efc 100644 --- a/ground/src/plugins/config/configgadgetfactory.cpp +++ b/ground/src/plugins/config/configgadgetfactory.cpp @@ -46,11 +46,6 @@ Core::IUAVGadget* ConfigGadgetFactory::createGadget(QWidget *parent) return new ConfigGadget(QString("ConfigGadget"), gadgetWidget, parent); } -IUAVGadgetConfiguration *ConfigGadgetFactory::createConfiguration(const QByteArray &state) -{ - return new ConfigGadgetConfiguration(QString("ConfigGadget"), state); -} - IUAVGadgetConfiguration *ConfigGadgetFactory::createConfiguration(QSettings* qSettings) { return new ConfigGadgetConfiguration(QString("ConfigGadget"), qSettings); diff --git a/ground/src/plugins/config/configgadgetfactory.h b/ground/src/plugins/config/configgadgetfactory.h index 14c39c4c1..4161ac9ba 100644 --- a/ground/src/plugins/config/configgadgetfactory.h +++ b/ground/src/plugins/config/configgadgetfactory.h @@ -45,7 +45,6 @@ public: ~ConfigGadgetFactory(); IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(const QByteArray &state); IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); }; diff --git a/ground/src/plugins/coreplugin/iuavgadgetfactory.h b/ground/src/plugins/coreplugin/iuavgadgetfactory.h index 692d99094..71d979abd 100644 --- a/ground/src/plugins/coreplugin/iuavgadgetfactory.h +++ b/ground/src/plugins/coreplugin/iuavgadgetfactory.h @@ -54,7 +54,6 @@ public: virtual ~IUAVGadgetFactory() {} virtual IUAVGadget *createGadget(QWidget *parent) = 0; - virtual IUAVGadgetConfiguration *createConfiguration(const QByteArray &/*state*/) { return 0; } virtual IUAVGadgetConfiguration *createConfiguration(QSettings* /*qSettings*/) { return 0; } virtual IOptionsPage *createOptionsPage(IUAVGadgetConfiguration */*config*/) { return 0; } QString classId() const { return m_classId; } diff --git a/ground/src/plugins/coreplugin/uavgadgetinstancemanager.cpp b/ground/src/plugins/coreplugin/uavgadgetinstancemanager.cpp index b1d0dec87..bb7a3508a 100644 --- a/ground/src/plugins/coreplugin/uavgadgetinstancemanager.cpp +++ b/ground/src/plugins/coreplugin/uavgadgetinstancemanager.cpp @@ -99,63 +99,29 @@ void UAVGadgetInstanceManager::readConfigs_1_0_0(QSettings *qs) IUAVGadgetFactory *f = factory(classId); qs->beginGroup(classId); - // New style: each config is a group, old style: each config is a value - QStringList groups = qs->childGroups(); - bool oldStyle = groups.size() == 0; QStringList configs = QStringList(); - if(oldStyle) { - // Old style configuration - configs = qs->childKeys(); - foreach (QString configName, configs) { - QByteArray ba = QByteArray::fromBase64(qs->value(configName).toByteArray()); - QDataStream stream(ba); - bool locked; - stream >> locked; - QByteArray state; - stream >> state; - IUAVGadgetConfiguration *config = f->createConfiguration(state); - if (config){ - config->setName(configName); - config->setProvisionalName(configName); - config->setLocked(locked); - int idx = indexForConfig(m_configurations, classId, configName); - if ( idx >= 0 ){ - // We should replace the config, but it might be used, so just - // throw it out of the list. The GCS should be reinitialised soon. - m_configurations[idx] = config; - } - else{ - m_configurations.append(config); - } + configs = qs->childGroups(); + foreach (QString configName, configs) { + qDebug() << "Loading config: " << classId << "," << configName; + qs->beginGroup(configName); + bool locked = qs->value("config.locked").toBool(); + IUAVGadgetConfiguration *config = f->createConfiguration(qs); + if (config){ + config->setName(configName); + config->setProvisionalName(configName); + config->setLocked(locked); + int idx = indexForConfig(m_configurations, classId, configName); + if ( idx >= 0 ){ + // We should replace the config, but it might be used, so just + // throw it out of the list. The GCS should be reinitialised soon. + m_configurations[idx] = config; + } + else{ + m_configurations.append(config); } } - } else { - // New style configuration - configs = qs->childGroups(); - - foreach (QString configName, configs) { - qDebug() << "Loading config: " << classId << "," << configName; - qs->beginGroup(configName); - bool locked = qs->value("config.locked").toBool(); - IUAVGadgetConfiguration *config = f->createConfiguration(qs); - if (config){ - config->setName(configName); - config->setProvisionalName(configName); - config->setLocked(locked); - int idx = indexForConfig(m_configurations, classId, configName); - if ( idx >= 0 ){ - // We should replace the config, but it might be used, so just - // throw it out of the list. The GCS should be reinitialised soon. - m_configurations[idx] = config; - } - else{ - m_configurations.append(config); - } - } - - qs->endGroup(); - } + qs->endGroup(); } if (configs.count() == 0) { diff --git a/ground/src/plugins/dial/dialgadgetconfiguration.cpp b/ground/src/plugins/dial/dialgadgetconfiguration.cpp index da98e3336..8d3a69760 100644 --- a/ground/src/plugins/dial/dialgadgetconfiguration.cpp +++ b/ground/src/plugins/dial/dialgadgetconfiguration.cpp @@ -28,67 +28,6 @@ #include "dialgadgetconfiguration.h" #include "utils/pathutils.h" -#include - -/** - * Loads a saved configuration or defaults if non exist. - * - */ -DialGadgetConfiguration::DialGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent) : - IUAVGadgetConfiguration(classId, parent), - m_defaultDial("Unknown"), - dialBackgroundID("background"), - dialForegroundID("foreground"), - dialNeedleID1("needle"), - dialNeedleID2("needle2"), - dialNeedleID3("needle3"), - needle1MinValue(0), - needle1MaxValue(100), - needle2MinValue(0), - needle2MaxValue(100), - needle3MinValue(0), - needle3MaxValue(100), - needle1Factor(1), - needle2Factor(1), - needle3Factor(1), - needle1Move("Rotate"), - needle2Move("Rotate"), - needle3Move("Rotate") -{ - //if a saved configuration exists load it - if (state.count() > 0) { - QDataStream stream(state); - QString dialFile; - stream >> dialFile; - m_defaultDial=Utils::PathUtils().InsertDataPath(dialFile); - stream >> dialBackgroundID; - stream >> dialForegroundID; - stream >> dialNeedleID1; - stream >> dialNeedleID2; - stream >> dialNeedleID3; - stream >> needle1MinValue; - stream >> needle1MaxValue; - stream >> needle2MinValue; - stream >> needle2MaxValue; - stream >> needle3MinValue; - stream >> needle3MaxValue; - stream >> needle1DataObject; - stream >> needle1ObjectField; - stream >> needle2DataObject; - stream >> needle2ObjectField; - stream >> needle3DataObject; - stream >> needle3ObjectField; - stream >> needle1Factor; - stream >> needle2Factor; - stream >> needle3Factor; - stream >> needle1Move; - stream >> needle2Move; - stream >> needle3Move; - stream >> font; - - } -} - /** * Loads a saved configuration or defaults if non exist. diff --git a/ground/src/plugins/dial/dialgadgetconfiguration.h b/ground/src/plugins/dial/dialgadgetconfiguration.h index 35d6339b8..609033e18 100644 --- a/ground/src/plugins/dial/dialgadgetconfiguration.h +++ b/ground/src/plugins/dial/dialgadgetconfiguration.h @@ -40,7 +40,6 @@ class DialGadgetConfiguration : public IUAVGadgetConfiguration { Q_OBJECT public: - explicit DialGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent = 0); explicit DialGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); diff --git a/ground/src/plugins/dial/dialgadgetfactory.cpp b/ground/src/plugins/dial/dialgadgetfactory.cpp index dd71a7501..c267b4ee3 100644 --- a/ground/src/plugins/dial/dialgadgetfactory.cpp +++ b/ground/src/plugins/dial/dialgadgetfactory.cpp @@ -49,11 +49,6 @@ Core::IUAVGadget* DialGadgetFactory::createGadget(QWidget *parent) return new DialGadget(QString("DialGadget"), gadgetWidget, parent); } -IUAVGadgetConfiguration *DialGadgetFactory::createConfiguration(const QByteArray &state) -{ - return new DialGadgetConfiguration(QString("DialGadget"), state); -} - IUAVGadgetConfiguration *DialGadgetFactory::createConfiguration(QSettings* qSettings) { return new DialGadgetConfiguration(QString("DialGadget"), qSettings); diff --git a/ground/src/plugins/dial/dialgadgetfactory.h b/ground/src/plugins/dial/dialgadgetfactory.h index 1905bc782..255ef22c9 100644 --- a/ground/src/plugins/dial/dialgadgetfactory.h +++ b/ground/src/plugins/dial/dialgadgetfactory.h @@ -46,7 +46,6 @@ public: ~DialGadgetFactory(); Core::IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(const QByteArray &state); IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); }; diff --git a/ground/src/plugins/gpsdisplay/gpsdisplaygadgetconfiguration.cpp b/ground/src/plugins/gpsdisplay/gpsdisplaygadgetconfiguration.cpp index a046ab09d..031a675d7 100644 --- a/ground/src/plugins/gpsdisplay/gpsdisplaygadgetconfiguration.cpp +++ b/ground/src/plugins/gpsdisplay/gpsdisplaygadgetconfiguration.cpp @@ -26,64 +26,8 @@ */ #include "gpsdisplaygadgetconfiguration.h" -#include #include -/** - * Loads a saved configuration or defaults if non exist. - * - */ -GpsDisplayGadgetConfiguration::GpsDisplayGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent) : - IUAVGadgetConfiguration(classId, parent), - m_connectionMode("Serial"), - m_defaultPort("Unknown"), - m_defaultSpeed(BAUD4800), - m_defaultDataBits(DATA_8), - m_defaultFlow(FLOW_OFF), - m_defaultParity(PAR_NONE), - m_defaultStopBits(STOP_1), - m_defaultTimeOut(5000) -{ - //if a saved configuration exists load it - if (state.count() > 0) { - QDataStream stream(state); - BaudRateType speed; - DataBitsType databits; - FlowType flow; - ParityType parity; - StopBitsType stopbits; - int ispeed; - int idatabits; - int iflow; - int iparity; - int istopbits; - QString port; - QString conMode; - stream >> ispeed; - stream >> idatabits; - stream >>iflow; - stream >>iparity; - stream >> istopbits; - stream >> port; - stream >> conMode; - - databits = (DataBitsType) idatabits; - flow = (FlowType)iflow; - parity = (ParityType)iparity; - stopbits = (StopBitsType)istopbits; - speed = (BaudRateType)ispeed; - m_defaultPort = port; - m_defaultSpeed = speed; - m_defaultDataBits = databits; - m_defaultFlow = flow; - m_defaultParity = parity; - m_defaultStopBits = stopbits; - m_connectionMode = conMode; - - } - -} - /** * Loads a saved configuration or defaults if non exist. * diff --git a/ground/src/plugins/gpsdisplay/gpsdisplaygadgetconfiguration.h b/ground/src/plugins/gpsdisplay/gpsdisplaygadgetconfiguration.h index 7d1eae0a1..073f0f8cb 100644 --- a/ground/src/plugins/gpsdisplay/gpsdisplaygadgetconfiguration.h +++ b/ground/src/plugins/gpsdisplay/gpsdisplaygadgetconfiguration.h @@ -37,7 +37,6 @@ class GpsDisplayGadgetConfiguration : public IUAVGadgetConfiguration { Q_OBJECT public: - explicit GpsDisplayGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent = 0); explicit GpsDisplayGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); void setConnectionMode(QString mode) { m_connectionMode = mode; } diff --git a/ground/src/plugins/gpsdisplay/gpsdisplaygadgetfactory.cpp b/ground/src/plugins/gpsdisplay/gpsdisplaygadgetfactory.cpp index 257f7911a..673891a16 100644 --- a/ground/src/plugins/gpsdisplay/gpsdisplaygadgetfactory.cpp +++ b/ground/src/plugins/gpsdisplay/gpsdisplaygadgetfactory.cpp @@ -48,11 +48,6 @@ Core::IUAVGadget* GpsDisplayGadgetFactory::createGadget(QWidget *parent) return new GpsDisplayGadget(QString("GpsDisplayGadget"), gadgetWidget, parent); } -IUAVGadgetConfiguration *GpsDisplayGadgetFactory::createConfiguration(const QByteArray &state) -{ - return new GpsDisplayGadgetConfiguration(QString("GpsDisplayGadget"), state); -} - IUAVGadgetConfiguration *GpsDisplayGadgetFactory::createConfiguration(QSettings* qSettings) { return new GpsDisplayGadgetConfiguration(QString("GpsDisplayGadget"), qSettings); diff --git a/ground/src/plugins/gpsdisplay/gpsdisplaygadgetfactory.h b/ground/src/plugins/gpsdisplay/gpsdisplaygadgetfactory.h index 4e476db8c..dcbaacf87 100644 --- a/ground/src/plugins/gpsdisplay/gpsdisplaygadgetfactory.h +++ b/ground/src/plugins/gpsdisplay/gpsdisplaygadgetfactory.h @@ -45,7 +45,6 @@ public: ~GpsDisplayGadgetFactory(); Core::IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(const QByteArray &state); IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); }; diff --git a/ground/src/plugins/hitlnew/hitlconfiguration.cpp b/ground/src/plugins/hitlnew/hitlconfiguration.cpp index 10b0b6ed0..8351032fe 100644 --- a/ground/src/plugins/hitlnew/hitlconfiguration.cpp +++ b/ground/src/plugins/hitlnew/hitlconfiguration.cpp @@ -26,35 +26,6 @@ */ #include "hitlconfiguration.h" -#include - -HITLConfiguration::HITLConfiguration(QString classId, const QByteArray &state, QObject *parent) : - IUAVGadgetConfiguration(classId, parent) -{ - settings.simulatorId = ""; - settings.binPath = ""; - settings.dataPath = ""; - settings.manual = false; - settings.hostAddress = "127.0.0.1"; - settings.outPort = 0; - settings.inPort = 0; - settings.latitude = ""; - settings.longitude = ""; - - if (state.count() > 0) { - QDataStream stream(state); - - stream >> settings.simulatorId; - stream >> settings.binPath; - stream >> settings.dataPath; - stream >> settings.manual; - stream >> settings.hostAddress; - stream >> settings.outPort; - stream >> settings.inPort; - stream >> settings.latitude; - stream >> settings.longitude; - } -} HITLConfiguration::HITLConfiguration(QString classId, QSettings* qSettings, QObject *parent) : IUAVGadgetConfiguration(classId, parent) diff --git a/ground/src/plugins/hitlnew/hitlconfiguration.h b/ground/src/plugins/hitlnew/hitlconfiguration.h index e4c208912..d92f0580a 100644 --- a/ground/src/plugins/hitlnew/hitlconfiguration.h +++ b/ground/src/plugins/hitlnew/hitlconfiguration.h @@ -44,7 +44,6 @@ class HITLConfiguration : public IUAVGadgetConfiguration Q_PROPERTY(SimulatorSettings settings READ Settings WRITE setSimulatorSettings) public: - explicit HITLConfiguration(QString classId, const QByteArray &state, QObject *parent = 0); explicit HITLConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); void saveConfig(QSettings* settings) const; diff --git a/ground/src/plugins/hitlnew/hitlfactory.cpp b/ground/src/plugins/hitlnew/hitlfactory.cpp index 249ef61cf..023f86a18 100644 --- a/ground/src/plugins/hitlnew/hitlfactory.cpp +++ b/ground/src/plugins/hitlnew/hitlfactory.cpp @@ -49,11 +49,6 @@ Core::IUAVGadget* HITLFactory::createGadget(QWidget *parent) return new HITLGadget(QString("HITL"), gadgetWidget, parent); } -IUAVGadgetConfiguration *HITLFactory::createConfiguration(const QByteArray &state) -{ - return new HITLConfiguration(QString("HITL"), state); -} - IUAVGadgetConfiguration *HITLFactory::createConfiguration(QSettings* qSettings) { return new HITLConfiguration(QString("HITL"), qSettings); diff --git a/ground/src/plugins/hitlnew/hitlfactory.h b/ground/src/plugins/hitlnew/hitlfactory.h index 90c3e92d3..6f6a59b1b 100644 --- a/ground/src/plugins/hitlnew/hitlfactory.h +++ b/ground/src/plugins/hitlnew/hitlfactory.h @@ -45,7 +45,6 @@ public: ~HITLFactory(); IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(const QByteArray &state); IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); }; diff --git a/ground/src/plugins/importexport/importexportgadgetconfiguration.cpp b/ground/src/plugins/importexport/importexportgadgetconfiguration.cpp index 6a4dc4277..4e5e7c78f 100644 --- a/ground/src/plugins/importexport/importexportgadgetconfiguration.cpp +++ b/ground/src/plugins/importexport/importexportgadgetconfiguration.cpp @@ -28,22 +28,6 @@ */ #include "importexportgadgetconfiguration.h" -#include - -/** - * Loads a saved configuration or defaults if non exist. - * - */ -ImportExportGadgetConfiguration::ImportExportGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent) : - IUAVGadgetConfiguration(classId, parent), - dialFile("gcs.ini") -{ - //if a saved configuration exists load it - if (state.count() > 0) { - QDataStream stream(state); - stream >> dialFile; - } -} /** * Loads a saved configuration or defaults if non exist. diff --git a/ground/src/plugins/importexport/importexportgadgetconfiguration.h b/ground/src/plugins/importexport/importexportgadgetconfiguration.h index eaae914ca..d2b739a00 100644 --- a/ground/src/plugins/importexport/importexportgadgetconfiguration.h +++ b/ground/src/plugins/importexport/importexportgadgetconfiguration.h @@ -39,7 +39,6 @@ class IMPORTEXPORT_EXPORT ImportExportGadgetConfiguration : public IUAVGadgetCon { Q_OBJECT public: - explicit ImportExportGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent = 0); explicit ImportExportGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); //set dial configuration functions diff --git a/ground/src/plugins/importexport/importexportgadgetfactory.cpp b/ground/src/plugins/importexport/importexportgadgetfactory.cpp index 143d64d63..03ce754f4 100644 --- a/ground/src/plugins/importexport/importexportgadgetfactory.cpp +++ b/ground/src/plugins/importexport/importexportgadgetfactory.cpp @@ -50,12 +50,6 @@ Core::IUAVGadget* ImportExportGadgetFactory::createGadget(QWidget *parent) return new ImportExportGadget(QString("ImportExportGadget"), gadgetWidget, parent); } -IUAVGadgetConfiguration *ImportExportGadgetFactory::createConfiguration(const QByteArray &state) -{ - lastConfig = new ImportExportGadgetConfiguration(QString("ImportExportGadget"), state); - return lastConfig; -} - IUAVGadgetConfiguration *ImportExportGadgetFactory::createConfiguration(QSettings* qSettings) { lastConfig = new ImportExportGadgetConfiguration(QString("ImportExportGadget"), qSettings); diff --git a/ground/src/plugins/importexport/importexportgadgetfactory.h b/ground/src/plugins/importexport/importexportgadgetfactory.h index f4915619f..0edaff5d6 100644 --- a/ground/src/plugins/importexport/importexportgadgetfactory.h +++ b/ground/src/plugins/importexport/importexportgadgetfactory.h @@ -47,7 +47,6 @@ public: ImportExportGadgetConfiguration *getLastConfig(){ return lastConfig;} Core::IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(const QByteArray &state); IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); diff --git a/ground/src/plugins/ipconnection/ipconnectionconfiguration.cpp b/ground/src/plugins/ipconnection/ipconnectionconfiguration.cpp index d193e0130..e90f52ab2 100644 --- a/ground/src/plugins/ipconnection/ipconnectionconfiguration.cpp +++ b/ground/src/plugins/ipconnection/ipconnectionconfiguration.cpp @@ -26,18 +26,8 @@ */ #include "ipconnectionconfiguration.h" -#include #include -IPconnectionConfiguration::IPconnectionConfiguration(QString classId, const QByteArray &state, QObject *parent) : - IUAVGadgetConfiguration(classId, parent), - m_HostName("127.0.0.1"), - m_Port(1000), - m_UseTCP(1) -{ - settings = Core::ICore::instance()->settings(); -} - IPconnectionConfiguration::IPconnectionConfiguration(QString classId, QSettings* qSettings, QObject *parent) : IUAVGadgetConfiguration(classId, parent), m_HostName("127.0.0.1"), diff --git a/ground/src/plugins/ipconnection/ipconnectionconfiguration.h b/ground/src/plugins/ipconnection/ipconnectionconfiguration.h index 3f33cf4e2..ff4117f29 100644 --- a/ground/src/plugins/ipconnection/ipconnectionconfiguration.h +++ b/ground/src/plugins/ipconnection/ipconnectionconfiguration.h @@ -42,7 +42,6 @@ Q_PROPERTY(int Port READ Port WRITE setPort) Q_PROPERTY(int UseTCP READ UseTCP WRITE setUseTCP) public: - explicit IPconnectionConfiguration(QString classId, const QByteArray &state, QObject *parent = 0); explicit IPconnectionConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); virtual ~IPconnectionConfiguration(); diff --git a/ground/src/plugins/lineardial/lineardialgadgetconfiguration.cpp b/ground/src/plugins/lineardial/lineardialgadgetconfiguration.cpp index 6db9b3b9e..27d34d092 100644 --- a/ground/src/plugins/lineardial/lineardialgadgetconfiguration.cpp +++ b/ground/src/plugins/lineardial/lineardialgadgetconfiguration.cpp @@ -27,49 +27,6 @@ #include "lineardialgadgetconfiguration.h" #include "utils/pathutils.h" -#include - -/** - * Loads a saved configuration or defaults if non exist. - * - */ -LineardialGadgetConfiguration::LineardialGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent) : - IUAVGadgetConfiguration(classId, parent), - dialFile("Unknown"), - sourceDataObject("Unknown"), - sourceObjectField("Unknown"), - minValue(0), - maxValue(100), - redMin(0), - redMax(33), - yellowMin(33), - yellowMax(66), - greenMin(66), - greenMax(100), - factor(1.00), - decimalPlaces(0) -{ - //if a saved configuration exists load it - if (state.count() > 0) { - QDataStream stream(state); - QString dFile; - stream >> dFile; - dialFile = Utils::PathUtils().InsertDataPath(dFile); - stream >> sourceDataObject; - stream >> sourceObjectField; - stream >> minValue; - stream >> maxValue; - stream >> redMin; - stream >> redMax; - stream >> yellowMin; - stream >> yellowMax; - stream >> greenMin; - stream >> greenMax; - stream >> font; - stream >> decimalPlaces; - stream >> factor; - } -} /** * Loads a saved configuration or defaults if non exist. diff --git a/ground/src/plugins/lineardial/lineardialgadgetconfiguration.h b/ground/src/plugins/lineardial/lineardialgadgetconfiguration.h index 157bebe93..59aedb35f 100644 --- a/ground/src/plugins/lineardial/lineardialgadgetconfiguration.h +++ b/ground/src/plugins/lineardial/lineardialgadgetconfiguration.h @@ -39,7 +39,6 @@ class LineardialGadgetConfiguration : public IUAVGadgetConfiguration { Q_OBJECT public: - explicit LineardialGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent = 0); explicit LineardialGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); //set dial configuration functions diff --git a/ground/src/plugins/lineardial/lineardialgadgetfactory.cpp b/ground/src/plugins/lineardial/lineardialgadgetfactory.cpp index fe4b43c2b..33f6e0421 100644 --- a/ground/src/plugins/lineardial/lineardialgadgetfactory.cpp +++ b/ground/src/plugins/lineardial/lineardialgadgetfactory.cpp @@ -48,11 +48,6 @@ Core::IUAVGadget* LineardialGadgetFactory::createGadget(QWidget *parent) return new LineardialGadget(QString("LineardialGadget"), gadgetWidget, parent); } -IUAVGadgetConfiguration *LineardialGadgetFactory::createConfiguration(const QByteArray &state) -{ - return new LineardialGadgetConfiguration(QString("LineardialGadget"), state); -} - IUAVGadgetConfiguration *LineardialGadgetFactory::createConfiguration(QSettings* qSettings) { return new LineardialGadgetConfiguration(QString("LineardialGadget"), qSettings); diff --git a/ground/src/plugins/lineardial/lineardialgadgetfactory.h b/ground/src/plugins/lineardial/lineardialgadgetfactory.h index 158435ebd..d44010a80 100644 --- a/ground/src/plugins/lineardial/lineardialgadgetfactory.h +++ b/ground/src/plugins/lineardial/lineardialgadgetfactory.h @@ -45,7 +45,6 @@ public: ~LineardialGadgetFactory(); Core::IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(const QByteArray &state); IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); }; diff --git a/ground/src/plugins/modelview/modelviewgadgetconfiguration.cpp b/ground/src/plugins/modelview/modelviewgadgetconfiguration.cpp index 12822cd2b..3092f4aac 100644 --- a/ground/src/plugins/modelview/modelviewgadgetconfiguration.cpp +++ b/ground/src/plugins/modelview/modelviewgadgetconfiguration.cpp @@ -27,25 +27,6 @@ #include "modelviewgadgetconfiguration.h" #include "utils/pathutils.h" -#include - -ModelViewGadgetConfiguration::ModelViewGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent) : - IUAVGadgetConfiguration(classId, parent), - m_acFilename("../share/models/Easystar/EasyStar.3ds"), - m_bgFilename(""), - m_enableVbo(false) -{ - if (state.count() > 0) { - QDataStream stream(state); - QString modelFile; - QString bgFile; - stream >> modelFile; - stream >> bgFile; - stream >> m_enableVbo; - m_acFilename = Utils::PathUtils().InsertDataPath(modelFile); - m_bgFilename = Utils::PathUtils().InsertDataPath(bgFile); - } -} ModelViewGadgetConfiguration::ModelViewGadgetConfiguration(QString classId, QSettings* qSettings, QObject *parent) : IUAVGadgetConfiguration(classId, parent), diff --git a/ground/src/plugins/modelview/modelviewgadgetconfiguration.h b/ground/src/plugins/modelview/modelviewgadgetconfiguration.h index b90d2261a..a9f76246f 100644 --- a/ground/src/plugins/modelview/modelviewgadgetconfiguration.h +++ b/ground/src/plugins/modelview/modelviewgadgetconfiguration.h @@ -36,7 +36,6 @@ class ModelViewGadgetConfiguration : public IUAVGadgetConfiguration { Q_OBJECT public: - explicit ModelViewGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent = 0); explicit ModelViewGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); void saveConfig(QSettings* settings) const; diff --git a/ground/src/plugins/modelview/modelviewgadgetfactory.cpp b/ground/src/plugins/modelview/modelviewgadgetfactory.cpp index 60109185c..a87bbbe75 100644 --- a/ground/src/plugins/modelview/modelviewgadgetfactory.cpp +++ b/ground/src/plugins/modelview/modelviewgadgetfactory.cpp @@ -47,11 +47,6 @@ Core::IUAVGadget* ModelViewGadgetFactory::createGadget(QWidget *parent) return new ModelViewGadget(QString("ModelViewGadget"), gadgetWidget, parent); } -IUAVGadgetConfiguration *ModelViewGadgetFactory::createConfiguration(const QByteArray &state) -{ - return new ModelViewGadgetConfiguration(QString("ModelViewGadget"), state); -} - IUAVGadgetConfiguration *ModelViewGadgetFactory::createConfiguration(QSettings* qSettings) { return new ModelViewGadgetConfiguration(QString("ModelViewGadget"), qSettings); diff --git a/ground/src/plugins/modelview/modelviewgadgetfactory.h b/ground/src/plugins/modelview/modelviewgadgetfactory.h index 0f9007b1d..ba76cb53b 100644 --- a/ground/src/plugins/modelview/modelviewgadgetfactory.h +++ b/ground/src/plugins/modelview/modelviewgadgetfactory.h @@ -45,7 +45,6 @@ public: ~ModelViewGadgetFactory(); Core::IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(const QByteArray &state); IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); }; diff --git a/ground/src/plugins/opmap/opmapgadgetconfiguration.cpp b/ground/src/plugins/opmap/opmapgadgetconfiguration.cpp index 45fd4e628..92dae2b60 100644 --- a/ground/src/plugins/opmap/opmapgadgetconfiguration.cpp +++ b/ground/src/plugins/opmap/opmapgadgetconfiguration.cpp @@ -27,59 +27,8 @@ #include "opmapgadgetconfiguration.h" #include "utils/pathutils.h" - -#include #include -OPMapGadgetConfiguration::OPMapGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent) : - IUAVGadgetConfiguration(classId, parent), - m_mapProvider("GoogleHybrid"), - m_defaultZoom(2), - m_defaultLatitude(0), - m_defaultLongitude(0), - m_useOpenGL(false), - m_showTileGridLines(false), - m_accessMode("ServerAndCache"), - m_useMemoryCache(true), - m_cacheLocation(Utils::PathUtils().GetStoragePath() + "mapscache" + QDir::separator()) -{ - if (state.count() > 0) - { - QDataStream stream(state); - - QString mapProvider; - int zoom; - double latitude; - double longitude; - bool useOpenGL; - bool showTileGridLines; - QString accessMode; - bool useMemoryCache; - QString cacheLocation; - - stream >> mapProvider; - stream >> zoom; - stream >> latitude; - stream >> longitude; - stream >> useOpenGL; - stream >> showTileGridLines; - stream >> accessMode; - stream >> useMemoryCache; - stream >> cacheLocation; - - if (!mapProvider.isEmpty()) m_mapProvider = mapProvider; - m_defaultZoom = zoom; - m_defaultLatitude = latitude; - m_defaultLongitude = longitude; - m_useOpenGL = useOpenGL; - m_showTileGridLines = showTileGridLines; - - if (!accessMode.isEmpty()) m_accessMode = accessMode; - m_useMemoryCache = useMemoryCache; - if (!cacheLocation.isEmpty()) m_cacheLocation = Utils::PathUtils().InsertStoragePath(cacheLocation); - } -} - OPMapGadgetConfiguration::OPMapGadgetConfiguration(QString classId, QSettings* qSettings, QObject *parent) : IUAVGadgetConfiguration(classId, parent), m_mapProvider("GoogleHybrid"), diff --git a/ground/src/plugins/opmap/opmapgadgetconfiguration.h b/ground/src/plugins/opmap/opmapgadgetconfiguration.h index effa5afe8..4bd068b44 100644 --- a/ground/src/plugins/opmap/opmapgadgetconfiguration.h +++ b/ground/src/plugins/opmap/opmapgadgetconfiguration.h @@ -48,7 +48,6 @@ Q_PROPERTY(bool useMemoryCache READ useMemoryCache WRITE setUseMemoryCache) Q_PROPERTY(QString cacheLocation READ cacheLocation WRITE setCacheLocation) public: - explicit OPMapGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent = 0); explicit OPMapGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); void saveConfig(QSettings* settings) const; diff --git a/ground/src/plugins/opmap/opmapgadgetfactory.cpp b/ground/src/plugins/opmap/opmapgadgetfactory.cpp index 79067944f..c8c9e29cf 100644 --- a/ground/src/plugins/opmap/opmapgadgetfactory.cpp +++ b/ground/src/plugins/opmap/opmapgadgetfactory.cpp @@ -46,11 +46,6 @@ Core::IUAVGadget * OPMapGadgetFactory::createGadget(QWidget *parent) return new OPMapGadget(QString("OPMapGadget"), gadgetWidget, parent); } -IUAVGadgetConfiguration * OPMapGadgetFactory::createConfiguration(const QByteArray &state) -{ - return new OPMapGadgetConfiguration(QString("OPMapGadget"), state); -} - IUAVGadgetConfiguration *OPMapGadgetFactory::createConfiguration(QSettings* qSettings) { return new OPMapGadgetConfiguration(QString("OPMapGadget"), qSettings); diff --git a/ground/src/plugins/opmap/opmapgadgetfactory.h b/ground/src/plugins/opmap/opmapgadgetfactory.h index f6118605f..07bb24e1f 100644 --- a/ground/src/plugins/opmap/opmapgadgetfactory.h +++ b/ground/src/plugins/opmap/opmapgadgetfactory.h @@ -45,7 +45,6 @@ public: ~OPMapGadgetFactory(); Core::IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(const QByteArray &state); IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); }; diff --git a/ground/src/plugins/pfd/pfdgadgetconfiguration.cpp b/ground/src/plugins/pfd/pfdgadgetconfiguration.cpp index f8d769430..d742f25ce 100644 --- a/ground/src/plugins/pfd/pfdgadgetconfiguration.cpp +++ b/ground/src/plugins/pfd/pfdgadgetconfiguration.cpp @@ -27,26 +27,6 @@ #include "pfdgadgetconfiguration.h" #include "utils/pathutils.h" -#include - -/** - * Loads a saved configuration or defaults if non exist. - * - */ -PFDGadgetConfiguration::PFDGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent) : - IUAVGadgetConfiguration(classId, parent), - m_defaultDial("Unknown") -{ - //if a saved configuration exists load it - if (state.count() > 0) { - QDataStream stream(state); - QString dialFile; - stream >> dialFile; - stream >> useOpenGLFlag; - stream >> hqFonts; - m_defaultDial=Utils::PathUtils().InsertDataPath(dialFile); - } -} /** * Loads a saved configuration or defaults if non exist. diff --git a/ground/src/plugins/pfd/pfdgadgetconfiguration.h b/ground/src/plugins/pfd/pfdgadgetconfiguration.h index 865b53d23..25fe773cc 100644 --- a/ground/src/plugins/pfd/pfdgadgetconfiguration.h +++ b/ground/src/plugins/pfd/pfdgadgetconfiguration.h @@ -36,7 +36,6 @@ class PFDGadgetConfiguration : public IUAVGadgetConfiguration { Q_OBJECT public: - explicit PFDGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent = 0); explicit PFDGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); //set dial configuration functions diff --git a/ground/src/plugins/pfd/pfdgadgetfactory.cpp b/ground/src/plugins/pfd/pfdgadgetfactory.cpp index ca91cb3d9..82932cf62 100644 --- a/ground/src/plugins/pfd/pfdgadgetfactory.cpp +++ b/ground/src/plugins/pfd/pfdgadgetfactory.cpp @@ -48,11 +48,6 @@ Core::IUAVGadget* PFDGadgetFactory::createGadget(QWidget *parent) return new PFDGadget(QString("PFDGadget"), gadgetWidget, parent); } -IUAVGadgetConfiguration *PFDGadgetFactory::createConfiguration(const QByteArray &state) -{ - return new PFDGadgetConfiguration(QString("PFDGadget"), state); -} - IUAVGadgetConfiguration *PFDGadgetFactory::createConfiguration(QSettings* qSettings) { return new PFDGadgetConfiguration(QString("PFDGadget"), qSettings); diff --git a/ground/src/plugins/pfd/pfdgadgetfactory.h b/ground/src/plugins/pfd/pfdgadgetfactory.h index 24c45146a..cec069cb4 100644 --- a/ground/src/plugins/pfd/pfdgadgetfactory.h +++ b/ground/src/plugins/pfd/pfdgadgetfactory.h @@ -45,7 +45,6 @@ public: ~PFDGadgetFactory(); Core::IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(const QByteArray &state); IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); }; diff --git a/ground/src/plugins/scope/scopegadgetconfiguration.cpp b/ground/src/plugins/scope/scopegadgetconfiguration.cpp index bb996f7d0..8adc8c3ff 100644 --- a/ground/src/plugins/scope/scopegadgetconfiguration.cpp +++ b/ground/src/plugins/scope/scopegadgetconfiguration.cpp @@ -26,57 +26,6 @@ */ #include "scopegadgetconfiguration.h" -#include - - -ScopeGadgetConfiguration::ScopeGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent) : - IUAVGadgetConfiguration(classId, parent), - m_plotType((int)ChronoPlot), - m_dataSize(60), - m_refreshInterval(1000) -{ - uint currentStreamVersion = 0; - int plotCurveCount = 0; - - if (state.count() > 0) { - - QDataStream stream(state); - stream >> currentStreamVersion; - - if(currentStreamVersion != m_configurationStreamVersion) - return; - - stream >> m_plotType; - stream >> m_dataSize; - stream >> m_refreshInterval; - stream >> plotCurveCount; - - while(plotCurveCount-- > 0) - { - QString uavObject; - QString uavField; - QRgb color; - - PlotCurveConfiguration* plotCurveConf = new PlotCurveConfiguration(); - stream >> uavObject; - plotCurveConf->uavObject = uavObject; - stream >> uavField; - plotCurveConf->uavField = uavField; - stream >> color; - plotCurveConf->color = color; - stream >> plotCurveConf->yScalePower; - stream >> plotCurveConf->yMinimum; - stream >> plotCurveConf->yMaximum; - - m_PlotCurveConfigs.append(plotCurveConf); - } - - //The value is converted to milliseconds, so if it is < 100, it is still seconds - if(m_refreshInterval < 100) - m_refreshInterval *= 1000; - } -} - ScopeGadgetConfiguration::ScopeGadgetConfiguration(QString classId, QSettings* qSettings, QObject *parent) : IUAVGadgetConfiguration(classId, parent), diff --git a/ground/src/plugins/scope/scopegadgetconfiguration.h b/ground/src/plugins/scope/scopegadgetconfiguration.h index 707d00a52..bba49479f 100644 --- a/ground/src/plugins/scope/scopegadgetconfiguration.h +++ b/ground/src/plugins/scope/scopegadgetconfiguration.h @@ -49,7 +49,6 @@ class ScopeGadgetConfiguration : public IUAVGadgetConfiguration { Q_OBJECT public: - explicit ScopeGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent = 0); explicit ScopeGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); ~ScopeGadgetConfiguration(); diff --git a/ground/src/plugins/scope/scopegadgetfactory.cpp b/ground/src/plugins/scope/scopegadgetfactory.cpp index 73d6ae687..bed659405 100644 --- a/ground/src/plugins/scope/scopegadgetfactory.cpp +++ b/ground/src/plugins/scope/scopegadgetfactory.cpp @@ -48,11 +48,6 @@ Core::IUAVGadget* ScopeGadgetFactory::createGadget(QWidget *parent) return new ScopeGadget(QString("ScopeGadget"), gadgetWidget, parent); } -IUAVGadgetConfiguration *ScopeGadgetFactory::createConfiguration(const QByteArray &state) -{ - return new ScopeGadgetConfiguration(QString("ScopeGadget"), state); -} - IUAVGadgetConfiguration *ScopeGadgetFactory::createConfiguration(QSettings* qSettings) { return new ScopeGadgetConfiguration(QString("ScopeGadget"), qSettings); diff --git a/ground/src/plugins/scope/scopegadgetfactory.h b/ground/src/plugins/scope/scopegadgetfactory.h index 15fe32eb5..a3ccc5e97 100644 --- a/ground/src/plugins/scope/scopegadgetfactory.h +++ b/ground/src/plugins/scope/scopegadgetfactory.h @@ -46,7 +46,6 @@ public: ~ScopeGadgetFactory(); Core::IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(const QByteArray &state); IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); }; diff --git a/ground/src/plugins/systemhealth/systemhealthgadgetconfiguration.cpp b/ground/src/plugins/systemhealth/systemhealthgadgetconfiguration.cpp index 2c102a580..05d3b4f81 100644 --- a/ground/src/plugins/systemhealth/systemhealthgadgetconfiguration.cpp +++ b/ground/src/plugins/systemhealth/systemhealthgadgetconfiguration.cpp @@ -27,24 +27,6 @@ #include "systemhealthgadgetconfiguration.h" #include "utils/pathutils.h" -#include - -/** - * Loads a saved configuration or defaults if non exist. - * - */ -SystemHealthGadgetConfiguration::SystemHealthGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent) : - IUAVGadgetConfiguration(classId, parent), - systemFile("Unknown") -{ - //if a saved configuration exists load it - if (state.count() > 0) { - QDataStream stream(state); - QString diagram; - stream >> diagram; - systemFile = Utils::PathUtils().InsertDataPath(diagram); - } -} /** * Loads a saved configuration or defaults if non exist. diff --git a/ground/src/plugins/systemhealth/systemhealthgadgetconfiguration.h b/ground/src/plugins/systemhealth/systemhealthgadgetconfiguration.h index ad3ff1428..fc2347cfc 100644 --- a/ground/src/plugins/systemhealth/systemhealthgadgetconfiguration.h +++ b/ground/src/plugins/systemhealth/systemhealthgadgetconfiguration.h @@ -39,7 +39,6 @@ class SystemHealthGadgetConfiguration : public IUAVGadgetConfiguration { Q_OBJECT public: - explicit SystemHealthGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent = 0); explicit SystemHealthGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); //set system health configuration functions diff --git a/ground/src/plugins/systemhealth/systemhealthgadgetfactory.cpp b/ground/src/plugins/systemhealth/systemhealthgadgetfactory.cpp index 557897bf6..80abb1be7 100644 --- a/ground/src/plugins/systemhealth/systemhealthgadgetfactory.cpp +++ b/ground/src/plugins/systemhealth/systemhealthgadgetfactory.cpp @@ -48,11 +48,6 @@ Core::IUAVGadget* SystemHealthGadgetFactory::createGadget(QWidget *parent) return new SystemHealthGadget(QString("SystemHealthGadget"), gadgetWidget, parent); } -IUAVGadgetConfiguration *SystemHealthGadgetFactory::createConfiguration(const QByteArray &state) -{ - return new SystemHealthGadgetConfiguration(QString("SystemHealthGadget"), state); -} - IUAVGadgetConfiguration *SystemHealthGadgetFactory::createConfiguration(QSettings* qSettings) { return new SystemHealthGadgetConfiguration(QString("SystemHealthGadget"), qSettings); diff --git a/ground/src/plugins/systemhealth/systemhealthgadgetfactory.h b/ground/src/plugins/systemhealth/systemhealthgadgetfactory.h index f11108729..96b93c123 100644 --- a/ground/src/plugins/systemhealth/systemhealthgadgetfactory.h +++ b/ground/src/plugins/systemhealth/systemhealthgadgetfactory.h @@ -45,7 +45,6 @@ public: ~SystemHealthGadgetFactory(); Core::IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(const QByteArray &state); IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); }; diff --git a/ground/src/plugins/uavobjectbrowser/uavobjectbrowserconfiguration.cpp b/ground/src/plugins/uavobjectbrowser/uavobjectbrowserconfiguration.cpp index 56314b845..e534542c6 100644 --- a/ground/src/plugins/uavobjectbrowser/uavobjectbrowserconfiguration.cpp +++ b/ground/src/plugins/uavobjectbrowser/uavobjectbrowserconfiguration.cpp @@ -26,27 +26,6 @@ */ #include "uavobjectbrowserconfiguration.h" -#include - -UAVObjectBrowserConfiguration::UAVObjectBrowserConfiguration(QString classId, const QByteArray &state, QObject *parent) : - IUAVGadgetConfiguration(classId, parent), - m_recentlyUpdatedColor(QColor(255, 230, 230)), - m_manuallyChangedColor(QColor(230, 230, 255)), - m_recentlyUpdatedTimeout(500) -{ - if (state.count() > 0) { - QDataStream stream(state); - QColor recent; - QColor manual; - int timeout; - stream >> recent; - stream >> manual; - stream >> timeout; - m_recentlyUpdatedColor = recent; - m_manuallyChangedColor = manual; - m_recentlyUpdatedTimeout = timeout; - } -} UAVObjectBrowserConfiguration::UAVObjectBrowserConfiguration(QString classId, QSettings* qSettings, QObject *parent) : IUAVGadgetConfiguration(classId, parent), diff --git a/ground/src/plugins/uavobjectbrowser/uavobjectbrowserconfiguration.h b/ground/src/plugins/uavobjectbrowser/uavobjectbrowserconfiguration.h index 251ebfcb2..941428f83 100644 --- a/ground/src/plugins/uavobjectbrowser/uavobjectbrowserconfiguration.h +++ b/ground/src/plugins/uavobjectbrowser/uavobjectbrowserconfiguration.h @@ -40,7 +40,6 @@ Q_PROPERTY(QColor m_recentlyUpdatedColor READ recentlyUpdatedColor WRITE setRece Q_PROPERTY(QColor m_manuallyChangedColor READ manuallyChangedColor WRITE setManuallyChangedColor) Q_PROPERTY(int m_recentlyUpdatedTimeout READ recentlyUpdatedTimeout WRITE setRecentlyUpdatedTimeout) public: - explicit UAVObjectBrowserConfiguration(QString classId, const QByteArray &state, QObject *parent = 0); explicit UAVObjectBrowserConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); void saveConfig(QSettings* settings) const; diff --git a/ground/src/plugins/uavobjectbrowser/uavobjectbrowserfactory.cpp b/ground/src/plugins/uavobjectbrowser/uavobjectbrowserfactory.cpp index 995c98dd3..6e364e458 100644 --- a/ground/src/plugins/uavobjectbrowser/uavobjectbrowserfactory.cpp +++ b/ground/src/plugins/uavobjectbrowser/uavobjectbrowserfactory.cpp @@ -46,11 +46,6 @@ Core::IUAVGadget* UAVObjectBrowserFactory::createGadget(QWidget *parent) return new UAVObjectBrowser(QString("UAVObjectBrowser"), gadgetWidget, parent); } -IUAVGadgetConfiguration *UAVObjectBrowserFactory::createConfiguration(const QByteArray &state) -{ - return new UAVObjectBrowserConfiguration(QString("UAVObjectBrowser"), state); -} - IUAVGadgetConfiguration *UAVObjectBrowserFactory::createConfiguration(QSettings* qSettings) { return new UAVObjectBrowserConfiguration(QString("UAVObjectBrowser"), qSettings); diff --git a/ground/src/plugins/uavobjectbrowser/uavobjectbrowserfactory.h b/ground/src/plugins/uavobjectbrowser/uavobjectbrowserfactory.h index fdf8ca8b7..b9d1af9f7 100644 --- a/ground/src/plugins/uavobjectbrowser/uavobjectbrowserfactory.h +++ b/ground/src/plugins/uavobjectbrowser/uavobjectbrowserfactory.h @@ -45,7 +45,6 @@ public: ~UAVObjectBrowserFactory(); Core::IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(const QByteArray &state); IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); }; diff --git a/ground/src/plugins/uploader/uploadergadgetconfiguration.cpp b/ground/src/plugins/uploader/uploadergadgetconfiguration.cpp index 84a308018..c5842b291 100755 --- a/ground/src/plugins/uploader/uploadergadgetconfiguration.cpp +++ b/ground/src/plugins/uploader/uploadergadgetconfiguration.cpp @@ -26,62 +26,8 @@ */ #include "uploadergadgetconfiguration.h" -#include #include -/** - * Loads a saved configuration or defaults if non exist. - * - */ -UploaderGadgetConfiguration::UploaderGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent) : - IUAVGadgetConfiguration(classId, parent), - m_defaultPort("Unknown"), - m_defaultSpeed(BAUD19200), - m_defaultDataBits(DATA_8), - m_defaultFlow(FLOW_OFF), - m_defaultParity(PAR_NONE), - m_defaultStopBits(STOP_1), - m_defaultTimeOut(5000) - -{ - //if a saved configuration exists load it - if (state.count() > 0) { - QDataStream stream(state); - BaudRateType speed; - DataBitsType databits; - FlowType flow; - ParityType parity; - StopBitsType stopbits; - int ispeed; - int idatabits; - int iflow; - int iparity; - int istopbits; - QString port; - stream >> ispeed; - stream >> idatabits; - stream >>iflow; - stream >>iparity; - stream >> istopbits; - stream >> port; - - databits=(DataBitsType) idatabits; - flow=(FlowType)iflow; - parity=(ParityType)iparity; - stopbits=(StopBitsType)istopbits; - speed=(BaudRateType)ispeed; - m_defaultPort=port; - m_defaultSpeed=speed; - m_defaultDataBits=databits; - m_defaultFlow=flow; - m_defaultParity=parity; - m_defaultStopBits=stopbits; - - } - -} - - /** * Loads a saved configuration or defaults if non exist. * diff --git a/ground/src/plugins/uploader/uploadergadgetconfiguration.h b/ground/src/plugins/uploader/uploadergadgetconfiguration.h index e58eac47d..274a73fab 100755 --- a/ground/src/plugins/uploader/uploadergadgetconfiguration.h +++ b/ground/src/plugins/uploader/uploadergadgetconfiguration.h @@ -37,7 +37,6 @@ class UploaderGadgetConfiguration : public IUAVGadgetConfiguration { Q_OBJECT public: - explicit UploaderGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent = 0); explicit UploaderGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); //set port configuration functions diff --git a/ground/src/plugins/uploader/uploadergadgetfactory.cpp b/ground/src/plugins/uploader/uploadergadgetfactory.cpp index 36229125d..4099b936b 100755 --- a/ground/src/plugins/uploader/uploadergadgetfactory.cpp +++ b/ground/src/plugins/uploader/uploadergadgetfactory.cpp @@ -47,11 +47,6 @@ Core::IUAVGadget* UploaderGadgetFactory::createGadget(QWidget *parent) return new UploaderGadget(QString("Uploader"), gadgetWidget, parent); } -IUAVGadgetConfiguration *UploaderGadgetFactory::createConfiguration(const QByteArray &state) -{ - return new UploaderGadgetConfiguration(QString("Uploader"), state); -} - IUAVGadgetConfiguration *UploaderGadgetFactory::createConfiguration(QSettings* qSettings) { return new UploaderGadgetConfiguration(QString("Uploader"), qSettings); diff --git a/ground/src/plugins/uploader/uploadergadgetfactory.h b/ground/src/plugins/uploader/uploadergadgetfactory.h index 5a4cb9fb8..fb44be6cc 100755 --- a/ground/src/plugins/uploader/uploadergadgetfactory.h +++ b/ground/src/plugins/uploader/uploadergadgetfactory.h @@ -45,7 +45,6 @@ public: ~UploaderGadgetFactory(); Core::IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(const QByteArray &state); IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); };