1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

OP-1683 - Add bank mode selection UI

This commit is contained in:
Alessio Morale 2015-01-24 15:40:21 +01:00
parent dcc9a5b7dc
commit 5901dbda35
2 changed files with 202 additions and 11 deletions

View File

@ -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 :

View File

@ -122,8 +122,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>674</width>
<height>677</height>
<width>680</width>
<height>672</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
@ -157,7 +157,7 @@
</size>
</property>
<property name="title">
<string>Output Update Speed</string>
<string>Output configuration</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="6">
@ -183,7 +183,7 @@
<item row="0" column="1">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Channel:</string>
<string>Channels:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -674,6 +674,188 @@
</item>
</widget>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Mode:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QComboBox" name="cb_outputMode1">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Setup output mode. standard ESCs uses PWM.</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QComboBox" name="cb_outputMode2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Setup output mode. standard ESCs uses PWM.</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QComboBox" name="cb_outputMode3">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Setup output mode. standard ESCs uses PWM.</string>
</property>
</widget>
</item>
<item row="2" column="5">
<widget class="QComboBox" name="cb_outputMode4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Setup output mode. standard ESCs uses PWM.</string>
</property>
</widget>
</item>
<item row="2" column="6">
<widget class="QComboBox" name="cb_outputMode5">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Setup output mode. standard ESCs uses PWM.</string>
</property>
</widget>
</item>
<item row="2" column="7">
<widget class="QComboBox" name="cb_outputMode6">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Setup output mode. standard ESCs uses PWM.</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>