Skip to content

Commit

Permalink
ParameterLoader -> ParameterManager
Browse files Browse the repository at this point in the history
  • Loading branch information
DonLakeFlyer committed Sep 15, 2016
1 parent 4b4ece6 commit d9d7308
Show file tree
Hide file tree
Showing 20 changed files with 289 additions and 163 deletions.
8 changes: 4 additions & 4 deletions qgroundcontrol.pro
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ HEADERS += \
src/FactSystem/FactSystemTestBase.h \
src/FactSystem/FactSystemTestGeneric.h \
src/FactSystem/FactSystemTestPX4.h \
src/FactSystem/ParameterManagerTest.h \
src/MissionManager/ComplexMissionItemTest.h \
src/MissionManager/MissionCommandTreeTest.h \
src/MissionManager/MissionControllerTest.h \
Expand All @@ -596,7 +597,6 @@ HEADERS += \
src/qgcunittest/MavlinkLogTest.h \
src/qgcunittest/MessageBoxTest.h \
src/qgcunittest/MultiSignalSpy.h \
src/qgcunittest/ParameterLoaderTest.h \
src/qgcunittest/RadioConfigTest.h \
src/qgcunittest/TCPLinkTest.h \
src/qgcunittest/TCPLoopBackServer.h \
Expand All @@ -608,6 +608,7 @@ SOURCES += \
src/FactSystem/FactSystemTestBase.cc \
src/FactSystem/FactSystemTestGeneric.cc \
src/FactSystem/FactSystemTestPX4.cc \
src/FactSystem/ParameterManagerTest.cc \
src/MissionManager/ComplexMissionItemTest.cc \
src/MissionManager/MissionCommandTreeTest.cc \
src/MissionManager/MissionControllerTest.cc \
Expand All @@ -624,7 +625,6 @@ SOURCES += \
src/qgcunittest/MavlinkLogTest.cc \
src/qgcunittest/MessageBoxTest.cc \
src/qgcunittest/MultiSignalSpy.cc \
src/qgcunittest/ParameterLoaderTest.cc \
src/qgcunittest/RadioConfigTest.cc \
src/qgcunittest/TCPLinkTest.cc \
src/qgcunittest/TCPLoopBackServer.cc \
Expand Down Expand Up @@ -787,7 +787,7 @@ HEADERS += \
src/FactSystem/FactMetaData.h \
src/FactSystem/FactSystem.h \
src/FactSystem/FactValidator.h \
src/FactSystem/ParameterLoader.h \
src/FactSystem/ParameterManager.h \
src/FactSystem/SettingsFact.h \

SOURCES += \
Expand All @@ -797,7 +797,7 @@ SOURCES += \
src/FactSystem/FactMetaData.cc \
src/FactSystem/FactSystem.cc \
src/FactSystem/FactValidator.cc \
src/FactSystem/ParameterLoader.cc \
src/FactSystem/ParameterManager.cc \
src/FactSystem/SettingsFact.cc \

#-------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/AutoPilotPlugins/APM/APMAirframeLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <QXmlStreamReader>
#include <QLoggingCategory>

#include "ParameterLoader.h"
#include "ParameterManager.h"
#include "FactSystem.h"
#include "UASInterface.h"
#include "AutoPilotPlugin.h"
Expand Down
23 changes: 9 additions & 14 deletions src/AutoPilotPlugins/AutoPilotPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include "AutoPilotPlugin.h"
#include "QGCApplication.h"
#include "ParameterLoader.h"
#include "ParameterManager.h"
#include "UAS.h"
#include "FirmwarePlugin.h"

Expand Down Expand Up @@ -104,24 +104,24 @@ void AutoPilotPlugin::resetAllParametersToDefaults(void)

void AutoPilotPlugin::refreshAllParameters(unsigned char componentID)
{
_vehicle->getParameterLoader()->refreshAllParameters((uint8_t)componentID);
_vehicle->getParameterManager()->refreshAllParameters((uint8_t)componentID);
}

void AutoPilotPlugin::refreshParameter(int componentId, const QString& name)
{
_vehicle->getParameterLoader()->refreshParameter(componentId, name);
_vehicle->getParameterManager()->refreshParameter(componentId, name);
}

void AutoPilotPlugin::refreshParametersPrefix(int componentId, const QString& namePrefix)
{
_vehicle->getParameterLoader()->refreshParametersPrefix(componentId, namePrefix);
_vehicle->getParameterManager()->refreshParametersPrefix(componentId, namePrefix);
}

bool AutoPilotPlugin::factExists(FactSystem::Provider_t provider, int componentId, const QString& name)
{
switch (provider) {
case FactSystem::ParameterProvider:
return _vehicle->getParameterLoader()->parameterExists(componentId, name);
return _vehicle->getParameterManager()->parameterExists(componentId, name);

// Other providers will go here once they come online
}
Expand All @@ -134,7 +134,7 @@ Fact* AutoPilotPlugin::getFact(FactSystem::Provider_t provider, int componentId,
{
switch (provider) {
case FactSystem::ParameterProvider:
return _vehicle->getParameterLoader()->getFact(componentId, name);
return _vehicle->getParameterManager()->getFact(componentId, name);

// Other providers will go here once they come online
}
Expand All @@ -145,20 +145,15 @@ Fact* AutoPilotPlugin::getFact(FactSystem::Provider_t provider, int componentId,

QStringList AutoPilotPlugin::parameterNames(int componentId)
{
return _vehicle->getParameterLoader()->parameterNames(componentId);
}

const QMap<int, QMap<QString, QStringList> >& AutoPilotPlugin::getGroupMap(void)
{
return _vehicle->getParameterLoader()->getGroupMap();
return _vehicle->getParameterManager()->parameterNames(componentId);
}

void AutoPilotPlugin::writeParametersToStream(QTextStream &stream)
{
_vehicle->getParameterLoader()->writeParametersToStream(stream);
_vehicle->getParameterManager()->writeParametersToStream(stream);
}

QString AutoPilotPlugin::readParametersFromStream(QTextStream &stream)
{
return _vehicle->getParameterLoader()->readParametersFromStream(stream);
return _vehicle->getParameterManager()->readParametersFromStream(stream);
}
4 changes: 1 addition & 3 deletions src/AutoPilotPlugins/AutoPilotPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "FactSystem.h"
#include "Vehicle.h"

class ParameterLoader;
class ParameterManager;
class Vehicle;
class FirmwarePlugin;

Expand Down Expand Up @@ -84,8 +84,6 @@ class AutoPilotPlugin : public QObject
int componentId, ///< fact component, -1=default component
const QString& name); ///< fact name

const QMap<int, QMap<QString, QStringList> >& getGroupMap(void);

// Must be implemented by derived class
virtual const QVariantList& vehicleComponents(void) = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/AutoPilotPlugins/PX4/PX4AirframeLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <QXmlStreamReader>
#include <QLoggingCategory>

#include "ParameterLoader.h"
#include "ParameterManager.h"
#include "FactSystem.h"
#include "UASInterface.h"
#include "AutoPilotPlugin.h"
Expand Down
Loading

0 comments on commit d9d7308

Please sign in to comment.