Skip to content
Snippets Groups Projects
Commit 1ce28cb9 authored by Lorenz Meier's avatar Lorenz Meier
Browse files

Fixed sensor config

parent cb3618b8
Branches
No related tags found
No related merge requests found
...@@ -118,7 +118,7 @@ QGCPX4SensorCalibration::QGCPX4SensorCalibration(QWidget *parent) : ...@@ -118,7 +118,7 @@ QGCPX4SensorCalibration::QGCPX4SensorCalibration(QWidget *parent) :
connect(ui->autopilotComboBox, SIGNAL(activated(int)), this, SLOT(setAutopilotOrientation(int))); connect(ui->autopilotComboBox, SIGNAL(activated(int)), this, SLOT(setAutopilotOrientation(int)));
connect(ui->magComboBox, SIGNAL(activated(int)), this, SLOT(setGpsOrientation(int))); connect(ui->magComboBox, SIGNAL(activated(int)), this, SLOT(setGpsOrientation(int)));
// XXX ask for params (if not loaded) updateIcons();
} }
QGCPX4SensorCalibration::~QGCPX4SensorCalibration() QGCPX4SensorCalibration::~QGCPX4SensorCalibration()
...@@ -282,9 +282,8 @@ void QGCPX4SensorCalibration::setGpsImage(const QString &path) ...@@ -282,9 +282,8 @@ void QGCPX4SensorCalibration::setGpsImage(const QString &path)
ui->gpsLabel->setPixmap(gpsIcon.scaled(w, h, Qt::KeepAspectRatio, Qt::SmoothTransformation)); ui->gpsLabel->setPixmap(gpsIcon.scaled(w, h, Qt::KeepAspectRatio, Qt::SmoothTransformation));
} }
void QGCPX4SensorCalibration::resizeEvent(QResizeEvent* event) void QGCPX4SensorCalibration::updateIcons()
{ {
int w = ui->iconLabel->width(); int w = ui->iconLabel->width();
int h = ui->iconLabel->height(); int h = ui->iconLabel->height();
ui->iconLabel->setPixmap(instructionIcon.scaled(w, h, Qt::KeepAspectRatio, Qt::SmoothTransformation)); ui->iconLabel->setPixmap(instructionIcon.scaled(w, h, Qt::KeepAspectRatio, Qt::SmoothTransformation));
...@@ -296,7 +295,11 @@ void QGCPX4SensorCalibration::resizeEvent(QResizeEvent* event) ...@@ -296,7 +295,11 @@ void QGCPX4SensorCalibration::resizeEvent(QResizeEvent* event)
int wg = ui->gpsLabel->width(); int wg = ui->gpsLabel->width();
int hg = ui->gpsLabel->height(); int hg = ui->gpsLabel->height();
ui->gpsLabel->setPixmap(gpsIcon.scaled(wg, hg, Qt::KeepAspectRatio, Qt::SmoothTransformation)); ui->gpsLabel->setPixmap(gpsIcon.scaled(wg, hg, Qt::KeepAspectRatio, Qt::SmoothTransformation));
}
void QGCPX4SensorCalibration::resizeEvent(QResizeEvent* event)
{
updateIcons();
QWidget::resizeEvent(event); QWidget::resizeEvent(event);
} }
......
...@@ -75,9 +75,12 @@ protected: ...@@ -75,9 +75,12 @@ protected:
void setMagCalibrated(bool calibrated); void setMagCalibrated(bool calibrated);
void setGyroCalibrated(bool calibrated); void setGyroCalibrated(bool calibrated);
void setAccelCalibrated(bool calibrated); void setAccelCalibrated(bool calibrated);
void updateIcons();
private: private:
Ui::QGCPX4SensorCalibration *ui; Ui::QGCPX4SensorCalibration *ui;
}; };
#endif // QGCPX4SENSORCALIBRATION_H #endif // QGCPX4SENSORCALIBRATION_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment