From 5901dbda35fa9c21a67cb9cc49c358f5dfad6321 Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Sat, 24 Jan 2015 15:40:21 +0100 Subject: [PATCH] OP-1683 - Add bank mode selection UI --- .../src/plugins/config/configoutputwidget.cpp | 23 ++- .../openpilotgcs/src/plugins/config/output.ui | 190 +++++++++++++++++- 2 files changed, 202 insertions(+), 11 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index 4f6370d75..e008274ef 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -98,9 +98,18 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren addWidget(ui->cb_outputRate1); addWidget(ui->spinningArmed); + addWidgetBinding("ActuatorSettings", "BankMode", ui->cb_outputMode1, 0); + addWidgetBinding("ActuatorSettings", "BankMode", ui->cb_outputMode2, 1); + addWidgetBinding("ActuatorSettings", "BankMode", ui->cb_outputMode3, 2); + addWidgetBinding("ActuatorSettings", "BankMode", ui->cb_outputMode4, 3); + addWidgetBinding("ActuatorSettings", "BankMode", ui->cb_outputMode5, 4); + addWidgetBinding("ActuatorSettings", "BankMode", ui->cb_outputMode6, 5); + disconnect(this, SLOT(refreshWidgetsValues(UAVObject *))); + populateWidgets(); refreshWidgetsValues(); + updateEnableControls(); } @@ -251,7 +260,7 @@ void ConfigOutputWidget::sendChannelTest(int index, int value) void ConfigOutputWidget::refreshWidgetsValues(UAVObject *obj) { Q_UNUSED(obj); - + ConfigTaskWidget::refreshWidgetsValues(obj); bool dirty = isDirty(); // Get Actuator Settings @@ -391,12 +400,12 @@ void ConfigOutputWidget::updateObjectsFromWidgets() } // Set update rates - actuatorSettingsData.BankUpdateFreq[0] = ui->cb_outputRate1->currentText().toUInt(); - actuatorSettingsData.BankUpdateFreq[1] = ui->cb_outputRate2->currentText().toUInt(); - actuatorSettingsData.BankUpdateFreq[2] = ui->cb_outputRate3->currentText().toUInt(); - actuatorSettingsData.BankUpdateFreq[3] = ui->cb_outputRate4->currentText().toUInt(); - actuatorSettingsData.BankUpdateFreq[4] = ui->cb_outputRate5->currentText().toUInt(); - actuatorSettingsData.BankUpdateFreq[5] = ui->cb_outputRate6->currentText().toUInt(); + actuatorSettingsData.BankUpdateFreq[0] = ui->cb_outputRate1->currentText().toUInt(); + actuatorSettingsData.BankUpdateFreq[1] = ui->cb_outputRate2->currentText().toUInt(); + actuatorSettingsData.BankUpdateFreq[2] = ui->cb_outputRate3->currentText().toUInt(); + actuatorSettingsData.BankUpdateFreq[3] = ui->cb_outputRate4->currentText().toUInt(); + actuatorSettingsData.BankUpdateFreq[4] = ui->cb_outputRate5->currentText().toUInt(); + actuatorSettingsData.BankUpdateFreq[5] = ui->cb_outputRate6->currentText().toUInt(); actuatorSettingsData.MotorsSpinWhileArmed = ui->spinningArmed->isChecked() ? ActuatorSettings::MOTORSSPINWHILEARMED_TRUE : diff --git a/ground/openpilotgcs/src/plugins/config/output.ui b/ground/openpilotgcs/src/plugins/config/output.ui index e80ea0764..b571d6313 100644 --- a/ground/openpilotgcs/src/plugins/config/output.ui +++ b/ground/openpilotgcs/src/plugins/config/output.ui @@ -122,8 +122,8 @@ 0 0 - 674 - 677 + 680 + 672 @@ -157,7 +157,7 @@ - Output Update Speed + Output configuration @@ -183,7 +183,7 @@ - Channel: + Channels: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -674,6 +674,188 @@ + + + + + 0 + 0 + + + + + 0 + 20 + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 5 + 20 + + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + Mode: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + + 0 + 0 + + + + + 0 + 20 + + + + Setup output mode. standard ESCs uses PWM. + + + + + + + false + + + + 0 + 0 + + + + + 0 + 20 + + + + Setup output mode. standard ESCs uses PWM. + + + + + + + false + + + + 0 + 0 + + + + + 0 + 20 + + + + Setup output mode. standard ESCs uses PWM. + + + + + + + false + + + + 0 + 0 + + + + + 0 + 20 + + + + Setup output mode. standard ESCs uses PWM. + + + + + + + false + + + + 0 + 0 + + + + + 0 + 20 + + + + Setup output mode. standard ESCs uses PWM. + + + + + + + false + + + + 0 + 0 + + + + + 0 + 20 + + + + Setup output mode. standard ESCs uses PWM. + + +