1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

Delete large section of unused code

This commit is contained in:
James Cotton 2011-10-20 07:51:00 -05:00
parent cb8d9c791c
commit fd96616c32

View File

@ -618,224 +618,6 @@ void ConfigInputWidget::restoreMdata()
manualCommandObj->setMetadata(manualControlMdata);
}
//void ConfigInputWidget::setupWizardWidget(int step)
//{
// if(step==wizardWelcome)
// {
// m_config->graphicsView->setVisible(false);
// setTxMovement(nothing);
// if(wizardStep==wizardChooseMode)
// {
// delete extraWidgets.at(0);
// delete extraWidgets.at(1);
// extraWidgets.clear();
// }
// manualSettingsData=manualSettingsObj->getData();
// manualSettingsData.Arming=ManualControlSettings::ARMING_ALWAYSDISARMED;
// manualSettingsObj->setData(manualSettingsData);
// m_config->wzText->setText(tr("Welcome to the inputs configuration wizard.\n"
// "Please follow the instructions on the screen and only move your controls when asked to.\n"
// "Make sure you already configured your hardware settings on the proper tab and restarted your board.\n"
// "At any time you can press 'back' to return to the previous screeen or 'Cancel' to cancel the wizard.\n"));
// m_config->stackedWidget->setCurrentIndex(1);
// m_config->wzBack->setEnabled(false);
// wizardStep=wizardWelcome;
// }
// else if(step==wizardChooseMode)
// {
// m_config->graphicsView->setVisible(true);
// setTxMovement(nothing);
// if(wizardStep==wizardIdentifySticks)
// {
// disconnect(receiverActivityObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(identifyControls()));
// m_config->wzNext->setEnabled(true);
// }
// m_config->wzText->setText(tr("Please choose your transmiter type.\n"
// "Mode 1 means your throttle stick is on the right\n"
// "Mode 2 means your throttle stick is on the left\n"));
// m_config->wzBack->setEnabled(true);
// QRadioButton * mode1=new QRadioButton(tr("Mode 1"),this);
// QRadioButton * mode2=new QRadioButton(tr("Mode 2"),this);
// mode2->setChecked(true);
// extraWidgets.clear();
// extraWidgets.append(mode1);
// extraWidgets.append(mode2);
// m_config->checkBoxesLayout->layout()->addWidget(mode1);
// m_config->checkBoxesLayout->layout()->addWidget(mode2);
// wizardStep=wizardChooseMode;
// }
// else if(step==wizardChooseType)
// {
// if(wizardStep==wizardChooseMode)
// {
// QRadioButton * mode=qobject_cast<QRadioButton *>(extraWidgets.at(0));
// if(mode->isChecked())
// transmitterMode=mode1;
// else
// transmitterMode=mode2;
// delete extraWidgets.at(0);
// delete extraWidgets.at(1);
// extraWidgets.clear();
// }
// m_config->wzText->setText(tr("Please choose your transmiter mode.\n"
// "Acro means normal transmitter\n"
// "Heli means there is a collective pitch and throttle input\n"));
// m_config->wzBack->setEnabled(true);
// QRadioButton * typeAcro=new QRadioButton(tr("Acro"),this);
// QRadioButton * typeHeli=new QRadioButton(tr("Heli"),this);
// typeAcro->setChecked(true);
// typeHeli->setChecked(false);
// extraWidgets.clear();
// extraWidgets.append(typeAcro);
// extraWidgets.append(typeHeli);
// m_config->checkBoxesLayout->layout()->addWidget(typeAcro);
// m_config->checkBoxesLayout->layout()->addWidget(typeHeli);
// wizardStep=wizardChooseType;
// } else if(step==wizardIdentifySticks && !isSimple) {
// usedChannels.clear();
// if(wizardStep==wizardChooseType)
// {
// qDebug() << "Chosing type";
// QRadioButton * type=qobject_cast<QRadioButton *>(extraWidgets.at(0));
// if(type->isChecked())
// transmitterType=acro;
// else
// transmitterType=heli;
// qDebug() << "Checked: " << type->isChecked() << " " << "type is" << transmitterType;
// delete extraWidgets.at(0);
// delete extraWidgets.at(1);
// extraWidgets.clear();
// }
// wizardStep=wizardIdentifySticks;
// currentCommand=0;
// getChannelFromStep(currentCommand);
// manualSettingsData=manualSettingsObj->getData();
// connect(receiverActivityObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(identifyControls()));
// m_config->wzNext->setEnabled(false);
// }
// else if(step==wizardIdentifyCenter || (isSimple && step==wizardIdentifySticks))
// {
// setTxMovement(centerAll);
// if(wizardStep==wizardIdentifySticks)
// disconnect(receiverActivityObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(identifyControls()));
// else
// {
// disconnect(manualCommandObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(identifyLimits()));
// manualSettingsObj->setData(manualSettingsData);
// manualCommandObj->setMetadata(manualCommandObj->getDefaultMetadata());
// }
// wizardStep=wizardIdentifyCenter;
// m_config->wzText->setText(QString(tr("Please center all control controls and press next when ready (if your FlightMode switch has only two positions, leave it on either position)")));
// }
// else if(step==wizardIdentifyLimits)
// {
// dimOtherControls(false);
// setTxMovement(moveAll);
// if(wizardStep==wizardIdentifyCenter)
// {
// wizardStep=wizardIdentifyLimits;
// manualCommandData=manualCommandObj->getData();
// manualSettingsData=manualSettingsObj->getData();
// for(unsigned int i=0;i<ManualControlCommand::CHANNEL_NUMELEM;++i)
// {
// manualSettingsData.ChannelNeutral[i]=manualCommandData.Channel[i];
// }
// manualSettingsObj->setData(manualSettingsData);
// }
// if(wizardStep==wizardIdentifyInverted)
// {
// foreach(QWidget * wd,extraWidgets)
// {
// QCheckBox * cb=qobject_cast<QCheckBox *>(wd);
// if(cb)
// {
// disconnect(cb,SIGNAL(toggled(bool)),this,SLOT(invertControls()));
// delete cb;
// }
// }
// }
// extraWidgets.clear();
// disconnect(manualCommandObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(moveSticks()));
// wizardStep=wizardIdentifyLimits;
// m_config->wzText->setText(QString(tr("Please move all controls to their maximum extents on both directions and press next when ready")));
// UAVObject::Metadata mdata= manualCommandObj->getMetadata();
// mdata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_PERIODIC;
// mdata.flightTelemetryUpdatePeriod = 150;
// manualCommandObj->setMetadata(mdata);
// manualSettingsData=manualSettingsObj->getData();
// for(uint i=0;i<ManualControlSettings::CHANNELMAX_NUMELEM;++i)
// {
// manualSettingsData.ChannelMin[i]=manualSettingsData.ChannelNeutral[i];
// manualSettingsData.ChannelMax[i]=manualSettingsData.ChannelNeutral[i];
// }
// connect(manualCommandObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(identifyLimits()));
// }
// else if(step==wizardIdentifyInverted)
// {
// dimOtherControls(true);
// setTxMovement(nothing);
// if(wizardStep==wizardIdentifyLimits)
// {
// disconnect(manualCommandObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(identifyLimits()));
// manualSettingsObj->setData(manualSettingsData);
// }
// extraWidgets.clear();
// foreach(QString name,manualSettingsObj->getFields().at(0)->getElementNames())
// {
// if(!name.contains("Access") && !name.contains("Flight"))
// {
// QCheckBox * cb=new QCheckBox(name,this);
// extraWidgets.append(cb);
// m_config->checkBoxesLayout->layout()->addWidget(cb);
// connect(cb,SIGNAL(toggled(bool)),this,SLOT(invertControls()));
// }
// }
// connect(manualCommandObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(moveSticks()));
// wizardStep=wizardIdentifyInverted;
// m_config->wzText->setText(QString(tr("Please check the picture below and check all the sticks which show an inverted movement and press next when ready")));
// }
// else if(step==wizardFinish)
// {
// foreach(QWidget * wd,extraWidgets)
// {
// QCheckBox * cb=qobject_cast<QCheckBox *>(wd);
// if(cb)
// {
// disconnect(cb,SIGNAL(toggled(bool)),this,SLOT(invertControls()));
// delete cb;
// }
// }
// wizardStep=wizardFinish;
// extraWidgets.clear();
// m_config->wzText->setText(QString(tr("You have completed this wizard, please check below if the picture below mimics your sticks movement.\n"
// "This new settings aren't saved to the board yet, after pressing next you will go to the initial screen where you can do that.")));
// }
// else if(step==wizardFinish+1)
// {
// setTxMovement(nothing);
// manualCommandObj->setMetadata(manualCommandObj->getDefaultMetadata());
// disconnect(manualCommandObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(moveSticks()));
// manualSettingsData=manualSettingsObj->getData();
// manualSettingsData.ChannelNeutral[ManualControlSettings::CHANNELNEUTRAL_THROTTLE]=
// manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_THROTTLE]+
// ((manualSettingsData.ChannelMax[ManualControlSettings::CHANNELMAX_THROTTLE]-
// manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_THROTTLE])*0.02);
// if((abs(manualSettingsData.ChannelMax[ManualControlSettings::CHANNELMAX_FLIGHTMODE]-manualSettingsData.ChannelNeutral[ManualControlSettings::CHANNELNEUTRAL_FLIGHTMODE])<100) ||
// (abs(manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_FLIGHTMODE]-manualSettingsData.ChannelNeutral[ManualControlSettings::CHANNELNEUTRAL_FLIGHTMODE])<100))
// {
// manualSettingsData.ChannelNeutral[ManualControlSettings::CHANNELNEUTRAL_FLIGHTMODE]=manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_FLIGHTMODE]+
// (manualSettingsData.ChannelMax[ManualControlSettings::CHANNELMAX_FLIGHTMODE]-manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_FLIGHTMODE])/2;
// }
// manualSettingsObj->setData(manualSettingsData);
// m_config->stackedWidget->setCurrentIndex(0);
// wizardStep=wizardWelcome;
// }
//}
/**
* Set the display to indicate which channel the person should move
*/