5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef _MULTIMODELPRINTER_H_
22 #define _MULTIMODELPRINTER_H_
25 #include <QTextDocument>
26 #include "eeprominterface.h"
27 #include "modelprinter.h"
29 class MultiModelPrinter
: public QObject
34 MultiModelPrinter(Firmware
* firmware
);
35 virtual ~MultiModelPrinter();
37 void setModel(int idx
, const ModelData
* model
, const GeneralSettings
* generalSettings
);
38 void setModel(int idx
, const ModelData
* model
);
40 QString
print(QTextDocument
* document
);
45 MultiColumns(int count
);
49 void append(const QString
& str
);
50 void appendTitle(const QString
& name
);
51 void append(int idx
, const QString
& str
);
52 template <class T
> void append(int idx
, T val
);
55 void appendLineBreak();
56 void appendSectionTableStart();
57 void appendTableEnd();
58 void appendRowStart(const QString
& title
= "", const unsigned int titlewidth
= 0);
60 void appendCellStart(const unsigned int width
= 0, const bool bold
= false);
61 void appendCellEnd(const bool bold
= false);
62 void appendLabelCell(const QString
& str
, const unsigned int width
= 0, const QString
& align
= "left", const QString
& color
= "");
63 void appendValueCell(const QString
& str
, const unsigned int width
= 0, const QString
& align
= "left", const QString
& color
= "");
64 void appendRow(const QStringList
& strl
, const unsigned int width
= 0, const QString
& align
= "left", const QString
& color
= "");
65 void appendRowHeader(const QStringList
& strl
, const unsigned int width
= 0, const QString
& align
= "left", const QString
& color
= "");
66 void appendRowBlank();
67 void appendFieldLabel(const QString
& lbl
= "");
68 void appendFieldSeparator(const bool sep
= false);
73 QString
* compareColumns
;
77 GeneralSettings defaultSettings
;
78 QMap
<int, QPair
<const ModelData
*, ModelPrinter
*> > modelPrinterMap
;
80 QString
printTitle(const QString
& label
);
82 QString
printModules();
83 QString
printHeliSetup();
84 QString
printFlightModes();
85 QString
printOutputs();
86 QString
printInputs();
87 QString
printMixers();
88 QString
printCurves(QTextDocument
* document
);
90 QString
printLogicalSwitches();
91 QString
printSpecialFunctions();
92 QString
printTelemetry();
93 QString
printTimers();
94 QString
printSensors();
95 QString
printTelemetryScreens();
96 QString
printGlobalFunctions();
97 QString
printChecklist();
100 #endif // _MULTIMODELPRINTER_H_