From decbcb3ee768bd550de35c89c919e46d6529ba73 Mon Sep 17 00:00:00 2001 From: m_thread Date: Mon, 20 Oct 2014 14:01:52 +0200 Subject: [PATCH] OP-1545 Added GUI to visualize the ESC calibration utput level during calibration. --- .../setupwizard/pages/esccalibrationpage.cpp | 12 + .../setupwizard/pages/esccalibrationpage.ui | 352 +++++++++++++++++- 2 files changed, 363 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp index 270a3ddef..6a5752ca1 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp @@ -40,6 +40,12 @@ EscCalibrationPage::EscCalibrationPage(SetupWizard *wizard, QWidget *parent) : ui(new Ui::EscCalibrationPage), m_isCalibrating(false) { ui->setupUi(this); + + ui->outputHigh->setEnabled(false); + ui->outputLow->setEnabled(true); + ui->outputLevel->setEnabled(true); + ui->outputLevel->setText(QString(tr("%1 µs")).arg(LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS)); + connect(ui->startStopButton, SIGNAL(clicked()), this, SLOT(startStopButtonClicked())); connect(ui->securityCheckBox1, SIGNAL(toggled(bool)), this, SLOT(securityCheckBoxesToggled())); @@ -82,6 +88,9 @@ void EscCalibrationPage::startStopButtonClicked() m_isCalibrating = true; ui->startStopButton->setEnabled(false); enableButtons(false); + ui->outputHigh->setEnabled(true); + ui->outputLow->setEnabled(false); + ui->outputLevel->setText(QString(tr("%1 µs")).arg(HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS)); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager *uavoManager = pm->getObject(); Q_ASSERT(uavoManager); @@ -107,6 +116,9 @@ void EscCalibrationPage::startStopButtonClicked() output->stopChannelOutput(); delete output; } + ui->outputHigh->setEnabled(false); + ui->outputLow->setEnabled(true); + ui->outputLevel->setText(QString(tr("%1 µs")).arg(LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS)); m_outputs.clear(); m_isCalibrating = false; resetAllSecurityCheckboxes(); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui index c22be3413..8e62e6ce8 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui @@ -7,7 +7,7 @@ 0 0 600 - 500 + 507 @@ -64,6 +64,356 @@ + + + + ESC Output Level + + + + 9 + + + 9 + + + 9 + + + + + false + + + + 100 + 22 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 34 + 34 + 200 + + + + + 6 + 6 + 150 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 34 + 34 + 200 + + + + + 6 + 6 + 150 + + + + + + + + + + + 34 + 34 + 200 + + + + + 6 + 6 + 150 + + + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 34 + 34 + 200 + + + + + 6 + 6 + 150 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 34 + 34 + 200 + + + + + 6 + 6 + 150 + + + + + + + + + + + 34 + 34 + 200 + + + + + 6 + 6 + 150 + + + + + + + + + + + 159 + 158 + 158 + + + + + + + 100 + 150 + 255 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 255 + 255 + 255 + + + + + + + 242 + 241 + 240 + + + + + + + + QPushButton:enabled { + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(34, 34, 200, 255), stop:0.78607 rgba(6, 6, 150, 255)); + color: rgb(255, 255, 255); + border-radius: 5; +} + + + Low/Off + + + true + + + + + + + + 0 + 0 + + + + QFrame::Sunken + + + 1 + + + Qt::Horizontal + + + + + + + false + + + N/A + + + + + + + + 0 + 0 + + + + Qt::Horizontal + + + + + + + false + + + + 100 + 22 + + + + QPushButton:enabled { + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(200, 14, 14, 255), stop:0.78607 rgba(160, 6, 6, 255)); + color: rgb(255, 255, 255); + border-radius: 5; +} + + + High + + + true + + + + + +