Companion enhancements for checklist editor, model print and compare (2 3 branch) (#6434)
* Model print and compare include GFs enhancement * Model print and compare include checklist contents * Add missing brackets and code tidy up * Print message if cannot open or read checklist file * Missing GV label translation Move some checklist code to helpers * Refactor to use helpers and add cursor position * Move improved version of removeAccents to helpers and apply to checklist * Force fixed width font for edit window
This commit is contained in:
committed by
Bertrand Songis
parent
0544846dc3
commit
b4175eade3
@@ -24,37 +24,7 @@
|
|||||||
#include "generalsettings.h"
|
#include "generalsettings.h"
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
#include "radiodataconversionstate.h"
|
#include "radiodataconversionstate.h"
|
||||||
|
#include "helpers.h"
|
||||||
|
|
||||||
QString removeAccents(const QString & str)
|
|
||||||
{
|
|
||||||
// UTF-8 ASCII Table
|
|
||||||
static const QHash<QString, QVariant> map = {
|
|
||||||
{"a", QRegularExpression("[áâãàä]")},
|
|
||||||
{"A", QRegularExpression("[ÁÂÃÀÄ]")},
|
|
||||||
{"e", QRegularExpression("[éèêě]")},
|
|
||||||
{"E", QRegularExpression("[ÉÈÊĚ]")},
|
|
||||||
{"o", QRegularExpression("[óôõö]")},
|
|
||||||
{"O", QRegularExpression("[ÓÔÕÖ]")},
|
|
||||||
{"u", QRegularExpression("[úü]")},
|
|
||||||
{"U", QRegularExpression("[ÚÜ]")},
|
|
||||||
{"i", "í"}, {"I", "Í"},
|
|
||||||
{"c", "ç"}, {"C", "Ç"},
|
|
||||||
{"y", "ý"}, {"Y", "Ý"},
|
|
||||||
{"s", "š"}, {"S", "Š"},
|
|
||||||
{"r", "ř"}, {"R", "Ř"}
|
|
||||||
};
|
|
||||||
|
|
||||||
QString result(str);
|
|
||||||
for (QHash<QString, QVariant>::const_iterator it = map.cbegin(), en = map.cend(); it != en; ++it) {
|
|
||||||
if (it.value().canConvert<QRegularExpression>())
|
|
||||||
result.replace(it.value().toRegularExpression(), it.key());
|
|
||||||
else
|
|
||||||
result.replace(it.value().toString(), it.key());
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TimerData
|
* TimerData
|
||||||
@@ -251,7 +221,7 @@ void ModelData::setDefaultInputs(const GeneralSettings & settings)
|
|||||||
expo->mode = INPUT_MODE_BOTH;
|
expo->mode = INPUT_MODE_BOTH;
|
||||||
expo->srcRaw = settings.getDefaultSource(i);
|
expo->srcRaw = settings.getDefaultSource(i);
|
||||||
expo->weight = 100;
|
expo->weight = 100;
|
||||||
strncpy(inputNames[i], removeAccents(expo->srcRaw.toString(this)).toLatin1().constData(), sizeof(inputNames[i])-1);
|
strncpy(inputNames[i], Helpers::removeAccents(expo->srcRaw.toString(this)).toLatin1().constData(), sizeof(inputNames[i])-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QDir>
|
||||||
|
|
||||||
using namespace Helpers;
|
using namespace Helpers;
|
||||||
|
|
||||||
@@ -809,3 +810,50 @@ void TableLayout::pushRowsUp(int row)
|
|||||||
// addDoubleSpring(gridLayout, 5, num_fsw+1);
|
// addDoubleSpring(gridLayout, 5, num_fsw+1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Helpers::getChecklistsPath()
|
||||||
|
{
|
||||||
|
return QDir::toNativeSeparators(g.profile[g.id()].sdPath() + "/MODELS/"); // TODO : add sub folder to constants
|
||||||
|
}
|
||||||
|
|
||||||
|
QString Helpers::getChecklistFilename(const ModelData * model)
|
||||||
|
{
|
||||||
|
QString name = model->name;
|
||||||
|
name.replace(" ", "_");
|
||||||
|
name.append(".txt"); // TODO : add to constants
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString Helpers::getChecklistFilePath(const ModelData * model)
|
||||||
|
{
|
||||||
|
return getChecklistsPath() + getChecklistFilename(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString Helpers::removeAccents(const QString & str)
|
||||||
|
{
|
||||||
|
// UTF-8 ASCII Table
|
||||||
|
static const QHash<QString, QVariant> map = {
|
||||||
|
{"a", QRegularExpression("[áâãàä]")},
|
||||||
|
{"A", QRegularExpression("[ÁÂÃÀÄ]")},
|
||||||
|
{"e", QRegularExpression("[éèêě]")},
|
||||||
|
{"E", QRegularExpression("[ÉÈÊĚ]")},
|
||||||
|
{"o", QRegularExpression("[óôõö]")},
|
||||||
|
{"O", QRegularExpression("[ÓÔÕÖ]")},
|
||||||
|
{"u", QRegularExpression("[úü]")},
|
||||||
|
{"U", QRegularExpression("[ÚÜ]")},
|
||||||
|
{"i", "í"}, {"I", "Í"},
|
||||||
|
{"c", "ç"}, {"C", "Ç"},
|
||||||
|
{"y", "ý"}, {"Y", "Ý"},
|
||||||
|
{"s", "š"}, {"S", "Š"},
|
||||||
|
{"r", "ř"}, {"R", "Ř"}
|
||||||
|
};
|
||||||
|
|
||||||
|
QString result(str);
|
||||||
|
for (QHash<QString, QVariant>::const_iterator it = map.cbegin(), en = map.cend(); it != en; ++it) {
|
||||||
|
if (it.value().canConvert<QRegularExpression>())
|
||||||
|
result.replace(it.value().toRegularExpression(), it.key());
|
||||||
|
else
|
||||||
|
result.replace(it.value().toString(), it.key());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|||||||
@@ -128,6 +128,11 @@ namespace Helpers
|
|||||||
|
|
||||||
void exportAppSettings(QWidget * dlgParent = nullptr);
|
void exportAppSettings(QWidget * dlgParent = nullptr);
|
||||||
|
|
||||||
|
QString getChecklistsPath();
|
||||||
|
QString getChecklistFilename(const ModelData * model);
|
||||||
|
QString getChecklistFilePath(const ModelData * model);
|
||||||
|
QString removeAccents(const QString & str);
|
||||||
|
|
||||||
} // namespace Helpers
|
} // namespace Helpers
|
||||||
|
|
||||||
// TODO : move globals to Helpers namespace
|
// TODO : move globals to Helpers namespace
|
||||||
|
|||||||
@@ -20,16 +20,12 @@
|
|||||||
|
|
||||||
#include "checklistdialog.h"
|
#include "checklistdialog.h"
|
||||||
#include "ui_checklistdialog.h"
|
#include "ui_checklistdialog.h"
|
||||||
|
|
||||||
#include "appdata.h"
|
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
extern AppData g;
|
ChecklistDialog::ChecklistDialog(QWidget *parent, const ModelData * model):
|
||||||
|
|
||||||
ChecklistDialog::ChecklistDialog(QWidget *parent, const QString modelName):
|
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::ChecklistDialog),
|
ui(new Ui::ChecklistDialog),
|
||||||
mDirty(false)
|
mDirty(false)
|
||||||
@@ -37,17 +33,21 @@ ChecklistDialog::ChecklistDialog(QWidget *parent, const QString modelName):
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setWindowIcon(CompanionIcon("edit.png"));
|
setWindowIcon(CompanionIcon("edit.png"));
|
||||||
|
|
||||||
mChecklistFolder = g.profile[g.id()].sdPath() + "/MODELS/";
|
mChecklistFolder = Helpers::getChecklistsPath();
|
||||||
QString name = modelName;
|
mModelChecklist = Helpers::getChecklistFilePath(model);
|
||||||
name.replace(" ", "_");
|
|
||||||
mModelChecklist = QDir::toNativeSeparators(mChecklistFolder + name + ".txt");
|
|
||||||
ui->file->setText("File: " + mModelChecklist);
|
ui->file->setText("File: " + mModelChecklist);
|
||||||
ui->pteCheck->setPlainText(readFile(mModelChecklist,QFile::exists(mModelChecklist)));
|
ui->pteCheck->setPlainText(readFile(mModelChecklist, QFile::exists(mModelChecklist)));
|
||||||
|
|
||||||
|
QFont f("Courier", 12, QFont::Normal); // fixed width font
|
||||||
|
ui->pteCheck->setFont(f);
|
||||||
|
|
||||||
connect(ui->pteCheck, SIGNAL(textChanged()), this, SLOT(changed()));
|
connect(ui->pteCheck, SIGNAL(textChanged()), this, SLOT(changed()));
|
||||||
|
connect(ui->pteCheck, SIGNAL(cursorPositionChanged()), this, SLOT(cursorChanged()));
|
||||||
connect(ui->pbImport, SIGNAL(clicked()), this, SLOT(import()));
|
connect(ui->pbImport, SIGNAL(clicked()), this, SLOT(import()));
|
||||||
connect(ui->pbCancel, SIGNAL(clicked()), this, SLOT(reject()));
|
connect(ui->pbCancel, SIGNAL(clicked()), this, SLOT(reject()));
|
||||||
connect(ui->pbOK, SIGNAL(clicked()), this, SLOT(update()));
|
connect(ui->pbOK, SIGNAL(clicked()), this, SLOT(update()));
|
||||||
|
|
||||||
|
cursorChanged(); // force label to update
|
||||||
}
|
}
|
||||||
|
|
||||||
ChecklistDialog::~ChecklistDialog()
|
ChecklistDialog::~ChecklistDialog()
|
||||||
@@ -78,7 +78,7 @@ void ChecklistDialog::update()
|
|||||||
else {
|
else {
|
||||||
QTextStream out(&file);
|
QTextStream out(&file);
|
||||||
if (out.status()==QTextStream::Ok) {
|
if (out.status()==QTextStream::Ok) {
|
||||||
out << ui->pteCheck->toPlainText();
|
out << Helpers::removeAccents(ui->pteCheck->toPlainText());
|
||||||
if (!(out.status()==QTextStream::Ok)) {
|
if (!(out.status()==QTextStream::Ok)) {
|
||||||
QMessageBox::critical(this, tr("Model Checklist"), tr("Cannot write to file %1:\n%2.").arg(mModelChecklist, file.errorString()));
|
QMessageBox::critical(this, tr("Model Checklist"), tr("Cannot write to file %1:\n%2.").arg(mModelChecklist, file.errorString()));
|
||||||
if (!file.flush()) {
|
if (!file.flush()) {
|
||||||
@@ -105,7 +105,7 @@ QString ChecklistDialog::readFile(const QString & filepath, const bool exists)
|
|||||||
else {
|
else {
|
||||||
QTextStream in(&file);
|
QTextStream in(&file);
|
||||||
if (in.status()==QTextStream::Ok) {
|
if (in.status()==QTextStream::Ok) {
|
||||||
data = in.readAll();
|
data = Helpers::removeAccents(in.readAll());
|
||||||
if (!(in.status()==QTextStream::Ok)) {
|
if (!(in.status()==QTextStream::Ok)) {
|
||||||
QMessageBox::critical(this, tr("Model Checklist"), tr("Cannot read file %1:\n%2.").arg(QDir::toNativeSeparators(filepath), file.errorString()));
|
QMessageBox::critical(this, tr("Model Checklist"), tr("Cannot read file %1:\n%2.").arg(QDir::toNativeSeparators(filepath), file.errorString()));
|
||||||
data = "";
|
data = "";
|
||||||
@@ -116,3 +116,9 @@ QString ChecklistDialog::readFile(const QString & filepath, const bool exists)
|
|||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ChecklistDialog::cursorChanged()
|
||||||
|
{
|
||||||
|
QTextCursor tc = ui->pteCheck->textCursor();
|
||||||
|
ui->lblCursorPos->setText(tr("Line %1, Col %2").arg(tc.blockNumber() + 1).arg(tc.positionInBlock() + 1));
|
||||||
|
}
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
#ifndef _CHECKLISTDIALOG_H_
|
#ifndef _CHECKLISTDIALOG_H_
|
||||||
#define _CHECKLISTDIALOG_H_
|
#define _CHECKLISTDIALOG_H_
|
||||||
|
|
||||||
|
#include "modeldata.h"
|
||||||
|
|
||||||
#include <QtWidgets>
|
#include <QtWidgets>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
@@ -31,13 +33,14 @@ class ChecklistDialog : public QDialog {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ChecklistDialog(QWidget *parent, const QString modelName);
|
ChecklistDialog(QWidget *parent, const ModelData * model);
|
||||||
~ChecklistDialog();
|
~ChecklistDialog();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void import();
|
void import();
|
||||||
void update();
|
void update();
|
||||||
void changed();
|
void changed();
|
||||||
|
void cursorChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ChecklistDialog *ui;
|
Ui::ChecklistDialog *ui;
|
||||||
|
|||||||
@@ -65,6 +65,13 @@
|
|||||||
<property name="sizeConstraint">
|
<property name="sizeConstraint">
|
||||||
<enum>QLayout::SetMinimumSize</enum>
|
<enum>QLayout::SetMinimumSize</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lblCursorPos">
|
||||||
|
<property name="text">
|
||||||
|
<string>Line nn, Col nn</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|||||||
@@ -1355,6 +1355,6 @@ void SetupPanel::onBeepCenterToggled(bool checked)
|
|||||||
|
|
||||||
void SetupPanel::on_editText_clicked()
|
void SetupPanel::on_editText_clicked()
|
||||||
{
|
{
|
||||||
ChecklistDialog *g = new ChecklistDialog(this, ui->name->text());
|
ChecklistDialog *g = new ChecklistDialog(this, model);
|
||||||
g->exec();
|
g->exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,11 +24,15 @@
|
|||||||
#include "boards.h"
|
#include "boards.h"
|
||||||
#include "helpers_html.h"
|
#include "helpers_html.h"
|
||||||
#include "multiprotocols.h"
|
#include "multiprotocols.h"
|
||||||
|
#include "appdata.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
|
extern AppData g;
|
||||||
|
|
||||||
QString changeColor(const QString & input, const QString & to, const QString & from)
|
QString changeColor(const QString & input, const QString & to, const QString & from)
|
||||||
{
|
{
|
||||||
@@ -649,10 +653,17 @@ QString ModelPrinter::printLogicalSwitchLine(int idx)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ModelPrinter::printCustomFunctionLine(int idx)
|
QString ModelPrinter::printCustomFunctionLine(int idx, bool gfunc)
|
||||||
{
|
{
|
||||||
QString result;
|
QString result;
|
||||||
const CustomFunctionData & cf = model.customFn[idx];
|
CustomFunctionData cf;
|
||||||
|
if (gfunc) {
|
||||||
|
if (model.noGlobalFunctions)
|
||||||
|
return result;
|
||||||
|
cf = generalSettings.customFn[idx];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
cf = model.customFn[idx];
|
||||||
if (cf.swtch.type == SWITCH_TYPE_NONE)
|
if (cf.swtch.type == SWITCH_TYPE_NONE)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
@@ -1445,3 +1456,21 @@ QString ModelPrinter::printTelemetryScreen(unsigned int idx, unsigned int line,
|
|||||||
}
|
}
|
||||||
return (hd.count() > 1 ? doTableRow(hd, width / hd.count(), "left", "", true) : "" ) + doTableRow(strl, width / strl.count());
|
return (hd.count() > 1 ? doTableRow(hd, width / hd.count(), "left", "", true) : "" ) + doTableRow(strl, width / strl.count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ModelPrinter::printChecklist()
|
||||||
|
{
|
||||||
|
if (!model.displayChecklist)
|
||||||
|
return "";
|
||||||
|
QString str = tr("Error: Unable to open or read file!");
|
||||||
|
QFile file(Helpers::getChecklistFilePath(&model));
|
||||||
|
if (file.open(QFile::ReadOnly | QFile::Text)) {
|
||||||
|
QTextStream in(&file);
|
||||||
|
if (in.status() == QTextStream::Ok) {
|
||||||
|
str = in.readAll();
|
||||||
|
str.replace("\n", "<br />");
|
||||||
|
str.remove("\r");
|
||||||
|
}
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class ModelPrinter: public QObject
|
|||||||
QString printInputLine(const ExpoData & ed);
|
QString printInputLine(const ExpoData & ed);
|
||||||
QString printMixerLine(const MixData & md, bool showMultiplex, int highlightedSource = 0);
|
QString printMixerLine(const MixData & md, bool showMultiplex, int highlightedSource = 0);
|
||||||
QString printLogicalSwitchLine(int idx);
|
QString printLogicalSwitchLine(int idx);
|
||||||
QString printCustomFunctionLine(int idx);
|
QString printCustomFunctionLine(int idx, bool gfunc = false);
|
||||||
QString printChannelName(int idx);
|
QString printChannelName(int idx);
|
||||||
QString printCurveName(int idx);
|
QString printCurveName(int idx);
|
||||||
QString printCurve(int idx);
|
QString printCurve(int idx);
|
||||||
@@ -131,6 +131,7 @@ class ModelPrinter: public QObject
|
|||||||
QString printSensorDetails(unsigned int idx);
|
QString printSensorDetails(unsigned int idx);
|
||||||
QString printTelemetryScreenType(unsigned int val);
|
QString printTelemetryScreenType(unsigned int val);
|
||||||
QString printTelemetryScreen(unsigned int idx, unsigned int line, unsigned int width);
|
QString printTelemetryScreen(unsigned int idx, unsigned int line, unsigned int width);
|
||||||
|
QString printChecklist();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Firmware * firmware;
|
Firmware * firmware;
|
||||||
|
|||||||
@@ -272,6 +272,8 @@ QString MultiModelPrinter::print(QTextDocument * document)
|
|||||||
document->setDefaultStyleSheet(css.text());
|
document->setDefaultStyleSheet(css.text());
|
||||||
QString str = "<table cellspacing='0' cellpadding='3' width='100%'>"; // attributes not settable via QT stylesheet
|
QString str = "<table cellspacing='0' cellpadding='3' width='100%'>"; // attributes not settable via QT stylesheet
|
||||||
str.append(printSetup());
|
str.append(printSetup());
|
||||||
|
if (firmware->getCapability(HasDisplayText))
|
||||||
|
str.append(printChecklist());
|
||||||
if (firmware->getCapability(Timers)) {
|
if (firmware->getCapability(Timers)) {
|
||||||
str.append(printTimers());
|
str.append(printTimers());
|
||||||
}
|
}
|
||||||
@@ -283,10 +285,12 @@ QString MultiModelPrinter::print(QTextDocument * document)
|
|||||||
str.append(printInputs());
|
str.append(printInputs());
|
||||||
str.append(printMixers());
|
str.append(printMixers());
|
||||||
str.append(printOutputs());
|
str.append(printOutputs());
|
||||||
str += printCurves(document);
|
str.append(printCurves(document));
|
||||||
if (firmware->getCapability(Gvars) && !firmware->getCapability(GvarsFlightModes))
|
if (firmware->getCapability(Gvars) && !firmware->getCapability(GvarsFlightModes))
|
||||||
str.append(printGvars());
|
str.append(printGvars());
|
||||||
str.append(printLogicalSwitches());
|
str.append(printLogicalSwitches());
|
||||||
|
if (firmware->getCapability(GlobalFunctions))
|
||||||
|
str.append(printGlobalFunctions());
|
||||||
str.append(printSpecialFunctions());
|
str.append(printSpecialFunctions());
|
||||||
if (firmware->getCapability(Telemetry) & TM_HASTELEMETRY) {
|
if (firmware->getCapability(Telemetry) & TM_HASTELEMETRY) {
|
||||||
str.append(printTelemetry());
|
str.append(printTelemetry());
|
||||||
@@ -917,3 +921,59 @@ QString MultiModelPrinter::printTelemetryScreens()
|
|||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString MultiModelPrinter::printGlobalFunctions()
|
||||||
|
{
|
||||||
|
QString str;
|
||||||
|
QString txt;
|
||||||
|
int count = 0;
|
||||||
|
int idx = -1;
|
||||||
|
MultiColumns columns(modelPrinterMap.size());
|
||||||
|
columns.appendSectionTableStart();
|
||||||
|
|
||||||
|
for (int k=0; k < modelPrinterMap.size(); k++) {
|
||||||
|
if (!modelPrinterMap.value(k).first->noGlobalFunctions) {
|
||||||
|
idx = k;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (idx > -1) {
|
||||||
|
ModelPrinter * modelPrinter = modelPrinterMap.value(idx).second;
|
||||||
|
(void)(modelPrinter);
|
||||||
|
|
||||||
|
for (int i=0; i < firmware->getCapability(GlobalFunctions); i++) {
|
||||||
|
txt = modelPrinter->printCustomFunctionLine(i, true);
|
||||||
|
if (!txt.isEmpty()) {
|
||||||
|
count++;
|
||||||
|
ROWLABELCOMPARECELL(tr("GF%1").arg(i+1), 20, modelPrinter->printCustomFunctionLine(i, true), 80);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
columns.appendTableEnd();
|
||||||
|
if (count > 0) {
|
||||||
|
str.append(printTitle(tr("Global Functions")));
|
||||||
|
str.append(columns.print());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString MultiModelPrinter::printChecklist()
|
||||||
|
{
|
||||||
|
QString str;
|
||||||
|
MultiColumns columns(modelPrinterMap.size());
|
||||||
|
bool isChecklist = false;
|
||||||
|
for (int k=0; k < modelPrinterMap.size(); k++) {
|
||||||
|
if (modelPrinterMap.value(k).first->displayChecklist) {
|
||||||
|
isChecklist = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isChecklist) {
|
||||||
|
columns.appendSectionTableStart();
|
||||||
|
ROWLABELCOMPARECELL(tr("Checklist"), 20, modelPrinter->printChecklist(), 80);
|
||||||
|
columns.appendTableEnd();
|
||||||
|
str.append(columns.print());
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ class MultiModelPrinter: public QObject
|
|||||||
QString printTimers();
|
QString printTimers();
|
||||||
QString printSensors();
|
QString printSensors();
|
||||||
QString printTelemetryScreens();
|
QString printTelemetryScreens();
|
||||||
|
QString printGlobalFunctions();
|
||||||
|
QString printChecklist();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _MULTIMODELPRINTER_H_
|
#endif // _MULTIMODELPRINTER_H_
|
||||||
|
|||||||
Reference in New Issue
Block a user