Commit 1f76bbed authored by Lorenz Meier's avatar Lorenz Meier

More fixes and rigor

parent 59743ec5
......@@ -408,6 +408,15 @@ QPushButton#viewModeGeneric, QPushButton#viewModePX4, QPushButton#viewModeAPM, Q
border: 3px solid #465158;
}
QPushButton#magButton, QPushButton#gyroButton, QPushButton#accelButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #73D95D, stop: 1 #18A154);
border-radius: 8px;
min-height: 30px;
max-height: 50px;
min-width: 60px;
border: 3px solid #465158;
}
QWidget#containerWidget {
background-color: qlineargradient(spread:pad, x1:0.527222, y1:0.961, x2:0.536946, y2:0.198864, stop:0.103448 rgba(65, 65, 65, 255), stop:1 rgba(119, 119, 119, 255));
border-radius: 16px;
......
......@@ -46,20 +46,31 @@ QGCPX4AirframeConfig::QGCPX4AirframeConfig(QWidget *parent) :
connect(ui->quadPlusPushButton, SIGNAL(clicked()), this, SLOT(quadPlusSelected()));
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)));
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)));
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)));
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->hComboBox, SIGNAL(activated(int)), this, SLOT(hSelected(int)));
ui->octoPlusPushButton->setEnabled(ui->octoPlusComboBox->count() > 0);
ui->hComboBox->addItem(tr("TBS Discovery"), 15);
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(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*)));
......@@ -123,9 +134,6 @@ void QGCPX4AirframeConfig::setAirframeID(int id)
qDebug() << "setAirframeID" << id;
ui->statusLabel->setText(tr("Start script ID: #%1").arg(id));
if (selectedId == id)
return;
selectedId = id;
// XXX too much boilerplate code here - this widget is really just
......@@ -223,6 +231,7 @@ void QGCPX4AirframeConfig::applyAndReboot()
configState = CONFIG_STATE_SEND;
QTimer::singleShot(200, this, SLOT(checkConfigState()));
setEnabled(false);
}
void QGCPX4AirframeConfig::checkConfigState()
......@@ -269,6 +278,7 @@ void QGCPX4AirframeConfig::checkConfigState()
if (progress->wasCanceled()) {
configState = CONFIG_STATE_ABORT;
setEnabled(true);
pendingParams = 0;
return;
}
......@@ -300,6 +310,13 @@ void QGCPX4AirframeConfig::checkConfigState()
progress = new QProgressDialog("Waiting for autopilot reboot", "Abort", 0, pendingMax, this);
progress->setWindowModality(Qt::WindowModal);
qDebug() << "Waiting for reboot, pending" << pendingParams;
} else {
if (progress->wasCanceled()) {
configState = CONFIG_STATE_ABORT;
setEnabled(true);
pendingParams = 0;
return;
}
}
if (pendingParams == 3) {
......@@ -334,6 +351,7 @@ void QGCPX4AirframeConfig::checkConfigState()
progress->setValue(pendingMax);
configState = CONFIG_STATE_ABORT;
pendingParams = 0;
setEnabled(true);
return;
}
qDebug() << "PENDING PARAMS REBOOT AFTER:" << pendingParams;
......
......@@ -33,7 +33,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-291</y>
<y>0</y>
<width>762</width>
<height>647</height>
</rect>
......
......@@ -21,6 +21,7 @@ QGCPX4SensorCalibration::QGCPX4SensorCalibration(QWidget *parent) :
accelAxes << "z+";
accelAxes << "z-";
ui->setupUi(this);
connect(clearAction, SIGNAL(triggered()), ui->textView, SLOT(clear()));
......
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