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:
parent
2fbf3eec8a
commit
a84ea1b73e
@ -656,8 +656,8 @@ void ConfigStabilizationWidget::onBoardConnected()
|
|||||||
|
|
||||||
Q_ASSERT(utilMngr);
|
Q_ASSERT(utilMngr);
|
||||||
boardModel = utilMngr->getBoardModel();
|
boardModel = utilMngr->getBoardModel();
|
||||||
// If Revolution board enable Althold tab, otherwise disable it
|
// If Revolution/Sparky2 board enable Althold tab, otherwise disable it
|
||||||
ui->AltitudeHold->setEnabled((boardModel & 0xff00) == 0x0900);
|
ui->AltitudeHold->setEnabled(((boardModel & 0xff00) == 0x0900) || ((boardModel & 0xff00) == 0x0B00));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigStabilizationWidget::stabBankChanged(int index)
|
void ConfigStabilizationWidget::stabBankChanged(int index)
|
||||||
@ -688,8 +688,8 @@ void ConfigStabilizationWidget::stabBankChanged(int index)
|
|||||||
|
|
||||||
bool ConfigStabilizationWidget::shouldObjectBeSaved(UAVObject *object)
|
bool ConfigStabilizationWidget::shouldObjectBeSaved(UAVObject *object)
|
||||||
{
|
{
|
||||||
// AltitudeHoldSettings should only be saved for Revolution board to avoid error.
|
// AltitudeHoldSettings should only be saved for Revolution/Sparky2 board to avoid error.
|
||||||
if ((boardModel & 0xff00) != 0x0900) {
|
if (((boardModel & 0xff00) != 0x0900) && ((boardModel & 0xff00) != 0x0B00)) {
|
||||||
return dynamic_cast<AltitudeHoldSettings *>(object) == 0;
|
return dynamic_cast<AltitudeHoldSettings *>(object) == 0;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user