1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-31 16:52:10 +01:00

LP-72 Properly enable AltitudeHold tab for Sparky2 board

This commit is contained in:
Vladimir Zidar 2016-05-21 10:01:05 +02:00 committed by Laurent Lalanne
parent 2fbf3eec8a
commit a84ea1b73e

View File

@ -656,8 +656,8 @@ void ConfigStabilizationWidget::onBoardConnected()
Q_ASSERT(utilMngr);
boardModel = utilMngr->getBoardModel();
// If Revolution board enable Althold tab, otherwise disable it
ui->AltitudeHold->setEnabled((boardModel & 0xff00) == 0x0900);
// If Revolution/Sparky2 board enable Althold tab, otherwise disable it
ui->AltitudeHold->setEnabled(((boardModel & 0xff00) == 0x0900) || ((boardModel & 0xff00) == 0x0B00));
}
void ConfigStabilizationWidget::stabBankChanged(int index)
@ -688,8 +688,8 @@ void ConfigStabilizationWidget::stabBankChanged(int index)
bool ConfigStabilizationWidget::shouldObjectBeSaved(UAVObject *object)
{
// AltitudeHoldSettings should only be saved for Revolution board to avoid error.
if ((boardModel & 0xff00) != 0x0900) {
// AltitudeHoldSettings should only be saved for Revolution/Sparky2 board to avoid error.
if (((boardModel & 0xff00) != 0x0900) && ((boardModel & 0xff00) != 0x0B00)) {
return dynamic_cast<AltitudeHoldSettings *>(object) == 0;
} else {
return true;