diff --git a/companion/src/helpers.cpp b/companion/src/helpers.cpp index 27094edda..7c5046b31 100644 --- a/companion/src/helpers.cpp +++ b/companion/src/helpers.cpp @@ -1351,6 +1351,34 @@ QString getProtocol(ModelData * g_model) return str; } +QString getPhasesStr(unsigned int phases, ModelData & model) +{ + int numphases = GetEepromInterface()->getCapability(FlightPhases); + + if (numphases && phases) { + QString str; + int count = 0; + if (phases == (unsigned int)(1< 0) str += QString(", "); + str += getPhaseName(i+1, model.phaseData[i].name); + } + } + } + if (count > 1) + return QObject::tr("Flight modes(%1)").arg(str); + else + return QObject::tr("Flight mode(%1)").arg(str); + } + else { + return ""; + } +} + float c9xexpou(float point, float coeff) { float x=point*1024.0/100.0; diff --git a/companion/src/helpers.h b/companion/src/helpers.h index 33a3d21df..bc61e2894 100644 --- a/companion/src/helpers.h +++ b/companion/src/helpers.h @@ -69,6 +69,7 @@ void populateCustomScreenFieldCB(QComboBox *b, unsigned int value, bool last, in void populateTimerSwitchCB(QComboBox *b, int value); QString getCustomSwitchStr(CustomSwData * customSw, const ModelData & model); QString getProtocolStr(const int proto); +QString getPhasesStr(unsigned int phases, ModelData & model); #define POPULATE_SOURCES 1 #define POPULATE_TRIMS 2 diff --git a/companion/src/modeledit/expodialog.cpp b/companion/src/modeledit/expodialog.cpp index 6a027bcf6..bb2df0c65 100644 --- a/companion/src/modeledit/expodialog.cpp +++ b/companion/src/modeledit/expodialog.cpp @@ -57,8 +57,6 @@ ExpoDialog::ExpoDialog(QWidget *parent, ExpoData *expoData, int stickMode) : ui->sideCB->setCurrentIndex(ed->mode-1); - ui->label_expo->hide(); - if (!GetEepromInterface()->getCapability(FlightPhases)) { ui->label_phases->hide(); for (int i=0; i<9; i++) { @@ -105,8 +103,6 @@ ExpoDialog::ExpoDialog(QWidget *parent, ExpoData *expoData, int stickMode) : valuesChanged(); connect(ui->expoName,SIGNAL(editingFinished()),this,SLOT(valuesChanged())); - connect(ui->expoCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged())); - connect(ui->expoSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged())); connect(ui->curveTypeCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged())); connect(ui->curveGVarCB,SIGNAL(stateChanged(int)),this,SLOT(valuesChanged())); @@ -117,7 +113,6 @@ ExpoDialog::ExpoDialog(QWidget *parent, ExpoData *expoData, int stickMode) : connect(ui->weightSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged())); connect(ui->switchesCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged())); connect(ui->sideCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged())); - connect(ui->expoGV,SIGNAL(stateChanged(int)),this,SLOT(widgetChanged())); connect(ui->weightGV,SIGNAL(stateChanged(int)),this,SLOT(widgetChanged())); for (int i=0; i<9; i++) { connect(cb_fp[i],SIGNAL(toggled(bool)),this,SLOT(valuesChanged())); @@ -174,7 +169,6 @@ void ExpoDialog::widgetChanged() QTimer::singleShot(0, this, SLOT(shrink())); } - void ExpoDialog::valuesChanged() { QCheckBox * cb_fp[] = {ui->cb_FP0,ui->cb_FP1,ui->cb_FP2,ui->cb_FP3,ui->cb_FP4,ui->cb_FP5,ui->cb_FP6,ui->cb_FP7,ui->cb_FP8 }; diff --git a/companion/src/modeledit/expodialog.ui b/companion/src/modeledit/expodialog.ui index 03c45a13b..baf7c6b14 100644 --- a/companion/src/modeledit/expodialog.ui +++ b/companion/src/modeledit/expodialog.ui @@ -7,7 +7,7 @@ 0 0 370 - 291 + 331 @@ -44,14 +44,14 @@ - + Weight - + @@ -85,47 +85,6 @@ - - - - Expo - - - - - - - - - GV - - - - - - - - - - Phase used by the expo. - - - - - - - Qt::Horizontal - - - - 40 - 0 - - - - - - @@ -305,44 +264,6 @@ If blank then the expo is considered to be "ON" all the time. - - - - Curve - - - - - - - - - - - - The curve used by the expo - - - - - - - GV - - - - - - - - - - - - - - - @@ -396,7 +317,7 @@ If blank then the expo is considered to be "ON" all the time. 20 - 40 + 30 @@ -408,41 +329,6 @@ If blank then the expo is considered to be "ON" all the time. - - - - - No - - - - - Yes - - - - - - - - Source - - - - - - - Include Trim - - - - - - - Scale - - - @@ -466,6 +352,79 @@ p, li { white-space: pre-wrap; } + + + + Scale + + + + + + + Include Trim + + + + + + + Source + + + + + + + + No + + + + + Yes + + + + + + + + Curve + + + + + + + + + + + + The curve used by the expo + + + + + + + GV + + + + + + + + + + + + + + + diff --git a/companion/src/modeledit/inputs.cpp b/companion/src/modeledit/inputs.cpp index b529e47df..d8882f01b 100644 --- a/companion/src/modeledit/inputs.cpp +++ b/companion/src/modeledit/inputs.cpp @@ -88,43 +88,10 @@ void InputsPanel::update() if (md->curve.value) str += " " + md->curve.toString(); - if (GetEepromInterface()->getCapability(FlightPhases)) { - if(md->phases) { - if (md->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { - int mask=1; - int first=0; - for (int i=0; igetCapability(FlightPhases);i++) { - if (!(md->phases & mask)) { - first++; - } - mask <<=1; - } - if (first>1) { - str += " " + tr("Flight modes") + QString("("); - } else { - str += " " + tr("Flight mode") + QString("("); - } - mask=1; - first=1; - for (int i=0; igetCapability(FlightPhases);i++) { - if (!(md->phases & mask)) { - if (!first) { - str += QString(", ")+ QString("%1").arg(getPhaseName(i+1, model.phaseData[i].name)); - } else { - str += QString("%1").arg(getPhaseName(i+1,model.phaseData[i].name)); - first=0; - } - } - mask <<=1; - } - str += QString(")"); - } - else { - str += tr("DISABLED")+QString(" !!!"); - } - } - } - if (md->swtch.type != SWITCH_TYPE_NONE) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString()); + QString phasesStr = getPhasesStr(md->phases, model); + if (!phasesStr.isEmpty()) str += " " + phasesStr; + + if (md->swtch.type != SWITCH_TYPE_NONE) str += " " + tr("Switch(%1)").arg(md->swtch.toString()); if (GetEepromInterface()->getCapability(HasExpoNames)) { QString ExpoName; @@ -231,7 +198,6 @@ void InputsPanel::setSelectedByExpoList(QList list) } } - void InputsPanel::exposDelete(bool ask) { QMessageBox::StandardButton ret = QMessageBox::No; diff --git a/companion/src/modeledit/inputs.h b/companion/src/modeledit/inputs.h index d4e71ce5d..4164caac9 100644 --- a/companion/src/modeledit/inputs.h +++ b/companion/src/modeledit/inputs.h @@ -22,6 +22,13 @@ class InputsPanel : public ModelPanel void expolistWidget_customContextMenuRequested(QPoint pos); void expolistWidget_doubleClicked(QModelIndex index); void expolistWidget_KeyPress(QKeyEvent *event); + void exposDelete(bool ask=true); + void exposCut(); + void exposCopy(); + void exposPaste(); + void exposDuplicate(); + void expoOpen(QListWidgetItem *item = NULL); + void expoAdd(); private: GeneralSettings & generalSettings; @@ -36,13 +43,6 @@ class InputsPanel : public ModelPanel void exposDeleteList(QList list); QList createExpoListFromSelected(); void setSelectedByExpoList(QList list); - void exposDelete(bool ask=true); - void exposCut(); - void exposCopy(); - void exposPaste(); - void exposDuplicate(); - void expoOpen(QListWidgetItem *item = NULL); - void expoAdd(); void pasteExpoMimeData(const QMimeData * mimeData, int destIdx); }; diff --git a/companion/src/modeledit/mixerdialog.cpp b/companion/src/modeledit/mixerdialog.cpp index e0bb19965..d0d4c3560 100644 --- a/companion/src/modeledit/mixerdialog.cpp +++ b/companion/src/modeledit/mixerdialog.cpp @@ -49,7 +49,8 @@ MixerDialog::MixerDialog(QWidget *parent, MixData *mixdata, int stickMode) : ui->weightGV->setChecked(true); ui->weightSB->hide(); ui->weightCB->show(); - } else { + } + else { ui->weightGV->setChecked(false); ui->weightSB->setValue(md->weight); ui->weightSB->show(); @@ -70,6 +71,11 @@ MixerDialog::MixerDialog(QWidget *parent, MixData *mixdata, int stickMode) : ui->offsetCB->hide(); } + if (GetEepromInterface()->getCapability(VirtualInputs)) { + ui->trimLabel->hide(); + ui->trimCB->hide(); + } + CurveGroup * curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve); ui->MixDR_CB->setChecked(md->noExpo==0); diff --git a/companion/src/modeledit/mixerdialog.ui b/companion/src/modeledit/mixerdialog.ui index c41bf2563..ed14a05b9 100644 --- a/companion/src/modeledit/mixerdialog.ui +++ b/companion/src/modeledit/mixerdialog.ui @@ -179,7 +179,7 @@ p, li { white-space: pre-wrap; } - + Include Trim diff --git a/companion/src/modeledit/mixes.cpp b/companion/src/modeledit/mixes.cpp index 178ef6e4f..c6ca3d070 100644 --- a/companion/src/modeledit/mixes.cpp +++ b/companion/src/modeledit/mixes.cpp @@ -105,49 +105,18 @@ void MixesPanel::update() }; str += md->srcRaw.toString(); + str += " " + tr("Weight(%1)").arg(getGVarString(md->weight, true)); - unsigned int fpCount = GetEepromInterface()->getCapability(FlightPhases); - if (GetEepromInterface()->getCapability(FlightPhases)) { - if(md->phases) { - if (md->phases!=(unsigned int)(1<phases & mask)) { - first++; - } - mask <<=1; - } - if (first>1) { - str += " " + tr("Flight modes") + QString("("); - } else { - str += " " + tr("Flight mode") + QString("("); - } - mask=1; - first=1; - for (unsigned int i=0; iphases & mask)) { - if (!first) { - str += QString(", ")+ QString("%1").arg(getPhaseName(i+1, model.phaseData[i].name)); - } - else { - str += QString("%1").arg(getPhaseName(i+1,model.phaseData[i].name)); - first=0; - } - } - mask <<=1; - } - str += QString(")"); - } else { - str += tr("DISABLED")+QString(" !!!"); - } - } + QString phasesStr = getPhasesStr(md->phases, model); + if (!phasesStr.isEmpty()) str += " " + phasesStr; + + if (md->swtch.type != SWITCH_TYPE_NONE) str += " " + tr("Switch(%1)").arg(md->swtch.toString()); + + if (md->carryTrim>0) { + str += " " + tr("No Trim"); } - if(md->swtch.type != SWITCH_TYPE_NONE) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString()); - if(md->carryTrim>0) { - str += " " +tr("No Trim"); - } else if (md->carryTrim<0) { + else if (md->carryTrim<0) { str += " " + RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString(); }