1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 08:15:17 +03:00

Now the wizard is able to configure a simple 4CH plane

This commit is contained in:
bsongis 2014-03-13 15:51:54 +01:00
parent e0582cd398
commit 383475a6ed
7 changed files with 131 additions and 73 deletions

View file

@ -21,16 +21,17 @@ Channel::Channel()
void Channel::clear()
{
sourceDlg = -1;
page = Page_None;
input1 = NOINPUT;
input2 = NOINPUT;
weight1 = 0;
weight2 = 0;
}
WizMix::WizMix(const unsigned int modelId):
WizMix::WizMix(const GeneralSettings & settings, const unsigned int modelId):
complete(false),
modelId(modelId),
settings(settings),
vehicle(NOVEHICLE)
{
strcpy(name, " ");
@ -42,6 +43,7 @@ WizMix::operator ModelData()
model.used = true;
model.modelId = modelId;
model.setDefaultInputs(settings);
// Safe copy model name
strncpy(model.name, name, WIZ_MODEL_NAME_LENGTH);
@ -49,8 +51,17 @@ WizMix::operator ModelData()
for (int i=0; i<WIZ_MAX_CHANNELS; i++ ) {
Channel ch = channel[i];
if (ch.sourceDlg > 0) {
//**** INSERT MIXER HERE ****
if (ch.page != Page_None) {
// qDebug() << "channel" << i << "page" << ch.page << ch.input1 << ch.input2;
MixData & mix = model.mixData[i];
mix.destCh = i+1;
if (ch.input1 >= RUDDER && ch.input1 <= AILERON) {
if (IS_TARANIS(GetEepromInterface()->getBoard()))
mix.srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, ch.input1-1, &model);
else
mix.srcRaw = RawSource(SOURCE_TYPE_STICK, ch.input1-1);
}
mix.weight = ch.weight1;
}
}