From 30b660da1728024ed8226604a9fbe076ad01f9ad Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 11 Jun 2014 20:06:47 +0200 Subject: [PATCH] Offset in Taranis Inputs was missing --- companion/src/modeledit/expodialog.cpp | 19 +++-- companion/src/modeledit/expodialog.h | 3 +- companion/src/modeledit/expodialog.ui | 103 +++++++++++++++++-------- companion/src/modeledit/inputs.cpp | 1 + 4 files changed, 89 insertions(+), 37 deletions(-) diff --git a/companion/src/modeledit/expodialog.cpp b/companion/src/modeledit/expodialog.cpp index 0d66f874a..ff0f788f1 100644 --- a/companion/src/modeledit/expodialog.cpp +++ b/companion/src/modeledit/expodialog.cpp @@ -18,10 +18,18 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G setWindowTitle(tr("Edit %1").arg(getInputStr(model, ed->chn))); QRegExp rx(CHAR_FOR_NAMES_REGEX); - if (IS_TARANIS(GetEepromInterface()->getBoard())) - gvGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, 100, -100, 100); - else - gvGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, 100, 0, 100); + if (IS_TARANIS(GetEepromInterface()->getBoard())) { + gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, 100, -100, 100); + gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, ed->offset, 0, -100, 100); + } + else { + gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, 100, 0, 100); + gvOffsetGroup = NULL; + ui->offsetLabel->hide(); + ui->offsetGV->hide(); + ui->offsetSB->hide(); + ui->offsetCB->hide(); + } curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve); @@ -105,7 +113,8 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G ExpoDialog::~ExpoDialog() { - delete gvGroup; + delete gvWeightGroup; + delete gvOffsetGroup; delete curveGroup; delete ui; } diff --git a/companion/src/modeledit/expodialog.h b/companion/src/modeledit/expodialog.h index eac2edc52..332b4412c 100644 --- a/companion/src/modeledit/expodialog.h +++ b/companion/src/modeledit/expodialog.h @@ -31,7 +31,8 @@ class ExpoDialog : public QDialog { FirmwareInterface * firmware; ExpoData * ed; char * inputName; - GVarGroup * gvGroup; + GVarGroup * gvWeightGroup; + GVarGroup * gvOffsetGroup; CurveGroup * curveGroup; }; diff --git a/companion/src/modeledit/expodialog.ui b/companion/src/modeledit/expodialog.ui index b51d1e82a..37bdb4362 100644 --- a/companion/src/modeledit/expodialog.ui +++ b/companion/src/modeledit/expodialog.ui @@ -30,10 +30,10 @@ :/icon.png:/icon.png - - - - Source for the mixer. + + + + Flight modes @@ -44,20 +44,6 @@ - - - - 6 - - - - - - - Weight - - - @@ -92,14 +78,28 @@ - - - - Flight modes + + + + 6 - + + + + Source for the mixer. + + + + + + + Weight + + + + @@ -256,14 +256,14 @@ - + Switch - + Switch used to enable the line. @@ -271,14 +271,14 @@ If blank then the input is considered to be "ON" all the time. - + Stick Side - + @@ -297,7 +297,7 @@ If blank then the input is considered to be "ON" all the time. - + @@ -316,7 +316,7 @@ If blank then the input is considered to be "ON" all the time. - + Qt::Vertical @@ -370,14 +370,14 @@ If blank then the input is considered to be "ON" all the time. - + Curve - + @@ -429,6 +429,47 @@ If blank then the input is considered to be "ON" all the time. + + + + Offset + + + + + + + + + GV + + + + + + + + + + The source for the mixer + + + + + + + Qt::Horizontal + + + + 40 + 0 + + + + + + diff --git a/companion/src/modeledit/inputs.cpp b/companion/src/modeledit/inputs.cpp index 2b7a7b9e7..f8df7d8fb 100644 --- a/companion/src/modeledit/inputs.cpp +++ b/companion/src/modeledit/inputs.cpp @@ -162,6 +162,7 @@ QString InputsPanel::getInputText(int dest, bool * new_ch) } str += " " + tr("Weight(%1)").arg(getGVarString(md->weight)); + if (md->offset) str += " " + tr("Offset(%1)").arg(getGVarString(md->offset)); if (firmware->getCapability(VirtualInputs)) { str += " " + tr("Source(%1)").arg(md->srcRaw.toString());