Fix doc path
[opentx.git] / companion / src / modelprinter.h
blob053ce85a99945bfb9c57a7b788cb5d236bd67518
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 _MODELPRINTER_H_
22 #define _MODELPRINTER_H_
24 #include <QString>
25 #include <QStringList>
26 #include <QPainter>
27 #include <QTextDocument>
28 #include "eeprominterface.h"
30 QString changeColor(const QString & input, const QString & to, const QString & from = "grey");
31 QString addFont(const QString & input, const QString & color = "", const QString & size = "", const QString & face = "");
32 void debugHtml(const QString & html);
33 QString formatTitle(const QString & name);
35 class CurveImage
37 public:
38 CurveImage();
39 void drawCurve(const CurveData & curve, QColor color);
40 const QImage & get() const { return image; }
42 protected:
43 int size;
44 QImage image;
45 QPainter painter;
48 class ModelPrinter: public QObject
50 Q_OBJECT
52 public:
53 ModelPrinter(Firmware * firmware, const GeneralSettings & generalSettings, const ModelData & model);
54 virtual ~ModelPrinter();
56 QString printBoolean(const bool val, const int typ);
57 QString printEEpromSize();
58 QString printTrimIncrementMode();
59 QString printThrottle();
60 QString printFlightModeSwitch(const RawSwitch & swtch);
61 QString printFlightModeName(int index);
62 QString printFlightModes(unsigned int flightModes);
63 QString printInputFlightModes(unsigned int flightModes);
64 QString printModule(int idx);
65 QString printTrainerMode();
66 QString printCenterBeep();
67 QString printHeliSwashType();
68 QString printTrim(int flightModeIndex, int stickIndex);
69 QString printGlobalVar(int flightModeIndex, int gvarIndex);
70 QString printRotaryEncoder(int flightModeIndex, int reIndex);
71 QString printTimer(int idx);
72 QString printTimer(const TimerData & timer);
73 QString printInputName(int idx);
74 QString printInputLine(int idx);
75 QString printInputLine(const ExpoData & ed);
76 QString printMixerLine(const MixData & md, bool showMultiplex, int highlightedSource = 0);
77 QString printLogicalSwitchLine(int idx);
78 QString printCustomFunctionLine(int idx);
79 QString printChannelName(int idx);
80 QString printCurveName(int idx);
81 QString printCurve(int idx);
82 QString createCurveImage(int idx, QTextDocument * document);
83 QString printGlobalVarUnit(int idx);
84 QString printGlobalVarPrec(int idx);
85 QString printGlobalVarMin(int idx);
86 QString printGlobalVarMax(int idx);
87 QString printGlobalVarPopup(int idx);
88 QString printOutputValueGVar(int val);
89 QString printOutputOffset(int idx);
90 QString printOutputMin(int idx);
91 QString printOutputMax(int idx);
92 QString printOutputRevert(int idx);
93 QString printOutputCurve(int idx);
94 QString printOutputPpmCenter(int idx);
95 QString printOutputSymetrical(int idx);
96 QString printSettingsOther();
97 QString printModuleType(int idx);
98 QString printThrottleSource(int idx);
99 QString printTrimsDisplayMode();
100 QString printSettingsTrim();
101 QString printSwitchWarnings();
102 QString printPotWarnings();
103 QString printPotsWarningMode();
104 QString printPxxPower(int power);
105 QString printFailsafe(int idx);
106 QString printFailsafeMode(unsigned int fsmode);
107 QString printFailsafeValue(int val);
108 QString printTimerCountdownBeep(unsigned int countdownBeep);
109 QString printTimerPersistent(unsigned int persistent);
110 QString printPPMFrameLength(int ppmFL);
111 QString printTimerName(int idx);
112 QString printTimeValue(const int value, const unsigned int mask);
113 QString printTimerMinuteBeep(bool mb);
114 QString printTimerTimeValue(unsigned int val);
115 QString printTelemetryProtocol(unsigned int val);
116 QString printLabelValue(const QString & lbl, const QString & val, const bool sep = false);
117 QString printLabelValues(const QString & lbl, const QStringList & vals, const bool sep = false);
118 QString printRssiAlarmsDisabled(bool mb);
119 QString printTelemetrySource(int val);
120 QString printVarioSource(unsigned int val);
121 QString printVarioCenterSilent(bool mb);
122 QString printVoltsSource(unsigned int val);
123 QString printCurrentSource(unsigned int val);
124 QString printMahPersistent(bool mb);
125 QString printIgnoreSensorIds(bool mb);
126 QString printSensorType(unsigned int val);
127 QString printSensorFormula(unsigned int val);
128 QString printSensorCells(unsigned int val);
129 QString printSensorTypeCond(unsigned int idx);
130 QString printSensorParams(unsigned int idx);
131 QString printSensorDetails(unsigned int idx);
132 QString printTelemetryScreenType(unsigned int val);
133 QString printTelemetryScreen(unsigned int idx, unsigned int line, unsigned int width);
135 private:
136 Firmware * firmware;
137 const GeneralSettings & generalSettings;
138 const ModelData & model;
142 #endif // _MODELPRINTER_H_