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

OP-532 Now saving channels to GUI config data structure

This commit is contained in:
Andrew Thoms 2011-06-16 00:33:07 -04:00
parent 5c5a07b101
commit 08822807b3
3 changed files with 21 additions and 4 deletions

View File

@ -75,7 +75,7 @@
</size>
</property>
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="BasicTab">
<attribute name="title">

View File

@ -734,6 +734,7 @@ void ConfigccpmWidget::ccpmSwashplateRedraw()
void ConfigccpmWidget::ccpmSwashplateUpdate()
{
ccpmSwashplateRedraw();
SetUIComponentVisibilities();
UpdateMixer();
}
@ -926,6 +927,11 @@ void ConfigccpmWidget::UpdatCCPMOptionsFromUI()
GUIConfigData.heli.SliderValue2 = m_ccpm->ccpmRollScale->value();
//GUIConfigData.heli.RevoSlider = m_ccpm->ccpmREVOScale->value();
//servo assignments
GUIConfigData.heli.ServoIndexW = m_ccpm->ccpmServoWChannel->currentIndex();
GUIConfigData.heli.ServoIndexX = m_ccpm->ccpmServoXChannel->currentIndex();
GUIConfigData.heli.ServoIndexY = m_ccpm->ccpmServoYChannel->currentIndex();
GUIConfigData.heli.ServoIndexZ = m_ccpm->ccpmServoZChannel->currentIndex();
}
void ConfigccpmWidget::UpdatCCPMUIFromOptions()
@ -957,6 +963,13 @@ void ConfigccpmWidget::UpdatCCPMUIFromOptions()
m_ccpm->ccpmCollectiveSlider->setValue(GUIConfigData.heli.SliderValue0);
m_ccpm->ccpmCollectivespinBox->setValue(GUIConfigData.heli.SliderValue0);
//m_ccpm->ccpmREVOScale->setValue(GUIConfigData.heli.RevoSlider);
//servo assignments
m_ccpm->ccpmServoWChannel->setCurrentIndex(GUIConfigData.heli.ServoIndexW);
m_ccpm->ccpmServoXChannel->setCurrentIndex(GUIConfigData.heli.ServoIndexX);
m_ccpm->ccpmServoYChannel->setCurrentIndex(GUIConfigData.heli.ServoIndexY);
m_ccpm->ccpmServoZChannel->setCurrentIndex(GUIConfigData.heli.ServoIndexZ);
}

View File

@ -60,13 +60,17 @@ typedef struct {
uint SliderValue0:7;
uint SliderValue1:7;
uint SliderValue2:7;//41bits
uint padding:23;
uint ServoIndexW:4;
uint ServoIndexX:4;
uint ServoIndexY:4;
uint ServoIndexZ:4;//57bits
uint padding:7;
} __attribute__((packed)) heliGUISettingsStruct;
typedef union
{
uint UAVObject[2];
heliGUISettingsStruct heli;
uint UAVObject[2];//32bits * 2
heliGUISettingsStruct heli;//64bits
} GUIConfigDataUnion;
class ConfigccpmWidget: public ConfigTaskWidget