1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

OP-311 New "Arming" tab in the config widget to setup how the airframe is armed.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2763 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2011-02-08 16:49:33 +00:00 committed by edouard
parent 93ee2765be
commit 04ba1261f0
2 changed files with 1132 additions and 982 deletions

View File

@ -157,6 +157,10 @@ ConfigServoWidget::ConfigServoWidget(QWidget *parent) : ConfigTaskWidget(parent)
m_config->fmsSsPos3Pitch->addItems(channelsList);
m_config->fmsSsPos3Yaw->addItems(channelsList);
// And the Armin configurations:
field = obj->getField(QString("Arming"));
m_config->armControl->clear();
m_config->armControl->addItems(field->getOptions());
obj = dynamic_cast<UAVDataObject*>(objManager->getObject(QString("ActuatorSettings")));
fieldList = obj->getFields();
@ -196,6 +200,11 @@ ConfigServoWidget::ConfigServoWidget(QWidget *parent) : ConfigTaskWidget(parent)
connect(m_config->saveFmsToRAM, SIGNAL(clicked()), this, SLOT(sendRCInputUpdate()));
connect(m_config->getFmsCurrent, SIGNAL(clicked()), this, SLOT(requestRCInputUpdate()));
connect(m_config->saveArmToSD, SIGNAL(clicked()), this, SLOT(saveRCInputObject()));
connect(m_config->saveArmToRAM, SIGNAL(clicked()), this, SLOT(sendRCInputUpdate()));
connect(m_config->getArmCurrent, SIGNAL(clicked()), this, SLOT(requestRCInputUpdate()));
connect(m_config->saveRCOutputToSD, SIGNAL(clicked()), this, SLOT(saveRCOutputObject()));
connect(m_config->saveRCOutputToRAM, SIGNAL(clicked()), this, SLOT(sendRCOutputUpdate()));
connect(m_config->getRCOutputCurrent, SIGNAL(clicked()), this, SLOT(requestRCOutputUpdate()));
@ -633,6 +642,12 @@ void ConfigServoWidget::requestRCInputUpdate()
m_config->fmsSsPos3Yaw->setCurrentIndex(m_config->fmsSsPos3Yaw->findText(
field->getValue(field->getElementNames().indexOf("Yaw")).toString()));
// Load the arming settings
field = obj->getField(QString("Arming"));
m_config->armControl->setCurrentIndex(m_config->armControl->findText(field->getValue().toString()));
field = obj->getField(QString("ArmedTimeout"));
m_config->armTimeout->setValue(field->getValue().toInt()/1000);
}
@ -751,6 +766,12 @@ void ConfigServoWidget::sendRCInputUpdate()
field->setValue(m_config->fmsSsPos3Pitch->currentText(), field->getElementNames().indexOf("Pitch"));
field->setValue(m_config->fmsSsPos3Yaw->currentText(), field->getElementNames().indexOf("Yaw"));
// Save the arming settings
field = obj->getField(QString("Arming"));
field->setValue(m_config->armControl->currentText());
field = obj->getField(QString("ArmedTimeout"));
field->setValue(m_config->armTimeout->value()*1000);
// ... and send to the OP Board
obj->updated();

View File

@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -2776,12 +2776,141 @@ Applies and Saves all settings to SD</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="tab_4">
<attribute name="title">
<string>Arming Settings</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_17">
<property name="text">
<string>Arm airframe using:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="armControl">
<property name="toolTip">
<string>Indicate the control used for arming the airframe.</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_18">
<property name="text">
<string>Arming timeout:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="armTimeout">
<property name="toolTip">
<string>After the time indicated here, the frame will be disarmed.</string>
</property>
<property name="maximum">
<number>64</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_19">
<property name="text">
<string>seconds.</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="getArmCurrent">
<property name="text">
<string>Get Current</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="saveArmToRAM">
<property name="text">
<string>Save to RAM</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="saveArmToSD">
<property name="text">
<string>Save to SD</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>ch0Slider</tabstop>
<tabstop>ch1Slider</tabstop>
<tabstop>ch2Slider</tabstop>