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 GENERALSETTINGS_H
22 #define GENERALSETTINGS_H
25 #include "constants.h"
26 #include "customfunctiondata.h"
27 #include "rawsource.h"
33 class GeneralSettings
;
34 class RadioDataConversionState
;
38 UART_MODE_TELEMETRY_MIRROR
,
40 UART_MODE_SBUS_TRAINER
,
46 TrainerMix() { clear(); }
47 unsigned int src
; // 0-7 = ch1-8
50 unsigned int mode
; // off, add-mode, subst-mode
51 void clear() { memset(this, 0, sizeof(TrainerMix
)); }
56 TrainerData() { clear(); }
59 void clear() { memset(this, 0, sizeof(TrainerData
)); }
62 class GeneralSettings
{
63 Q_DECLARE_TR_FUNCTIONS(GeneralSettings
)
69 BEEPER_ALARMS_ONLY
= -1,
75 void convert(RadioDataConversionState
& cstate
);
77 void setDefaultControlTypes(Board::Type board
);
78 int getDefaultStick(unsigned int channel
) const;
79 RawSource
getDefaultSource(unsigned int channel
) const;
80 int getDefaultChannel(unsigned int stick
) const;
84 int calibMid
[CPN_MAX_ANALOGS
];
85 int calibSpanNeg
[CPN_MAX_ANALOGS
];
86 int calibSpanPos
[CPN_MAX_ANALOGS
];
87 unsigned int currModelIndex
;
88 char currModelFilename
[16+1];
89 unsigned int contrast
;
90 unsigned int vBatWarn
;
91 int txVoltageCalibration
;
92 int txCurrentCalibration
;
97 unsigned int view
; // main screen view // TODO enum
98 bool disableThrottleWarning
;
100 bool disableMemoryWarning
;
101 BeeperMode beeperMode
;
102 bool disableAlarmWarning
;
103 bool disableRssiPoweroffAlarm
;
104 unsigned int usbMode
;
105 BeeperMode hapticMode
;
106 unsigned int stickMode
; // TODO enum
110 unsigned int inactivityTimer
;
114 unsigned int splashMode
;
116 unsigned int backlightDelay
;
117 unsigned int templateSetup
; //RETA order according to chout_ar array
120 unsigned int reNavigation
;
121 unsigned int stickReverse
;
122 unsigned int speakerPitch
;
124 unsigned int speakerMode
;
125 char ownerName
[10+1];
127 unsigned int gpsFormat
;
129 unsigned int backlightBright
;
130 unsigned int backlightOffBright
;
132 int temperatureCalib
;
134 unsigned int mAhWarn
;
135 unsigned int mAhUsed
;
136 unsigned int globalTimer
;
137 bool bluetoothEnable
;
138 char bluetoothName
[10+1];
139 unsigned int bluetoothBaudrate
;
140 unsigned int bluetoothMode
;
141 unsigned int sticksGain
;
142 unsigned int rotarySteps
;
143 unsigned int countryCode
;
145 unsigned int imperial
;
146 char ttsLanguage
[2+1];
153 int backgroundVolume
;
154 unsigned int mavbaud
;
155 unsigned int switchUnlockStates
;
156 unsigned int hw_uartMode
; // UartModes
157 unsigned int backlightColor
;
158 CustomFunctionData customFn
[CPN_MAX_SPECIAL_FUNCTIONS
];
159 char switchName
[CPN_MAX_SWITCHES
][3+1];
160 unsigned int switchConfig
[CPN_MAX_SWITCHES
];
161 char stickName
[CPN_MAX_STICKS
][3+1];
162 char potName
[CPN_MAX_KNOBS
][3+1];
163 unsigned int potConfig
[CPN_MAX_KNOBS
];
164 char sliderName
[CPN_MAX_SLIDERS
][3+1];
165 unsigned int sliderConfig
[CPN_MAX_SLIDERS
];
168 typedef uint8_t ThemeOptionData
[8+1];
169 ThemeOptionData themeOptionValue
[5];
171 bool switchPositionAllowedTaranis(int index
) const;
172 bool switchSourceAllowedTaranis(int index
) const;
173 bool isPotAvailable(int index
) const;
174 bool isSliderAvailable(int index
) const;
178 #endif // GENERALSETTINGS_H