mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
OP-1301 allow GPS protocol selection only if GPS module is enabled.
This allow to be able to save HW settings with GPS module disabled.
This commit is contained in:
parent
d9b25db36d
commit
7be6c16a40
@ -26,7 +26,6 @@
|
|||||||
*/
|
*/
|
||||||
#include "config_cc_hw_widget.h"
|
#include "config_cc_hw_widget.h"
|
||||||
#include "hwsettings.h"
|
#include "hwsettings.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
@ -83,7 +82,16 @@ ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent)
|
|||||||
addWidgetBinding("HwSettings", "TelemetrySpeed", m_telemetry->telemetrySpeed);
|
addWidgetBinding("HwSettings", "TelemetrySpeed", m_telemetry->telemetrySpeed);
|
||||||
addWidgetBinding("HwSettings", "GPSSpeed", m_telemetry->gpsSpeed);
|
addWidgetBinding("HwSettings", "GPSSpeed", m_telemetry->gpsSpeed);
|
||||||
// Add Gps protocol configuration
|
// Add Gps protocol configuration
|
||||||
addWidgetBinding("GPSSettings", "DataProtocol", m_telemetry->gpsProtocol);
|
|
||||||
|
HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager());
|
||||||
|
HwSettings::DataFields hwSettingsData = hwSettings->getData();
|
||||||
|
|
||||||
|
if(hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_GPS] != HwSettings::OPTIONALMODULES_ENABLED) {
|
||||||
|
m_telemetry->gpsProtocol->setEnabled(false);
|
||||||
|
m_telemetry->gpsProtocol->setToolTip(tr("Enable GPS module and reboot the board to be able to select GPS protocol"));
|
||||||
|
} else {
|
||||||
|
addWidgetBinding("GPSSettings", "DataProtocol", m_telemetry->gpsProtocol);
|
||||||
|
}
|
||||||
|
|
||||||
addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_telemetry->comUsbBridgeSpeed);
|
addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_telemetry->comUsbBridgeSpeed);
|
||||||
connect(m_telemetry->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
|
connect(m_telemetry->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user