[Companion] Radio module setup: Fix custom failsafe no-pulse and hold options not being saved properly (closes #4904).

This commit is contained in:
Max Paperno
2017-05-08 08:29:11 -04:00
parent 11579d9118
commit ca25696d1a
+3 -3
View File
@@ -764,16 +764,16 @@ void ModulePanel::updateFailsafe(int channel)
const int failsafeValue = module.failsafeChannels[channel];
const ChannelFailsafeWidgetsGroup & grp = failsafeGroupsMap.value(channel);
const bool valDisable = (failsafeValue == FAILSAFE_CHANNEL_HOLD || failsafeValue == FAILSAFE_CHANNEL_NOPULSE);
const int cbIdx = (failsafeValue == FAILSAFE_CHANNEL_HOLD ? 1 : failsafeValue == FAILSAFE_CHANNEL_NOPULSE ? 2 : 0);
if (grp.combo)
grp.combo->setCurrentIndex(cbIdx);
grp.combo->setCurrentIndex(grp.combo->findData(valDisable ? failsafeValue : 0));
if (grp.sbPercent)
grp.sbPercent->setDisabled(valDisable);
if (grp.sbUsec)
grp.sbUsec->setDisabled(valDisable);
setChannelFailsafeValue(channel, (valDisable ? 0 : failsafeValue), (FAILSAFE_DISPLAY_PERCENT | FAILSAFE_DISPLAY_USEC));
if (!valDisable)
setChannelFailsafeValue(channel, failsafeValue, (FAILSAFE_DISPLAY_PERCENT | FAILSAFE_DISPLAY_USEC));
}
/******************************************************************************/