1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

OP-816 Added Revolution specific configuration code to Setup Wizard.

This commit is contained in:
Fredrik Arvidsson 2013-04-11 21:25:38 +02:00
parent b36672042b
commit 860077c428
3 changed files with 44 additions and 14 deletions

View File

@ -74,18 +74,42 @@ bool InputPage::restartNeeded(VehicleConfigurationSource::INPUT_TYPE selectedTyp
Q_ASSERT(uavoManager);
HwSettings* hwSettings = HwSettings::GetInstance(uavoManager);
HwSettings::DataFields data = hwSettings->getData();
switch(selectedType)
{
case VehicleConfigurationSource::INPUT_PWM:
return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PWM;
case VehicleConfigurationSource::INPUT_PPM:
return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PPM;
case VehicleConfigurationSource::INPUT_SBUS:
return data.CC_MainPort != HwSettings::CC_MAINPORT_SBUS;
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;
switch(getWizard()->getControllerType()) {
case SetupWizard::CONTROLLER_CC:
case SetupWizard::CONTROLLER_CC3D:
{
switch(selectedType)
{
case VehicleConfigurationSource::INPUT_PWM:
return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PWM;
case VehicleConfigurationSource::INPUT_PPM:
return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PPM;
case VehicleConfigurationSource::INPUT_SBUS:
return data.CC_MainPort != HwSettings::CC_MAINPORT_SBUS;
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;
}
}

View File

@ -81,8 +81,8 @@ int SetupWizard::nextId() const
{
case CONTROLLER_CC:
case CONTROLLER_CC3D:
return PAGE_INPUT;
case CONTROLLER_REVO:
return PAGE_INPUT;
case CONTROLLER_OPLINK:
default:
return PAGE_NOTYETIMPLEMENTED;

View File

@ -260,11 +260,17 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
switch(m_configSource->getVehicleSubType()) {
case VehicleConfigurationSource::MULTI_ROTOR_TRI_Y:
data.ChannelUpdateFreq[0] = updateFrequence;
if(m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
data.ChannelUpdateFreq[1] = updateFrequence;
}
break;
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
data.ChannelUpdateFreq[0] = updateFrequence;
data.ChannelUpdateFreq[1] = updateFrequence;
if(m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
data.ChannelUpdateFreq[2] = updateFrequence;
}
break;
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y: