Add function switches to model print and compare
This commit is contained in:
committed by
Raphael Coeffic
parent
9a07b83b00
commit
f5b398b32c
@@ -277,6 +277,9 @@ QString MultiModelPrinter::print(QTextDocument * document)
|
||||
if (firmware->getCapability(Timers)) {
|
||||
str.append(printTimers());
|
||||
}
|
||||
if (Boards::getCapability(firmware->getBoard(), Board::NumFunctionSwitches)) {
|
||||
str.append(printFunctionSwitches());
|
||||
}
|
||||
str.append(printModules());
|
||||
if (firmware->getCapability(Heli))
|
||||
str.append(printHeliSetup());
|
||||
@@ -938,3 +941,52 @@ QString MultiModelPrinter::printChecklist()
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
QString MultiModelPrinter::printFunctionSwitches()
|
||||
{
|
||||
QString str;
|
||||
MultiColumns columns(modelPrinterMap.size());
|
||||
columns.appendSectionTableStart();
|
||||
|
||||
int numFS = Boards::getCapability(firmware->getBoard(), Board::NumFunctionSwitches);
|
||||
int colwidth = 80 / numFS;
|
||||
|
||||
QStringList headings = { tr("Function Switches") };
|
||||
for (int i = 0; i < numFS; i++) {
|
||||
headings << tr("Switch %1").arg(i + 1);
|
||||
}
|
||||
columns.appendRowHeader(headings);
|
||||
|
||||
columns.appendRowStart(tr("Name"), 20);
|
||||
|
||||
for (int i = 0; i < numFS; i++) {
|
||||
COMPARECELLWIDTH(model->functionSwitchNames[i], colwidth);
|
||||
}
|
||||
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart(tr("Type"), 20);
|
||||
|
||||
for (int i = 0; i < numFS; i++) {
|
||||
COMPARECELLWIDTH(model->funcSwitchConfigToString((unsigned int)i), colwidth);
|
||||
}
|
||||
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart(tr("Start"), 20);
|
||||
|
||||
for (int i = 0; i < numFS; i++) {
|
||||
COMPARECELLWIDTH(model->funcSwitchStartToString((unsigned int)i), colwidth);
|
||||
}
|
||||
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart(tr("Group"), 20);
|
||||
|
||||
for (int i = 0; i < numFS; i++) {
|
||||
COMPARECELLWIDTH((model->functionSwitchGroup >> (2 * i)) & 0x03, colwidth);
|
||||
}
|
||||
|
||||
columns.appendRowEnd();
|
||||
|
||||
columns.appendTableEnd();
|
||||
str.append(columns.print());
|
||||
return str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user