1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

Tweeks: verify heli init's curves correctly; mixer pre-allocates a spindelegate

so we can reset min/max later
This commit is contained in:
Mike LaBranche 2012-07-06 14:01:53 -07:00
parent 382fecabbe
commit 51891881db
2 changed files with 11 additions and 5 deletions

View File

@ -133,12 +133,12 @@ ConfigCcpmWidget::ConfigCcpmWidget(QWidget *parent) : VehicleConfig(parent)
}
//initialize our two mixer curves
// mixercurve defaults to mixercurve_throttle
m_ccpm->ThrottleCurve->initLinearCurve(5, 1.0, 0.0);
m_ccpm->ThrottleCurve->setMixerType(MixerCurve::MIXERCURVE_THROTTLE);
m_ccpm->ThrottleCurve->ResetCurve();
// tell mixercurve this is a pitch curve
m_ccpm->PitchCurve->setMixerType(MixerCurve::MIXERCURVE_PITCH);
m_ccpm->PitchCurve->ResetCurve();
m_ccpm->PitchCurve->initLinearCurve(5, 1.0, -1.0);
//initialize channel names
m_ccpm->ccpmEngineChannel->addItems(channelNames);

View File

@ -37,13 +37,20 @@ MixerCurve::MixerCurve(QWidget *parent) :
{
m_mixerUI->setupUi(this);
// setup some convienence pointers
m_curve = m_mixerUI->CurveWidget;
m_settings = m_mixerUI->CurveSettings;
// create our spin delegate
m_spinDelegate = new DoubleSpinDelegate();
// set the default mixer type
setMixerType(MixerCurve::MIXERCURVE_THROTTLE);
// paint the ui
UpdateCurveUI();
// wire up our signals
connect(m_mixerUI->CurveType, SIGNAL(currentIndexChanged(int)), this, SLOT(CurveTypeChanged()));
connect(m_mixerUI->ResetCurve, SIGNAL(clicked()), this, SLOT(ResetCurve()));
connect(m_mixerUI->GenerateCurve, SIGNAL(clicked()), this, SLOT(GenerateCurve()));
@ -86,7 +93,6 @@ void MixerCurve::setMixerType(MixerCurveType curveType)
}
}
m_spinDelegate = new DoubleSpinDelegate();
m_spinDelegate->setRange(m_mixerUI->CurveMin->minimum(), m_mixerUI->CurveMax->maximum());
for (int i=0; i<MixerCurveWidget::NODE_NUMELEM; i++) {
m_settings->setItemDelegateForRow(i, m_spinDelegate);