1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-16 08:29:15 +01:00

OP-1592 Same logic using dataObj

This commit is contained in:
Laurent Lalanne 2014-11-02 15:38:41 +01:00
parent 4defa7ed3e
commit 51f82dedbe
2 changed files with 4 additions and 4 deletions

View File

@ -98,12 +98,12 @@ bool VehicleConfigurationHelper::setupHardwareSettings(bool save)
return result; return result;
} }
bool VehicleConfigurationHelper::isApplicable(UAVObject *object) bool VehicleConfigurationHelper::isApplicable(UAVObject *dataObj)
{ {
switch (m_configSource->getControllerType()) { switch (m_configSource->getControllerType()) {
case VehicleConfigurationSource::CONTROLLER_CC: case VehicleConfigurationSource::CONTROLLER_CC:
case VehicleConfigurationSource::CONTROLLER_CC3D: case VehicleConfigurationSource::CONTROLLER_CC3D:
if (object->getName() == "EKFConfiguration") { if (dataObj->getName() == "EKFConfiguration") {
return false; return false;
} }
default: default:
@ -765,7 +765,7 @@ void VehicleConfigurationHelper::applyTemplateSettings()
foreach(UAVObject * object, updatedObjects) { foreach(UAVObject * object, updatedObjects) {
UAVDataObject *dataObj = dynamic_cast<UAVDataObject *>(object); UAVDataObject *dataObj = dynamic_cast<UAVDataObject *>(object);
if (dataObj != NULL && isApplicable(object)) { if (dataObj != NULL && isApplicable(dataObj)) {
addModifiedObject(dataObj, tr("Writing template settings for %1").arg(object->getName())); addModifiedObject(dataObj, tr("Writing template settings for %1").arg(object->getName()));
} }
} }

View File

@ -57,7 +57,7 @@ public:
VehicleConfigurationHelper(VehicleConfigurationSource *configSource); VehicleConfigurationHelper(VehicleConfigurationSource *configSource);
bool setupVehicle(bool save = true); bool setupVehicle(bool save = true);
bool setupHardwareSettings(bool save = true); bool setupHardwareSettings(bool save = true);
bool isApplicable(UAVObject *object); bool isApplicable(UAVObject *dataObj);
static const qint16 LEGACY_ESC_FREQUENCY = 50; static const qint16 LEGACY_ESC_FREQUENCY = 50;
static const qint16 RAPID_ESC_FREQUENCY = 500; static const qint16 RAPID_ESC_FREQUENCY = 500;
static const qint16 ANALOG_SERVO_FREQUENCY = 50; static const qint16 ANALOG_SERVO_FREQUENCY = 50;