From 58f81b193b0ac061ec2342ef15fe5459945b6a81 Mon Sep 17 00:00:00 2001 From: bsongis Date: Sat, 5 Jul 2014 23:13:14 +0200 Subject: [PATCH] PPM polarity was inverted in Companion PrintDialog and CompareDialog --- companion/src/comparedialog.cpp | 8 ++++---- companion/src/eeprominterface.h | 1 + companion/src/printdialog.cpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/companion/src/comparedialog.cpp b/companion/src/comparedialog.cpp index 29a60f2cf..7bb1e86e0 100644 --- a/companion/src/comparedialog.cpp +++ b/companion/src/comparedialog.cpp @@ -256,8 +256,8 @@ void CompareDialog::printSetup() str.append(fv(tr("Timer2"), getTimerStr(g_model1->timers[1]), color)); //value, mode, count up/down color=getColor1(getProtocol(g_model1),getProtocol(g_model2)); str.append(fv(tr("Protocol"), getProtocol(g_model1), color)); //proto, numch, delay, - color=getColor1(g_model1->moduleData[0].ppmPulsePol,g_model2->moduleData[0].ppmPulsePol); - str.append(fv(tr("Pulse Polarity"), g_model1->moduleData[0].ppmPulsePol ? "NEG" : "POS", color)); + color=getColor1(g_model1->moduleData[0].ppmPulsePol, g_model2->moduleData[0].ppmPulsePol); + str.append(fv(tr("Pulse Polarity"), g_model1->moduleData[0].polarityToString(), color)); color=getColor1(g_model1->thrTrim,g_model2->thrTrim); str.append(fv(tr("Throttle Trim"), g_model1->thrTrim ? tr("Enabled") : tr("Disabled"), color)); color=getColor1(g_model1->thrExpo,g_model2->thrExpo); @@ -279,8 +279,8 @@ void CompareDialog::printSetup() str.append(fv(tr("Timer2"), getTimerStr(g_model2->timers[1]),color)); //value, mode, count up/down color=getColor2(getProtocol(g_model1),getProtocol(g_model2)); str.append(fv(tr("Protocol"), getProtocol(g_model2), color)); //proto, numch, delay, - color=getColor2(g_model1->moduleData[0].ppmPulsePol,g_model2->moduleData[0].ppmPulsePol); - str.append(fv(tr("Pulse Polarity"), g_model2->moduleData[0].ppmPulsePol ? "NEG" : "POS", color)); + color=getColor2(g_model1->moduleData[0].ppmPulsePol, g_model2->moduleData[0].ppmPulsePol); + str.append(fv(tr("Pulse Polarity"), g_model2->moduleData[0].polarityToString(), color)); color=getColor2(g_model1->thrTrim,g_model2->thrTrim); str.append(fv(tr("Throttle Trim"), g_model2->thrTrim ? tr("Enabled") : tr("Disabled"), color)); color=getColor2(g_model1->thrExpo,g_model2->thrExpo); diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index d9831709b..f1fb305ac 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -954,6 +954,7 @@ class ModuleData { bool ppmPulsePol; // false = positive int ppmFrameLength; void clear() { memset(this, 0, sizeof(ModuleData)); } + QString polarityToString() { return ppmPulsePol ? QObject::tr("Positive") : QObject::tr("Negative"); } }; #define C9X_MAX_SCRIPTS 7 diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index ec67f7533..53bbdc629 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -119,7 +119,7 @@ void PrintDialog::printSetup() str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay, - str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].ppmPulsePol ? "NEG" : "POS")); + str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].polarityToString())); str.append(fv(tr("Throttle Trim"), g_model->thrTrim ? tr("Enabled") : tr("Disabled"))); str.append(fv(tr("Throttle Expo"), g_model->thrExpo ? tr("Enabled") : tr("Disabled"))); // TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw)));