From 358992c48fb80d5395db08c107c825faa7bb2410 Mon Sep 17 00:00:00 2001 From: Kjell Kernen Date: Wed, 9 Apr 2014 11:05:56 +0200 Subject: [PATCH] Fixes #959 --- companion/src/wizarddata.cpp | 13 ++++++++----- companion/src/wizarddata.h | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/companion/src/wizarddata.cpp b/companion/src/wizarddata.cpp index ea624074f..091ce7895 100644 --- a/companion/src/wizarddata.cpp +++ b/companion/src/wizarddata.cpp @@ -39,8 +39,10 @@ WizMix::WizMix(const GeneralSettings & settings, const unsigned int modelId): } -void WizMix::maxMixSwitch(MixData &mix, int channel, int sw, int weight) +void WizMix::maxMixSwitch(char *name, MixData &mix, int channel, int sw, int weight) { + strncpy(mix.name, name, sizeof(mix.name)); + mix.name[sizeof(mix.name)]=0; mix.destCh = channel; mix.srcRaw = RawSource(SOURCE_TYPE_MAX); mix.swtch = RawSwitch(SWITCH_TYPE_SWITCH, sw); @@ -65,12 +67,13 @@ void WizMix::addMix(ModelData &model, Input input, int weight, int channel, int } else if (input==FLAPS_INPUT){ // 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 + maxMixSwitch( "Flaps Up", model.mixData[mixIndex++], channel+1, isTaranis ? 1 :-3 , weight); //SA-UP or ELE-UP + maxMixSwitch( "Flaps Down", 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 , weight); //SE-UP or RUD-UP - maxMixSwitch( model.mixData[mixIndex++], channel+1, isTaranis ? 15 : 2 , weight); //SE-DOWN or RUD-DOWN + maxMixSwitch( "Airbrk Off", model.mixData[mixIndex++], channel+1, isTaranis ? 13 :-2 , -weight); //SE-UP or RUD-UP + maxMixSwitch( "Airbrk On", model.mixData[mixIndex++], channel+1, isTaranis ? 15 : 2 , weight); //SE-DOWN or RUD-DOWN } } } diff --git a/companion/src/wizarddata.h b/companion/src/wizarddata.h index 7d715fbf5..f361f7e88 100644 --- a/companion/src/wizarddata.h +++ b/companion/src/wizarddata.h @@ -93,7 +93,7 @@ class WizMix private: WizMix(); void addMix(ModelData & model, Input input, int weight, int channel, int & mixerIndex); - void maxMixSwitch(MixData &mix, int destCh, int sw, int weight); + void maxMixSwitch(char *name, MixData &mix, int destCh, int sw, int weight); };