mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 08:15:17 +03:00
V-tail and Elevon mixing added to wizard.
This commit is contained in:
parent
a527a869c1
commit
342aa93213
5 changed files with 33 additions and 19 deletions
Binary file not shown.
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 12 KiB |
|
@ -484,7 +484,7 @@ Om fältet lämnas tomt så är filtret aktivt hela tiden.</translation>
|
|||
<message>
|
||||
<location line="+1"/>
|
||||
<source>Ele</source>
|
||||
<translation>Höj</translation>
|
||||
<translation>Hjd</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+1"/>
|
||||
|
@ -552,7 +552,7 @@ Om fältet lämnas tomt så är filtret aktivt hela tiden.</translation>
|
|||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Ele</source>
|
||||
<translation>Höj</translation>
|
||||
<translation>Hjd</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
|
@ -3899,7 +3899,7 @@ p, li { white-space: pre-wrap; }
|
|||
<message>
|
||||
<location line="+1"/>
|
||||
<source>Ele</source>
|
||||
<translation>Höj</translation>
|
||||
<translation>Hjd</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+1"/>
|
||||
|
@ -4609,7 +4609,7 @@ p, li { white-space: pre-wrap; }
|
|||
<location line="+0"/>
|
||||
<location filename="../helpers.cpp" line="+0"/>
|
||||
<source>Ele</source>
|
||||
<translation>Höj</translation>
|
||||
<translation>Hjd</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
|
|
|
@ -37,10 +37,30 @@ WizMix::WizMix(const GeneralSettings & settings, const unsigned int modelId):
|
|||
strcpy(name, " ");
|
||||
}
|
||||
|
||||
void WizMix::addMix(ModelData &model, Input input, int weight, int channel, int & mixerIndex)
|
||||
{
|
||||
if (input != NOINPUT)
|
||||
{
|
||||
MixData & mix = model.mixData[mixerIndex++];
|
||||
mix.destCh = channel+1;
|
||||
if (input >= RUDDER && input <= AILERON)
|
||||
{
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard()))
|
||||
mix.srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, input-1, &model);
|
||||
else
|
||||
mix.srcRaw = RawSource(SOURCE_TYPE_STICK, input-1);
|
||||
}
|
||||
if (input==FLAP){
|
||||
}
|
||||
if (input==AIRBREAK){
|
||||
}
|
||||
mix.weight = weight;
|
||||
}
|
||||
}
|
||||
|
||||
WizMix::operator ModelData()
|
||||
{
|
||||
ModelData model;
|
||||
|
||||
model.used = true;
|
||||
model.modelId = modelId;
|
||||
model.setDefaultInputs(settings);
|
||||
|
@ -49,22 +69,13 @@ WizMix::operator ModelData()
|
|||
strncpy(model.name, name, WIZ_MODEL_NAME_LENGTH);
|
||||
model.name[WIZ_MODEL_NAME_LENGTH] = 0;
|
||||
|
||||
for (int i=0; i<WIZ_MAX_CHANNELS; i++ ) {
|
||||
int mixIndex = 0;
|
||||
for (int i=0; i<WIZ_MAX_CHANNELS; i++ )
|
||||
{
|
||||
Channel ch = channel[i];
|
||||
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);
|
||||
addMix(model, ch.input1, ch.weight1, i, mixIndex);
|
||||
addMix(model, ch.input2, ch.weight2, i, mixIndex);
|
||||
}
|
||||
mix.weight = ch.weight1;
|
||||
}
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
|
|
|
@ -91,6 +91,7 @@ class WizMix
|
|||
|
||||
private:
|
||||
WizMix();
|
||||
void addMix(ModelData & model, Input input, int weight, int channel, int & mixerIndex);
|
||||
};
|
||||
|
||||
#endif // WIZARDDATA_H
|
||||
|
|
|
@ -15,12 +15,14 @@
|
|||
#include <QtGui>
|
||||
#include "wizarddialog.h"
|
||||
#include "wizarddata.h"
|
||||
#include "helpers.h"
|
||||
|
||||
WizardDialog::WizardDialog(const GeneralSettings & settings, unsigned int modelId, QWidget *parent)
|
||||
: QWizard(parent),
|
||||
mix(settings, modelId),
|
||||
settings(settings)
|
||||
{
|
||||
setWindowIcon(CompanionIcon("wizard.png"));
|
||||
setWindowTitle(tr("Model Wizard"));
|
||||
|
||||
setPage(Page_Models, new ModelSelectionPage(this, "models",tr("Model Type"),tr("Enter model name and model type.")));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue