File tree Expand file tree Collapse file tree
ground/gcs/src/plugins/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,16 +108,14 @@ void ConfigRevoHWWidget::refreshWidgetsValuesImpl(UAVObject *obj)
108108void ConfigRevoHWWidget::updateObjectsFromWidgetsImpl ()
109109{
110110 // If any port is configured to be GPS port, enable GPS module if it is not enabled.
111- // Otherwise disable GPS module.
112- quint8 enableModule = HwSettings::OPTIONALMODULES_DISABLED ;
111+ // GPS module will be already built in for Revo board, keep this check just in case .
112+ HwSettings *hwSettings = HwSettings::GetInstance ( getObjectManager ()) ;
113113
114- if (isComboboxOptionSelected (m_ui->cbFlexi , HwSettings::RM_FLEXIPORT_GPS)
115- || isComboboxOptionSelected (m_ui->cbMain , HwSettings::RM_MAINPORT_GPS)) {
116- enableModule = HwSettings::OPTIONALMODULES_ENABLED;
114+ if ((hwSettings->optionalModulesGPS () == HwSettings_OptionalModules::Disabled) &&
115+ (isComboboxOptionSelected (m_ui->cbFlexi , HwSettings::RM_FLEXIPORT_GPS) ||
116+ isComboboxOptionSelected (m_ui->cbMain , HwSettings::RM_MAINPORT_GPS))) {
117+ hwSettings->setOptionalModulesGPS (HwSettings_OptionalModules::Enabled);
117118 }
118-
119- HwSettings *hwSettings = HwSettings::GetInstance (getObjectManager ());
120- hwSettings->setOptionalModules (HwSettings::OPTIONALMODULES_GPS, enableModule);
121119}
122120
123121void ConfigRevoHWWidget::usbVCPPortChanged (int index)
Original file line number Diff line number Diff line change @@ -98,16 +98,14 @@ void ConfigRevoNanoHWWidget::refreshWidgetsValuesImpl(UAVObject *obj)
9898void ConfigRevoNanoHWWidget::updateObjectsFromWidgetsImpl ()
9999{
100100 // If any port is configured to be GPS port, enable GPS module if it is not enabled.
101- // Otherwise disable GPS module.
102- quint8 enableModule = HwSettings::OPTIONALMODULES_DISABLED ;
101+ // GPS module will be already built in for RevoNano board, keep this check just in case .
102+ HwSettings *hwSettings = HwSettings::GetInstance ( getObjectManager ()) ;
103103
104- if (isComboboxOptionSelected (m_ui->cbFlexi , HwSettings::RM_FLEXIPORT_GPS)
105- || isComboboxOptionSelected (m_ui->cbMain , HwSettings::RM_MAINPORT_GPS)) {
106- enableModule = HwSettings::OPTIONALMODULES_ENABLED;
104+ if ((hwSettings->optionalModulesGPS () == HwSettings_OptionalModules::Disabled) &&
105+ (isComboboxOptionSelected (m_ui->cbFlexi , HwSettings::RM_FLEXIPORT_GPS) ||
106+ isComboboxOptionSelected (m_ui->cbMain , HwSettings::RM_MAINPORT_GPS))) {
107+ hwSettings->setOptionalModulesGPS (HwSettings_OptionalModules::Enabled);
107108 }
108-
109- HwSettings *hwSettings = HwSettings::GetInstance (getObjectManager ());
110- hwSettings->setOptionalModules (HwSettings::OPTIONALMODULES_GPS, enableModule);
111109}
112110
113111void ConfigRevoNanoHWWidget::usbVCPPortChanged (int index)
Original file line number Diff line number Diff line change @@ -103,16 +103,14 @@ void ConfigSparky2HWWidget::refreshWidgetsValuesImpl(UAVObject *obj)
103103void ConfigSparky2HWWidget::updateObjectsFromWidgetsImpl ()
104104{
105105 // If any port is configured to be GPS port, enable GPS module if it is not enabled.
106- // Otherwise disable GPS module .
107- quint8 enableModule = HwSettings::OPTIONALMODULES_DISABLED ;
106+ // GPS will be already built in for Sparky2 board, keep this check just in case .
107+ HwSettings *hwSettings = HwSettings::GetInstance ( getObjectManager ()) ;
108108
109- if (isComboboxOptionSelected (m_ui->cbFlexi , HwSettings::SPK2_FLEXIPORT_GPS)
110- || isComboboxOptionSelected (m_ui->cbMain , HwSettings::SPK2_MAINPORT_GPS)) {
111- enableModule = HwSettings::OPTIONALMODULES_ENABLED;
109+ if ((hwSettings->optionalModulesGPS () == HwSettings_OptionalModules::Disabled) &&
110+ (isComboboxOptionSelected (m_ui->cbFlexi , HwSettings::RM_FLEXIPORT_GPS) ||
111+ isComboboxOptionSelected (m_ui->cbMain , HwSettings::RM_MAINPORT_GPS))) {
112+ hwSettings->setOptionalModulesGPS (HwSettings_OptionalModules::Enabled);
112113 }
113-
114- HwSettings *hwSettings = HwSettings::GetInstance (getObjectManager ());
115- hwSettings->setOptionalModules (HwSettings::OPTIONALMODULES_GPS, enableModule);
116114}
117115
118116void ConfigSparky2HWWidget::usbVCPPortChanged (int index)
You can’t perform that action at this time.
0 commit comments