diff --git a/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp b/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp index d9eb5c465..fd182b031 100644 --- a/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp @@ -264,7 +264,7 @@ void ConfigccpmWidget::UpdateType() QString TypeText; double AdjustmentAngle=0; - UpdatCCPMUIOptions(); + UpdatCCPMOptionsFromUI(); SetUIComponentVisibilities(); TypeInt = m_ccpm->ccpmType->count() - m_ccpm->ccpmType->currentIndex()-1; @@ -846,7 +846,7 @@ void ConfigccpmWidget::UpdateMixer() /* Get the state of the UI check boxes and change the visibility of sliders */ -void ConfigccpmWidget::UpdatCCPMUIOptions() +void ConfigccpmWidget::UpdatCCPMOptionsFromUI() { if (updatingFromHardware) return; //get the user options @@ -861,10 +861,14 @@ void ConfigccpmWidget::UpdatCCPMUIOptions() } +void ConfigccpmWidget::UpdatCCPMUIFromOptions() +{ +} + void ConfigccpmWidget::SetUIComponentVisibilities() { - UpdatCCPMUIOptions(); + UpdatCCPMOptionsFromUI(); //set which sliders are user... m_ccpm->ccpmRevoMixingBox->setVisible(0); @@ -915,6 +919,13 @@ void ConfigccpmWidget::requestccpmUpdate() int i,j; UAVObjectField *field; UAVDataObject* obj; + + obj = dynamic_cast(getObjectManager()->getObject(QString("SystemSettings"))); + field = obj->getField(QString("GUIConfigData")); + GUIConfigData.UAVObject=field->getValue().toUInt(); + + + obj = dynamic_cast(objManager->getObject(QString("MixerSettings"))); Q_ASSERT(obj); @@ -1180,9 +1191,16 @@ void ConfigccpmWidget::sendccpmUpdate() if (SwashLvlConfigurationInProgress)return; ShowDisclaimer(1); + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager *objManager = pm->getObject(); + obj = dynamic_cast(getObjectManager()->getObject(QString("SystemSettings"))); + field = obj->getField(QString("GUIConfigData")); + field->setValue(GUIConfigData.UAVObject); + obj->updated(); + + obj = dynamic_cast(objManager->getObject(QString("MixerSettings"))); Q_ASSERT(obj); diff --git a/ground/openpilotgcs/src/plugins/config/configccpmwidget.h b/ground/openpilotgcs/src/plugins/config/configccpmwidget.h index 8140f175d..ca53695f5 100644 --- a/ground/openpilotgcs/src/plugins/config/configccpmwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configccpmwidget.h @@ -59,12 +59,12 @@ typedef struct { uint CollectiveChannel:3; uint padding:12; uint padding2:32; -} __attribute__((packed)) ccpmGUISettingsStruct; +} __attribute__((packed)) heliGUISettingsStruct; typedef union { uint UAVObject; - ccpmGUISettingsStruct heli; + heliGUISettingsStruct heli; } GUIConfigDataUnion; class ConfigccpmWidget: public ConfigTaskWidget @@ -125,7 +125,9 @@ private: void SwashLvlCancelButtonPressed(); void SwashLvlFinishButtonPressed(); - void UpdatCCPMUIOptions(); + void UpdatCCPMOptionsFromUI(); + void UpdatCCPMUIFromOptions(); + void SetUIComponentVisibilities(); void enableSwashplateLevellingControl(bool state);