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

Merged in f5soh/librepilot/LP-577_HW_Settings_GPS_reboot (pull request #494)

LP-577 Ignore disabling GPS module for boards where the module is already built in.

Approved-by: Philippe Renon <philippe_renon@yahoo.fr>
This commit is contained in:
Lalanne Laurent 2018-04-29 17:29:08 +00:00 committed by Philippe Renon
commit cd94147a5a
3 changed files with 21 additions and 27 deletions

View File

@ -108,16 +108,14 @@ void ConfigRevoHWWidget::refreshWidgetsValuesImpl(UAVObject *obj)
void ConfigRevoHWWidget::updateObjectsFromWidgetsImpl()
{
// If any port is configured to be GPS port, enable GPS module if it is not enabled.
// Otherwise disable GPS module.
quint8 enableModule = HwSettings::OPTIONALMODULES_DISABLED;
if (isComboboxOptionSelected(m_ui->cbFlexi, HwSettings::RM_FLEXIPORT_GPS)
|| isComboboxOptionSelected(m_ui->cbMain, HwSettings::RM_MAINPORT_GPS)) {
enableModule = HwSettings::OPTIONALMODULES_ENABLED;
}
// GPS module will be already built in for Revo board, keep this check just in case.
HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager());
hwSettings->setOptionalModules(HwSettings::OPTIONALMODULES_GPS, enableModule);
if ((hwSettings->optionalModulesGPS() == HwSettings_OptionalModules::Disabled) &&
(isComboboxOptionSelected(m_ui->cbFlexi, HwSettings::RM_FLEXIPORT_GPS) ||
isComboboxOptionSelected(m_ui->cbMain, HwSettings::RM_MAINPORT_GPS))) {
hwSettings->setOptionalModulesGPS(HwSettings_OptionalModules::Enabled);
}
}
void ConfigRevoHWWidget::usbVCPPortChanged(int index)

View File

@ -98,16 +98,14 @@ void ConfigRevoNanoHWWidget::refreshWidgetsValuesImpl(UAVObject *obj)
void ConfigRevoNanoHWWidget::updateObjectsFromWidgetsImpl()
{
// If any port is configured to be GPS port, enable GPS module if it is not enabled.
// Otherwise disable GPS module.
quint8 enableModule = HwSettings::OPTIONALMODULES_DISABLED;
if (isComboboxOptionSelected(m_ui->cbFlexi, HwSettings::RM_FLEXIPORT_GPS)
|| isComboboxOptionSelected(m_ui->cbMain, HwSettings::RM_MAINPORT_GPS)) {
enableModule = HwSettings::OPTIONALMODULES_ENABLED;
}
// GPS module will be already built in for RevoNano board, keep this check just in case.
HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager());
hwSettings->setOptionalModules(HwSettings::OPTIONALMODULES_GPS, enableModule);
if ((hwSettings->optionalModulesGPS() == HwSettings_OptionalModules::Disabled) &&
(isComboboxOptionSelected(m_ui->cbFlexi, HwSettings::RM_FLEXIPORT_GPS) ||
isComboboxOptionSelected(m_ui->cbMain, HwSettings::RM_MAINPORT_GPS))) {
hwSettings->setOptionalModulesGPS(HwSettings_OptionalModules::Enabled);
}
}
void ConfigRevoNanoHWWidget::usbVCPPortChanged(int index)

View File

@ -103,16 +103,14 @@ void ConfigSparky2HWWidget::refreshWidgetsValuesImpl(UAVObject *obj)
void ConfigSparky2HWWidget::updateObjectsFromWidgetsImpl()
{
// If any port is configured to be GPS port, enable GPS module if it is not enabled.
// Otherwise disable GPS module.
quint8 enableModule = HwSettings::OPTIONALMODULES_DISABLED;
if (isComboboxOptionSelected(m_ui->cbFlexi, HwSettings::SPK2_FLEXIPORT_GPS)
|| isComboboxOptionSelected(m_ui->cbMain, HwSettings::SPK2_MAINPORT_GPS)) {
enableModule = HwSettings::OPTIONALMODULES_ENABLED;
}
// GPS will be already built in for Sparky2 board, keep this check just in case.
HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager());
hwSettings->setOptionalModules(HwSettings::OPTIONALMODULES_GPS, enableModule);
if ((hwSettings->optionalModulesGPS() == HwSettings_OptionalModules::Disabled) &&
(isComboboxOptionSelected(m_ui->cbFlexi, HwSettings::RM_FLEXIPORT_GPS) ||
isComboboxOptionSelected(m_ui->cbMain, HwSettings::RM_MAINPORT_GPS))) {
hwSettings->setOptionalModulesGPS(HwSettings_OptionalModules::Enabled);
}
}
void ConfigSparky2HWWidget::usbVCPPortChanged(int index)