|
|
@ -46,20 +46,31 @@ QGCPX4AirframeConfig::QGCPX4AirframeConfig(QWidget *parent) : |
|
|
|
|
|
|
|
|
|
|
|
connect(ui->quadPlusPushButton, SIGNAL(clicked()), this, SLOT(quadPlusSelected())); |
|
|
|
connect(ui->quadPlusPushButton, SIGNAL(clicked()), this, SLOT(quadPlusSelected())); |
|
|
|
connect(ui->quadPlusComboBox, SIGNAL(activated(int)), this, SLOT(quadPlusSelected(int))); |
|
|
|
connect(ui->quadPlusComboBox, SIGNAL(activated(int)), this, SLOT(quadPlusSelected(int))); |
|
|
|
|
|
|
|
ui->quadPlusPushButton->setEnabled(ui->quadPlusComboBox->count() > 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(ui->hexaXPushButton, SIGNAL(clicked()), this, SLOT(hexaXSelected())); |
|
|
|
connect(ui->hexaXComboBox, SIGNAL(activated(int)), this, SLOT(hexaXSelected(int))); |
|
|
|
connect(ui->hexaXComboBox, SIGNAL(activated(int)), this, SLOT(hexaXSelected(int))); |
|
|
|
|
|
|
|
ui->hexaXPushButton->setEnabled(ui->hexaXComboBox->count() > 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(ui->hexaPlusPushButton, SIGNAL(clicked()), this, SLOT(hexaPlusSelected())); |
|
|
|
connect(ui->hexaPlusComboBox, SIGNAL(activated(int)), this, SLOT(hexaPlusSelected(int))); |
|
|
|
connect(ui->hexaPlusComboBox, SIGNAL(activated(int)), this, SLOT(hexaPlusSelected(int))); |
|
|
|
|
|
|
|
ui->hexaPlusPushButton->setEnabled(ui->hexaPlusComboBox->count() > 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(ui->octoXPushButton, SIGNAL(clicked()), this, SLOT(octoXSelected())); |
|
|
|
connect(ui->octoXComboBox, SIGNAL(activated(int)), this, SLOT(octoXSelected(int))); |
|
|
|
connect(ui->octoXComboBox, SIGNAL(activated(int)), this, SLOT(octoXSelected(int))); |
|
|
|
|
|
|
|
ui->octoXPushButton->setEnabled(ui->octoXComboBox->count() > 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(ui->octoPlusPushButton, SIGNAL(clicked()), this, SLOT(octoPlusSelected())); |
|
|
|
connect(ui->octoPlusComboBox, SIGNAL(activated(int)), this, SLOT(octoPlusSelected(int))); |
|
|
|
connect(ui->octoPlusComboBox, SIGNAL(activated(int)), this, SLOT(octoPlusSelected(int))); |
|
|
|
|
|
|
|
ui->octoPlusPushButton->setEnabled(ui->octoPlusComboBox->count() > 0); |
|
|
|
connect(ui->hComboBox, SIGNAL(activated(int)), this, SLOT(hSelected(int))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ui->hComboBox->addItem(tr("TBS Discovery"), 15); |
|
|
|
ui->hComboBox->addItem(tr("TBS Discovery"), 15); |
|
|
|
ui->hComboBox->addItem(tr("H Custom"), 16); |
|
|
|
ui->hComboBox->addItem(tr("H Custom"), 16); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(ui->hPushButton, SIGNAL(clicked()), this, SLOT(hSelected())); |
|
|
|
|
|
|
|
connect(ui->hComboBox, SIGNAL(activated(int)), this, SLOT(hSelected(int))); |
|
|
|
|
|
|
|
ui->hPushButton->setEnabled(ui->hComboBox->count() > 0); |
|
|
|
|
|
|
|
|
|
|
|
connect(ui->applyButton, SIGNAL(clicked()), this, SLOT(applyAndReboot())); |
|
|
|
connect(ui->applyButton, SIGNAL(clicked()), this, SLOT(applyAndReboot())); |
|
|
|
|
|
|
|
|
|
|
|
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*))); |
|
|
|
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*))); |
|
|
@ -123,9 +134,6 @@ void QGCPX4AirframeConfig::setAirframeID(int id) |
|
|
|
qDebug() << "setAirframeID" << id; |
|
|
|
qDebug() << "setAirframeID" << id; |
|
|
|
ui->statusLabel->setText(tr("Start script ID: #%1").arg(id)); |
|
|
|
ui->statusLabel->setText(tr("Start script ID: #%1").arg(id)); |
|
|
|
|
|
|
|
|
|
|
|
if (selectedId == id) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectedId = id; |
|
|
|
selectedId = id; |
|
|
|
|
|
|
|
|
|
|
|
// XXX too much boilerplate code here - this widget is really just
|
|
|
|
// XXX too much boilerplate code here - this widget is really just
|
|
|
@ -223,6 +231,7 @@ void QGCPX4AirframeConfig::applyAndReboot() |
|
|
|
|
|
|
|
|
|
|
|
configState = CONFIG_STATE_SEND; |
|
|
|
configState = CONFIG_STATE_SEND; |
|
|
|
QTimer::singleShot(200, this, SLOT(checkConfigState())); |
|
|
|
QTimer::singleShot(200, this, SLOT(checkConfigState())); |
|
|
|
|
|
|
|
setEnabled(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void QGCPX4AirframeConfig::checkConfigState() |
|
|
|
void QGCPX4AirframeConfig::checkConfigState() |
|
|
@ -269,6 +278,7 @@ void QGCPX4AirframeConfig::checkConfigState() |
|
|
|
|
|
|
|
|
|
|
|
if (progress->wasCanceled()) { |
|
|
|
if (progress->wasCanceled()) { |
|
|
|
configState = CONFIG_STATE_ABORT; |
|
|
|
configState = CONFIG_STATE_ABORT; |
|
|
|
|
|
|
|
setEnabled(true); |
|
|
|
pendingParams = 0; |
|
|
|
pendingParams = 0; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -300,6 +310,13 @@ void QGCPX4AirframeConfig::checkConfigState() |
|
|
|
progress = new QProgressDialog("Waiting for autopilot reboot", "Abort", 0, pendingMax, this); |
|
|
|
progress = new QProgressDialog("Waiting for autopilot reboot", "Abort", 0, pendingMax, this); |
|
|
|
progress->setWindowModality(Qt::WindowModal); |
|
|
|
progress->setWindowModality(Qt::WindowModal); |
|
|
|
qDebug() << "Waiting for reboot, pending" << pendingParams; |
|
|
|
qDebug() << "Waiting for reboot, pending" << pendingParams; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (progress->wasCanceled()) { |
|
|
|
|
|
|
|
configState = CONFIG_STATE_ABORT; |
|
|
|
|
|
|
|
setEnabled(true); |
|
|
|
|
|
|
|
pendingParams = 0; |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (pendingParams == 3) { |
|
|
|
if (pendingParams == 3) { |
|
|
@ -334,6 +351,7 @@ void QGCPX4AirframeConfig::checkConfigState() |
|
|
|
progress->setValue(pendingMax); |
|
|
|
progress->setValue(pendingMax); |
|
|
|
configState = CONFIG_STATE_ABORT; |
|
|
|
configState = CONFIG_STATE_ABORT; |
|
|
|
pendingParams = 0; |
|
|
|
pendingParams = 0; |
|
|
|
|
|
|
|
setEnabled(true); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
qDebug() << "PENDING PARAMS REBOOT AFTER:" << pendingParams; |
|
|
|
qDebug() << "PENDING PARAMS REBOOT AFTER:" << pendingParams; |
|
|
|