chore(cpn): move capabilities from firmware to boards, remove unused (#7070)
This commit is contained in:
@@ -420,8 +420,6 @@ QString ModelPrinter::printMixerLine(const MixData & mix, bool showMultiplex, in
|
||||
else if (mix.carryTrim < 0)
|
||||
str += " " + RawSource(SOURCE_TYPE_TRIM, (-(mix.carryTrim)-1) + 1).toString(&model, &generalSettings);
|
||||
|
||||
if (firmware->getCapability(HasNoExpo) && mix.noExpo)
|
||||
str += " " + tr("No DR/Expo").toHtmlEscaped();
|
||||
if (mix.sOffset)
|
||||
str += " " + tr("Offset(%1)").arg(SourceNumRef(mix.sOffset).toString(&model, &generalSettings)).toHtmlEscaped();
|
||||
if (mix.curve.value)
|
||||
@@ -634,12 +632,11 @@ QString ModelPrinter::printLogicalSwitchLine(int idx)
|
||||
result += RawSwitch(ls.andsw).toString(getCurrentBoard(), &generalSettings);
|
||||
}
|
||||
|
||||
if (firmware->getCapability(LogicalSwitchesExt)) {
|
||||
if (ls.duration)
|
||||
result += " " + tr("Duration") + QString("(%1s)").arg(ls.duration/10.0);
|
||||
if (ls.delay)
|
||||
result += " " + tr("Delay") + QString("(%1s)").arg(ls.delay/10.0);
|
||||
}
|
||||
if (ls.duration)
|
||||
result += " " + tr("Duration") + QString("(%1s)").arg(ls.duration/10.0);
|
||||
|
||||
if (ls.delay)
|
||||
result += " " + tr("Delay") + QString("(%1s)").arg(ls.delay/10.0);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -746,8 +743,7 @@ QString ModelPrinter::printSettingsOther()
|
||||
{
|
||||
QStringList str;
|
||||
str << printLabelValue(tr("Extended Limits"), printBoolean(model.extendedLimits, BOOLEAN_YESNO));
|
||||
if (firmware->getCapability(HasDisplayText))
|
||||
str << printLabelValue(tr("Display Checklist"), printBoolean(model.displayChecklist, BOOLEAN_YESNO));
|
||||
str << printLabelValue(tr("Display Checklist"), printBoolean(model.displayChecklist, BOOLEAN_YESNO));
|
||||
if (firmware->getCapability(GlobalFunctions))
|
||||
str << printLabelValue(tr("Global Functions"), printBoolean(!model.noGlobalFunctions, BOOLEAN_YESNO));
|
||||
return str.join(" ");
|
||||
|
||||
@@ -274,8 +274,7 @@ QString MultiModelPrinter::print(QTextDocument * document)
|
||||
document->setDefaultStyleSheet(css.text());
|
||||
QString str = "<table cellspacing='0' cellpadding='3' width='100%'>"; // attributes not settable via QT stylesheet
|
||||
str.append(printSetup());
|
||||
if (firmware->getCapability(HasDisplayText))
|
||||
str.append(printChecklist());
|
||||
str.append(printChecklist());
|
||||
if (firmware->getCapability(Timers)) {
|
||||
str.append(printTimers());
|
||||
}
|
||||
@@ -292,18 +291,14 @@ QString MultiModelPrinter::print(QTextDocument * document)
|
||||
str.append(printMixers());
|
||||
str.append(printOutputs());
|
||||
str.append(printCurves(document));
|
||||
if (firmware->getCapability(Gvars) && !firmware->getCapability(GvarsFlightModes))
|
||||
str.append(printGvars());
|
||||
str.append(printLogicalSwitches());
|
||||
if (firmware->getCapability(GlobalFunctions))
|
||||
str.append(printGlobalFunctions());
|
||||
str.append(printSpecialFunctions());
|
||||
if (firmware->getCapability(Telemetry)) {
|
||||
str.append(printTelemetry());
|
||||
str.append(printSensors());
|
||||
if (firmware->getCapability(TelemetryCustomScreens)) {
|
||||
str.append(printTelemetryScreens());
|
||||
}
|
||||
str.append(printTelemetry());
|
||||
str.append(printSensors());
|
||||
if (firmware->getCapability(TelemetryCustomScreens)) {
|
||||
str.append(printTelemetryScreens());
|
||||
}
|
||||
str.append("</table>");
|
||||
return str;
|
||||
@@ -463,71 +458,63 @@ QString MultiModelPrinter::printFlightModes()
|
||||
// GVars
|
||||
int gvars = firmware->getCapability(Gvars);
|
||||
|
||||
if (gvars && firmware->getCapability(GvarsFlightModes)) {
|
||||
MultiColumns columns(modelPrinterMap.size());
|
||||
columns.appendSectionTableStart();
|
||||
QStringList hd = QStringList() << tr("Global vars");
|
||||
if (firmware->getCapability(GvarsFlightModes)) {
|
||||
for (int i = 0; i < gvars; i++) {
|
||||
hd << tr("GV%1").arg(i + 1);
|
||||
}
|
||||
}
|
||||
columns.appendRowHeader(hd);
|
||||
int wd = 80 / gvars;
|
||||
if (firmware->getCapability(GvarsFlightModes)) {
|
||||
columns.appendRowStart(tr("Name"), 20);
|
||||
for (int i = 0; i < gvars; i++) {
|
||||
COMPARECELLWIDTH(model->gvarData[i].name, wd);
|
||||
}
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart(tr("Unit"));
|
||||
for (int i = 0; i < gvars; i++) {
|
||||
COMPARECELL(modelPrinter->printGlobalVarUnit(i));
|
||||
}
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart(tr("Prec"));
|
||||
for (int i = 0; i < gvars; i++) {
|
||||
COMPARECELL(modelPrinter->printGlobalVarPrec(i));
|
||||
}
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart(tr("Min"));
|
||||
for (int i = 0; i < gvars; i++) {
|
||||
COMPARECELL(modelPrinter->printGlobalVarMin(i));
|
||||
}
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart(tr("Max"));
|
||||
for (int i = 0; i < gvars; i++) {
|
||||
COMPARECELL(modelPrinter->printGlobalVarMax(i));
|
||||
}
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart(tr("Popup"));
|
||||
for (int i = 0; i < gvars; i++) {
|
||||
COMPARECELL(modelPrinter->printGlobalVarPopup(i));
|
||||
}
|
||||
columns.appendRowEnd();
|
||||
}
|
||||
|
||||
columns.appendRowHeader(
|
||||
QStringList() << (Boards::getCapability(getCurrentBoard(), Board::Air)
|
||||
? tr("Flight mode")
|
||||
: tr("Drive mode")));
|
||||
|
||||
for (int i = 0; i < firmware->getCapability(FlightModes); i++) {
|
||||
columns.appendRowStart();
|
||||
columns.appendCellStart(0, true);
|
||||
COMPARE(modelPrinter->printFlightModeName(i));
|
||||
columns.appendCellEnd(true);
|
||||
if (firmware->getCapability(GvarsFlightModes)) {
|
||||
for (int k = 0; k < gvars; k++) {
|
||||
COMPARECELL(modelPrinter->printGlobalVar(i, k));
|
||||
}
|
||||
}
|
||||
|
||||
columns.appendRowEnd();
|
||||
}
|
||||
columns.appendTableEnd();
|
||||
str.append(columns.print());
|
||||
MultiColumns columns(modelPrinterMap.size());
|
||||
columns.appendSectionTableStart();
|
||||
QStringList hd = QStringList() << tr("Global vars");
|
||||
for (int i = 0; i < gvars; i++) {
|
||||
hd << tr("GV%1").arg(i + 1);
|
||||
}
|
||||
columns.appendRowHeader(hd);
|
||||
int wd = 80 / gvars;
|
||||
columns.appendRowStart(tr("Name"), 20);
|
||||
for (int i = 0; i < gvars; i++) {
|
||||
COMPARECELLWIDTH(model->gvarData[i].name, wd);
|
||||
}
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart(tr("Unit"));
|
||||
for (int i = 0; i < gvars; i++) {
|
||||
COMPARECELL(modelPrinter->printGlobalVarUnit(i));
|
||||
}
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart(tr("Prec"));
|
||||
for (int i = 0; i < gvars; i++) {
|
||||
COMPARECELL(modelPrinter->printGlobalVarPrec(i));
|
||||
}
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart(tr("Min"));
|
||||
for (int i = 0; i < gvars; i++) {
|
||||
COMPARECELL(modelPrinter->printGlobalVarMin(i));
|
||||
}
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart(tr("Max"));
|
||||
for (int i = 0; i < gvars; i++) {
|
||||
COMPARECELL(modelPrinter->printGlobalVarMax(i));
|
||||
}
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart(tr("Popup"));
|
||||
for (int i = 0; i < gvars; i++) {
|
||||
COMPARECELL(modelPrinter->printGlobalVarPopup(i));
|
||||
}
|
||||
columns.appendRowEnd();
|
||||
|
||||
columns.appendRowHeader(
|
||||
QStringList() << (Boards::getCapability(getCurrentBoard(), Board::Air)
|
||||
? tr("Flight mode")
|
||||
: tr("Drive mode")));
|
||||
|
||||
for (int i = 0; i < firmware->getCapability(FlightModes); i++) {
|
||||
columns.appendRowStart();
|
||||
columns.appendCellStart(0, true);
|
||||
COMPARE(modelPrinter->printFlightModeName(i));
|
||||
columns.appendCellEnd(true);
|
||||
for (int k = 0; k < gvars; k++) {
|
||||
COMPARECELL(modelPrinter->printGlobalVar(i, k));
|
||||
}
|
||||
|
||||
columns.appendRowEnd();
|
||||
}
|
||||
columns.appendTableEnd();
|
||||
str.append(columns.print());
|
||||
|
||||
return str;
|
||||
}
|
||||
@@ -542,16 +529,14 @@ QString MultiModelPrinter::printOutputs()
|
||||
hd << tr("Curve");
|
||||
if (firmware->getCapability(PPMCenter))
|
||||
hd << tr("PPM");
|
||||
if (firmware->getCapability(SYMLimits))
|
||||
hd << tr("Linear");
|
||||
hd << tr("Linear");
|
||||
columns.appendRowHeader(hd);
|
||||
int cols = 4;
|
||||
if (IS_HORUS_OR_TARANIS(firmware->getBoard()))
|
||||
cols++;
|
||||
if (firmware->getCapability(PPMCenter))
|
||||
cols++;
|
||||
if (firmware->getCapability(SYMLimits))
|
||||
cols++;
|
||||
cols++;
|
||||
int wd = 80/cols;
|
||||
for (int i=0; i<firmware->getCapability(Outputs); i++) {
|
||||
int count = 0;
|
||||
@@ -573,9 +558,7 @@ QString MultiModelPrinter::printOutputs()
|
||||
if (firmware->getCapability(PPMCenter)) {
|
||||
COMPARECELLWIDTH(modelPrinter->printOutputPpmCenter(i), wd);
|
||||
}
|
||||
if (firmware->getCapability(SYMLimits)) {
|
||||
COMPARECELLWIDTH(modelPrinter->printOutputSymetrical(i), wd);
|
||||
}
|
||||
COMPARECELLWIDTH(modelPrinter->printOutputSymetrical(i), wd);
|
||||
columns.appendRowEnd();
|
||||
}
|
||||
columns.appendTableEnd();
|
||||
@@ -583,27 +566,6 @@ QString MultiModelPrinter::printOutputs()
|
||||
return str;
|
||||
}
|
||||
|
||||
QString MultiModelPrinter::printGvars()
|
||||
{
|
||||
QString str = printTitle(tr("Global Variables"));
|
||||
int gvars = firmware->getCapability(Gvars);
|
||||
MultiColumns columns(modelPrinterMap.size());
|
||||
columns.appendSectionTableStart();
|
||||
QStringList hd;
|
||||
for (int i=0; i<gvars; i++) {
|
||||
hd << tr("GV%1").arg(i+1);
|
||||
}
|
||||
columns.appendRowHeader(hd);
|
||||
|
||||
for (int i=0; i<gvars; i++) {
|
||||
COMPARECELL(model->flightModeData[0].gvars[i]);
|
||||
}
|
||||
columns.appendRowEnd();
|
||||
columns.appendTableEnd();
|
||||
str.append(columns.print());
|
||||
return str;
|
||||
}
|
||||
|
||||
QString MultiModelPrinter::printInputs()
|
||||
{
|
||||
QString str = printTitle(tr("Inputs"));
|
||||
|
||||
@@ -87,7 +87,6 @@ class MultiModelPrinter: public QObject
|
||||
QString printInputs();
|
||||
QString printMixers();
|
||||
QString printCurves(QTextDocument * document);
|
||||
QString printGvars();
|
||||
QString printLogicalSwitches();
|
||||
QString printSpecialFunctions();
|
||||
QString printTelemetry();
|
||||
|
||||
Reference in New Issue
Block a user