From b7ace8526b5a828b1bbdd5bb568033e563c95dd6 Mon Sep 17 00:00:00 2001 From: Kjell Kernen Date: Mon, 7 Apr 2014 10:12:48 +0200 Subject: [PATCH] Changed direction defaults for ailerons, flaps and airbrakes after input from people on openRCforums. There really is no right or wrong, but the most common view seems to be that it is best to let the default channel weights mirror the logical travel of control surfaces. OK by me. Also fixed bug in prebooking of channels. --- companion/src/wizarddata.cpp | 10 +++++----- companion/src/wizarddialog.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/companion/src/wizarddata.cpp b/companion/src/wizarddata.cpp index eff44b35e..ea624074f 100644 --- a/companion/src/wizarddata.cpp +++ b/companion/src/wizarddata.cpp @@ -64,13 +64,13 @@ void WizMix::addMix(ModelData &model, Input input, int weight, int channel, int mix.weight = weight; } else if (input==FLAPS_INPUT){ - // There must be some kind of constants for switches somewhere... - maxMixSwitch( model.mixData[mixIndex++], channel+1, isTaranis ? 1 :-3 , -1*weight); //SA-UP or ELE-UP - maxMixSwitch( model.mixData[mixIndex++], channel+1, isTaranis ? 3 : 3 , weight); //SA-DOWN or ELE-DOWN + // There ought to be some kind of constants for switches somewhere... + maxMixSwitch( model.mixData[mixIndex++], channel+1, isTaranis ? 1 :-3 , weight); //SA-UP or ELE-UP + maxMixSwitch( model.mixData[mixIndex++], channel+1, isTaranis ? 3 : 3 , weight); //SA-DOWN or ELE-DOWN } else if (input==AIRBRAKES_INPUT){ - maxMixSwitch( model.mixData[mixIndex++], channel+1, isTaranis ? 13 :-2 , -1*weight); //SE-UP or RUD-UP - maxMixSwitch( model.mixData[mixIndex++], channel+1, isTaranis ? 15 : 2 , weight); //SE-DOWN or RUD-DOWN + maxMixSwitch( model.mixData[mixIndex++], channel+1, isTaranis ? 13 :-2 , weight); //SE-UP or RUD-UP + maxMixSwitch( model.mixData[mixIndex++], channel+1, isTaranis ? 15 : 2 , weight); //SE-DOWN or RUD-DOWN } } } diff --git a/companion/src/wizarddialog.cpp b/companion/src/wizarddialog.cpp index b64086ede..773863d11 100644 --- a/companion/src/wizarddialog.cpp +++ b/companion/src/wizarddialog.cpp @@ -171,7 +171,8 @@ void StandardPage::populateCB(QComboBox *cb, int preferred) int channel = cb->itemData(cb->currentIndex()).toInt(); if(wizDlg->mix.channel[channel].prebooked){ for(int i=cb->count()-1; i>=0; i--){ - if( !wizDlg->mix.channel[i].prebooked ){ + channel = cb->itemData(i).toInt(); + if( !wizDlg->mix.channel[channel].prebooked ){ cb->setCurrentIndex(i); break; } @@ -427,7 +428,7 @@ bool AileronsPage::validatePage() { return (bookChannel(aileron1CB, AILERONS_INPUT, 100 )); } return( bookChannel(aileron1CB, AILERONS_INPUT, 100 ) && - bookChannel(aileron2CB, AILERONS_INPUT, 100 )); + bookChannel(aileron2CB, AILERONS_INPUT, -100 )); } void AileronsPage::noAileronChannel(){ aileron1CB->setEnabled(false);aileron2CB->setEnabled(false);} @@ -476,7 +477,7 @@ bool FlapsPage::validatePage() { return (bookChannel(flap1CB, FLAPS_INPUT, 100 )); } return( bookChannel(flap1CB, FLAPS_INPUT, 100 ) && - bookChannel(flap2CB, FLAPS_INPUT, -100 )); + bookChannel(flap2CB, FLAPS_INPUT, 100 )); } void FlapsPage::noFlapChannel(){ flap1CB->setEnabled(false);flap2CB->setEnabled(false);} @@ -525,7 +526,7 @@ bool AirbrakesPage::validatePage() { return (bookChannel(airbrake1CB, AIRBRAKES_INPUT, 100 )); } return( bookChannel(airbrake1CB, AIRBRAKES_INPUT, 100 ) && - bookChannel(airbrake2CB, AIRBRAKES_INPUT, -100 )); + bookChannel(airbrake2CB, AIRBRAKES_INPUT, 100 )); } void AirbrakesPage::noAirbrakeChannel(){ airbrake1CB->setEnabled(false);airbrake2CB->setEnabled(false);}