mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
LP-114 Allow Accessory display name in Output tab when Accessory is used
in Custom table
This commit is contained in:
parent
8885180fde
commit
c65b735d8a
@ -2,7 +2,8 @@
|
||||
******************************************************************************
|
||||
*
|
||||
* @file configcustomwidget.cpp
|
||||
* @author E. Lafargue & The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
|
||||
* E. Lafargue & The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||
* @addtogroup GCSPlugins GCS Plugins
|
||||
* @{
|
||||
* @addtogroup ConfigPlugin Config Plugin
|
||||
@ -123,6 +124,24 @@ QStringList ConfigCustomWidget::getChannelDescriptions()
|
||||
if (custom.Servo8 > 0 && custom.Servo8 <= VehicleConfig::CHANNEL_NUMELEM) {
|
||||
channelDesc[custom.Servo8 - 1] = QString("Servo8");
|
||||
}
|
||||
if (custom.Accessory0 > 0 && custom.Accessory0 <= VehicleConfig::CHANNEL_NUMELEM) {
|
||||
channelDesc[custom.Accessory0 - 1] = QString("Accessory0");
|
||||
}
|
||||
if (custom.Accessory1 > 0 && custom.Accessory1 <= VehicleConfig::CHANNEL_NUMELEM) {
|
||||
channelDesc[custom.Accessory1 - 1] = QString("Accessory1");
|
||||
}
|
||||
if (custom.Accessory2 > 0 && custom.Accessory2 <= VehicleConfig::CHANNEL_NUMELEM) {
|
||||
channelDesc[custom.Accessory2 - 1] = QString("Accessory2");
|
||||
}
|
||||
if (custom.Accessory3 > 0 && custom.Accessory3 <= VehicleConfig::CHANNEL_NUMELEM) {
|
||||
channelDesc[custom.Accessory3 - 1] = QString("Accessory3");
|
||||
}
|
||||
if (custom.Accessory4 > 0 && custom.Accessory4 <= VehicleConfig::CHANNEL_NUMELEM) {
|
||||
channelDesc[custom.Accessory4 - 1] = QString("Accessory4");
|
||||
}
|
||||
if (custom.Accessory5 > 0 && custom.Accessory5 <= VehicleConfig::CHANNEL_NUMELEM) {
|
||||
channelDesc[custom.Accessory5 - 1] = QString("Accessory5");
|
||||
}
|
||||
return channelDesc;
|
||||
}
|
||||
|
||||
@ -198,6 +217,12 @@ void ConfigCustomWidget::resetActuators(GUIConfigDataUnion *configData)
|
||||
configData->custom.Servo6 = 0;
|
||||
configData->custom.Servo7 = 0;
|
||||
configData->custom.Servo8 = 0;
|
||||
configData->custom.Accessory0 = 0;
|
||||
configData->custom.Accessory1 = 0;
|
||||
configData->custom.Accessory2 = 0;
|
||||
configData->custom.Accessory3 = 0;
|
||||
configData->custom.Accessory4 = 0;
|
||||
configData->custom.Accessory5 = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -377,16 +402,22 @@ QString ConfigCustomWidget::updateConfigObjectsFromWidgets()
|
||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_CAMERAYAW);
|
||||
} else if (q->currentText() == "Accessory0") {
|
||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_ACCESSORY0);
|
||||
configData.custom.Accessory0 = channel + 1;
|
||||
} else if (q->currentText() == "Accessory1") {
|
||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_ACCESSORY1);
|
||||
configData.custom.Accessory1 = channel + 1;
|
||||
} else if (q->currentText() == "Accessory2") {
|
||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_ACCESSORY2);
|
||||
configData.custom.Accessory2 = channel + 1;
|
||||
} else if (q->currentText() == "Accessory3") {
|
||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_ACCESSORY3);
|
||||
configData.custom.Accessory3 = channel + 1;
|
||||
} else if (q->currentText() == "Accessory4") {
|
||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_ACCESSORY4);
|
||||
configData.custom.Accessory4 = channel + 1;
|
||||
} else if (q->currentText() == "Accessory5") {
|
||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_ACCESSORY5);
|
||||
configData.custom.Accessory5 = channel + 1;
|
||||
}
|
||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_THROTTLECURVE1,
|
||||
m_aircraft->customMixerTable->item(1, channel)->text().toDouble());
|
||||
|
@ -131,7 +131,13 @@ typedef struct {
|
||||
uint RevMotor6 : 4;
|
||||
uint RevMotor7 : 4;
|
||||
uint RevMotor8 : 4; // 96 bits
|
||||
quint32 padding; // 128 bits
|
||||
uint Accessory0 : 4;
|
||||
uint Accessory1 : 4;
|
||||
uint Accessory2 : 4;
|
||||
uint Accessory3 : 4;
|
||||
uint Accessory4 : 4;
|
||||
uint Accessory5 : 4;
|
||||
uint padding : 8; // 128 bits
|
||||
} __attribute__((packed)) customGUISettingsStruct;
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user