1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Fix bug where clicking back at last screen of input wizard would go back to

main screen and then in future buttons hung around for no reason
This commit is contained in:
James Cotton 2011-11-25 11:23:56 -06:00
parent 60664f6a26
commit fae611a01f
2 changed files with 10 additions and 28 deletions

View File

@ -3139,6 +3139,7 @@
65F93D0712EE09290047DB36 /* uavtalk_comms.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = uavtalk_comms.c; sourceTree = "<group>"; };
65F93D0812EE09290047DB36 /* watchdog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = watchdog.c; sourceTree = "<group>"; };
65FAA03F133B669400F6F5CD /* GTOP_BIN.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GTOP_BIN.c; sourceTree = "<group>"; };
65FAB8CF147FFD76000FF8B2 /* receiveractivity.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = receiveractivity.xml; sourceTree = "<group>"; };
65FBE14412E7C98100176B5A /* pios_servo_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_servo_priv.h; sourceTree = "<group>"; };
65FC66AA123F30F100B04F74 /* ahrs_timer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ahrs_timer.c; path = ../../AHRS/ahrs_timer.c; sourceTree = SOURCE_ROOT; };
65FC66AB123F312A00B04F74 /* ahrs_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_timer.h; sourceTree = "<group>"; };
@ -7469,6 +7470,7 @@
65C35E6E12EFB2F3004811C2 /* positionactual.xml */,
65C35E6F12EFB2F3004811C2 /* positiondesired.xml */,
65C35E7012EFB2F3004811C2 /* ratedesired.xml */,
65FAB8CF147FFD76000FF8B2 /* receiveractivity.xml */,
652C856A132B6EA600BFCC70 /* sonaraltitude.xml */,
6536D47B1307962C0042A298 /* stabilizationdesired.xml */,
65C35E7112EFB2F3004811C2 /* stabilizationsettings.xml */,

View File

@ -293,6 +293,7 @@ void ConfigInputWidget::wzCancel()
if(wizardStep != wizardNone)
wizardTearDownStep(wizardStep);
wizardStep=wizardNone;
m_config->stackedWidget->setCurrentIndex(0);
// Load settings back from beginning of wizard
manualSettingsObj->setData(previousManualSettingsData);
@ -334,23 +335,8 @@ void ConfigInputWidget::wzNext()
wizardSetUpStep(wizardFinish);
break;
case wizardFinish:
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=wizardNone;
m_config->stackedWidget->setCurrentIndex(0);
break;
default:
Q_ASSERT(0);
@ -463,7 +449,6 @@ void ConfigInputWidget::wizardSetUpStep(enum wizardSteps step)
break;
case wizardIdentifyLimits:
{
dimOtherControls(false);
setTxMovement(nothing);
m_config->wzText->setText(QString(tr("Please move all controls to their maximum extents on both directions and press next when ready")));
fastMdata();
@ -496,16 +481,7 @@ void ConfigInputWidget::wizardSetUpStep(enum wizardSteps step)
fastMdata();
break;
case wizardFinish:
foreach(QWidget * wd,extraWidgets)
{
QCheckBox * cb=qobject_cast<QCheckBox *>(wd);
if(cb)
{
disconnect(cb,SIGNAL(toggled(bool)),this,SLOT(invertControls()));
delete cb;
}
}
extraWidgets.clear();
dimOtherControls(true);
connect(manualCommandObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(moveSticks()));
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.")));
@ -559,6 +535,7 @@ void ConfigInputWidget::wizardTearDownStep(enum wizardSteps step)
case wizardIdentifySticks:
disconnect(receiverActivityObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(identifyControls()));
m_config->wzNext->setEnabled(true);
setTxMovement(nothing);
break;
case wizardIdentifyCenter:
manualCommandData=manualCommandObj->getData();
@ -568,14 +545,17 @@ void ConfigInputWidget::wizardTearDownStep(enum wizardSteps step)
manualSettingsData.ChannelNeutral[i]=manualCommandData.Channel[i];
}
manualSettingsObj->setData(manualSettingsData);
setTxMovement(nothing);
break;
case wizardIdentifyLimits:
disconnect(manualCommandObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(identifyLimits()));
disconnect(manualCommandObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(moveSticks()));
manualSettingsObj->setData(manualSettingsData);
restoreMdata();
setTxMovement(nothing);
break;
case wizardIdentifyInverted:
dimOtherControls(false);
foreach(QWidget * wd,extraWidgets)
{
QCheckBox * cb=qobject_cast<QCheckBox *>(wd);
@ -590,8 +570,8 @@ void ConfigInputWidget::wizardTearDownStep(enum wizardSteps step)
restoreMdata();
break;
case wizardFinish:
dimOtherControls(false);
setTxMovement(nothing);
m_config->stackedWidget->setCurrentIndex(0);
disconnect(manualCommandObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(moveSticks()));
restoreMdata();
break;