mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-15 07:29:15 +01:00
LP-120 Add conditions for GPS+I2C - SRXL fixes
This commit is contained in:
parent
89b992176e
commit
7b3a0e504b
@ -40,8 +40,10 @@ void AirSpeedPage::initializePage(VehicleConfigurationSource *settings)
|
||||
// Enable all
|
||||
setItemDisabled(-1, false);
|
||||
if (settings->getInputType() == VehicleConfigurationSource::INPUT_SBUS ||
|
||||
settings->getInputType() == VehicleConfigurationSource::INPUT_DSM) {
|
||||
// Disable non estimated sensors if ports are taken by receivers
|
||||
settings->getInputType() == VehicleConfigurationSource::INPUT_DSM ||
|
||||
settings->getInputType() == VehicleConfigurationSource::INPUT_SRXL ||
|
||||
settings->getGpsType() == VehicleConfigurationSource::GPS_UBX_FLEXI_I2CMAG) {
|
||||
// Disable non estimated sensors if ports are taken by receivers or I2C Mag
|
||||
setItemDisabled(VehicleConfigurationSource::AIRSPEED_EAGLETREE, true);
|
||||
setItemDisabled(VehicleConfigurationSource::AIRSPEED_MS4525, true);
|
||||
if (getSelectedItem()->id() == VehicleConfigurationSource::AIRSPEED_EAGLETREE ||
|
||||
|
@ -37,7 +37,18 @@ GpsPage::~GpsPage()
|
||||
|
||||
void GpsPage::initializePage(VehicleConfigurationSource *settings)
|
||||
{
|
||||
Q_UNUSED(settings);
|
||||
// Enable all
|
||||
setItemDisabled(-1, false);
|
||||
if (settings->getInputType() == VehicleConfigurationSource::INPUT_SBUS ||
|
||||
settings->getInputType() == VehicleConfigurationSource::INPUT_DSM ||
|
||||
settings->getInputType() == VehicleConfigurationSource::INPUT_SRXL) {
|
||||
// Disable GPS+I2C Mag
|
||||
setItemDisabled(VehicleConfigurationSource::GPS_UBX_FLEXI_I2CMAG, true);
|
||||
if (getSelectedItem()->id() == VehicleConfigurationSource::GPS_UBX_FLEXI_I2CMAG) {
|
||||
// If previously selected invalid GPS, reset to no GPS
|
||||
setSelectedItem(VehicleConfigurationSource::GPS_DISABLED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool GpsPage::validatePage(SelectionItem *selectedItem)
|
||||
|
@ -377,6 +377,9 @@ QString SetupWizard::getSummaryText()
|
||||
case INPUT_DSM:
|
||||
summary.append(tr("Spektrum Satellite"));
|
||||
break;
|
||||
case INPUT_SRXL:
|
||||
summary.append(tr("Multiplex SRXL"));
|
||||
break;
|
||||
default:
|
||||
summary.append(tr("Unknown"));
|
||||
}
|
||||
|
@ -159,13 +159,16 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
|
||||
}
|
||||
break;
|
||||
case VehicleConfigurationSource::INPUT_SBUS:
|
||||
// We have to set teletry on flexport since s.bus needs the mainport.
|
||||
// We have to set teletry on flexiport since s.bus needs the mainport.
|
||||
data.CC_MainPort = HwSettings::CC_MAINPORT_SBUS;
|
||||
data.CC_FlexiPort = HwSettings::CC_FLEXIPORT_TELEMETRY;
|
||||
break;
|
||||
case VehicleConfigurationSource::INPUT_DSM:
|
||||
data.CC_FlexiPort = HwSettings::CC_FLEXIPORT_DSM;
|
||||
break;
|
||||
case VehicleConfigurationSource::INPUT_SRXL:
|
||||
data.CC_FlexiPort = HwSettings::CC_FLEXIPORT_SRXL;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -193,7 +196,7 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
|
||||
break;
|
||||
case VehicleConfigurationSource::INPUT_SBUS:
|
||||
data.RM_MainPort = HwSettings::RM_MAINPORT_SBUS;
|
||||
// We have to set telemetry on flexport since s.bus needs the mainport on all but Revo.
|
||||
// We have to set telemetry on flexiport since s.bus needs the mainport on all but Revo.
|
||||
if (m_configSource->getControllerType() != VehicleConfigurationSource::CONTROLLER_REVO) {
|
||||
data.RM_FlexiPort = HwSettings::RM_FLEXIPORT_TELEMETRY;
|
||||
}
|
||||
@ -238,6 +241,7 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
|
||||
AuxMagSettings *magSettings = AuxMagSettings::GetInstance(m_uavoManager);
|
||||
Q_ASSERT(magSettings);
|
||||
AuxMagSettings::DataFields magsData = magSettings->getData();
|
||||
magsData.Type = AuxMagSettings::TYPE_GPSV9;
|
||||
magsData.Usage = AuxMagSettings::USAGE_AUXONLY;
|
||||
magSettings->setData(magsData);
|
||||
addModifiedObject(magSettings, tr("Writing External Mag sensor settings"));
|
||||
@ -247,11 +251,12 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
|
||||
{
|
||||
gpsData.DataProtocol = GPSSettings::DATAPROTOCOL_UBX;
|
||||
gpsData.UbxAutoConfig = GPSSettings::UBXAUTOCONFIG_AUTOBAUDANDCONFIGURE;
|
||||
data.RM_FlexiPort = HwSettings::RM_FLEXIPORT_I2C;
|
||||
data.RM_FlexiPort = HwSettings::RM_FLEXIPORT_I2C;
|
||||
AuxMagSettings *magSettings = AuxMagSettings::GetInstance(m_uavoManager);
|
||||
Q_ASSERT(magSettings);
|
||||
AuxMagSettings::DataFields magsData = magSettings->getData();
|
||||
magsData.Usage = AuxMagSettings::USAGE_FLEXONLY;
|
||||
magsData.Type = AuxMagSettings::TYPE_FLEXI;
|
||||
magsData.Usage = AuxMagSettings::USAGE_AUXONLY;
|
||||
magSettings->setData(magsData);
|
||||
addModifiedObject(magSettings, tr("Writing I2C Mag sensor settings"));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user