Browse Source

fix for range-loop-construct

QGC4.4
acxz 4 years ago committed by Don Gagne
parent
commit
ef5c4164f4
  1. 4
      src/AutoPilotPlugins/PX4/PX4AdvancedFlightModesController.cc
  2. 2
      src/AutoPilotPlugins/PX4/PX4RadioComponent.cc

4
src/AutoPilotPlugins/PX4/PX4AdvancedFlightModesController.cc

@ -101,7 +101,7 @@ void PX4AdvancedFlightModesController::_init(void) @@ -101,7 +101,7 @@ void PX4AdvancedFlightModesController::_init(void)
// Setup the channel combobox model
QVector<int> usedChannels;
for (const QString &attitudeParam : {"RC_MAP_THROTTLE", "RC_MAP_YAW", "RC_MAP_PITCH", "RC_MAP_ROLL", "RC_MAP_FLAPS", "RC_MAP_AUX1", "RC_MAP_AUX2"}) {
for (const char* const&attitudeParam : {"RC_MAP_THROTTLE", "RC_MAP_YAW", "RC_MAP_PITCH", "RC_MAP_ROLL", "RC_MAP_FLAPS", "RC_MAP_AUX1", "RC_MAP_AUX2"}) {
int channel = getParameterFact(-1, attitudeParam)->rawValue().toInt();
if (channel != 0) {
usedChannels << channel;
@ -170,7 +170,7 @@ void PX4AdvancedFlightModesController::_validateConfiguration(void) @@ -170,7 +170,7 @@ void PX4AdvancedFlightModesController::_validateConfiguration(void)
}
// Validate thresholds within range
for(const QString &thresholdParam : {"RC_ASSIST_TH", "RC_AUTO_TH", "RC_ACRO_TH", "RC_POSCTL_TH", "RC_LOITER_TH", "RC_RETURN_TH", "RC_OFFB_TH"}) {
for(const char* const&thresholdParam : {"RC_ASSIST_TH", "RC_AUTO_TH", "RC_ACRO_TH", "RC_POSCTL_TH", "RC_LOITER_TH", "RC_RETURN_TH", "RC_OFFB_TH"}) {
float threshold = getParameterFact(-1, thresholdParam)->rawValue().toFloat();
if (threshold < 0.0f || threshold > 1.0f) {
_validConfiguration = false;

2
src/AutoPilotPlugins/PX4/PX4RadioComponent.cc

@ -43,7 +43,7 @@ bool PX4RadioComponent::setupComplete(void) const @@ -43,7 +43,7 @@ bool PX4RadioComponent::setupComplete(void) const
if (_vehicle->parameterManager()->getParameter(-1, "COM_RC_IN_MODE")->rawValue().toInt() != 1) {
// The best we can do to detect the need for a radio calibration is look for attitude
// controls to be mapped.
for(const QString &mapParam : {"RC_MAP_ROLL", "RC_MAP_PITCH", "RC_MAP_YAW", "RC_MAP_THROTTLE"}) {
for(const char* const&mapParam : {"RC_MAP_ROLL", "RC_MAP_PITCH", "RC_MAP_YAW", "RC_MAP_THROTTLE"}) {
if (_vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, mapParam)->rawValue().toInt() == 0) {
return false;
}

Loading…
Cancel
Save