1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

Move Config plugin for fixed wings back to oly Aileron type per Eric

This commit is contained in:
Fredrik Larson 2014-08-26 12:44:11 +10:00
parent 221dd1308f
commit a4d2582cec
4 changed files with 11 additions and 27 deletions

View File

@ -53,11 +53,11 @@ ConfigFixedWingWidget::ConfigFixedWingWidget(QWidget *parent) :
populateChannelComboBoxes();
QStringList fixedWingTypes;
fixedWingTypes << "Aileron Dual Servo" << "Aileron Single Servo" << "Elevon";
fixedWingTypes << "Aileron" << "Elevon";
m_aircraft->fixedWingType->addItems(fixedWingTypes);
// Set default model to "Aileron Dual Servo"
m_aircraft->fixedWingType->setCurrentIndex(m_aircraft->fixedWingType->findText("Aileron Dual Servo"));
// Set default model to "Aileron"
m_aircraft->fixedWingType->setCurrentIndex(m_aircraft->fixedWingType->findText("Aileron"));
setupUI(m_aircraft->fixedWingType->currentText());
@ -135,9 +135,9 @@ void ConfigFixedWingWidget::setupUI(QString frameType)
qDebug() << "Current Aircraft type: \n" << m_aircraft->fixedWingType->currentText();
if (frameType == "FixedWing" || frameType == "Aileron Dual Servo") {
if (frameType == "FixedWing" || frameType == "Aileron") {
plane->setElementId("aileron");
setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Aileron Dual Servo"));
setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Aileron"));
resetChannelboxesAndSliders();
m_aircraft->fwRudder1ChannelBox->setEnabled(true);
@ -152,22 +152,6 @@ void ConfigFixedWingWidget::setupUI(QString frameType)
m_aircraft->fwElevator1Label->setText("Elevator 1");
m_aircraft->fwElevator2Label->setText("Elevator 2");
} else if (frameType == "Aileron Single Servo") {
plane->setElementId("aileron-single");
setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Aileron Single Servo"));
resetChannelboxesAndSliders();
m_aircraft->fwRudder1ChannelBox->setEnabled(true);
m_aircraft->fwRudder2ChannelBox->setEnabled(true);
m_aircraft->fwElevator1ChannelBox->setEnabled(true);
m_aircraft->fwElevator2ChannelBox->setEnabled(true);
m_aircraft->fwAileron1ChannelBox->setEnabled(true);
m_aircraft->fwAileron2ChannelBox->setEnabled(false);
m_aircraft->fwAileron1Label->setText("Aileron 1");
m_aircraft->fwAileron2Label->setText("Aileron 2");
m_aircraft->fwElevator1Label->setText("Elevator 1");
m_aircraft->fwElevator2Label->setText("Elevator 2");
} else if (frameType == "FixedWingVtail" || frameType == "Vtail") {
// do nothing for now
} else if (frameType == "FixedWingElevon" || frameType == "Elevon") {
@ -218,7 +202,7 @@ void ConfigFixedWingWidget::setupEnabledControls(QString frameType)
// enableComboBoxes(this, CHANNELBOXNAME, 3, true);
} else if (frameType == "Elevon" || frameType == "Elevon") {
enableComboBoxes(this, CHANNELBOXNAME, 3, true);
} else if (frameType == "aileron" || frameType == "Aileron Dual Servo" || frameType == "Aileron Single Servo") {
} else if (frameType == "aileron" || frameType == "Aileron") {
enableComboBoxes(this, CHANNELBOXNAME, 4, true);
}
}
@ -316,7 +300,7 @@ QString ConfigFixedWingWidget::updateConfigObjectsFromWidgets()
QString airframeType;
QList<QString> motor_servo_List;
if (m_aircraft->fixedWingType->currentText() == "Aileron Dual Servo" || "aileron-single") {
if (m_aircraft->fixedWingType->currentText() == "Aileron") {
airframeType = "FixedWing";
setupFrameFixedWing(airframeType);

View File

@ -261,9 +261,8 @@ void ConfigVehicleTypeWidget::updateObjectsFromWidgets()
int ConfigVehicleTypeWidget::frameCategory(QString frameType)
{
if (frameType == "FixedWing" || frameType == "Aileron Dual Servo" || frameType == "Aileron Single Servo"
|| frameType == "FixedWingElevon" || frameType == "Elevon" || frameType == "FixedWingVtail"
|| frameType == "Vtail") {
if (frameType == "FixedWing" || frameType == "Aileron" || frameType == "FixedWingElevon"
|| frameType == "Elevon" || frameType == "FixedWingVtail" || frameType == "Vtail") {
return ConfigVehicleTypeWidget::FIXED_WING;
} else if (frameType == "Tri" || frameType == "Tricopter Y" || frameType == "QuadX" || frameType == "Quad X"
|| frameType == "QuadP" || frameType == "Quad +" || frameType == "Hexa" || frameType == "Hexacopter"

View File

@ -35,7 +35,7 @@ FixedWingPage::FixedWingPage(SetupWizard *wizard, QWidget *parent) :
{
ui->setupUi(this);
QSvgRenderer *renderer = new QSvgRenderer();
renderer->load(QString(":/configgadget/images/fixedwing-shapes.svg"));
renderer->load(QString(":/setupwizard/resources/fixedwing-shapes-wizard-no-numbers.svg"));
m_fixedwingPic = new QGraphicsSvgItem();
m_fixedwingPic->setSharedRenderer(renderer);
QGraphicsScene *scene = new QGraphicsScene(this);

View File

@ -36,6 +36,7 @@
<file>resources/wizard.png</file>
<file>resources/multirotor-shapes.svg</file>
<file>resources/fixedwing-shapes-wizard.svg</file>
<file>resources/fixedwing-shapes-wizard-no-numbers.svg</file>
<!-- these are different from the files in /config/images -->
<file>resources/bttn-illustration-down.png</file>
<file>resources/bttn-illustration-up.png</file>