diff --git a/companion/src/multimodelprinter.cpp b/companion/src/multimodelprinter.cpp index d46a93641e4..de2807c2546 100644 --- a/companion/src/multimodelprinter.cpp +++ b/companion/src/multimodelprinter.cpp @@ -429,20 +429,20 @@ QString MultiModelPrinter::printFlightModes() MultiColumns columns(modelPrinterMap.size()); columns.appendSectionTableStart(); QStringList hd = QStringList() << tr("Flight mode") << tr("Switch") << tr("F.In") << tr("F.Out"); - for (int i=0; i < getBoardCapability(getCurrentBoard(), Board::NumTrims); i++) { - hd << RawSource(SOURCE_TYPE_TRIM, i).toString(); + for (int i = 0; i < getBoardCapability(getCurrentBoard(), Board::NumTrims); i++) { + hd << RawSource(SOURCE_TYPE_TRIM, i + 1).toString(); } columns.appendRowHeader(hd); - int wd = 80/(getBoardCapability(getCurrentBoard(), Board::NumTrims) + 3); - for (int i=0; igetCapability(FlightModes); i++) { + int wd = 80 / (getBoardCapability(getCurrentBoard(), Board::NumTrims) + 3); + for (int i = 0; i < firmware->getCapability(FlightModes); i++) { columns.appendRowStart(); - columns.appendCellStart(20,true); + columns.appendCellStart(20, true); COMPARE(modelPrinter->printFlightModeName(i)); columns.appendCellEnd(true); COMPARECELLWIDTH(modelPrinter->printFlightModeSwitch(model->flightModeData[i].swtch), wd); COMPARECELLWIDTH(model->flightModeData[i].fadeIn, wd); COMPARECELLWIDTH(model->flightModeData[i].fadeOut, wd); - for (int k=0; k < getBoardCapability(getCurrentBoard(), Board::NumTrims); k++) { + for (int k = 0; k < getBoardCapability(getCurrentBoard(), Board::NumTrims); k++) { COMPARECELLWIDTH(modelPrinter->printTrim(i, k), wd); } columns.appendRowEnd(); @@ -459,43 +459,43 @@ QString MultiModelPrinter::printFlightModes() columns.appendSectionTableStart(); QStringList hd = QStringList() << tr("Global vars"); if (firmware->getCapability(GvarsFlightModes)) { - for (int i=0; igetCapability(RotaryEncoders); i++) { - hd << tr("RE%1").arg(i+1); + hd << tr("RE%1").arg(i + 1); } columns.appendRowHeader(hd); - int wd = 80/gvars; + int wd = 80 / gvars; if (firmware->getCapability(GvarsFlightModes)) { columns.appendRowStart(tr("Name"), 20); - for (int i=0; igvarData[i].name, wd); } columns.appendRowEnd(); columns.appendRowStart(tr("Unit")); - for (int i=0; iprintGlobalVarUnit(i)); } columns.appendRowEnd(); columns.appendRowStart(tr("Prec")); - for (int i=0; iprintGlobalVarPrec(i)); } columns.appendRowEnd(); columns.appendRowStart(tr("Min")); - for (int i=0; iprintGlobalVarMin(i)); } columns.appendRowEnd(); columns.appendRowStart(tr("Max")); - for (int i=0; iprintGlobalVarMax(i)); } columns.appendRowEnd(); columns.appendRowStart(tr("Popup")); - for (int i=0; iprintGlobalVarPopup(i)); } columns.appendRowEnd(); @@ -503,17 +503,17 @@ QString MultiModelPrinter::printFlightModes() columns.appendRowHeader(QStringList() << tr("Flight mode")); - for (int i=0; igetCapability(FlightModes); i++) { + for (int i = 0; i < firmware->getCapability(FlightModes); i++) { columns.appendRowStart(); - columns.appendCellStart(0,true); + columns.appendCellStart(0, true); COMPARE(modelPrinter->printFlightModeName(i)); columns.appendCellEnd(true); if (firmware->getCapability(GvarsFlightModes)) { - for (int k=0; kprintGlobalVar(i, k)); } } - for (int k=0; kgetCapability(RotaryEncoders); k++) { + for (int k = 0; k < firmware->getCapability(RotaryEncoders); k++) { COMPARECELL(modelPrinter->printRotaryEncoder(i, k)); } columns.appendRowEnd();