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:
parent
4defa7ed3e
commit
51f82dedbe
@ -98,12 +98,12 @@ bool VehicleConfigurationHelper::setupHardwareSettings(bool save)
|
||||
return result;
|
||||
}
|
||||
|
||||
bool VehicleConfigurationHelper::isApplicable(UAVObject *object)
|
||||
bool VehicleConfigurationHelper::isApplicable(UAVObject *dataObj)
|
||||
{
|
||||
switch (m_configSource->getControllerType()) {
|
||||
case VehicleConfigurationSource::CONTROLLER_CC:
|
||||
case VehicleConfigurationSource::CONTROLLER_CC3D:
|
||||
if (object->getName() == "EKFConfiguration") {
|
||||
if (dataObj->getName() == "EKFConfiguration") {
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
@ -765,7 +765,7 @@ void VehicleConfigurationHelper::applyTemplateSettings()
|
||||
foreach(UAVObject * object, updatedObjects) {
|
||||
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()));
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
VehicleConfigurationHelper(VehicleConfigurationSource *configSource);
|
||||
bool setupVehicle(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 RAPID_ESC_FREQUENCY = 500;
|
||||
static const qint16 ANALOG_SERVO_FREQUENCY = 50;
|
||||
|
Loading…
x
Reference in New Issue
Block a user