mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-10 18:24:11 +01:00
OP-816 Added Revolution specific configuration code to Setup Wizard.
This commit is contained in:
parent
b36672042b
commit
860077c428
@ -74,18 +74,42 @@ bool InputPage::restartNeeded(VehicleConfigurationSource::INPUT_TYPE selectedTyp
|
|||||||
Q_ASSERT(uavoManager);
|
Q_ASSERT(uavoManager);
|
||||||
HwSettings* hwSettings = HwSettings::GetInstance(uavoManager);
|
HwSettings* hwSettings = HwSettings::GetInstance(uavoManager);
|
||||||
HwSettings::DataFields data = hwSettings->getData();
|
HwSettings::DataFields data = hwSettings->getData();
|
||||||
switch(selectedType)
|
switch(getWizard()->getControllerType()) {
|
||||||
{
|
case SetupWizard::CONTROLLER_CC:
|
||||||
case VehicleConfigurationSource::INPUT_PWM:
|
case SetupWizard::CONTROLLER_CC3D:
|
||||||
return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PWM;
|
{
|
||||||
case VehicleConfigurationSource::INPUT_PPM:
|
switch(selectedType)
|
||||||
return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PPM;
|
{
|
||||||
case VehicleConfigurationSource::INPUT_SBUS:
|
case VehicleConfigurationSource::INPUT_PWM:
|
||||||
return data.CC_MainPort != HwSettings::CC_MAINPORT_SBUS;
|
return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PWM;
|
||||||
case VehicleConfigurationSource::INPUT_DSM2:
|
case VehicleConfigurationSource::INPUT_PPM:
|
||||||
// TODO: Handle all of the DSM types ?? Which is most common?
|
return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PPM;
|
||||||
return data.CC_MainPort != HwSettings::CC_MAINPORT_DSM2;
|
case VehicleConfigurationSource::INPUT_SBUS:
|
||||||
default:
|
return data.CC_MainPort != HwSettings::CC_MAINPORT_SBUS;
|
||||||
return true;
|
case VehicleConfigurationSource::INPUT_DSM2:
|
||||||
|
// TODO: Handle all of the DSM types ?? Which is most common?
|
||||||
|
return data.CC_MainPort != HwSettings::CC_MAINPORT_DSM2;
|
||||||
|
default: return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SetupWizard::CONTROLLER_REVO:
|
||||||
|
{
|
||||||
|
switch(selectedType)
|
||||||
|
{
|
||||||
|
case VehicleConfigurationSource::INPUT_PWM:
|
||||||
|
return data.RM_RcvrPort != HwSettings::CC_RCVRPORT_PWM;
|
||||||
|
case VehicleConfigurationSource::INPUT_PPM:
|
||||||
|
return data.RM_RcvrPort != HwSettings::CC_RCVRPORT_PPM;
|
||||||
|
case VehicleConfigurationSource::INPUT_SBUS:
|
||||||
|
return data.RM_MainPort != HwSettings::CC_MAINPORT_SBUS;
|
||||||
|
case VehicleConfigurationSource::INPUT_DSM2:
|
||||||
|
// TODO: Handle all of the DSM types ?? Which is most common?
|
||||||
|
return data.RM_MainPort != HwSettings::CC_MAINPORT_DSM2;
|
||||||
|
default: return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,8 +81,8 @@ int SetupWizard::nextId() const
|
|||||||
{
|
{
|
||||||
case CONTROLLER_CC:
|
case CONTROLLER_CC:
|
||||||
case CONTROLLER_CC3D:
|
case CONTROLLER_CC3D:
|
||||||
return PAGE_INPUT;
|
|
||||||
case CONTROLLER_REVO:
|
case CONTROLLER_REVO:
|
||||||
|
return PAGE_INPUT;
|
||||||
case CONTROLLER_OPLINK:
|
case CONTROLLER_OPLINK:
|
||||||
default:
|
default:
|
||||||
return PAGE_NOTYETIMPLEMENTED;
|
return PAGE_NOTYETIMPLEMENTED;
|
||||||
|
@ -260,11 +260,17 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
|||||||
switch(m_configSource->getVehicleSubType()) {
|
switch(m_configSource->getVehicleSubType()) {
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_TRI_Y:
|
case VehicleConfigurationSource::MULTI_ROTOR_TRI_Y:
|
||||||
data.ChannelUpdateFreq[0] = updateFrequence;
|
data.ChannelUpdateFreq[0] = updateFrequence;
|
||||||
|
if(m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
||||||
|
data.ChannelUpdateFreq[1] = updateFrequence;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
|
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
|
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
|
||||||
data.ChannelUpdateFreq[0] = updateFrequence;
|
data.ChannelUpdateFreq[0] = updateFrequence;
|
||||||
data.ChannelUpdateFreq[1] = updateFrequence;
|
data.ChannelUpdateFreq[1] = updateFrequence;
|
||||||
|
if(m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
||||||
|
data.ChannelUpdateFreq[2] = updateFrequence;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
|
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y:
|
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y:
|
||||||
|
Loading…
Reference in New Issue
Block a user