@ -795,9 +795,12 @@ void QGCPX4VehicleConfig::loadConfig()
@@ -795,9 +795,12 @@ void QGCPX4VehicleConfig::loadConfig()
xml . readNext ( ) ;
}
mav - > getParamManager ( ) - > setParamDescriptions ( paramTooltips ) ;
if ( ! paramTooltips . isEmpty ( ) ) {
mav - > getParamManager ( ) - > setParamDescriptions ( paramTooltips ) ;
}
doneLoadingConfig = true ;
mav - > requestParameters ( ) ; //Config is finished, lets do a parameter request to ensure none are missed if someone else started requesting before we were finished.
//Config is finished, lets do a parameter request to ensure none are missed if someone else started requesting before we were finished.
mav - > getParamCommsMgr ( ) - > requestParameterList ( ) ;
}
void QGCPX4VehicleConfig : : setActiveUAS ( UASInterface * active )
@ -826,31 +829,28 @@ void QGCPX4VehicleConfig::setActiveUAS(UASInterface* active)
@@ -826,31 +829,28 @@ void QGCPX4VehicleConfig::setActiveUAS(UASInterface* active)
// Disconnect old system
disconnect ( mav , SIGNAL ( remoteControlChannelRawChanged ( int , float ) ) , this ,
SLOT ( remoteControlChannelRawChanged ( int , float ) ) ) ;
//TODO use paramCommsMgr instead
disconnect ( mav , SIGNAL ( parameterChanged ( int , int , QString , QVariant ) ) , this ,
SLOT ( parameterChanged ( int , int , QString , QVariant ) ) ) ;
disconnect ( ui - > refreshButton , SIGNAL ( clicked ( ) ) , mav , SLOT ( requestParameters ( ) ) ) ;
disconnect ( ui - > refreshButton , SIGNAL ( clicked ( ) ) ,
paramCommsMgr , SLOT ( requestParameterList ( ) ) ) ;
// Delete all children from all fixed tabs.
foreach ( QWidget * child , ui - > generalLeftContents - > findChildren < QWidget * > ( ) )
{
foreach ( QWidget * child , ui - > generalLeftContents - > findChildren < QWidget * > ( ) ) {
child - > deleteLater ( ) ;
}
foreach ( QWidget * child , ui - > generalRightContents - > findChildren < QWidget * > ( ) )
{
foreach ( QWidget * child , ui - > generalRightContents - > findChildren < QWidget * > ( ) ) {
child - > deleteLater ( ) ;
}
foreach ( QWidget * child , ui - > advanceColumnContents - > findChildren < QWidget * > ( ) )
{
foreach ( QWidget * child , ui - > advanceColumnContents - > findChildren < QWidget * > ( ) ) {
child - > deleteLater ( ) ;
}
foreach ( QWidget * child , ui - > sensorContents - > findChildren < QWidget * > ( ) )
{
foreach ( QWidget * child , ui - > sensorContents - > findChildren < QWidget * > ( ) ) {
child - > deleteLater ( ) ;
}
// And then delete any custom tabs
foreach ( QWidget * child , additionalTabs )
{
foreach ( QWidget * child , additionalTabs ) {
child - > deleteLater ( ) ;
}
additionalTabs . clear ( ) ;
@ -866,6 +866,7 @@ void QGCPX4VehicleConfig::setActiveUAS(UASInterface* active)
@@ -866,6 +866,7 @@ void QGCPX4VehicleConfig::setActiveUAS(UASInterface* active)
// Connect new system
mav = active ;
paramCommsMgr = mav - > getParamCommsMgr ( ) ;
// Reset current state
resetCalibrationRC ( ) ;
@ -875,25 +876,23 @@ void QGCPX4VehicleConfig::setActiveUAS(UASInterface* active)
@@ -875,25 +876,23 @@ void QGCPX4VehicleConfig::setActiveUAS(UASInterface* active)
chanCount = 0 ;
// Connect new system
connect ( acti ve , SIGNAL ( remoteControlChannelRawChanged ( int , float ) ) , this ,
connect ( m av, SIGNAL ( remoteControlChannelRawChanged ( int , float ) ) , this ,
SLOT ( remoteControlChannelRawChanged ( int , float ) ) ) ;
connect ( acti ve , SIGNAL ( parameterChanged ( int , int , QString , QVariant ) ) , this ,
connect ( m av, SIGNAL ( parameterChanged ( int , int , QString , QVariant ) ) , this ,
SLOT ( parameterChanged ( int , int , QString , QVariant ) ) ) ;
connect ( ui - > refreshButton , SIGNAL ( clicked ( ) ) , active , SLOT ( requestParameters ( ) ) ) ;
connect ( ui - > refreshButton , SIGNAL ( clicked ( ) ) ,
paramCommsMgr , SLOT ( requestParameterList ( ) ) ) ;
if ( systemTypeToParamMap . contains ( mav - > getSystemTypeName ( ) ) )
{
if ( systemTypeToParamMap . contains ( mav - > getSystemTypeName ( ) ) ) {
paramToWidgetMap = systemTypeToParamMap [ mav - > getSystemTypeName ( ) ] ;
}
else
{
else {
//Indication that we have no meta data for this system type.
qDebug ( ) < < " No parameters defined for system type: " < < mav - > getSystemTypeName ( ) ;
paramToWidgetMap = systemTypeToParamMap [ mav - > getSystemTypeName ( ) ] ;
}
if ( ! paramTooltips . isEmpty ( ) )
{
if ( ! paramTooltips . isEmpty ( ) ) {
mav - > getParamManager ( ) - > setParamDescriptions ( paramTooltips ) ;
}
@ -912,8 +911,7 @@ void QGCPX4VehicleConfig::setActiveUAS(UASInterface* active)
@@ -912,8 +911,7 @@ void QGCPX4VehicleConfig::setActiveUAS(UASInterface* active)
ui - > writeButton - > setEnabled ( true ) ;
ui - > loadFileButton - > setEnabled ( true ) ;
ui - > saveFileButton - > setEnabled ( true ) ;
if ( mav - > getAutopilotTypeName ( ) = = " ARDUPILOTMEGA " )
{
if ( mav - > getAutopilotTypeName ( ) = = " ARDUPILOTMEGA " ) {
ui - > readButton - > hide ( ) ;
ui - > writeButton - > hide ( ) ;
}
@ -978,8 +976,8 @@ void QGCPX4VehicleConfig::writeCalibrationRC()
@@ -978,8 +976,8 @@ void QGCPX4VehicleConfig::writeCalibrationRC()
void QGCPX4VehicleConfig : : requestCalibrationRC ( )
{
if ( mav ) {
mav - > getPa ramCommsMgr( ) - > requestRcCalibrationParamsUpdate ( ) ;
if ( paramCommsMgr ) {
pa ramCommsMgr- > requestRcCalibrationParamsUpdate ( ) ;
}
}