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

OP-1134 Populate_new_custom_tab : Always update custom tab from airframe's mixer currently used

This commit is contained in:
Laurent Lalanne 2014-08-28 14:43:52 +02:00
parent eda53adf9e
commit c00aef04f8

View File

@ -198,12 +198,27 @@ void ConfigVehicleTypeWidget::refreshWidgetsValues(UAVObject *o)
// is not ideal, but there you go. // is not ideal, but there you go.
QString frameType = field->getValue().toString(); QString frameType = field->getValue().toString();
int category = frameCategory(frameType); // Always update custom tab from others airframe settings : debug/learn hardcoded mixers
int category = frameCategory("Custom");
m_aircraft->aircraftType->setCurrentIndex(category); m_aircraft->aircraftType->setCurrentIndex(category);
VehicleConfig *vehicleConfig = getVehicleConfigWidget(category); VehicleConfig *vehicleConfig = getVehicleConfigWidget(category);
if (vehicleConfig) { if (vehicleConfig) {
vehicleConfig->refreshWidgetsValues(frameType); vehicleConfig->refreshWidgetsValues("Custom");
}
// Switch to Airframe currently used
category = frameCategory(frameType);
if (frameType != "Custom") {
m_aircraft->aircraftType->setCurrentIndex(category);
VehicleConfig *vehicleConfig = getVehicleConfigWidget(category);
if (vehicleConfig) {
vehicleConfig->refreshWidgetsValues(frameType);
}
} }
updateFeedForwardUI(); updateFeedForwardUI();
@ -252,7 +267,8 @@ void ConfigVehicleTypeWidget::updateObjectsFromWidgets()
vconfig->setMixerValue(mixer, "DecelTime", m_aircraft->decelTime->value()); vconfig->setMixerValue(mixer, "DecelTime", m_aircraft->decelTime->value());
vconfig->setMixerValue(mixer, "MaxAccel", m_aircraft->maxAccelSlider->value()); vconfig->setMixerValue(mixer, "MaxAccel", m_aircraft->maxAccelSlider->value());
// TODO call refreshWidgetsValues() to reflect actual saved values ? // call refreshWidgetsValues() to reflect actual saved values ?
callrefreshWidgetsValues();
updateFeedForwardUI(); updateFeedForwardUI();
} }