@ -378,7 +378,7 @@ void RadioConfigTest::_fullCalibrationWorker(MAV_AUTOPILOT firmwareType)
@@ -378,7 +378,7 @@ void RadioConfigTest::_fullCalibrationWorker(MAV_AUTOPILOT firmwareType)
switchList < < " RC_MAP_MODE_SW " < < " RC_MAP_LOITER_SW " < < " RC_MAP_RETURN_SW " < < " RC_MAP_POSCTL_SW " < < " RC_MAP_ACRO_SW " ;
foreach ( const QString & switchParam , switchList ) {
Q_ASSERT ( _autopilot - > getParameterFact ( FactSystem : : defaultComponentId , switchParam ) - > rawValue ( ) . toInt ( ) ! = channel + 1 ) ;
Q_ASSERT ( _vehicle - > getParameterFact ( FactSystem : : defaultComponentId , switchParam ) - > rawValue ( ) . toInt ( ) ! = channel + 1 ) ;
}
}
@ -393,7 +393,7 @@ void RadioConfigTest::_fullCalibrationWorker(MAV_AUTOPILOT firmwareType)
@@ -393,7 +393,7 @@ void RadioConfigTest::_fullCalibrationWorker(MAV_AUTOPILOT firmwareType)
if ( ! found ) {
const char * paramName = _functionInfo ( ) [ function ] . parameterName ;
if ( paramName ) {
_rgFunctionChannelMap [ function ] = _autopilot - > getParameterFact ( FactSystem : : defaultComponentId , paramName ) - > rawValue ( ) . toInt ( ) ;
_rgFunctionChannelMap [ function ] = _vehicle - > getParameterFact ( FactSystem : : defaultComponentId , paramName ) - > rawValue ( ) . toInt ( ) ;
qCDebug ( RadioConfigTestLog ) < < " Assigning switch " < < function < < _rgFunctionChannelMap [ function ] ;
if ( _rgFunctionChannelMap [ function ] = = 0 ) {
_rgFunctionChannelMap [ function ] = - 1 ; // -1 signals no mapping
@ -469,8 +469,8 @@ void RadioConfigTest::_validateParameters(void)
@@ -469,8 +469,8 @@ void RadioConfigTest::_validateParameters(void)
const char * paramName = _functionInfo ( ) [ chanFunction ] . parameterName ;
if ( paramName ) {
qCDebug ( RadioConfigTestLog ) < < " Validate " < < chanFunction < < _autopilot - > getParameterFact ( FactSystem : : defaultComponentId , paramName ) - > rawValue ( ) . toInt ( ) ;
QCOMPARE ( _autopilot - > getParameterFact ( FactSystem : : defaultComponentId , paramName ) - > rawValue ( ) . toInt ( ) , expectedParameterValue ) ;
qCDebug ( RadioConfigTestLog ) < < " Validate " < < chanFunction < < _vehicle - > getParameterFact ( FactSystem : : defaultComponentId , paramName ) - > rawValue ( ) . toInt ( ) ;
QCOMPARE ( _vehicle - > getParameterFact ( FactSystem : : defaultComponentId , paramName ) - > rawValue ( ) . toInt ( ) , expectedParameterValue ) ;
}
}
@ -485,13 +485,13 @@ void RadioConfigTest::_validateParameters(void)
@@ -485,13 +485,13 @@ void RadioConfigTest::_validateParameters(void)
int rcTrimExpected = _channelSettingsValidate ( ) [ chan ] . rcTrim ;
bool rcReversedExpected = _channelSettingsValidate ( ) [ chan ] . reversed ;
int rcMinActual = _autopilot - > getParameterFact ( FactSystem : : defaultComponentId , minTpl . arg ( oneBasedChannel ) ) - > rawValue ( ) . toInt ( & convertOk ) ;
int rcMinActual = _vehicle - > getParameterFact ( FactSystem : : defaultComponentId , minTpl . arg ( oneBasedChannel ) ) - > rawValue ( ) . toInt ( & convertOk ) ;
QCOMPARE ( convertOk , true ) ;
int rcMaxActual = _autopilot - > getParameterFact ( FactSystem : : defaultComponentId , maxTpl . arg ( oneBasedChannel ) ) - > rawValue ( ) . toInt ( & convertOk ) ;
int rcMaxActual = _vehicle - > getParameterFact ( FactSystem : : defaultComponentId , maxTpl . arg ( oneBasedChannel ) ) - > rawValue ( ) . toInt ( & convertOk ) ;
QCOMPARE ( convertOk , true ) ;
int rcTrimActual = _autopilot - > getParameterFact ( FactSystem : : defaultComponentId , trimTpl . arg ( oneBasedChannel ) ) - > rawValue ( ) . toInt ( & convertOk ) ;
int rcTrimActual = _vehicle - > getParameterFact ( FactSystem : : defaultComponentId , trimTpl . arg ( oneBasedChannel ) ) - > rawValue ( ) . toInt ( & convertOk ) ;
QCOMPARE ( convertOk , true ) ;
float rcReversedFloat = _autopilot - > getParameterFact ( FactSystem : : defaultComponentId , revTpl . arg ( oneBasedChannel ) ) - > rawValue ( ) . toFloat ( & convertOk ) ;
float rcReversedFloat = _vehicle - > getParameterFact ( FactSystem : : defaultComponentId , revTpl . arg ( oneBasedChannel ) ) - > rawValue ( ) . toFloat ( & convertOk ) ;
QCOMPARE ( convertOk , true ) ;
bool rcReversedActual = ( rcReversedFloat = = - 1.0f ) ;
@ -515,7 +515,7 @@ void RadioConfigTest::_validateParameters(void)
@@ -515,7 +515,7 @@ void RadioConfigTest::_validateParameters(void)
const char * paramName = _functionInfo ( ) [ chanFunction ] . parameterName ;
if ( paramName ) {
// qCDebug(RadioConfigTestLog) << chanFunction << expectedValue << mapParamsSet[paramName].toInt();
QCOMPARE ( _autopilot - > getParameterFact ( FactSystem : : defaultComponentId , paramName ) - > rawValue ( ) . toInt ( ) , expectedValue ) ;
QCOMPARE ( _vehicle - > getParameterFact ( FactSystem : : defaultComponentId , paramName ) - > rawValue ( ) . toInt ( ) , expectedValue ) ;
}
}
}