Update CREDITS.txt
[opentx.git] / companion / src / multimodelprinter.h
blobc9045ae5cd7f5a25a49f78d3782fab54248951b0
1 /*
2 * Copyright (C) OpenTX
4 * Based on code named
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_
24 #include <QObject>
25 #include <QTextDocument>
26 #include "eeprominterface.h"
27 #include "modelprinter.h"
29 class MultiModelPrinter: public QObject
31 Q_OBJECT
33 public:
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);
39 void clearModels();
40 QString print(QTextDocument * document);
42 protected:
43 class MultiColumns {
44 public:
45 MultiColumns(int count);
46 ~MultiColumns();
47 bool isEmpty();
48 QString print();
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);
53 void beginCompare();
54 void endCompare(const QString & color = "grey");
55 private:
56 int count;
57 QString * columns;
58 QString * compareColumns;
61 Firmware * firmware;
62 GeneralSettings defaultSettings;
63 QMap<int, QPair<const ModelData *, ModelPrinter *> > modelPrinterMap;
65 QString printTitle(const QString & label);
66 QString printSetup();
67 QString printModules();
68 QString printHeliSetup();
69 QString printFlightModes();
70 QString printOutputs();
71 QString printInputs();
72 QString printMixers();
73 QString printCurves(QTextDocument * document);
74 QString printGvars();
75 QString printLogicalSwitches();
76 QString printCustomFunctions();
77 QString printTelemetry();
78 QString printTimers();
81 #endif // _MULTIMODELPRINTER_H_