mirror of
https://github.com/opentx/opentx.git
synced 2025-07-12 19:10:19 +03:00
Add fs to model print
This commit is contained in:
parent
798c38fa84
commit
29cf283f52
2 changed files with 53 additions and 0 deletions
|
@ -277,6 +277,9 @@ QString MultiModelPrinter::print(QTextDocument * document)
|
||||||
if (firmware->getCapability(Timers)) {
|
if (firmware->getCapability(Timers)) {
|
||||||
str.append(printTimers());
|
str.append(printTimers());
|
||||||
}
|
}
|
||||||
|
if (Boards::getCapability(firmware->getBoard(), Board::NumFunctionSwitches)) {
|
||||||
|
str.append(printFunctionSwitches());
|
||||||
|
}
|
||||||
str.append(printModules());
|
str.append(printModules());
|
||||||
if (firmware->getCapability(Heli))
|
if (firmware->getCapability(Heli))
|
||||||
str.append(printHeliSetup());
|
str.append(printHeliSetup());
|
||||||
|
@ -937,3 +940,52 @@ QString MultiModelPrinter::printChecklist()
|
||||||
}
|
}
|
||||||
return str;
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -95,6 +95,7 @@ class MultiModelPrinter: public QObject
|
||||||
QString printTelemetryScreens();
|
QString printTelemetryScreens();
|
||||||
QString printGlobalFunctions();
|
QString printGlobalFunctions();
|
||||||
QString printChecklist();
|
QString printChecklist();
|
||||||
|
QString printFunctionSwitches();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _MULTIMODELPRINTER_H_
|
#endif // _MULTIMODELPRINTER_H_
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue