14 SWITCH_THR
= SWITCH_NONE
+1,
24 SWITCH_SA0
= SWITCH_NONE
+1,
69 FAILSAFE_LAST
= FAILSAFE_RECEIVER
72 #define CHAR_FOR_NAMES " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-."
73 #define CHAR_FOR_NAMES_REGEX "[ A-Za-z0-9_.-,]*"
76 HELI_SWASH_TYPE_NONE
=0,
84 class GeneralSettings
;
86 enum TelemetrySource
{
87 TELEMETRY_SOURCE_TX_BATT
,
88 TELEMETRY_SOURCE_TX_TIME
,
89 TELEMETRY_SOURCE_TIMER1
,
90 TELEMETRY_SOURCE_TIMER2
,
91 TELEMETRY_SOURCE_TIMER3
,
93 TELEMETRY_SOURCE_RSSI_TX
,
94 TELEMETRY_SOURCE_RSSI_RX
,
100 TELEMETRY_SOURCE_RPM
,
101 TELEMETRY_SOURCE_FUEL
,
104 TELEMETRY_SOURCE_SPEED
,
105 TELEMETRY_SOURCE_DIST
,
106 TELEMETRY_SOURCE_GPS_ALT
,
107 TELEMETRY_SOURCE_CELL
,
108 TELEMETRY_SOURCE_CELLS_SUM
,
109 TELEMETRY_SOURCE_VFAS
,
110 TELEMETRY_SOURCE_CURRENT
,
111 TELEMETRY_SOURCE_CONSUMPTION
,
112 TELEMETRY_SOURCE_POWER
,
113 TELEMETRY_SOURCE_ACCX
,
114 TELEMETRY_SOURCE_ACCY
,
115 TELEMETRY_SOURCE_ACCZ
,
116 TELEMETRY_SOURCE_HDG
,
117 TELEMETRY_SOURCE_VERTICAL_SPEED
,
118 TELEMETRY_SOURCE_ASPEED
,
119 TELEMETRY_SOURCE_DTE
,
120 TELEMETRY_SOURCE_A1_MIN
,
121 TELEMETRY_SOURCE_A2_MIN
,
122 TELEMETRY_SOURCE_A3_MIN
,
123 TELEMETRY_SOURCE_A4_MIN
,
124 TELEMETRY_SOURCE_ALT_MIN
,
125 TELEMETRY_SOURCE_ALT_MAX
,
126 TELEMETRY_SOURCE_RPM_MAX
,
127 TELEMETRY_SOURCE_T1_MAX
,
128 TELEMETRY_SOURCE_T2_MAX
,
129 TELEMETRY_SOURCE_SPEED_MAX
,
130 TELEMETRY_SOURCE_DIST_MAX
,
131 TELEMETRY_SOURCE_ASPEED_MAX
,
132 TELEMETRY_SOURCE_CELL_MIN
,
133 TELEMETRY_SOURCE_CELLS_MIN
,
134 TELEMETRY_SOURCE_VFAS_MIN
,
135 TELEMETRY_SOURCE_CURRENT_MAX
,
136 TELEMETRY_SOURCE_POWER_MAX
,
137 TELEMETRY_SOURCE_ACC
,
138 TELEMETRY_SOURCE_GPS_TIME
,
139 TELEMETRY_SOURCES_STATUS_COUNT
= TELEMETRY_SOURCE_GPS_TIME
+1,
140 TELEMETRY_SOURCES_DISPLAY_COUNT
= TELEMETRY_SOURCE_POWER_MAX
+1,
141 TELEMETRY_SOURCES_COUNT
= TELEMETRY_SOURCE_POWER_MAX
+1,
142 TELEMETRY_SOURCE_RESERVE
= -1
145 #define TM_HASTELEMETRY 0x01
146 #define TM_HASOFFSET 0x02
147 #define TM_HASWSHH 0x04
151 SOURCE_TYPE_VIRTUAL_INPUT
,
152 SOURCE_TYPE_LUA_OUTPUT
,
153 SOURCE_TYPE_STICK
, // and POTS
154 SOURCE_TYPE_ROTARY_ENCODER
,
158 SOURCE_TYPE_CUSTOM_SWITCH
,
164 SOURCE_TYPE_TELEMETRY
,
180 float getValue(int value
);
190 #define RANGE_SINGLE_PRECISION 1
191 #define RANGE_DELTA_FUNCTION 2
192 #define RANGE_DELTA_ABS_FUNCTION 4
197 type(SOURCE_TYPE_NONE
),
202 explicit RawSource(int value
):
203 type(RawSourceType(abs(value
)/65536)),
204 index(value
>= 0 ? abs(value
)%65536 : -(abs(value
)%65536))
208 RawSource(RawSourceType type
, int index
=0):
214 RawSource
convert(Board::Type before
, Board::Type after
);
216 inline const int toValue() const
218 return index
>= 0 ? (type
* 65536 + index
) : -(type
* 65536 - index
);
221 QString
toString(const ModelData
* model
= NULL
, const GeneralSettings
* const generalSettings
= NULL
) const;
223 RawSourceRange
getRange(const ModelData
* model
, const GeneralSettings
& settings
, unsigned int flags
=0) const;
225 bool operator == ( const RawSource
& other
) {
226 return (this->type
== other
.type
) && (this->index
== other
.index
);
229 bool operator != ( const RawSource
& other
) {
230 return (this->type
!= other
.type
) || (this->index
!= other
.index
);
233 bool isTimeBased() const;
234 bool isStick(int * potsIndex
= NULL
) const;
235 bool isPot(int * potsIndex
= NULL
) const;
236 bool isSlider(int * sliderIndex
= NULL
) const;
246 SWITCH_TYPE_MULTIPOS_POT
,
248 SWITCH_TYPE_ROTARY_ENCODER
,
252 SWITCH_TYPE_FLIGHT_MODE
,
253 SWITCH_TYPE_TIMER_MODE
,
254 SWITCH_TYPE_TELEMETRY
,
261 type(SWITCH_TYPE_NONE
),
266 explicit RawSwitch(int value
):
267 type(RawSwitchType(abs(value
)/256)),
268 index(value
>= 0 ? abs(value
)%256 : -(abs(value
)%256))
272 RawSwitch(RawSwitchType type
, int index
=0):
278 inline const int toValue() const
280 return index
>= 0 ? (type
* 256 + index
) : -(type
* 256 - index
);
283 QString
toString(Board::Type board
= Board::BOARD_UNKNOWN
, const GeneralSettings
* const generalSettings
= NULL
, const ModelData
* const modelData
= NULL
) const;
285 bool operator== ( const RawSwitch
& other
) {
286 return (this->type
== other
.type
) && (this->index
== other
.index
);
289 bool operator!= ( const RawSwitch
& other
) {
290 return (this->type
!= other
.type
) || (this->index
!= other
.index
);
293 RawSwitch
convert(Board::Type before
, Board::Type after
);
299 class CurveReference
{
308 CurveReference() { clear(); }
310 CurveReference(CurveRefType type
, int value
):
316 void clear() { memset(this, 0, sizeof(CurveReference
)); }
321 QString
toString(const ModelData
* model
= NULL
, bool verbose
= true) const;
333 ExpoData() { clear(); }
339 unsigned int flightModes
; // -5=!FP4, 0=normal, 5=FP4
342 CurveReference curve
;
345 void clear() { memset(this, 0, sizeof(ExpoData
)); }
346 void convert(Board::Type before
, Board::Type after
);
360 CURVE_TYPE_LAST
= CURVE_TYPE_CUSTOM
364 void clear(int count
);
365 bool isEmpty() const;
366 QString
nameToString(const int idx
) const;
371 CurvePoint points
[CPN_MAX_POINTS
];
377 LimitData() { clear(); }
385 CurveReference curve
;
386 QString
minToString() const;
387 QString
maxToString() const;
388 QString
offsetToString() const;
389 QString
revertToString() const;
399 #define MIXDATA_NAME_LEN 10
403 MixData() { clear(); }
404 void convert(Board::Type before
, Board::Type after
);
406 unsigned int destCh
; // 1..CPN_MAX_CHNOUT
410 CurveReference curve
; //0=symmetrisch
411 unsigned int delayUp
;
412 unsigned int delayDown
;
413 unsigned int speedUp
; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
414 unsigned int speedDown
; // 0 nichts
417 MltpxValue mltpx
; // multiplex method 0=+ 1=* 2=replace
418 unsigned int mixWarn
; // mixer warning
419 unsigned int flightModes
; // -5=!FP4, 0=normal, 5=FP4
421 char name
[MIXDATA_NAME_LEN
+1];
423 void clear() { memset(this, 0, sizeof(MixData
)); }
443 LS_FN_VEQUAL
, // added at the end to avoid everything renumbered
448 // later ... LS_FN_RANGE,
452 enum CSFunctionFamily
{
461 class LogicalSwitchData
{ // Logical Switches data
463 LogicalSwitchData(unsigned int func
=0)
473 unsigned int duration
;
476 void clear() { memset(this, 0, sizeof(LogicalSwitchData
)); }
477 bool isEmpty() const;
478 CSFunctionFamily
getFunctionFamily() const;
479 unsigned int getRangeFlags() const;
480 QString
funcToString() const;
481 void convert(Board::Type before
, Board::Type after
);
486 FuncOverrideCH32
= FuncOverrideCH1
+CPN_MAX_CHNOUT
-1,
509 FuncBackgroundMusicPause
,
511 FuncAdjustGVLast
= FuncAdjustGV1
+CPN_MAX_GVARS
-1,
512 FuncSetFailsafeInternalModule
,
513 FuncSetFailsafeExternalModule
,
514 FuncRangeCheckInternalModule
,
515 FuncRangeCheckExternalModule
,
516 FuncBindInternalModule
,
517 FuncBindExternalModule
,
524 FUNC_ADJUST_GVAR_CONSTANT
,
525 FUNC_ADJUST_GVAR_SOURCE
,
526 FUNC_ADJUST_GVAR_GVAR
,
527 FUNC_ADJUST_GVAR_INCDEC
530 class CustomFunctionData
{ // Function Switches data
532 CustomFunctionData(AssignFunc func
=FuncOverrideCH1
) { clear(); this->func
= func
; }
537 unsigned int enabled
; // TODO perhaps not any more the right name
538 unsigned int adjustMode
;
542 bool isEmpty() const;
543 QString
funcToString(const ModelData
* model
= NULL
) const;
544 QString
paramToString(const ModelData
* model
) const;
545 QString
repeatToString() const;
546 QString
enabledToString() const;
548 static void populateResetParams(const ModelData
* model
, QComboBox
* b
, unsigned int value
);
549 static void populatePlaySoundParams(QStringList
& qs
);
550 static void populateHapticParams(QStringList
& qs
);
552 void convert(Board::Type before
, Board::Type after
);
556 class FlightModeData
{
558 FlightModeData() { clear(0); }
559 int trimMode
[CPN_MAX_TRIMS
];
560 int trimRef
[CPN_MAX_TRIMS
];
561 int trim
[CPN_MAX_TRIMS
];
565 unsigned int fadeOut
;
566 int rotaryEncoders
[CPN_MAX_ENCODERS
];
567 int gvars
[CPN_MAX_GVARS
];
568 void clear(const int phase
);
569 void convert(Board::Type before
, Board::Type after
);
572 class SwashRingData
{ // Swash Ring data
574 SwashRingData() { clear(); }
577 int collectiveWeight
;
579 RawSource collectiveSource
;
580 RawSource aileronSource
;
581 RawSource elevatorSource
;
583 void clear() { memset(this, 0, sizeof(SwashRingData
)); }
586 class FrSkyAlarmData
{
588 FrSkyAlarmData() { clear(); }
589 unsigned int level
; // 0=none, 1=Yellow, 2=Orange, 3=Red
590 unsigned int greater
; // 0=LT(<), 1=GT(>)
591 unsigned int value
; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
593 void clear() { memset(this, 0, sizeof(FrSkyAlarmData
)); }
596 class RSSIAlarmData
{
598 RSSIAlarmData() { clear(); }
599 unsigned int level
[2]; // AVR Only
608 this->disabled
= false;
612 class FrSkyChannelData
{
614 FrSkyChannelData() { clear(); }
615 unsigned int ratio
; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
616 unsigned int type
; // future use: 0=volts, 1=ml...
618 unsigned int multiplier
;
619 FrSkyAlarmData alarms
[2];
621 float getRatio() const;
622 RawSourceRange
getRange() const;
623 void clear() { memset(this, 0, sizeof(FrSkyChannelData
)); }
626 struct FrSkyBarData
{
628 int barMin
; // minimum for bar display
629 int barMax
; // ditto for max display (would usually = ratio)
632 struct FrSkyLineData
{
636 struct TelemetryScriptData
{
640 enum TelemetryScreenEnum
{
641 TELEMETRY_SCREEN_NONE
,
642 TELEMETRY_SCREEN_NUMBERS
,
643 TELEMETRY_SCREEN_BARS
,
644 TELEMETRY_SCREEN_SCRIPT
647 class FrSkyScreenData
{
649 FrSkyScreenData() { clear(); }
652 FrSkyBarData bars
[4];
653 FrSkyLineData lines
[4];
654 TelemetryScriptData script
;
658 FrSkyScreenBody body
;
663 enum TelemetryVarioSources
{
664 TELEMETRY_VARIO_SOURCE_ALTI
,
665 TELEMETRY_VARIO_SOURCE_ALTI_PLUS
,
666 TELEMETRY_VARIO_SOURCE_VSPEED
,
667 TELEMETRY_VARIO_SOURCE_A1
,
668 TELEMETRY_VARIO_SOURCE_A2
,
669 TELEMETRY_VARIO_SOURCE_DTE
,
672 enum TelemetryVoltsSources
{
673 TELEMETRY_VOLTS_SOURCE_A1
,
674 TELEMETRY_VOLTS_SOURCE_A2
,
675 TELEMETRY_VOLTS_SOURCE_A3
,
676 TELEMETRY_VOLTS_SOURCE_A4
,
677 TELEMETRY_VOLTS_SOURCE_FAS
,
678 TELEMETRY_VOLTS_SOURCE_CELLS
681 enum TelemetryCurrentSources
{
682 TELEMETRY_CURRENT_SOURCE_NONE
,
683 TELEMETRY_CURRENT_SOURCE_A1
,
684 TELEMETRY_CURRENT_SOURCE_A2
,
685 TELEMETRY_CURRENT_SOURCE_A3
,
686 TELEMETRY_CURRENT_SOURCE_A4
,
687 TELEMETRY_CURRENT_SOURCE_FAS
692 UART_MODE_TELEMETRY_MIRROR
,
694 UART_MODE_SBUS_TRAINER
,
699 TRAINER_MODE_MASTER_TRAINER_JACK
,
701 TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE
,
702 TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
,
703 TRAINER_MODE_MASTER_BATTERY_COMPARTMENT
,
708 FrSkyData() { clear(); }
709 FrSkyChannelData channels
[4];
710 unsigned int usrProto
;
712 unsigned int voltsSource
;
713 unsigned int altitudeSource
;
714 unsigned int currentSource
;
715 FrSkyScreenData screens
[4];
716 unsigned int varioSource
;
717 bool varioCenterSilent
;
719 int varioCenterMin
; // if increment in 0.2m/s = 3.0m/s max
723 unsigned int storedMah
;
725 bool ignoreSensorIds
;
732 MavlinkData() { clear();}
733 unsigned int rc_rssi_scale
;
734 unsigned int pc_rssi_en
;
735 void clear() { memset(this, 0, sizeof(MavlinkData
)); }
738 #define TIMER_NAME_LEN 8
748 TimerData() { clear(); }
750 char name
[TIMER_NAME_LEN
+1];
752 unsigned int countdownBeep
;
754 unsigned int persistent
;
756 void clear() { memset(this, 0, sizeof(TimerData
)); mode
= RawSwitch(SWITCH_TYPE_TIMER_MODE
, 0); }
759 enum PulsesProtocol
{
782 enum MultiModuleRFProtocols
{
783 MM_RF_PROTO_FLYSKY
=0,
784 MM_RF_PROTO_FIRST
=MM_RF_PROTO_FLYSKY
,
809 MM_RF_PROTO_FS_AFHDS2A
,
815 MM_RF_PROTO_LAST
=MM_RF_PROTO_DM002
818 enum TrainerProtocol
{
821 TRAINER_MASTER_SBUS_MODULE
,
822 TRAINER_MASTER_CPPM_MODULE
,
823 TRAINER_MASTER_SBUS_BATT_COMPARTMENT
828 ModuleData() { clear(); }
829 unsigned int modelId
;
831 unsigned int subType
;
833 unsigned int channelsStart
;
834 int channelsCount
; // 0=8 channels
835 unsigned int failsafeMode
;
836 int failsafeChannels
[CPN_MAX_CHNOUT
];
841 bool pulsePol
; // false = positive
842 bool outputType
; // false = open drain, true = push pull
847 unsigned int rfProtocol
;
855 int power
; // 0 10 mW, 1 100 mW, 2 500 mW, 3 1W
856 bool receiver_telem_off
; // false = receiver telem enabled
857 bool receiver_channel_9_16
; // false = pwm out 1-8, true 9-16
858 bool external_antenna
; // false = internal antenna, true = external antenna
863 void clear() { memset(this, 0, sizeof(ModuleData
)); }
864 QString
polarityToString() const { return ppm
.pulsePol
? QObject::tr("Positive") : QObject::tr("Negative"); } // TODO ModelPrinter
867 #define CPN_MAX_SCRIPTS 9
868 #define CPN_MAX_SCRIPT_INPUTS 10
871 ScriptData() { clear(); }
874 int inputs
[CPN_MAX_SCRIPT_INPUTS
];
875 void clear() { memset(this, 0, sizeof(ScriptData
)); }
878 #define CPN_MAX_SENSORS 32
886 TELEM_TYPE_CALCULATED
892 TELEM_FORMULA_AVERAGE
,
895 TELEM_FORMULA_MULTIPLY
,
896 TELEM_FORMULA_TOTALIZE
,
898 TELEM_FORMULA_CONSUMPTION
,
900 TELEM_FORMULA_LAST
= TELEM_FORMULA_DIST
904 TELEM_CELL_INDEX_LOWEST
,
911 TELEM_CELL_INDEX_HIGHEST
,
912 TELEM_CELL_INDEX_DELTA
,
922 UNIT_METERS_PER_SECOND
,
923 UNIT_FEET_PER_SECOND
,
944 // FrSky format used for these fields, could be another format in the future
946 UNIT_CELLS
= UNIT_FIRST_VIRTUAL
,
951 UNIT_GPS_LONGITUDE_EW
,
952 UNIT_GPS_LATITUDE_NS
,
954 UNIT_DATETIME_DAY_MONTH
,
955 UNIT_DATETIME_HOUR_MIN
,
959 SensorData() { clear(); }
960 unsigned int type
; // custom / formula
963 unsigned int instance
;
964 unsigned int persistentValue
;
965 unsigned int formula
;
975 // for custom sensors
993 bool isAvailable() const { return strlen(label
) > 0; }
995 QString
unitString() const;
996 void clear() { memset(this, 0, sizeof(SensorData
)); }
1003 class CustomScreenOptionData
{
1008 class CustomScreenZoneData
{
1010 char widgetName
[10+1];
1011 WidgetOptionData widgetOptions
[5];
1014 class CustomScreenData
{
1018 char layoutName
[10+1];
1019 CustomScreenZoneData zones
[];
1020 CustomScreenOptionData options
[];
1023 typedef char CustomScreenData
[610+1];
1024 typedef char TopbarData
[216+1];
1027 #define GVAR_NAME_LEN 3
1028 #define GVAR_MAX_VALUE 1024
1029 #define GVAR_MIN_VALUE -GVAR_MAX_VALUE
1033 GVarData() { clear(); }
1045 char name
[GVAR_NAME_LEN
+1];
1049 unsigned int prec
; // 0 0._ 1 0.0
1050 unsigned int unit
; // 0 _ 1 %
1052 void clear() {memset(this, 0, sizeof(GVarData
)); }
1053 QString
unitToString() const;
1054 QString
precToString() const;
1055 int multiplierSet();
1056 float multiplierGet() const;
1057 void setMin(float val
);
1058 void setMax(float val
);
1061 float getMinPrec() const;
1062 float getMaxPrec() const;
1068 ModelData(const ModelData
& src
);
1069 ModelData
& operator = (const ModelData
& src
);
1071 void convert(Board::Type before
, Board::Type after
);
1073 ExpoData
* insertInput(const int idx
);
1074 void removeInput(const int idx
);
1076 bool isInputValid(const unsigned int idx
) const;
1077 bool hasExpos(uint8_t inputIdx
) const;
1078 bool hasMixes(uint8_t output
) const;
1080 QVector
<const ExpoData
*> expos(int input
) const;
1081 QVector
<const MixData
*> mixes(int channel
) const;
1086 char filename
[16+1];
1087 int modelIndex
; // Companion only, temporary index position managed by data model.
1089 TimerData timers
[CPN_MAX_TIMERS
];
1090 bool noGlobalFunctions
;
1091 bool thrTrim
; // Enable Throttle Trim
1092 int trimInc
; // Trim Increments
1093 unsigned int trimsDisplay
;
1094 bool disableThrottleWarning
;
1096 unsigned int beepANACenter
; // 1<<0->A1.. 1<<6->A7
1098 bool extendedLimits
; // TODO xml
1100 bool throttleReversed
;
1101 FlightModeData flightModeData
[CPN_MAX_FLIGHT_MODES
];
1102 MixData mixData
[CPN_MAX_MIXERS
];
1103 LimitData limitData
[CPN_MAX_CHNOUT
];
1105 char inputNames
[CPN_MAX_INPUTS
][4+1];
1106 ExpoData expoData
[CPN_MAX_EXPOS
];
1108 CurveData curves
[CPN_MAX_CURVES
];
1109 LogicalSwitchData logicalSw
[CPN_MAX_LOGICAL_SWITCHES
];
1110 CustomFunctionData customFn
[CPN_MAX_SPECIAL_FUNCTIONS
];
1111 SwashRingData swashRingData
;
1112 unsigned int thrTraceSrc
;
1113 uint64_t switchWarningStates
;
1114 unsigned int switchWarningEnable
;
1115 unsigned int potsWarningMode
;
1116 bool potsWarningEnabled
[CPN_MAX_POTS
];
1117 int potPosition
[CPN_MAX_POTS
];
1118 bool displayChecklist
;
1119 GVarData gvarData
[CPN_MAX_GVARS
];
1120 MavlinkData mavlink
;
1121 unsigned int telemetryProtocol
;
1123 RSSIAlarmData rssiAlarms
;
1127 unsigned int trainerMode
;
1129 ModuleData moduleData
[CPN_MAX_MODULES
+1/*trainer*/];
1131 ScriptData scriptData
[CPN_MAX_SCRIPTS
];
1133 SensorData sensorData
[CPN_MAX_SENSORS
];
1135 unsigned int toplcdTimer
;
1137 CustomScreenData customScreenData
[5];
1139 TopbarData topbarData
;
1142 bool isEmpty() const;
1143 void setDefaultInputs(const GeneralSettings
& settings
);
1144 void setDefaultMixes(const GeneralSettings
& settings
);
1145 void setDefaultValues(unsigned int id
, const GeneralSettings
& settings
);
1147 int getTrimValue(int phaseIdx
, int trimIdx
);
1148 void setTrimValue(int phaseIdx
, int trimIdx
, int value
);
1150 bool isGVarLinked(int phaseIdx
, int gvarIdx
);
1151 int getGVarFieldValue(int phaseIdx
, int gvarIdx
);
1152 float getGVarFieldValuePrec(int phaseIdx
, int gvarIdx
);
1154 ModelData
removeGlobalVars();
1159 int getChannelsMax(bool forceExtendedLimits
=false) const;
1161 bool isAvailable(const RawSwitch
& swtch
) const;
1164 void removeGlobalVar(int & var
);
1170 TrainerMix() { clear(); }
1171 unsigned int src
; // 0-7 = ch1-8
1174 unsigned int mode
; // off, add-mode, subst-mode
1175 void clear() { memset(this, 0, sizeof(TrainerMix
)); }
1180 TrainerData() { clear(); }
1183 void clear() { memset(this, 0, sizeof(TrainerData
)); }
1186 class GeneralSettings
{
1191 BEEPER_ALARMS_ONLY
= -1,
1197 void convert(Board::Type before
, Board::Type after
);
1199 int getDefaultStick(unsigned int channel
) const;
1200 RawSource
getDefaultSource(unsigned int channel
) const;
1201 int getDefaultChannel(unsigned int stick
) const;
1203 unsigned int version
;
1204 unsigned int variant
;
1205 int calibMid
[CPN_MAX_ANALOGS
];
1206 int calibSpanNeg
[CPN_MAX_ANALOGS
];
1207 int calibSpanPos
[CPN_MAX_ANALOGS
];
1208 unsigned int currModelIndex
;
1209 char currModelFilename
[16+1];
1210 unsigned int contrast
;
1211 unsigned int vBatWarn
;
1212 int txVoltageCalibration
;
1213 int txCurrentCalibration
;
1217 TrainerData trainer
;
1218 unsigned int view
; // main screen view // TODO enum
1219 bool disableThrottleWarning
;
1221 bool disableMemoryWarning
;
1222 BeeperMode beeperMode
;
1223 bool disableAlarmWarning
;
1224 bool disableRssiPoweroffAlarm
;
1225 unsigned int usbMode
;
1226 BeeperMode hapticMode
;
1227 unsigned int stickMode
; // TODO enum
1231 unsigned int inactivityTimer
;
1235 unsigned int splashMode
;
1237 unsigned int backlightDelay
;
1238 unsigned int templateSetup
; //RETA order according to chout_ar array
1241 unsigned int reNavigation
;
1242 unsigned int stickReverse
;
1243 unsigned int speakerPitch
;
1245 unsigned int speakerMode
;
1246 char ownerName
[10+1];
1248 unsigned int gpsFormat
;
1250 unsigned int backlightBright
;
1251 unsigned int backlightOffBright
;
1253 int temperatureCalib
;
1254 int temperatureWarn
;
1255 unsigned int mAhWarn
;
1256 unsigned int mAhUsed
;
1257 unsigned int globalTimer
;
1258 bool bluetoothEnable
;
1259 char bluetoothName
[10+1];
1260 unsigned int bluetoothBaudrate
;
1261 unsigned int bluetoothMode
;
1262 unsigned int sticksGain
;
1263 unsigned int rotarySteps
;
1264 unsigned int countryCode
;
1266 unsigned int imperial
;
1267 char ttsLanguage
[2+1];
1274 int backgroundVolume
;
1275 unsigned int mavbaud
;
1276 unsigned int switchUnlockStates
;
1277 unsigned int hw_uartMode
;
1278 unsigned int backlightColor
;
1279 CustomFunctionData customFn
[CPN_MAX_SPECIAL_FUNCTIONS
];
1280 char switchName
[CPN_MAX_SWITCHES
][3+1];
1281 unsigned int switchConfig
[CPN_MAX_SWITCHES
];
1282 char stickName
[CPN_MAX_STICKS
][3+1];
1283 char potName
[CPN_MAX_KNOBS
][3+1];
1284 unsigned int potConfig
[CPN_MAX_KNOBS
];
1285 char sliderName
[CPN_MAX_SLIDERS
][3+1];
1286 unsigned int sliderConfig
[CPN_MAX_SLIDERS
];
1288 char themeName
[8+1];
1289 typedef uint8_t ThemeOptionData
[8+1];
1290 ThemeOptionData themeOptionValue
[5];
1292 bool switchPositionAllowedTaranis(int index
) const;
1293 bool switchSourceAllowedTaranis(int index
) const;
1294 bool isPotAvailable(int index
) const;
1295 bool isSliderAvailable(int index
) const;
1298 class CategoryData
{
1300 CategoryData(const char * name
) {
1301 strncpy(this->name
, name
, sizeof(CategoryData::name
));
1310 GeneralSettings generalSettings
;
1311 std::vector
<CategoryData
> categories
;
1312 std::vector
<ModelData
> models
;
1314 void convert(Board::Type before
, Board::Type after
);
1316 void setCurrentModel(unsigned int index
);
1317 void fixModelFilenames();
1318 QString
getNextModelFilename();
1321 void fixModelFilename(unsigned int index
);
1324 #endif // _RADIODATA_H_