Commit 6733692c authored by Michael Carpenter's avatar Michael Carpenter

Fix for potential race condition where UI is not finished configuring when...

Fix for potential race condition where UI is not finished configuring when parameters start coming in
parent f2cbf7bc
......@@ -4,9 +4,13 @@
AP2ConfigWidget::AP2ConfigWidget(QWidget *parent) : QWidget(parent)
{
m_uas = 0;
}
void AP2ConfigWidget::initConnections()
{
connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));
activeUASSet(UASManager::instance()->getActiveUAS());
}
void AP2ConfigWidget::activeUASSet(UASInterface *uas)
{
if (m_uas)
......
......@@ -12,6 +12,7 @@ public:
protected:
UASInterface *m_uas;
void showNullMAVErrorMessageBox();
void initConnections();
signals:
public slots:
......
......@@ -6,9 +6,8 @@ AccelCalibrationConfig::AccelCalibrationConfig(QWidget *parent) : AP2ConfigWidge
ui.setupUi(this);
connect(ui.calibrateAccelButton,SIGNAL(clicked()),this,SLOT(calibrateButtonClicked()));
connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));
activeUASSet(UASManager::instance()->getActiveUAS());
m_accelAckCount=0;
initConnections();
}
AccelCalibrationConfig::~AccelCalibrationConfig()
......
......@@ -11,7 +11,7 @@ AdvParameterList::AdvParameterList(QWidget *parent) : AP2ConfigWidget(parent)
ui.tableWidget->setColumnWidth(1,100);
ui.tableWidget->setColumnWidth(2,200);
ui.tableWidget->setColumnWidth(3,800);
initConnections();
}
AdvParameterList::~AdvParameterList()
......
......@@ -4,6 +4,7 @@
AdvancedParamConfig::AdvancedParamConfig(QWidget *parent) : AP2ConfigWidget(parent)
{
ui.setupUi(this);
initConnections();
}
AdvancedParamConfig::~AdvancedParamConfig()
......
......@@ -6,6 +6,7 @@ AirspeedConfig::AirspeedConfig(QWidget *parent) : AP2ConfigWidget(parent)
ui.setupUi(this);
connect(ui.enableCheckBox,SIGNAL(toggled(bool)),this,SLOT(enableCheckBoxClicked(bool)));
connect(ui.useAirspeedCheckBox,SIGNAL(toggled(bool)),this,SLOT(useCheckBoxClicked(bool)));
initConnections();
}
AirspeedConfig::~AirspeedConfig()
......
......@@ -6,6 +6,7 @@ ApmPlaneLevel::ApmPlaneLevel(QWidget *parent) : AP2ConfigWidget(parent)
ui.setupUi(this);
connect(ui.levelPushButton,SIGNAL(clicked()),this,SLOT(levelClicked()));
connect(ui.manualLevelCheckBox,SIGNAL(toggled(bool)),this,SLOT(manualCheckBoxToggled(bool)));
initConnections();
}
ApmPlaneLevel::~ApmPlaneLevel()
......
......@@ -107,6 +107,7 @@ ArduCopterPidConfig::ArduCopterPidConfig(QWidget *parent) : AP2ConfigWidget(pare
ui.ch7OptComboBox->addItem(m_ch78ValueToTextList[i].second);
ui.ch8OptComboBox->addItem(m_ch78ValueToTextList[i].second);
}
initConnections();
}
ArduCopterPidConfig::~ArduCopterPidConfig()
......
......@@ -58,7 +58,7 @@ ArduPlanePidConfig::ArduPlanePidConfig(QWidget *parent) : AP2ConfigWidget(parent
connect(ui.writePushButton,SIGNAL(clicked()),this,SLOT(writeButtonClicked()));
connect(ui.refreshPushButton,SIGNAL(clicked()),this,SLOT(refreshButtonClicked()));
initConnections();
}
ArduPlanePidConfig::~ArduPlanePidConfig()
......
......@@ -39,7 +39,7 @@ ArduRoverPidConfig::ArduRoverPidConfig(QWidget *parent) : AP2ConfigWidget(parent
connect(ui.writePushButton,SIGNAL(clicked()),this,SLOT(writeButtonClicked()));
connect(ui.refreshPushButton,SIGNAL(clicked()),this,SLOT(refreshButtonClicked()));
initConnections();
}
ArduRoverPidConfig::~ArduRoverPidConfig()
......
......@@ -31,7 +31,7 @@ BatteryMonitorConfig::BatteryMonitorConfig(QWidget *parent) : AP2ConfigWidget(pa
connect(ui.battCapacityLineEdit,SIGNAL(editingFinished()),this,SLOT(batteryCapacitySet()));
initConnections();
}
void BatteryMonitorConfig::activeUASSet(UASInterface *uas)
{
......
......@@ -106,7 +106,7 @@ CameraGimbalConfig::CameraGimbalConfig(QWidget *parent) : AP2ConfigWidget(parent
connect(ui.neutralXSpinBox,SIGNAL(editingFinished()),this,SLOT(updateNeutralAngles()));
connect(ui.neutralYSpinBox,SIGNAL(editingFinished()),this,SLOT(updateNeutralAngles()));
connect(ui.neutralZSpinBox,SIGNAL(editingFinished()),this,SLOT(updateNeutralAngles()));
initConnections();
}
void CameraGimbalConfig::updateRetractAngles()
......
......@@ -39,6 +39,7 @@ CompassConfig::CompassConfig(QWidget *parent) : AP2ConfigWidget(parent)
ui.orientationComboBox->addItem("ROTATION_PITCH_90");
ui.orientationComboBox->addItem("ROTATION_PITCH_270");
ui.orientationComboBox->addItem("ROTATION_MAX");
initConnections();
}
CompassConfig::~CompassConfig()
{
......
......@@ -82,6 +82,7 @@ FailSafeConfig::FailSafeConfig(QWidget *parent) : AP2ConfigWidget(parent)
connect(ui.throttleCheckBox,SIGNAL(clicked(bool)),this,SLOT(throttleChecked(bool)));
connect(ui.throttlePwmSpinBox,SIGNAL(editingFinished()),this,SLOT(throttlePwmChanged()));
connect(ui.throttleFailSafeComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(throttleFailSafeChanged(int)));
initConnections();
}
void FailSafeConfig::gcsChecked(bool checked)
{
......
......@@ -5,6 +5,7 @@ FlightModeConfig::FlightModeConfig(QWidget *parent) : AP2ConfigWidget(parent)
{
ui.setupUi(this);
connect(ui.savePushButton,SIGNAL(clicked()),this,SLOT(saveButtonClicked()));
initConnections();
}
FlightModeConfig::~FlightModeConfig()
......
......@@ -44,6 +44,7 @@ FrameTypeConfig::FrameTypeConfig(QWidget *parent) : AP2ConfigWidget(parent)
connect(ui.plusRadioButton,SIGNAL(clicked()),this,SLOT(plusFrameSelected()));
connect(ui.xRadioButton,SIGNAL(clicked()),this,SLOT(xFrameSelected()));
connect(ui.vRadioButton,SIGNAL(clicked()),this,SLOT(vFrameSelected()));
initConnections();
}
FrameTypeConfig::~FrameTypeConfig()
......
......@@ -5,6 +5,7 @@ OpticalFlowConfig::OpticalFlowConfig(QWidget *parent) : AP2ConfigWidget(parent)
{
ui.setupUi(this);
connect(ui.enableCheckBox,SIGNAL(clicked(bool)),this,SLOT(enableCheckBoxClicked(bool)));
initConnections();
}
OpticalFlowConfig::~OpticalFlowConfig()
......
......@@ -5,6 +5,8 @@ OsdConfig::OsdConfig(QWidget *parent) : AP2ConfigWidget(parent)
{
ui.setupUi(this);
connect(ui.enablePushButton,SIGNAL(clicked()),this,SLOT(enableButtonClicked()));
initConnections();
}
OsdConfig::~OsdConfig()
......
......@@ -76,6 +76,8 @@ RadioCalibrationConfig::RadioCalibrationConfig(QWidget *parent) : AP2ConfigWidge
rcMax << 1900.0 << 1900.0 << 1900.0 << 1900.0 << 1900.0 << 1900.0 << 1900.0 << 1900.0;
rcTrim << 1500.0 << 1500.0 << 1500.0 << 1500.0 << 1500.0 << 1500.0 << 1500.0 << 1500.0;
rcValue << 0.0 << 0.0 << 0.0 << 0.0 << 0.0 << 0.0 << 0.0 << 0.0;
initConnections();
}
RadioCalibrationConfig::~RadioCalibrationConfig()
......
......@@ -10,6 +10,8 @@ SonarConfig::SonarConfig(QWidget *parent) : AP2ConfigWidget(parent)
ui.sonarTypeComboBox->addItem("HRLV");
connect(ui.enableCheckBox,SIGNAL(toggled(bool)),this,SLOT(checkBoxToggled(bool)));
connect(ui.sonarTypeComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(sonarTypeChanged(int)));
initConnections();
}
SonarConfig::~SonarConfig()
......
......@@ -3,6 +3,7 @@
StandardParamConfig::StandardParamConfig(QWidget *parent) : AP2ConfigWidget(parent)
{
ui.setupUi(this);
initConnections();
}
StandardParamConfig::~StandardParamConfig()
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment