@ -300,11 +300,10 @@ void QGCPX4VehicleConfig::identifyChannelMapping(int aert_index)
@@ -300,11 +300,10 @@ void QGCPX4VehicleConfig::identifyChannelMapping(int aert_index)
}
}
msgBox . setText ( tr ( " Identifying %1 channel " ) . arg ( channelNames [ channelWanted ] ) ) ;
msgBox . setInformativeText ( tr ( " Please move stick, switch or potentiometer for the %1 channel \n all the way up/down or left/right. " ) . arg ( channelNames [ channelWanted ] ) ) ;
msgBox . setStandardButtons ( QMessageBox : : Ok ) ;
msgBox . setText ( tr ( " Detecting %1 ... \t \t " ) . arg ( channelNames [ channelWanted ] ) ) ;
msgBox . setInformativeText ( tr ( " Please move stick, switch or potentiometer for this channel all the way up/down or left/right. " ) ) ;
msgBox . setStandardButtons ( QMessageBox : : NoButton ) ;
skipActionButton = msgBox . addButton ( tr ( " Skip " ) , QMessageBox : : RejectRole ) ;
msgBox . setDefaultButton ( QMessageBox : : Ok ) ;
msgBox . exec ( ) ;
skipActionButton - > hide ( ) ;
msgBox . removeButton ( skipActionButton ) ;
@ -404,11 +403,10 @@ void QGCPX4VehicleConfig::detectChannelInversion(int aert_index)
@@ -404,11 +403,10 @@ void QGCPX4VehicleConfig::detectChannelInversion(int aert_index)
instructions < < " AUX1: Push down / towards you or turn dial to the leftmost position " ;
instructions < < " AUX2: Push down / towards you or turn dial to the leftmost position " ;
msgBox . setText ( tr ( " Identifying DIRECTION of %1 channel " ) . arg ( channelNames [ channelReverseStateWanted ] ) ) ;
msgBox . setText ( tr ( " %1 Direction " ) . arg ( channelNames [ channelReverseStateWanted ] ) ) ;
msgBox . setInformativeText ( tr ( " %2 " ) . arg ( ( aert_index < instructions . length ( ) ) ? instructions [ aert_index ] : " " ) ) ;
msgBox . setStandardButtons ( QMessageBox : : Ok ) ;
msgBox . setStandardButtons ( QMessageBox : : NoButton ) ;
skipActionButton = msgBox . addButton ( tr ( " Skip " ) , QMessageBox : : RejectRole ) ;
msgBox . setDefaultButton ( QMessageBox : : Ok ) ;
msgBox . exec ( ) ;
skipActionButton - > hide ( ) ;
msgBox . removeButton ( skipActionButton ) ;
@ -422,12 +420,16 @@ void QGCPX4VehicleConfig::detectChannelInversion(int aert_index)
@@ -422,12 +420,16 @@ void QGCPX4VehicleConfig::detectChannelInversion(int aert_index)
void QGCPX4VehicleConfig : : startCalibrationRC ( )
{
if ( chanCount < 5 ) {
QMessageBox : : warning ( 0 , tr ( " Warning! Not enough RC channels " ) , tr ( " Detected %1 radio channels. To operate PX4, you need at least 5 channels. Is the radio control connected? " ) . arg ( chanCount ) ) ;
QMessageBox : : warning ( 0 ,
tr ( " RC not Connected " ) ,
tr ( " Is the RC receiver connected and transmitter turned on? Detected %1 radio channels. To operate PX4, you need at least 5 channels. " ) . arg ( chanCount ) ) ;
return ;
}
configEnabled = true ;
QMessageBox : : warning ( 0 , " Warning! " , " You are about to start radio calibration. \n Please ensure all motor power is disconnected AND all props are removed from the vehicle. \n Also ensure transmitter and receiver are powered and connected. \n RESET ALL TRIMS TO CENTER! \n \n Do not move the RC sticks, then click OK to confirm " ) ;
QMessageBox : : warning ( 0 , tr ( " Safety Warning " ) ,
tr ( " Starting RC calibration. \n \n Ensure that motor power is disconnected, all props are removed, RC transmitter and receiver are powered and connected. \n \n Reset transmitter trims to center, then click OK to continue " ) ) ;
//go ahead and try to map first 8 channels, now that user can skip channels
for ( int i = 0 ; i < 8 ; i + + ) {
@ -457,7 +459,7 @@ void QGCPX4VehicleConfig::startCalibrationRC()
@@ -457,7 +459,7 @@ void QGCPX4VehicleConfig::startCalibrationRC()
void QGCPX4VehicleConfig : : stopCalibrationRC ( )
{
QMessageBox : : information ( 0 , " Trims " , " Ensure all sticks are centeres and throttle is in the downmost position, c lick OK to continue " ) ;
QMessageBox : : information ( 0 , " Trims " , " Ensure all controls are centered and throttle is in the lowest position. C lick OK to continue " ) ;
calibrationEnabled = false ;
configEnabled = false ;
@ -486,10 +488,10 @@ void QGCPX4VehicleConfig::stopCalibrationRC()
@@ -486,10 +488,10 @@ void QGCPX4VehicleConfig::stopCalibrationRC()
setTrimPositions ( ) ;
QString statusstr ;
statusstr = " Below you will find the detected radio calibration information that will be sent to the autopilot \n " ;
statusstr + = " Normal values are around 1100 to 19 00, with disconnected channels reading 1000, 1500, 2000\n \n " ;
statusstr + = " Channel \t Min \t Center \t Max \n " ;
statusstr + = " ----------------- --- \n " ;
statusstr = tr ( " This is the RC calibration information that will be sent to the autopilot if you click OK. To prevent transmission, click Cancel. " ) ;
statusstr + = tr ( " Normal values range from 1000 to 20 00, with disconnected channels reading 1000, 1500, 2000\n \n " ) ;
statusstr + = tr ( " Channel \t Min \t Center \t Max \n " ) ;
statusstr + = " ------- \t --- \t ------ \t --- \n " ;
for ( unsigned int i = 0 ; i < chanCount ; i + + ) {
statusstr + = QString : : number ( i ) + " \t " + QString : : number ( rcMin [ i ] ) + " \t " + QString : : number ( rcValue [ i ] ) + " \t " + QString : : number ( rcMax [ i ] ) + " \n " ;
}
@ -1235,10 +1237,13 @@ void QGCPX4VehicleConfig::remoteControlChannelRawChanged(int chan, float fval)
@@ -1235,10 +1237,13 @@ void QGCPX4VehicleConfig::remoteControlChannelRawChanged(int chan, float fval)
channelWanted = - 1 ;
// Confirm found channel
msgBox . setText ( tr ( " %1 Channel found. " ) . arg ( channelNames [ chanFound ] ) ) ;
msgBox . setInformativeText ( tr ( " Found %1 to be on the raw RC channel %2 " ) . arg ( channelNames [ chanFound ] ) . arg ( chan + 1 ) ) ;
msgBox . setText ( tr ( " Found %1 \t \t " ) . arg ( channelNames [ chanFound ] ) ) ;
msgBox . setInformativeText ( tr ( " Assigned raw RC channel %2 " ) . arg ( chan + 1 ) ) ;
msgBox . setStandardButtons ( QMessageBox : : Ok ) ;
msgBox . setDefaultButton ( QMessageBox : : Ok ) ;
skipActionButton - > hide ( ) ;
msgBox . removeButton ( skipActionButton ) ;
( void ) msgBox . exec ( ) ;
// XXX fuse with parameter update handling
@ -1364,17 +1369,19 @@ void QGCPX4VehicleConfig::remoteControlChannelRawChanged(int chan, float fval)
@@ -1364,17 +1369,19 @@ void QGCPX4VehicleConfig::remoteControlChannelRawChanged(int chan, float fval)
channelReverseStateWanted = - 1 ;
// Confirm found channel
msgBox . setText ( tr ( " Direction of %1 Channel assigned" ) . arg ( channelNames [ currRevFunc ] ) ) ;
msgBox . setInformativeText ( tr ( " %1 " ) . arg ( ( rcRev [ rcMapping [ currRevFunc ] ] ) ? " Reversed channel. " : " Did not reverse channel. " ) ) ;
msgBox . setText ( tr ( " %1 direction assigned" ) . arg ( channelNames [ currRevFunc ] ) ) ;
msgBox . setInformativeText ( tr ( " %1 " ) . arg ( ( rcRev [ rcMapping [ currRevFunc ] ] ) ? tr ( " Reversed channel. " ) : tr ( " Did not reverse channel. " ) ) ) ;
msgBox . setStandardButtons ( QMessageBox : : Ok ) ;
msgBox . setDefaultButton ( QMessageBox : : Ok ) ;
skipActionButton - > hide ( ) ;
msgBox . removeButton ( skipActionButton ) ;
( void ) msgBox . exec ( ) ;
}
}
dataModelChanged = true ;
qDebug ( ) < < " RC CHAN: " < < chan < < " PPM: " < < fval < < " NORMALIZED: " < < normalized ;
//qDebug() << "RC CHAN:" << chan << "PPM:" << fval << "NORMALIZED:" << normalized;
}
void QGCPX4VehicleConfig : : updateAllInvertedCheckboxes ( )