mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
OP-907 step 3: vehicle config code formatting cleanups
This commit is contained in:
parent
3520a7c055
commit
80b658cebf
@ -44,12 +44,9 @@
|
||||
|
||||
QStringList ConfigCcpmWidget::getChannelDescriptions()
|
||||
{
|
||||
int i;
|
||||
QStringList channelDesc;
|
||||
|
||||
// init a channel_numelem list of channel desc defaults
|
||||
for (i=0; i < (int)(ConfigCcpmWidget::CHANNEL_NUMELEM); i++)
|
||||
{
|
||||
QStringList channelDesc;
|
||||
for (int i = 0; i < (int) ConfigCcpmWidget::CHANNEL_NUMELEM; i++) {
|
||||
channelDesc.append(QString("-"));
|
||||
}
|
||||
|
||||
@ -57,53 +54,66 @@ QStringList ConfigCcpmWidget::getChannelDescriptions()
|
||||
GUIConfigDataUnion configData = GetConfigData();
|
||||
heliGUISettingsStruct heli = configData.heli;
|
||||
|
||||
if (heli.Throttle > 0)
|
||||
if (heli.Throttle > 0) {
|
||||
channelDesc[heli.Throttle - 1] = QString("Throttle");
|
||||
if (heli.Tail > 0)
|
||||
channelDesc[heli.Tail - 1] = QString("Tail");
|
||||
|
||||
switch(heli.FirstServoIndex)
|
||||
{
|
||||
case 0: //front
|
||||
if (heli.ServoIndexW > 0)
|
||||
channelDesc[heli.ServoIndexW - 1] = QString("Elevator");
|
||||
if (heli.ServoIndexX > 0)
|
||||
channelDesc[heli.ServoIndexX - 1] = QString("Roll1");
|
||||
if (heli.ServoIndexY > 0)
|
||||
channelDesc[heli.ServoIndexY - 1] = QString("Roll2");
|
||||
break;
|
||||
|
||||
case 1: //right
|
||||
if (heli.ServoIndexW > 0)
|
||||
channelDesc[heli.ServoIndexW - 1] = QString("ServoW");
|
||||
if (heli.ServoIndexX > 0)
|
||||
channelDesc[heli.ServoIndexX - 1] = QString("ServoX");
|
||||
if (heli.ServoIndexY > 0)
|
||||
channelDesc[heli.ServoIndexY - 1] = QString("ServoY");
|
||||
break;
|
||||
|
||||
case 2: //rear
|
||||
if (heli.ServoIndexW > 0)
|
||||
channelDesc[heli.ServoIndexW - 1] = QString("Elevator");
|
||||
if (heli.ServoIndexX > 0)
|
||||
channelDesc[heli.ServoIndexX - 1] = QString("Roll1");
|
||||
if (heli.ServoIndexY > 0)
|
||||
channelDesc[heli.ServoIndexY - 1] = QString("Roll2");
|
||||
break;
|
||||
|
||||
case 3: //left
|
||||
if (heli.ServoIndexW > 0)
|
||||
channelDesc[heli.ServoIndexW - 1] = QString("ServoW");
|
||||
if (heli.ServoIndexX > 0)
|
||||
channelDesc[heli.ServoIndexX - 1] = QString("ServoX");
|
||||
if (heli.ServoIndexY > 0)
|
||||
channelDesc[heli.ServoIndexY - 1] = QString("ServoY");
|
||||
break;
|
||||
|
||||
}
|
||||
if (heli.ServoIndexZ > 0)
|
||||
channelDesc[heli.ServoIndexZ - 1] = QString("ServoZ");
|
||||
if (heli.Tail > 0) {
|
||||
channelDesc[heli.Tail - 1] = QString("Tail");
|
||||
}
|
||||
|
||||
switch (heli.FirstServoIndex) {
|
||||
case 0:
|
||||
// front
|
||||
if (heli.ServoIndexW > 0) {
|
||||
channelDesc[heli.ServoIndexW - 1] = QString("Elevator");
|
||||
}
|
||||
if (heli.ServoIndexX > 0) {
|
||||
channelDesc[heli.ServoIndexX - 1] = QString("Roll1");
|
||||
}
|
||||
if (heli.ServoIndexY > 0) {
|
||||
channelDesc[heli.ServoIndexY - 1] = QString("Roll2");
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
// right
|
||||
if (heli.ServoIndexW > 0) {
|
||||
channelDesc[heli.ServoIndexW - 1] = QString("ServoW");
|
||||
}
|
||||
if (heli.ServoIndexX > 0) {
|
||||
channelDesc[heli.ServoIndexX - 1] = QString("ServoX");
|
||||
}
|
||||
if (heli.ServoIndexY > 0) {
|
||||
channelDesc[heli.ServoIndexY - 1] = QString("ServoY");
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
// rear
|
||||
if (heli.ServoIndexW > 0) {
|
||||
channelDesc[heli.ServoIndexW - 1] = QString("Elevator");
|
||||
}
|
||||
if (heli.ServoIndexX > 0) {
|
||||
channelDesc[heli.ServoIndexX - 1] = QString("Roll1");
|
||||
}
|
||||
if (heli.ServoIndexY > 0) {
|
||||
channelDesc[heli.ServoIndexY - 1] = QString("Roll2");
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
// left
|
||||
if (heli.ServoIndexW > 0) {
|
||||
channelDesc[heli.ServoIndexW - 1] = QString("ServoW");
|
||||
}
|
||||
if (heli.ServoIndexX > 0) {
|
||||
channelDesc[heli.ServoIndexX - 1] = QString("ServoX");
|
||||
}
|
||||
if (heli.ServoIndexY > 0) {
|
||||
channelDesc[heli.ServoIndexY - 1] = QString("ServoY");
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (heli.ServoIndexZ > 0) {
|
||||
channelDesc[heli.ServoIndexZ - 1] = QString("ServoZ");
|
||||
}
|
||||
return channelDesc;
|
||||
}
|
||||
|
||||
@ -112,17 +122,12 @@ ConfigCcpmWidget::ConfigCcpmWidget(QWidget *parent) :
|
||||
{
|
||||
m_aircraft->setupUi(this);
|
||||
|
||||
//Ui_CcpmConfigWidget *m_aircraft = m_aircraft;
|
||||
|
||||
SwashLvlConfigurationInProgress = 0;
|
||||
SwashLvlState = 0;
|
||||
SwashLvlServoInterlock = 0;
|
||||
updatingFromHardware = FALSE;
|
||||
updatingToHardware = FALSE;
|
||||
|
||||
//m_aircraft = new Ui_ccpmWidget();
|
||||
//m_aircraft->setupUi(this);
|
||||
|
||||
// Initialization of the swashplaye widget
|
||||
m_aircraft->SwashplateImage->setScene(new QGraphicsScene(this));
|
||||
|
||||
@ -137,7 +142,6 @@ ConfigCcpmWidget::ConfigCcpmWidget(QWidget *parent) :
|
||||
QSvgRenderer *renderer = new QSvgRenderer();
|
||||
renderer->load(QString(":/configgadget/images/ccpm_setup.svg"));
|
||||
|
||||
|
||||
SwashplateImg = new QGraphicsSvgItem();
|
||||
SwashplateImg->setSharedRenderer(renderer);
|
||||
SwashplateImg->setElementId("Swashplate");
|
||||
@ -146,7 +150,8 @@ ConfigCcpmWidget::ConfigCcpmWidget(QWidget *parent) :
|
||||
m_aircraft->SwashplateImage->scene()->addItem(SwashplateImg);
|
||||
|
||||
QFont serifFont("Times", 24, QFont::Bold);
|
||||
QPen pen; // creates a default pen
|
||||
// creates a default pen
|
||||
QPen pen;
|
||||
|
||||
pen.setStyle(Qt::DotLine);
|
||||
pen.setWidth(2);
|
||||
@ -154,9 +159,9 @@ ConfigCcpmWidget::ConfigCcpmWidget(QWidget *parent) :
|
||||
pen.setCapStyle(Qt::RoundCap);
|
||||
pen.setJoinStyle(Qt::RoundJoin);
|
||||
|
||||
|
||||
QBrush brush(Qt::darkBlue);
|
||||
QPen pen2; // creates a default pen
|
||||
// creates a default pen
|
||||
QPen pen2;
|
||||
|
||||
//pen2.setStyle(Qt::DotLine);
|
||||
pen2.setWidth(1);
|
||||
@ -164,7 +169,6 @@ ConfigCcpmWidget::ConfigCcpmWidget(QWidget *parent) :
|
||||
//pen2.setCapStyle(Qt::RoundCap);
|
||||
//pen2.setJoinStyle(Qt::RoundJoin);
|
||||
|
||||
|
||||
//brush.setStyle(Qt::RadialGradientPattern);
|
||||
|
||||
QList<QString> ServoNames;
|
||||
@ -189,8 +193,6 @@ ConfigCcpmWidget::ConfigCcpmWidget(QWidget *parent) :
|
||||
m_aircraft->SwashplateImage->scene()->addItem(ServosTextCircles[i]);
|
||||
m_aircraft->SwashplateImage->scene()->addItem(ServosText[i]);
|
||||
|
||||
|
||||
|
||||
SwashLvlSpinBoxes[i] = new QSpinBox(m_aircraft->SwashLvlSwashplateImage); // use QGraphicsView
|
||||
m_aircraft->SwashLvlSwashplateImage->scene()->addWidget(SwashLvlSpinBoxes[i]);
|
||||
SwashLvlSpinBoxes[i]->setMaximum(10000);
|
||||
@ -222,11 +224,11 @@ ConfigCcpmWidget::ConfigCcpmWidget(QWidget *parent) :
|
||||
m_aircraft->ccpmServoZChannel->setCurrentIndex(0);
|
||||
|
||||
QStringList Types;
|
||||
Types << QString::fromUtf8("CCPM 2 Servo 90º") << QString::fromUtf8("CCPM 3 Servo 90º") << QString::fromUtf8("CCPM 4 Servo 90º") <<
|
||||
QString::fromUtf8("CCPM 3 Servo 120º") << QString::fromUtf8("CCPM 3 Servo 140º") <<
|
||||
QString::fromUtf8("FP 2 Servo 90º") <<
|
||||
QString::fromUtf8("Coax 2 Servo 90º") <<
|
||||
QString::fromUtf8("Custom - User Angles") << QString::fromUtf8("Custom - Advanced Settings");
|
||||
Types << QString::fromUtf8("CCPM 2 Servo 90º") << QString::fromUtf8("CCPM 3 Servo 90º")
|
||||
<< QString::fromUtf8("CCPM 4 Servo 90º") << QString::fromUtf8("CCPM 3 Servo 120º")
|
||||
<< QString::fromUtf8("CCPM 3 Servo 140º") << QString::fromUtf8("FP 2 Servo 90º")
|
||||
<< QString::fromUtf8("Coax 2 Servo 90º") << QString::fromUtf8("Custom - User Angles")
|
||||
<< QString::fromUtf8("Custom - Advanced Settings");
|
||||
m_aircraft->ccpmType->addItems(Types);
|
||||
m_aircraft->ccpmType->setCurrentIndex(m_aircraft->ccpmType->count() - 1);
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
QStringList ConfigCustomWidget::getChannelDescriptions()
|
||||
{
|
||||
QStringList channelDesc;
|
||||
for (int i = 0; i < (int) (VehicleConfig::CHANNEL_NUMELEM); i++) {
|
||||
for (int i = 0; i < (int) VehicleConfig::CHANNEL_NUMELEM; i++) {
|
||||
channelDesc.append(QString("-"));
|
||||
}
|
||||
return channelDesc;
|
||||
@ -58,14 +58,14 @@ ConfigCustomWidget::ConfigCustomWidget(QWidget *parent) :
|
||||
|
||||
UAVObjectField* field = mixer->getField(QString("Mixer1Type"));
|
||||
QStringList list = field->getOptions();
|
||||
for (int i = 0; i < (int) (VehicleConfig::CHANNEL_NUMELEM); i++) {
|
||||
for (int i = 0; i < (int) VehicleConfig::CHANNEL_NUMELEM; i++) {
|
||||
QComboBox* qb = new QComboBox(m_aircraft->customMixerTable);
|
||||
qb->addItems(list);
|
||||
m_aircraft->customMixerTable->setCellWidget(0, i, qb);
|
||||
}
|
||||
|
||||
SpinBoxDelegate *sbd = new SpinBoxDelegate();
|
||||
for (int i = 1; i < (int) (VehicleConfig::CHANNEL_NUMELEM); i++) {
|
||||
for (int i = 1; i < (int) VehicleConfig::CHANNEL_NUMELEM; i++) {
|
||||
m_aircraft->customMixerTable->setItemDelegateForRow(i, sbd);
|
||||
}
|
||||
}
|
||||
@ -164,7 +164,7 @@ QString ConfigCustomWidget::updateConfigObjectsFromWidgets()
|
||||
setThrottleCurve(mixer, VehicleConfig::MIXER_THROTTLECURVE2, m_aircraft->customThrottle2Curve->getCurve());
|
||||
|
||||
// Update the table:
|
||||
for (int channel = 0; channel < (int) (VehicleConfig::CHANNEL_NUMELEM); channel++) {
|
||||
for (int channel = 0; channel < (int) VehicleConfig::CHANNEL_NUMELEM; channel++) {
|
||||
QComboBox* q = (QComboBox*) m_aircraft->customMixerTable->cellWidget(0, channel);
|
||||
if (q->currentText() == "Disabled") {
|
||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_DISABLED);
|
||||
|
@ -44,7 +44,7 @@ QStringList ConfigFixedWingWidget::getChannelDescriptions()
|
||||
{
|
||||
// init a channel_numelem list of channel desc defaults
|
||||
QStringList channelDesc;
|
||||
for (int i = 0; i < (int) (ConfigFixedWingWidget::CHANNEL_NUMELEM); i++) {
|
||||
for (int i = 0; i < (int) ConfigFixedWingWidget::CHANNEL_NUMELEM; i++) {
|
||||
channelDesc.append(QString("-"));
|
||||
}
|
||||
|
||||
@ -105,7 +105,6 @@ void ConfigFixedWingWidget::setupUI(QString frameType)
|
||||
Q_ASSERT(m_aircraft);
|
||||
|
||||
if (frameType == "FixedWing" || frameType == "Elevator aileron rudder") {
|
||||
//setComboCurrentIndex(m_aircraft->aircraftType, m_aircraft->aircraftType->findText("Fixed Wing"));
|
||||
setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Elevator aileron rudder"));
|
||||
m_aircraft->fwRudder1ChannelBox->setEnabled(true);
|
||||
m_aircraft->fwRudder1Label->setEnabled(true);
|
||||
@ -127,7 +126,6 @@ void ConfigFixedWingWidget::setupUI(QString frameType)
|
||||
m_aircraft->elevonMixBox->setHidden(true);
|
||||
|
||||
} else if (frameType == "FixedWingElevon" || frameType == "Elevon") {
|
||||
//setComboCurrentIndex(m_aircraft->aircraftType, m_aircraft->aircraftType->findText("Fixed Wing"));
|
||||
setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Elevon"));
|
||||
m_aircraft->fwAileron1Label->setText("Elevon 1");
|
||||
m_aircraft->fwAileron2Label->setText("Elevon 2");
|
||||
@ -146,7 +144,6 @@ void ConfigFixedWingWidget::setupUI(QString frameType)
|
||||
m_aircraft->elevonLabel2->setText("Pitch");
|
||||
|
||||
} else if (frameType == "FixedWingVtail" || frameType == "Vtail") {
|
||||
//setComboCurrentIndex(m_aircraft->aircraftType, m_aircraft->aircraftType->findText("Fixed Wing"));
|
||||
setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Vtail"));
|
||||
m_aircraft->fwRudder1ChannelBox->setEnabled(false);
|
||||
m_aircraft->fwRudder1Label->setEnabled(false);
|
||||
@ -177,6 +174,67 @@ void ConfigFixedWingWidget::resetActuators(GUIConfigDataUnion *configData)
|
||||
configData->fixedwing.FixedWingThrottle = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Virtual function to refresh the UI widget values
|
||||
*/
|
||||
void ConfigFixedWingWidget::refreshWidgetsValues(QString frameType)
|
||||
{
|
||||
Q_ASSERT(m_aircraft);
|
||||
|
||||
setupUI(frameType);
|
||||
|
||||
UAVDataObject *mixer = dynamic_cast<UAVDataObject *>(getObjectManager()->getObject(QString("MixerSettings")));
|
||||
Q_ASSERT(mixer);
|
||||
|
||||
QList<double> curveValues;
|
||||
getThrottleCurve(mixer, VehicleConfig::MIXER_THROTTLECURVE1, &curveValues);
|
||||
|
||||
// is at least one of the curve values != 0?
|
||||
if (isValidThrottleCurve(&curveValues)) {
|
||||
// yes, use the curve we just read from mixersettings
|
||||
m_aircraft->fixedWingThrottle->initCurve(&curveValues);
|
||||
}
|
||||
else {
|
||||
// no, init a straight curve
|
||||
m_aircraft->fixedWingThrottle->initLinearCurve(curveValues.count(), 1.0);
|
||||
}
|
||||
|
||||
GUIConfigDataUnion config = GetConfigData();
|
||||
fixedGUISettingsStruct fixed = config.fixedwing;
|
||||
|
||||
// Then retrieve how channels are setup
|
||||
setComboCurrentIndex(m_aircraft->fwEngineChannelBox, fixed.FixedWingThrottle);
|
||||
setComboCurrentIndex(m_aircraft->fwAileron1ChannelBox, fixed.FixedWingRoll1);
|
||||
setComboCurrentIndex(m_aircraft->fwAileron2ChannelBox, fixed.FixedWingRoll2);
|
||||
setComboCurrentIndex(m_aircraft->fwElevator1ChannelBox, fixed.FixedWingPitch1);
|
||||
setComboCurrentIndex(m_aircraft->fwElevator2ChannelBox, fixed.FixedWingPitch2);
|
||||
setComboCurrentIndex(m_aircraft->fwRudder1ChannelBox, fixed.FixedWingYaw1);
|
||||
setComboCurrentIndex(m_aircraft->fwRudder2ChannelBox, fixed.FixedWingYaw2);
|
||||
|
||||
if (frameType == "FixedWingElevon") {
|
||||
// If the airframe is elevon, restore the slider setting
|
||||
// Find the channel number for Elevon1 (FixedWingRoll1)
|
||||
int channel = m_aircraft->fwAileron1ChannelBox->currentIndex() - 1;
|
||||
if (channel > -1) {
|
||||
// If for some reason the actuators were incoherent, we might fail here, hence the check.
|
||||
m_aircraft->elevonSlider1->setValue(
|
||||
getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL) * 100);
|
||||
m_aircraft->elevonSlider2->setValue(
|
||||
getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH) * 100);
|
||||
}
|
||||
}
|
||||
else if (frameType == "FixedWingVtail") {
|
||||
int channel = m_aircraft->fwElevator1ChannelBox->currentIndex() - 1;
|
||||
if (channel > -1) {
|
||||
// If for some reason the actuators were incoherent, we might fail here, hence the check.
|
||||
m_aircraft->elevonSlider1->setValue(
|
||||
getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW) * 100);
|
||||
m_aircraft->elevonSlider2->setValue(
|
||||
getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH) * 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Virtual function to update the UI widget objects
|
||||
*/
|
||||
@ -209,81 +267,6 @@ QString ConfigFixedWingWidget::updateConfigObjectsFromWidgets()
|
||||
return airframeType;
|
||||
}
|
||||
|
||||
/**
|
||||
Virtual function to refresh the UI widget values
|
||||
*/
|
||||
void ConfigFixedWingWidget::refreshWidgetsValues(QString frameType)
|
||||
{
|
||||
Q_ASSERT(m_aircraft);
|
||||
|
||||
setupUI(frameType);
|
||||
|
||||
UAVDataObject *mixer = dynamic_cast<UAVDataObject *>(getObjectManager()->getObject(QString("MixerSettings")));
|
||||
Q_ASSERT(mixer);
|
||||
|
||||
QList<double> curveValues;
|
||||
getThrottleCurve(mixer, VehicleConfig::MIXER_THROTTLECURVE1, &curveValues);
|
||||
|
||||
// is at least one of the curve values != 0?
|
||||
if (isValidThrottleCurve(&curveValues)) {
|
||||
// yes, use the curve we just read from mixersettings
|
||||
m_aircraft->fixedWingThrottle->initCurve(&curveValues);
|
||||
}
|
||||
else {
|
||||
// no, init a straight curve
|
||||
m_aircraft->fixedWingThrottle->initLinearCurve(curveValues.count(), 1.0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GUIConfigDataUnion config = GetConfigData();
|
||||
fixedGUISettingsStruct fixed = config.fixedwing;
|
||||
|
||||
// Then retrieve how channels are setup
|
||||
setComboCurrentIndex(m_aircraft->fwEngineChannelBox, fixed.FixedWingThrottle);
|
||||
setComboCurrentIndex(m_aircraft->fwAileron1ChannelBox, fixed.FixedWingRoll1);
|
||||
setComboCurrentIndex(m_aircraft->fwAileron2ChannelBox, fixed.FixedWingRoll2);
|
||||
setComboCurrentIndex(m_aircraft->fwElevator1ChannelBox, fixed.FixedWingPitch1);
|
||||
setComboCurrentIndex(m_aircraft->fwElevator2ChannelBox, fixed.FixedWingPitch2);
|
||||
setComboCurrentIndex(m_aircraft->fwRudder1ChannelBox, fixed.FixedWingYaw1);
|
||||
setComboCurrentIndex(m_aircraft->fwRudder2ChannelBox, fixed.FixedWingYaw2);
|
||||
|
||||
//UAVDataObject* mixer= dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("MixerSettings")));
|
||||
//Q_ASSERT(mixer);
|
||||
|
||||
int channel;
|
||||
if (frameType == "FixedWingElevon") {
|
||||
// If the airframe is elevon, restore the slider setting
|
||||
// Find the channel number for Elevon1 (FixedWingRoll1)
|
||||
channel = m_aircraft->fwAileron1ChannelBox->currentIndex() - 1;
|
||||
if (channel > -1) {
|
||||
// If for some reason the actuators were incoherent, we might fail here, hence the check.
|
||||
m_aircraft->elevonSlider1->setValue(
|
||||
getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL) * 100);
|
||||
m_aircraft->elevonSlider2->setValue(
|
||||
getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH) * 100);
|
||||
}
|
||||
}
|
||||
else if (frameType == "FixedWingVtail") {
|
||||
channel = m_aircraft->fwElevator1ChannelBox->currentIndex() - 1;
|
||||
if (channel > -1) {
|
||||
// If for some reason the actuators were incoherent, we might fail here, hence the check.
|
||||
m_aircraft->elevonSlider1->setValue(
|
||||
getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW) * 100);
|
||||
m_aircraft->elevonSlider2->setValue(
|
||||
getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH) * 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Setup Elevator/Aileron/Rudder airframe.
|
||||
|
||||
@ -300,7 +283,6 @@ bool ConfigFixedWingWidget::setupFrameFixedWing(QString airframeType)
|
||||
}
|
||||
|
||||
// Now setup the channels:
|
||||
|
||||
GUIConfigDataUnion config = GetConfigData();
|
||||
resetActuators(&config);
|
||||
|
||||
@ -360,8 +342,6 @@ bool ConfigFixedWingWidget::setupFrameFixedWing(QString airframeType)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Setup Elevon
|
||||
*/
|
||||
@ -432,8 +412,6 @@ bool ConfigFixedWingWidget::setupFrameElevon(QString airframeType)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Setup VTail
|
||||
*/
|
||||
@ -467,8 +445,6 @@ bool ConfigFixedWingWidget::setupFrameVtail(QString airframeType)
|
||||
|
||||
// 1. Assign the servo/motor/none for each channel
|
||||
|
||||
double value;
|
||||
|
||||
// motor
|
||||
int channel = m_aircraft->fwEngineChannelBox->currentIndex()-1;
|
||||
setMixerType(mixer,channel,VehicleConfig::MIXERTYPE_MOTOR);
|
||||
@ -498,7 +474,7 @@ bool ConfigFixedWingWidget::setupFrameVtail(QString airframeType)
|
||||
channel = m_aircraft->fwElevator1ChannelBox->currentIndex()-1;
|
||||
if (channel > -1) {
|
||||
setMixerType(mixer,channel,VehicleConfig::MIXERTYPE_SERVO);
|
||||
value = (double)(m_aircraft->elevonSlider2->value()*1.27);
|
||||
double value = (double)(m_aircraft->elevonSlider2->value()*1.27);
|
||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH, value);
|
||||
value = (double)(m_aircraft->elevonSlider1->value()*1.27);
|
||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, value);
|
||||
@ -532,26 +508,24 @@ bool ConfigFixedWingWidget::throwConfigError(QString airframeType)
|
||||
if (m_aircraft->fwEngineChannelBox->currentText() == "None") {
|
||||
m_aircraft->fwEngineChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
error = true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
m_aircraft->fwEngineChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
}
|
||||
|
||||
if (m_aircraft->fwElevator1ChannelBox->currentText() == "None") {
|
||||
m_aircraft->fwElevator1ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
error = true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
m_aircraft->fwElevator1ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
}
|
||||
|
||||
if ((m_aircraft->fwAileron1ChannelBox->currentText() == "None") && (m_aircraft->fwRudder1ChannelBox->currentText() == "None")) {
|
||||
if ((m_aircraft->fwAileron1ChannelBox->currentText() == "None")
|
||||
&& (m_aircraft->fwRudder1ChannelBox->currentText() == "None")) {
|
||||
pixmap.fill(QColor("green"));
|
||||
m_aircraft->fwAileron1ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
m_aircraft->fwRudder1ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
error = true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
m_aircraft->fwAileron1ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
m_aircraft->fwRudder1ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
}
|
||||
@ -559,24 +533,21 @@ bool ConfigFixedWingWidget::throwConfigError(QString airframeType)
|
||||
if (m_aircraft->fwEngineChannelBox->currentText() == "None") {
|
||||
m_aircraft->fwEngineChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
error = true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
m_aircraft->fwEngineChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
}
|
||||
|
||||
if (m_aircraft->fwAileron1ChannelBox->currentText() == "None") {
|
||||
m_aircraft->fwAileron1ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
error = true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
m_aircraft->fwAileron1ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
}
|
||||
|
||||
if (m_aircraft->fwAileron2ChannelBox->currentText() == "None") {
|
||||
m_aircraft->fwAileron2ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
error = true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
m_aircraft->fwAileron2ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
}
|
||||
|
||||
@ -584,24 +555,21 @@ bool ConfigFixedWingWidget::throwConfigError(QString airframeType)
|
||||
if (m_aircraft->fwEngineChannelBox->currentText() == "None") {
|
||||
m_aircraft->fwEngineChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
error = true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
m_aircraft->fwEngineChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
}
|
||||
|
||||
if (m_aircraft->fwElevator1ChannelBox->currentText() == "None") {
|
||||
m_aircraft->fwElevator1ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
error = true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
m_aircraft->fwElevator1ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
}
|
||||
|
||||
if (m_aircraft->fwElevator2ChannelBox->currentText() == "None") {
|
||||
m_aircraft->fwElevator2ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
error = true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
m_aircraft->fwElevator2ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "configgroundvehiclewidget.h"
|
||||
//#include "configvehicletypewidget.h"
|
||||
#include "mixersettings.h"
|
||||
#include "systemsettings.h"
|
||||
#include "actuatorsettings.h"
|
||||
@ -38,14 +37,15 @@
|
||||
#include <QtGui/QVBoxLayout>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QBrush>
|
||||
#include <math.h>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
QStringList ConfigGroundVehicleWidget::getChannelDescriptions()
|
||||
{
|
||||
// init a channel_numelem list of channel desc defaults
|
||||
QStringList channelDesc;
|
||||
for (int i = 0; i < (int) (ConfigGroundVehicleWidget::CHANNEL_NUMELEM); i++) {
|
||||
for (int i = 0; i < (int) ConfigGroundVehicleWidget::CHANNEL_NUMELEM; i++) {
|
||||
channelDesc.append(QString("-"));
|
||||
}
|
||||
|
||||
@ -91,7 +91,6 @@ ConfigGroundVehicleWidget::~ConfigGroundVehicleWidget()
|
||||
|
||||
/**
|
||||
Virtual function to setup the UI
|
||||
TODO move to constructor or make private
|
||||
*/
|
||||
void ConfigGroundVehicleWidget::setupUI(QString frameType)
|
||||
{
|
||||
@ -99,7 +98,6 @@ void ConfigGroundVehicleWidget::setupUI(QString frameType)
|
||||
//STILL NEEDS WORK
|
||||
|
||||
// Setup the UI
|
||||
//setComboCurrentIndex(m_aircraft->aircraftType, m_aircraft->aircraftType->findText("Ground"));
|
||||
|
||||
m_aircraft->gvEngineChannelBox->setEnabled(false);
|
||||
m_aircraft->gvEngineLabel->setEnabled(false);
|
||||
@ -112,7 +110,8 @@ void ConfigGroundVehicleWidget::setupUI(QString frameType)
|
||||
|
||||
if (frameType == "GroundVehicleDifferential" || frameType == "Differential (tank)") {
|
||||
// Tank
|
||||
setComboCurrentIndex(m_aircraft->groundVehicleType, m_aircraft->groundVehicleType->findText("Differential (tank)"));
|
||||
setComboCurrentIndex(m_aircraft->groundVehicleType,
|
||||
m_aircraft->groundVehicleType->findText("Differential (tank)"));
|
||||
m_aircraft->gvMotor1ChannelBox->setEnabled(true);
|
||||
m_aircraft->gvMotor1Label->setEnabled(true);
|
||||
|
||||
@ -135,8 +134,7 @@ void ConfigGroundVehicleWidget::setupUI(QString frameType)
|
||||
m_aircraft->gvThrottleCurve1GroupBox->setTitle("Left throttle curve");
|
||||
m_aircraft->gvThrottleCurve2GroupBox->setTitle("Right throttle curve");
|
||||
|
||||
}
|
||||
else if (frameType == "GroundVehicleMotorcycle" || frameType == "Motorcycle") {
|
||||
} else if (frameType == "GroundVehicleMotorcycle" || frameType == "Motorcycle") {
|
||||
// Motorcycle
|
||||
setComboCurrentIndex(m_aircraft->groundVehicleType, m_aircraft->groundVehicleType->findText("Motorcycle"));
|
||||
m_aircraft->gvMotor1ChannelBox->setEnabled(false);
|
||||
@ -160,8 +158,7 @@ void ConfigGroundVehicleWidget::setupUI(QString frameType)
|
||||
|
||||
m_aircraft->gvThrottleCurve1GroupBox->setTitle("Front throttle curve");
|
||||
m_aircraft->gvThrottleCurve2GroupBox->setTitle("Rear throttle curve");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// Car
|
||||
setComboCurrentIndex(m_aircraft->groundVehicleType, m_aircraft->groundVehicleType->findText("Turnable (car)"));
|
||||
|
||||
@ -214,8 +211,7 @@ void ConfigGroundVehicleWidget::refreshWidgetsValues(QString frameType)
|
||||
if (isValidThrottleCurve(&curveValues)) {
|
||||
// yes, use the curve we just read from mixersettings
|
||||
m_aircraft->groundVehicleThrottle1->initCurve(&curveValues);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// no, init a straight curve
|
||||
m_aircraft->groundVehicleThrottle1->initLinearCurve(curveValues.count(), 1.0);
|
||||
}
|
||||
@ -225,23 +221,9 @@ void ConfigGroundVehicleWidget::refreshWidgetsValues(QString frameType)
|
||||
|
||||
if (isValidThrottleCurve(&curveValues)) {
|
||||
m_aircraft->groundVehicleThrottle2->initCurve(&curveValues);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
m_aircraft->groundVehicleThrottle2->initLinearCurve(curveValues.count(), 1.0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//UAVDataObject *obj;
|
||||
//UAVObjectField *field;
|
||||
|
||||
GUIConfigDataUnion config = GetConfigData();
|
||||
|
||||
// THIS SECTION STILL NEEDS WORK. FOR THE MOMENT, USE THE FIXED-WING ONBOARD SETTING IN ORDER TO MINIMIZE CHANCES OF BOLLOXING REAL CODE
|
||||
@ -266,8 +248,7 @@ void ConfigGroundVehicleWidget::refreshWidgetsValues(QString frameType)
|
||||
m_aircraft->differentialSteeringSlider2->setValue(
|
||||
getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH) * 100);
|
||||
}
|
||||
}
|
||||
else if (frameType == "GroundVehicleMotorcycle") {
|
||||
} else if (frameType == "GroundVehicleMotorcycle") {
|
||||
// CURRENTLY BROKEN UNTIL WE DECIDE HOW MOTORCYCLE SHOULD BEHAVE
|
||||
// obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("MixerSettings")));
|
||||
// Q_ASSERT(obj);
|
||||
@ -320,7 +301,8 @@ QString ConfigGroundVehicleWidget::updateConfigObjectsFromWidgets()
|
||||
|
||||
Returns False if impossible to create the mixer.
|
||||
*/
|
||||
bool ConfigGroundVehicleWidget::setupGroundVehicleMotorcycle(QString airframeType){
|
||||
bool ConfigGroundVehicleWidget::setupGroundVehicleMotorcycle(QString airframeType)
|
||||
{
|
||||
// Check coherence:
|
||||
// Show any config errors in GUI
|
||||
if (throwConfigError(airframeType)) {
|
||||
@ -368,7 +350,8 @@ bool ConfigGroundVehicleWidget::setupGroundVehicleMotorcycle(QString airframeTyp
|
||||
|
||||
Returns False if impossible to create the mixer.
|
||||
*/
|
||||
bool ConfigGroundVehicleWidget::setupGroundVehicleDifferential(QString airframeType){
|
||||
bool ConfigGroundVehicleWidget::setupGroundVehicleDifferential(QString airframeType)
|
||||
{
|
||||
// Check coherence:
|
||||
// Show any config errors in GUI
|
||||
|
||||
@ -465,14 +448,14 @@ bool ConfigGroundVehicleWidget::throwConfigError(QString airframeType)
|
||||
// Initialize configuration error flag
|
||||
bool error = false;
|
||||
|
||||
|
||||
// Create a red block. All combo boxes are the same size, so any one should do as a model
|
||||
int size = m_aircraft->gvEngineChannelBox->style()->pixelMetric(QStyle::PM_SmallIconSize);
|
||||
QPixmap pixmap(size, size);
|
||||
pixmap.fill(QColor("red"));
|
||||
|
||||
if (airframeType == "GroundVehicleCar") { //Car
|
||||
if(m_aircraft->gvMotor1ChannelBox->currentText() == "None" && m_aircraft->gvMotor2ChannelBox->currentText() == "None"){
|
||||
if (m_aircraft->gvMotor1ChannelBox->currentText() == "None"
|
||||
&& m_aircraft->gvMotor2ChannelBox->currentText() == "None") {
|
||||
pixmap.fill(QColor("green"));
|
||||
m_aircraft->gvMotor1ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
m_aircraft->gvMotor2ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
@ -480,44 +463,42 @@ bool ConfigGroundVehicleWidget::throwConfigError(QString airframeType)
|
||||
//m_aircraft->gvMotor2Label->setText("<font color='red'>" + m_aircraft->gvMotor2Label->text() + "</font>");
|
||||
error = true;
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
m_aircraft->gvMotor1ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
m_aircraft->gvMotor2ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
//QTextEdit* htmlText=new QTextEdit(m_aircraft->gvMotor1Label->text()); // HtmlText is any QString with html tags.
|
||||
//m_aircraft->gvMotor1Label->setText(htmlText->toPlainText());
|
||||
//delete htmlText;
|
||||
//
|
||||
|
||||
//htmlText=new QTextEdit(m_aircraft->gvMotor2Label->text()); // HtmlText is any QString with html tags.
|
||||
//m_aircraft->gvMotor2Label->setText(htmlText->toPlainText());
|
||||
}
|
||||
|
||||
if (m_aircraft->gvSteering1ChannelBox->currentText() == "None" && m_aircraft->gvSteering2ChannelBox->currentText() == "None") {
|
||||
if (m_aircraft->gvSteering1ChannelBox->currentText() == "None"
|
||||
&& m_aircraft->gvSteering2ChannelBox->currentText() == "None") {
|
||||
m_aircraft->gvSteering1ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
m_aircraft->gvSteering2ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
//m_aircraft->gvStatusLabel->setText("<font color='red'>ERROR: check steering channel assignment</font>");
|
||||
//m_aircraft->gvSteering1Label->setText("<font color='red'>" + m_aircraft->gvSteering1Label->text() + "</font>");
|
||||
//m_aircraft->gvSteering2Label->setText("<font color='red'>" + m_aircraft->gvSteering2Label->text() + "</font>");
|
||||
error = true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
m_aircraft->gvSteering1ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
m_aircraft->gvSteering2ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
//QTextEdit* htmlText=new QTextEdit(m_aircraft->gvSteering1Label->text()); // HtmlText is any QString with html tags.
|
||||
//m_aircraft->gvSteering1Label->setText(htmlText->toPlainText());
|
||||
//delete htmlText;
|
||||
//
|
||||
|
||||
//htmlText=new QTextEdit(m_aircraft->gvSteering2Label->text()); // HtmlText is any QString with html tags.
|
||||
//m_aircraft->gvSteering2Label->setText(htmlText->toPlainText());
|
||||
}
|
||||
|
||||
} else if (airframeType == "GroundVehicleDifferential") { //Tank
|
||||
if(m_aircraft->gvMotor1ChannelBox->currentText() == "None" || m_aircraft->gvMotor2ChannelBox->currentText() == "None"){
|
||||
if (m_aircraft->gvMotor1ChannelBox->currentText() == "None"
|
||||
|| m_aircraft->gvMotor2ChannelBox->currentText() == "None") {
|
||||
m_aircraft->gvMotor1ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
m_aircraft->gvMotor2ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
error = true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
m_aircraft->gvMotor1ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
m_aircraft->gvMotor2ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
}
|
||||
@ -526,19 +507,19 @@ bool ConfigGroundVehicleWidget::throwConfigError(QString airframeType)
|
||||
m_aircraft->gvSteering1ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
m_aircraft->gvSteering2ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
} else if (airframeType == "GroundVehicleMotorcycle") { //Motorcycle
|
||||
if(m_aircraft->gvMotor1ChannelBox->currentText() == "None" && m_aircraft->gvMotor2ChannelBox->currentText() == "None"){
|
||||
if (m_aircraft->gvMotor1ChannelBox->currentText() == "None"
|
||||
&& m_aircraft->gvMotor2ChannelBox->currentText() == "None") {
|
||||
m_aircraft->gvMotor2ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
error = true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
m_aircraft->gvMotor2ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
}
|
||||
|
||||
if (m_aircraft->gvSteering1ChannelBox->currentText() == "None" && m_aircraft->gvSteering2ChannelBox->currentText() == "None") {
|
||||
if (m_aircraft->gvSteering1ChannelBox->currentText() == "None"
|
||||
&& m_aircraft->gvSteering2ChannelBox->currentText() == "None") {
|
||||
m_aircraft->gvSteering1ChannelBox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
error = true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
m_aircraft->gvSteering1ChannelBox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
}
|
||||
|
||||
|
@ -43,12 +43,11 @@
|
||||
|
||||
const QString ConfigMultiRotorWidget::CHANNELBOXNAME = QString("multiMotorChannelBox");
|
||||
|
||||
|
||||
QStringList ConfigMultiRotorWidget::getChannelDescriptions()
|
||||
{
|
||||
// init a channel_numelem list of channel desc defaults
|
||||
QStringList channelDesc;
|
||||
for (int i = 0; i < (int) (ConfigMultiRotorWidget::CHANNEL_NUMELEM); i++) {
|
||||
for (int i = 0; i < (int) ConfigMultiRotorWidget::CHANNEL_NUMELEM; i++) {
|
||||
channelDesc.append(QString("-"));
|
||||
}
|
||||
|
||||
@ -86,7 +85,6 @@ QStringList ConfigMultiRotorWidget::getChannelDescriptions()
|
||||
return channelDesc;
|
||||
}
|
||||
|
||||
|
||||
ConfigMultiRotorWidget::ConfigMultiRotorWidget(QWidget *parent) :
|
||||
VehicleConfig(parent), m_aircraft(new Ui_MultiRotorConfigWidget()), invertMotors(1)
|
||||
{
|
||||
@ -107,14 +105,9 @@ ConfigMultiRotorWidget::ConfigMultiRotorWidget(QWidget *parent) :
|
||||
scene->setSceneRect(quad->boundingRect());
|
||||
m_aircraft->quadShape->setScene(scene);
|
||||
|
||||
//m_multirotor = new ConfigMultiRotorWidget(m_aircraft);
|
||||
//m_multirotor->quad = quad;
|
||||
//setupUI(m_aircraft->multirotorFrameType->currentText());
|
||||
|
||||
QStringList multiRotorTypes;
|
||||
multiRotorTypes << "Tricopter Y" << "Quad +" << "Quad X" <<
|
||||
"Hexacopter" << "Hexacopter X" << "Hexacopter Y6" <<
|
||||
"Octocopter" << "Octocopter V" << "Octo Coax +" << "Octo Coax X" ;
|
||||
multiRotorTypes << "Tricopter Y" << "Quad +" << "Quad X" << "Hexacopter" << "Hexacopter X" << "Hexacopter Y6"
|
||||
<< "Octocopter" << "Octocopter V" << "Octo Coax +" << "Octo Coax X";
|
||||
m_aircraft->multirotorFrameType->addItems(multiRotorTypes);
|
||||
|
||||
// Set default model to "Quad X"
|
||||
@ -140,9 +133,6 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
|
||||
qDebug() << "ConfigMultiRotorWidget::setupUI - frame type" << frameType;
|
||||
|
||||
// set aircraftType to Multirotor
|
||||
//setComboCurrentIndex(m_aircraft->aircraftType, m_aircraft->aircraftType->findText("Multirotor"));
|
||||
|
||||
// disable triyaw channel
|
||||
m_aircraft->triYawChannelBox->setEnabled(false);
|
||||
|
||||
@ -167,8 +157,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
setYawMixLevel(50);
|
||||
|
||||
m_aircraft->triYawChannelBox->setEnabled(true);
|
||||
}
|
||||
else if (frameType == "QuadX" || frameType == "Quad X") {
|
||||
} else if (frameType == "QuadX" || frameType == "Quad X") {
|
||||
setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Quad X"));
|
||||
|
||||
// Enable all necessary motor channel boxes...
|
||||
@ -178,8 +167,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
m_aircraft->mrRollMixLevel->setValue(50);
|
||||
m_aircraft->mrPitchMixLevel->setValue(50);
|
||||
setYawMixLevel(50);
|
||||
}
|
||||
else if (frameType == "QuadP" || frameType == "Quad +") {
|
||||
} else if (frameType == "QuadP" || frameType == "Quad +") {
|
||||
setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Quad +"));
|
||||
|
||||
// Enable all necessary motor channel boxes...
|
||||
@ -188,8 +176,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
m_aircraft->mrRollMixLevel->setValue(100);
|
||||
m_aircraft->mrPitchMixLevel->setValue(100);
|
||||
setYawMixLevel(50);
|
||||
}
|
||||
else if (frameType == "Hexa" || frameType == "Hexacopter") {
|
||||
} else if (frameType == "Hexa" || frameType == "Hexacopter") {
|
||||
setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Hexacopter"));
|
||||
|
||||
// Enable all necessary motor channel boxes...
|
||||
@ -198,8 +185,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
m_aircraft->mrRollMixLevel->setValue(50);
|
||||
m_aircraft->mrPitchMixLevel->setValue(33);
|
||||
setYawMixLevel(33);
|
||||
}
|
||||
else if (frameType == "HexaX" || frameType == "Hexacopter X" ) {
|
||||
} else if (frameType == "HexaX" || frameType == "Hexacopter X") {
|
||||
setComboCurrentIndex(m_aircraft->multirotorFrameType,
|
||||
m_aircraft->multirotorFrameType->findText("Hexacopter X"));
|
||||
|
||||
@ -209,8 +195,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
m_aircraft->mrRollMixLevel->setValue(33);
|
||||
m_aircraft->mrPitchMixLevel->setValue(50);
|
||||
setYawMixLevel(33);
|
||||
}
|
||||
else if (frameType == "HexaCoax" || frameType == "Hexacopter Y6") {
|
||||
} else if (frameType == "HexaCoax" || frameType == "Hexacopter Y6") {
|
||||
setComboCurrentIndex(m_aircraft->multirotorFrameType,
|
||||
m_aircraft->multirotorFrameType->findText("Hexacopter Y6"));
|
||||
|
||||
@ -220,8 +205,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
m_aircraft->mrRollMixLevel->setValue(100);
|
||||
m_aircraft->mrPitchMixLevel->setValue(50);
|
||||
setYawMixLevel(66);
|
||||
}
|
||||
else if (frameType == "Octo" || frameType == "Octocopter") {
|
||||
} else if (frameType == "Octo" || frameType == "Octocopter") {
|
||||
setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Octocopter"));
|
||||
|
||||
// Enable all necessary motor channel boxes
|
||||
@ -230,8 +214,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
m_aircraft->mrRollMixLevel->setValue(33);
|
||||
m_aircraft->mrPitchMixLevel->setValue(33);
|
||||
setYawMixLevel(25);
|
||||
}
|
||||
else if (frameType == "OctoV" || frameType == "Octocopter V") {
|
||||
} else if (frameType == "OctoV" || frameType == "Octocopter V") {
|
||||
setComboCurrentIndex(m_aircraft->multirotorFrameType,
|
||||
m_aircraft->multirotorFrameType->findText("Octocopter V"));
|
||||
|
||||
@ -241,8 +224,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
m_aircraft->mrRollMixLevel->setValue(25);
|
||||
m_aircraft->mrPitchMixLevel->setValue(25);
|
||||
setYawMixLevel(25);
|
||||
}
|
||||
else if (frameType == "OctoCoaxP" || frameType == "Octo Coax +") {
|
||||
} else if (frameType == "OctoCoaxP" || frameType == "Octo Coax +") {
|
||||
setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Octo Coax +"));
|
||||
|
||||
// Enable all necessary motor channel boxes
|
||||
@ -251,8 +233,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
m_aircraft->mrRollMixLevel->setValue(100);
|
||||
m_aircraft->mrPitchMixLevel->setValue(100);
|
||||
setYawMixLevel(50);
|
||||
}
|
||||
else if (frameType == "OctoCoaxX" || frameType == "Octo Coax X") {
|
||||
} else if (frameType == "OctoCoaxX" || frameType == "Octo Coax X") {
|
||||
setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Octo Coax X"));
|
||||
|
||||
// Enable all necessary motor channel boxes
|
||||
@ -262,7 +243,6 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
m_aircraft->mrPitchMixLevel->setValue(50);
|
||||
setYawMixLevel(50);
|
||||
}
|
||||
|
||||
// Draw the appropriate airframe
|
||||
//drawAirframe(frameType);
|
||||
}
|
||||
@ -299,26 +279,15 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
if (isValidThrottleCurve(&curveValues)) {
|
||||
// yes, use the curve we just read from mixersettings
|
||||
m_aircraft->multiThrottleCurve->initCurve(&curveValues);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// no, init a straight curve
|
||||
m_aircraft->multiThrottleCurve->initLinearCurve(curveValues.count(), 0.9);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int channel;
|
||||
double value;
|
||||
|
||||
GUIConfigDataUnion config = GetConfigData();
|
||||
multiGUISettingsStruct multi = config.multi;
|
||||
|
||||
// UAVDataObject* mixer = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("MixerSettings")));
|
||||
// Q_ASSERT(mixer);
|
||||
|
||||
if (frameType == "QuadP")
|
||||
{
|
||||
if (frameType == "QuadP") {
|
||||
// Motors 1/2/3/4 are: N / E / S / W
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorN);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorE);
|
||||
@ -326,13 +295,11 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorW);
|
||||
|
||||
// Now, read the 1st mixer R/P/Y levels and initialize the mix sliders.
|
||||
// This assumes that all vectors are identical - if not, the user should use the
|
||||
// "custom" setting.
|
||||
// This assumes that all vectors are identical - if not, the user should use the "custom" setting.
|
||||
|
||||
channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1)
|
||||
{
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1) {
|
||||
double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27));
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
@ -341,11 +308,8 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27));
|
||||
|
||||
}
|
||||
}
|
||||
else if (frameType == "QuadX")
|
||||
{
|
||||
} else if (frameType == "QuadX") {
|
||||
// Motors 1/2/3/4 are: NW / NE / SE / SW
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorNE);
|
||||
@ -355,10 +319,9 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
// Now, read the 1st mixer R/P/Y levels and initialize the mix sliders.
|
||||
// This assumes that all vectors are identical - if not, the user should use the
|
||||
// "custom" setting.
|
||||
channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1)
|
||||
{
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1) {
|
||||
double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27));
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
@ -366,14 +329,9 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
m_aircraft->mrRollMixLevel->setValue(qRound(value / 1.27));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (frameType == "Hexa")
|
||||
{
|
||||
} else if (frameType == "Hexa") {
|
||||
// Motors 1/2/3 4/5/6 are: N / NE / SE / S / SW / NW
|
||||
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorN);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorNE);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorSE);
|
||||
@ -385,10 +343,9 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
// This assumes that all vectors are identical - if not, the user should use the
|
||||
// "custom" setting.
|
||||
|
||||
channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1)
|
||||
{
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1) {
|
||||
double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27));
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
@ -398,15 +355,9 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (frameType == "HexaX")
|
||||
{
|
||||
} else if (frameType == "HexaX") {
|
||||
// Motors 1/2/3 4/5/6 are: NE / E / SE / SW / W / NW
|
||||
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNE);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorE);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorSE);
|
||||
@ -418,10 +369,9 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
// This assumes that all vectors are identical - if not, the user should use the
|
||||
// "custom" setting.
|
||||
|
||||
channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1)
|
||||
{
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1) {
|
||||
double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27));
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
@ -431,11 +381,8 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27));
|
||||
}
|
||||
}
|
||||
else if (frameType == "HexaCoax")
|
||||
{
|
||||
} else if (frameType == "HexaCoax") {
|
||||
// Motors 1/2/3 4/5/6 are: NW/W NE/E S/SE
|
||||
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorW);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorNE);
|
||||
@ -446,10 +393,9 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
// Now, read the 1st mixer R/P/Y levels and initialize the mix sliders.
|
||||
// This assumes that all vectors are identical - if not, the user should use the
|
||||
// "custom" setting.
|
||||
channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1)
|
||||
{
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1) {
|
||||
double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
m_aircraft->mrPitchMixLevel->setValue(qRound(2 * value / 1.27));
|
||||
|
||||
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
|
||||
@ -459,11 +405,8 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
m_aircraft->mrRollMixLevel->setValue(qRound(value / 1.27));
|
||||
}
|
||||
}
|
||||
else if (frameType == "Octo" || frameType == "OctoV" || frameType == "OctoCoaxP")
|
||||
{
|
||||
} else if (frameType == "Octo" || frameType == "OctoV" || frameType == "OctoCoaxP") {
|
||||
// Motors 1 to 8 are N / NE / E / etc
|
||||
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorN);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorNE);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorE);
|
||||
@ -476,11 +419,10 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
// Now, read the 1st mixer R/P/Y levels and initialize the mix sliders.
|
||||
// This assumes that all vectors are identical - if not, the user should use the
|
||||
// "custom" setting.
|
||||
channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1)
|
||||
{
|
||||
int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1) {
|
||||
if (frameType == "Octo") {
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27));
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
@ -490,9 +432,8 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27));
|
||||
}
|
||||
else if (frameType == "OctoV") {
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
} else if (frameType == "OctoV") {
|
||||
double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27));
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
@ -502,9 +443,8 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27));
|
||||
}
|
||||
else if (frameType == "OctoCoaxP") {
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
} else if (frameType == "OctoCoaxP") {
|
||||
double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27));
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
@ -515,13 +455,9 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (frameType == "OctoCoaxX")
|
||||
{
|
||||
} else if (frameType == "OctoCoaxX") {
|
||||
// Motors 1 to 8 are N / NE / E / etc
|
||||
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorN);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorNE);
|
||||
@ -534,10 +470,9 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
// Now, read the 1st mixer R/P/Y levels and initialize the mix sliders.
|
||||
// This assumes that all vectors are identical - if not, the user should use the
|
||||
// "custom" setting.
|
||||
channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1)
|
||||
{
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1) {
|
||||
double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27));
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
@ -546,21 +481,17 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
m_aircraft->mrRollMixLevel->setValue(qRound(value / 1.27));
|
||||
}
|
||||
}
|
||||
else if (frameType == "Tri")
|
||||
{
|
||||
} else if (frameType == "Tri") {
|
||||
// Motors 1 to 8 are N / NE / E / etc
|
||||
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorNE);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorS);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorS);
|
||||
setComboCurrentIndex(m_aircraft->triYawChannelBox, multi.TRIYaw);
|
||||
|
||||
channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1)
|
||||
{
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
|
||||
if (channel > -1) {
|
||||
double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
|
||||
m_aircraft->mrPitchMixLevel->setValue(qRound(2 * value / 1.27));
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
@ -577,15 +508,14 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
*/
|
||||
QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
|
||||
{
|
||||
QString airframeType;
|
||||
QList<QString> motorList;
|
||||
|
||||
UAVDataObject *mixer = dynamic_cast<UAVDataObject *>(getObjectManager()->getObject(QString("MixerSettings")));
|
||||
Q_ASSERT(mixer);
|
||||
|
||||
// Curve is also common to all quads:
|
||||
setThrottleCurve(mixer, VehicleConfig::MIXER_THROTTLECURVE1, m_aircraft->multiThrottleCurve->getCurve() );
|
||||
|
||||
QString airframeType;
|
||||
QList<QString> motorList;
|
||||
if (m_aircraft->multirotorFrameType->currentText() == "Quad +") {
|
||||
airframeType = "QuadP";
|
||||
setupQuad(true);
|
||||
@ -605,8 +535,7 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
|
||||
if (throwConfigError(6)) {
|
||||
return airframeType;
|
||||
}
|
||||
motorList << "VTOLMotorNW" << "VTOLMotorW" << "VTOLMotorNE" << "VTOLMotorE"
|
||||
<< "VTOLMotorS" << "VTOLMotorSE";
|
||||
motorList << "VTOLMotorNW" << "VTOLMotorW" << "VTOLMotorNE" << "VTOLMotorE" << "VTOLMotorS" << "VTOLMotorSE";
|
||||
setupMotors(motorList);
|
||||
|
||||
// Motor 1 to 6, Y6 Layout:
|
||||
@ -632,8 +561,8 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
|
||||
return airframeType;
|
||||
|
||||
}
|
||||
motorList << "VTOLMotorN" << "VTOLMotorNE" << "VTOLMotorE" << "VTOLMotorSE"
|
||||
<< "VTOLMotorS" << "VTOLMotorSW" << "VTOLMotorW" << "VTOLMotorNW";
|
||||
motorList << "VTOLMotorN" << "VTOLMotorNE" << "VTOLMotorE" << "VTOLMotorSE" << "VTOLMotorS" << "VTOLMotorSW"
|
||||
<< "VTOLMotorW" << "VTOLMotorNW";
|
||||
setupMotors(motorList);
|
||||
// Motor 1 to 8:
|
||||
// pitch roll yaw
|
||||
@ -657,8 +586,8 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
|
||||
if (throwConfigError(8)) {
|
||||
return airframeType;
|
||||
}
|
||||
motorList << "VTOLMotorN" << "VTOLMotorNE" << "VTOLMotorE" << "VTOLMotorSE"
|
||||
<< "VTOLMotorS" << "VTOLMotorSW" << "VTOLMotorW" << "VTOLMotorNW";
|
||||
motorList << "VTOLMotorN" << "VTOLMotorNE" << "VTOLMotorE" << "VTOLMotorSE" << "VTOLMotorS" << "VTOLMotorSW"
|
||||
<< "VTOLMotorW" << "VTOLMotorNW";
|
||||
setupMotors(motorList);
|
||||
// Motor 1 to 8:
|
||||
// IMPORTANT: Assumes evenly spaced engines
|
||||
@ -683,8 +612,8 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
|
||||
if (throwConfigError(8)) {
|
||||
return airframeType;
|
||||
}
|
||||
motorList << "VTOLMotorN" << "VTOLMotorNE" << "VTOLMotorE" << "VTOLMotorSE"
|
||||
<< "VTOLMotorS" << "VTOLMotorSW" << "VTOLMotorW" << "VTOLMotorNW";
|
||||
motorList << "VTOLMotorN" << "VTOLMotorNE" << "VTOLMotorE" << "VTOLMotorSE" << "VTOLMotorS" << "VTOLMotorSW"
|
||||
<< "VTOLMotorW" << "VTOLMotorNW";
|
||||
setupMotors(motorList);
|
||||
// Motor 1 to 8:
|
||||
// pitch roll yaw
|
||||
@ -708,8 +637,8 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
|
||||
if (throwConfigError(8)) {
|
||||
return airframeType;
|
||||
}
|
||||
motorList << "VTOLMotorNW" << "VTOLMotorN" << "VTOLMotorNE" << "VTOLMotorE"
|
||||
<< "VTOLMotorSE" << "VTOLMotorS" << "VTOLMotorSW" << "VTOLMotorW";
|
||||
motorList << "VTOLMotorNW" << "VTOLMotorN" << "VTOLMotorNE" << "VTOLMotorE" << "VTOLMotorSE" << "VTOLMotorS"
|
||||
<< "VTOLMotorSW" << "VTOLMotorW";
|
||||
setupMotors(motorList);
|
||||
// Motor 1 to 8:
|
||||
// pitch roll yaw
|
||||
@ -745,7 +674,6 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
|
||||
config.multi.TRIYaw = m_aircraft->triYawChannelBox->currentIndex();
|
||||
SetConfigData(config);
|
||||
|
||||
|
||||
// Motor 1 to 6, Y6 Layout:
|
||||
// pitch roll yaw
|
||||
double mixerMatrix[8][3] = {
|
||||
@ -848,48 +776,43 @@ void ConfigMultiRotorWidget::setupQuadMotor(int channel, double pitch, double ro
|
||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, yaw * 127);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Helper function: setup motors. Takes a list of channel names in input.
|
||||
*/
|
||||
void ConfigMultiRotorWidget::setupMotors(QList<QString> motorList)
|
||||
{
|
||||
QList<QComboBox*> mmList;
|
||||
mmList << m_aircraft->multiMotorChannelBox1 << m_aircraft->multiMotorChannelBox2 << m_aircraft->multiMotorChannelBox3
|
||||
<< m_aircraft->multiMotorChannelBox4 << m_aircraft->multiMotorChannelBox5 << m_aircraft->multiMotorChannelBox6
|
||||
mmList << m_aircraft->multiMotorChannelBox1 << m_aircraft->multiMotorChannelBox2
|
||||
<< m_aircraft->multiMotorChannelBox3 << m_aircraft->multiMotorChannelBox4
|
||||
<< m_aircraft->multiMotorChannelBox5 << m_aircraft->multiMotorChannelBox6
|
||||
<< m_aircraft->multiMotorChannelBox7 << m_aircraft->multiMotorChannelBox8;
|
||||
|
||||
GUIConfigDataUnion configData = GetConfigData();
|
||||
resetActuators(&configData);
|
||||
|
||||
int index;
|
||||
foreach (QString motor, motorList) {
|
||||
|
||||
index = mmList.takeFirst()->currentIndex();
|
||||
|
||||
if (motor == QString("VTOLMotorN"))
|
||||
foreach (QString motor, motorList)
|
||||
{
|
||||
int index = mmList.takeFirst()->currentIndex();
|
||||
if (motor == QString("VTOLMotorN")) {
|
||||
configData.multi.VTOLMotorN = index;
|
||||
else if (motor == QString("VTOLMotorNE"))
|
||||
} else if (motor == QString("VTOLMotorNE")) {
|
||||
configData.multi.VTOLMotorNE = index;
|
||||
else if (motor == QString("VTOLMotorE"))
|
||||
} else if (motor == QString("VTOLMotorE")) {
|
||||
configData.multi.VTOLMotorE = index;
|
||||
else if (motor == QString("VTOLMotorSE"))
|
||||
} else if (motor == QString("VTOLMotorSE")) {
|
||||
configData.multi.VTOLMotorSE = index;
|
||||
else if (motor == QString( "VTOLMotorS"))
|
||||
} else if (motor == QString("VTOLMotorS")) {
|
||||
configData.multi.VTOLMotorS = index;
|
||||
else if (motor == QString( "VTOLMotorSW"))
|
||||
} else if (motor == QString("VTOLMotorSW")) {
|
||||
configData.multi.VTOLMotorSW = index;
|
||||
else if (motor == QString( "VTOLMotorW"))
|
||||
} else if (motor == QString("VTOLMotorW")) {
|
||||
configData.multi.VTOLMotorW = index;
|
||||
else if (motor == QString( "VTOLMotorNW"))
|
||||
} else if (motor == QString("VTOLMotorNW")) {
|
||||
configData.multi.VTOLMotorNW = index;
|
||||
}
|
||||
SetConfigData(configData);
|
||||
|
||||
}
|
||||
|
||||
|
||||
SetConfigData(configData);
|
||||
}
|
||||
|
||||
/**
|
||||
Set up a Quad-X or Quad-P mixer
|
||||
@ -903,14 +826,11 @@ bool ConfigMultiRotorWidget::setupQuad(bool pLayout)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
QList<QString> motorList;
|
||||
if (pLayout) {
|
||||
motorList << "VTOLMotorN" << "VTOLMotorE" << "VTOLMotorS"
|
||||
<< "VTOLMotorW";
|
||||
motorList << "VTOLMotorN" << "VTOLMotorE" << "VTOLMotorS" << "VTOLMotorW";
|
||||
} else {
|
||||
motorList << "VTOLMotorNW" << "VTOLMotorNE" << "VTOLMotorSE"
|
||||
<< "VTOLMotorSW";
|
||||
motorList << "VTOLMotorNW" << "VTOLMotorNE" << "VTOLMotorSE" << "VTOLMotorSW";
|
||||
}
|
||||
setupMotors(motorList);
|
||||
|
||||
@ -931,7 +851,7 @@ bool ConfigMultiRotorWidget::setupQuad(bool pLayout)
|
||||
{ 0, 0, 0},
|
||||
{ 0, 0, 0}
|
||||
};
|
||||
//
|
||||
|
||||
// Motor 1 to 4, P Layout:
|
||||
// pitch roll yaw
|
||||
// {1 ,0 ,-0.5 //Front motor (CW)
|
||||
@ -958,8 +878,6 @@ bool ConfigMultiRotorWidget::setupQuad(bool pLayout)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Set up a Hexa-X or Hexa-P mixer
|
||||
*/
|
||||
@ -967,16 +885,15 @@ bool ConfigMultiRotorWidget::setupHexa(bool pLayout)
|
||||
{
|
||||
// Check coherence:
|
||||
// Show any config errors in GUI
|
||||
if (throwConfigError(6))
|
||||
if (throwConfigError(6)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QList<QString> motorList;
|
||||
if (pLayout) {
|
||||
motorList << "VTOLMotorN" << "VTOLMotorNE" << "VTOLMotorSE"
|
||||
<< "VTOLMotorS" << "VTOLMotorSW" << "VTOLMotorNW";
|
||||
motorList << "VTOLMotorN" << "VTOLMotorNE" << "VTOLMotorSE" << "VTOLMotorS" << "VTOLMotorSW" << "VTOLMotorNW";
|
||||
} else {
|
||||
motorList << "VTOLMotorNE" << "VTOLMotorE" << "VTOLMotorSE"
|
||||
<< "VTOLMotorSW" << "VTOLMotorW" << "VTOLMotorNW";
|
||||
motorList << "VTOLMotorNE" << "VTOLMotorE" << "VTOLMotorSE" << "VTOLMotorSW" << "VTOLMotorW" << "VTOLMotorNW";
|
||||
}
|
||||
setupMotors(motorList);
|
||||
|
||||
@ -990,7 +907,6 @@ bool ConfigMultiRotorWidget::setupHexa(bool pLayout)
|
||||
// 4 {-0.3 , 0 , 0.3 // S CCW
|
||||
// 5 {-0.3 , 0.5 ,-0.3 // SW CW
|
||||
// 6 { 0.3 , 0.5 , 0.3 // NW CCW
|
||||
|
||||
double pMixer [8][3] = {
|
||||
{ 1, 0, -1},
|
||||
{ 1, -1, 1},
|
||||
@ -1002,7 +918,6 @@ bool ConfigMultiRotorWidget::setupHexa(bool pLayout)
|
||||
{ 0, 0, 0}
|
||||
};
|
||||
|
||||
//
|
||||
// Motor 1 to 6, X Layout:
|
||||
// 1 [ 0.5, -0.3, -0.3 ] NE
|
||||
// 2 [ 0 , -0.3, 0.3 ] E
|
||||
@ -1037,8 +952,9 @@ bool ConfigMultiRotorWidget::setupHexa(bool pLayout)
|
||||
bool ConfigMultiRotorWidget::setupMultiRotorMixer(double mixerFactors[8][3])
|
||||
{
|
||||
QList<QComboBox*> mmList;
|
||||
mmList << m_aircraft->multiMotorChannelBox1 << m_aircraft->multiMotorChannelBox2 << m_aircraft->multiMotorChannelBox3
|
||||
<< m_aircraft->multiMotorChannelBox4 << m_aircraft->multiMotorChannelBox5 << m_aircraft->multiMotorChannelBox6
|
||||
mmList << m_aircraft->multiMotorChannelBox1 << m_aircraft->multiMotorChannelBox2
|
||||
<< m_aircraft->multiMotorChannelBox3 << m_aircraft->multiMotorChannelBox4
|
||||
<< m_aircraft->multiMotorChannelBox5 << m_aircraft->multiMotorChannelBox6
|
||||
<< m_aircraft->multiMotorChannelBox7 << m_aircraft->multiMotorChannelBox8;
|
||||
|
||||
UAVDataObject* mixer = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("MixerSettings")));
|
||||
@ -1051,18 +967,16 @@ bool ConfigMultiRotorWidget::setupMultiRotorMixer(double mixerFactors[8][3])
|
||||
invertMotors = m_aircraft->MultirotorRevMixerCheckBox->isChecked() ? -1 : 1;
|
||||
double yFactor = invertMotors * (double) m_aircraft->mrYawMixLevel->value() / 100;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if(mmList.at(i)->isEnabled())
|
||||
{
|
||||
if (mmList.at(i)->isEnabled()) {
|
||||
int channel = mmList.at(i)->currentIndex() - 1;
|
||||
if (channel > -1)
|
||||
setupQuadMotor(channel, mixerFactors[i][0]*pFactor,
|
||||
rFactor*mixerFactors[i][1], yFactor*mixerFactors[i][2]);
|
||||
setupQuadMotor(channel, mixerFactors[i][0] * pFactor, rFactor * mixerFactors[i][1],
|
||||
yFactor * mixerFactors[i][2]);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
This function displays text and color formatting in order to help the user understand what channels have not yet been configured.
|
||||
*/
|
||||
@ -1082,16 +996,15 @@ bool ConfigMultiRotorWidget::throwConfigError(int numMotors)
|
||||
pixmap.fill(QColor("red"));
|
||||
combobox->setItemData(0, pixmap, Qt::DecorationRole); //Set color palettes
|
||||
error = true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
combobox->setItemData(0, 0, Qt::DecorationRole); //Reset color palettes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (error) {
|
||||
m_aircraft->mrStatusLabel->setText(QString("<font color='red'>ERROR: Assign all %1 motor channels</font>").arg(numMotors));
|
||||
m_aircraft->mrStatusLabel->setText(
|
||||
QString("<font color='red'>ERROR: Assign all %1 motor channels</font>").arg(numMotors));
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ VehicleConfig::VehicleConfig(QWidget *parent) : ConfigTaskWidget(parent)
|
||||
{
|
||||
// Generate lists of mixerTypeNames, mixerVectorNames, channelNames
|
||||
channelNames << "None";
|
||||
for (int i = 0; i < (int)(VehicleConfig::CHANNEL_NUMELEM); i++) {
|
||||
for (int i = 0; i < (int) VehicleConfig::CHANNEL_NUMELEM; i++) {
|
||||
mixerTypes << QString("Mixer%1Type").arg(i+1);
|
||||
mixerVectors << QString("Mixer%1Vector").arg(i+1);
|
||||
channelNames << QString("Channel%1").arg(i+1);
|
||||
@ -60,8 +60,8 @@ VehicleConfig::~VehicleConfig()
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
GUIConfigDataUnion VehicleConfig::GetConfigData() {
|
||||
|
||||
GUIConfigDataUnion VehicleConfig::GetConfigData()
|
||||
{
|
||||
int i;
|
||||
GUIConfigDataUnion configData;
|
||||
|
||||
@ -81,13 +81,10 @@ GUIConfigDataUnion VehicleConfig::GetConfigData() {
|
||||
return configData;
|
||||
}
|
||||
|
||||
void VehicleConfig::SetConfigData(GUIConfigDataUnion configData) {
|
||||
|
||||
int i;
|
||||
|
||||
void VehicleConfig::SetConfigData(GUIConfigDataUnion configData)
|
||||
{
|
||||
// sanity check
|
||||
Q_ASSERT(SystemSettings::GUICONFIGDATA_NUMELEM ==
|
||||
(sizeof(configData.UAVObject) / sizeof(configData.UAVObject[0])));
|
||||
Q_ASSERT(SystemSettings::GUICONFIGDATA_NUMELEM == (sizeof(configData.UAVObject) / sizeof(configData.UAVObject[0])));
|
||||
|
||||
// get an instance of systemsettings
|
||||
SystemSettings * systemSettings = SystemSettings::GetInstance(getUAVObjectManager());
|
||||
@ -96,14 +93,15 @@ void VehicleConfig::SetConfigData(GUIConfigDataUnion configData) {
|
||||
|
||||
UAVObjectField* guiConfig = systemSettings->getField("GUIConfigData");
|
||||
Q_ASSERT(guiConfig);
|
||||
if(!guiConfig)
|
||||
if (!guiConfig) {
|
||||
return;
|
||||
|
||||
// copy parameter configData -> systemsettings
|
||||
for (i = 0; i < (int)(SystemSettings::GUICONFIGDATA_NUMELEM); i++)
|
||||
guiConfig->setValue(configData.UAVObject[i], i);
|
||||
}
|
||||
|
||||
// copy parameter configData -> systemsettings
|
||||
for (int i = 0; i < (int) (SystemSettings::GUICONFIGDATA_NUMELEM); i++) {
|
||||
guiConfig->setValue(configData.UAVObject[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
void VehicleConfig::setupUI(QString frameType)
|
||||
{
|
||||
@ -154,15 +152,17 @@ QString VehicleConfig::getMixerType(UAVDataObject *mixer, int channel)
|
||||
{
|
||||
Q_ASSERT(mixer);
|
||||
|
||||
QString mixerType = mixerTypeDescriptions[0]; //default to disabled
|
||||
// default to disabled
|
||||
QString mixerType = mixerTypeDescriptions[0];
|
||||
|
||||
if (channel >= 0 && channel < mixerTypes.count()) {
|
||||
UAVObjectField *field = mixer->getField(mixerTypes.at(channel));
|
||||
Q_ASSERT(field);
|
||||
|
||||
if (field)
|
||||
if (field) {
|
||||
mixerType = field->getValue().toString();
|
||||
}
|
||||
}
|
||||
|
||||
return mixerType;
|
||||
}
|
||||
@ -176,8 +176,7 @@ void VehicleConfig::setMixerType(UAVDataObject* mixer, int channel, MixerTypeEle
|
||||
Q_ASSERT(field);
|
||||
|
||||
if (field) {
|
||||
if (mixerType >= 0 && mixerType < mixerTypeDescriptions.count())
|
||||
{
|
||||
if (mixerType >= 0 && mixerType < mixerTypeDescriptions.count()) {
|
||||
field->setValue(mixerTypeDescriptions[mixerType]);
|
||||
}
|
||||
}
|
||||
@ -212,9 +211,7 @@ void VehicleConfig::resetMotorAndServoMixers(UAVDataObject *mixer)
|
||||
double VehicleConfig::getMixerVectorValue(UAVDataObject *mixer, int channel, MixerVectorElem elementName)
|
||||
{
|
||||
Q_ASSERT(mixer);
|
||||
|
||||
double value = 0;
|
||||
|
||||
if (channel >= 0 && channel < mixerVectors.count()) {
|
||||
UAVObjectField *field = mixer->getField(mixerVectors.at(channel));
|
||||
Q_ASSERT(field);
|
||||
@ -322,6 +319,7 @@ bool VehicleConfig::isValidThrottleCurve(QList<double>* curve)
|
||||
|
||||
double VehicleConfig::getCurveMin(QList<double> *curve)
|
||||
{
|
||||
// TODO initialize to max double
|
||||
double min = 0;
|
||||
for (int i = 0; i < curve->count(); i++) {
|
||||
min = std::min(min, curve->at(i));
|
||||
@ -331,6 +329,7 @@ double VehicleConfig::getCurveMin(QList<double> *curve)
|
||||
|
||||
double VehicleConfig::getCurveMax(QList<double> *curve)
|
||||
{
|
||||
// TODO initialize to min double
|
||||
double max = 0;
|
||||
for (int i = 0; i < curve->count(); i++) {
|
||||
max = std::max(max, curve->at(i));
|
||||
@ -352,7 +351,8 @@ void VehicleConfig::resetField(UAVObjectField * field)
|
||||
* Util function to get a pointer to the object manager
|
||||
* @return pointer to the UAVObjectManager
|
||||
*/
|
||||
UAVObjectManager *VehicleConfig::getUAVObjectManager() {
|
||||
UAVObjectManager *VehicleConfig::getUAVObjectManager()
|
||||
{
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
UAVObjectManager *objMngr = pm->getObject<UAVObjectManager>();
|
||||
Q_ASSERT(objMngr);
|
||||
|
@ -206,35 +206,6 @@ ConfigVehicleTypeWidget::~ConfigVehicleTypeWidget()
|
||||
// m_aircraft->airframesWidget->setCurrentIndex(index);
|
||||
//}
|
||||
|
||||
/**
|
||||
\brief Sets up the mixer depending on Airframe type. Accepts either system settings or
|
||||
combo box entry from airframe type, as those do not overlap.
|
||||
*/
|
||||
//void ConfigVehicleTypeWidget::setupAirframeUI(QString frameType)
|
||||
//{
|
||||
// qDebug() << "ConfigVehicleTypeWidget::setupAirframeUI - begin";
|
||||
// qDebug() << "ConfigVehicleTypeWidget::setupAirframeUI - frame type" << frameType;
|
||||
//
|
||||
// bool dirty = isDirty();
|
||||
//
|
||||
// QString category = frameCategory2(frameType);
|
||||
// if (category == "FixedWing") {
|
||||
// m_fixedwing->setupUI(frameType);
|
||||
// } else if (category == "Multirotor") {
|
||||
// m_multirotor->setupUI(frameType);
|
||||
// } else if (category == "Helicopter") {
|
||||
// m_heli->setupUI(frameType);
|
||||
// } else if (category == "Ground") {
|
||||
// m_groundvehicle->setupUI(frameType);
|
||||
// } else if (category == "Custom") {
|
||||
// m_custom->setupUI(frameType);
|
||||
// }
|
||||
//
|
||||
// setDirty(dirty);
|
||||
//
|
||||
// qDebug() << "ConfigVehicleTypeWidget::setupAirframeUI - end";
|
||||
//}
|
||||
|
||||
/**
|
||||
Refreshes the current value of the SystemSettings which holds the aircraft type
|
||||
*/
|
||||
@ -462,7 +433,6 @@ void ConfigVehicleTypeWidget::enableFFTest()
|
||||
|
||||
Note: does NOT ask for an object refresh itself!
|
||||
*/
|
||||
// TODO rename to FF
|
||||
void ConfigVehicleTypeWidget::updateFeedForwardUI()
|
||||
{
|
||||
UAVDataObject* mixer = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("MixerSettings")));
|
||||
|
Loading…
x
Reference in New Issue
Block a user