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.
26 #define CPN_MAX_SENSORS 32
29 Q_DECLARE_TR_FUNCTIONS(SensorData
)
42 TELEM_FORMULA_AVERAGE
,
45 TELEM_FORMULA_MULTIPLY
,
46 TELEM_FORMULA_TOTALIZE
,
48 TELEM_FORMULA_CONSUMPTION
,
50 TELEM_FORMULA_LAST
= TELEM_FORMULA_DIST
54 TELEM_CELL_INDEX_LOWEST
,
61 TELEM_CELL_INDEX_HIGHEST
,
62 TELEM_CELL_INDEX_DELTA
,
72 UNIT_METERS_PER_SECOND
,
94 // FrSky format used for these fields, could be another format in the future
96 UNIT_CELLS
= UNIT_FIRST_VIRTUAL
,
101 UNIT_GPS_LONGITUDE_EW
,
102 UNIT_GPS_LATITUDE_NS
,
104 UNIT_DATETIME_DAY_MONTH
,
105 UNIT_DATETIME_HOUR_MIN
,
109 SensorData() { clear(); }
110 unsigned int type
; // custom / formula
113 unsigned int instance
;
114 unsigned int persistentValue
;
115 unsigned int formula
;
125 // for custom sensors
143 bool isAvailable() const { return strlen(label
) > 0; }
145 QString
unitString() const;
146 QString
nameToString(int index
) const;
147 void clear() { memset(this, 0, sizeof(SensorData
)); }
150 #endif // SENSORDATA_H