Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2136 | - | 1 | /***************************************************************************** |
2 | * Copyright (C) 2008 Thomas Kaiser, thomas@ft-fanpage.de * |
||
3 | * Copyright (C) 2009 Peter "woggle" Mack, mac@denich.net * |
||
4 | * Copyright (C) 2011 Christian "Cebra" Brandtner, brandtner@brandtner.net * |
||
5 | * Copyright (C) 2011 Harald Bongartz * |
||
6 | * * |
||
7 | * This program is free software; you can redistribute it and/or modify * |
||
8 | * it under the terms of the GNU General Public License as published by * |
||
9 | * the Free Software Foundation; either version 2 of the License. * |
||
10 | * * |
||
11 | * This program is distributed in the hope that it will be useful, * |
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||
14 | * GNU General Public License for more details. * |
||
15 | * * |
||
16 | * You should have received a copy of the GNU General Public License * |
||
17 | * along with this program; if not, write to the * |
||
18 | * Free Software Foundation, Inc., * |
||
19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||
20 | * * |
||
21 | * * |
||
22 | * Credits to: * |
||
23 | * Holger Buss & Ingo Busker from mikrokopter.de for the MK project + SVN * |
||
24 | * http://www.mikrokopter.de * |
||
25 | * Gregor "killagreg" Stobrawa for his version of the MK code * |
||
26 | * Thomas Kaiser "thkais" for the original project. See * |
||
27 | * http://www.ft-fanpage.de/mikrokopter/ * |
||
28 | * http://forum.mikrokopter.de/topic-4061-1.html * |
||
29 | * Claas Anders "CaScAdE" Rathje for providing the font and his C-OSD code * |
||
30 | * http://www.mylifesucks.de/oss/c-osd/ * |
||
31 | * Harald Bongartz "HaraldB" for providing his Ideas and Code for usibility* |
||
32 | *****************************************************************************/ |
||
33 | |||
34 | //############################################################################ |
||
35 | //# HISTORY mkparameters.c |
||
36 | //# |
||
37 | //# 16.07.2015 Cebra |
||
38 | //# - add: Erweiterung SingleWpControlChannel; (FC2.11a) |
||
39 | //# MenuKeyChannel; (FC2.11a) |
||
40 | //# |
||
41 | //# 09.04.2015 Cebra |
||
42 | //# - add: Erweiterung paramEditItemTable und ID_MENU_KAMERA_Items[] um neue Parameter (FC2.09j) |
||
43 | //# param_ServoNickFailsave, param_ServoRollFailsave, param_Servo3Failsave, param_Servo4Failsave, param_Servo5Failsave |
||
44 | //# |
||
45 | //# 26.01.2015 Cebra |
||
46 | //# - add: Comming Home Ausrichtung hinzugefügt, |
||
47 | //# neue Einstellungen ab FC 209a im Wert ServoCompInvert, Bit4 + Bit5 |
||
48 | //# |
||
49 | //# 26.09.2014 Cebra |
||
50 | //# - add: im Menü Höhe -> param_Hoehe_TiltCompensation, FC207d |
||
51 | //# |
||
52 | //# 04.06.2014 OG |
||
53 | //# - chg: MK_Parameters_MenuMain() eine Menue-Trennlinie hinter Favoriten eingefuegt |
||
54 | //# |
||
55 | //# 14.05.2014 OG |
||
56 | //# - chg: include "mkbase.h" geaendert auf "../mk/mkbase.h" |
||
57 | //# |
||
58 | //# 11.05.2014 OG |
||
59 | //# - chg: Menu_Favoriten() umgestellt auf MenuCtrl_SetTitleFromParentItem() |
||
60 | //# - chg: Menu_EditCategory() umgestellt auf MenuCtrl_SetTitleFromParentItem() |
||
61 | //# |
||
62 | //# 10.05.2014 OG |
||
63 | //# - del: editDisableDeclCalc() - wurde ersetzt durch eine Transform-Funktion |
||
64 | //# in paramset.c und wird jetzt von editGeneric() bearbeitet |
||
65 | //# |
||
66 | //# 07.05.2014 OG |
||
67 | //# - chg: Menu_Favoriten() - uebernimmt den gegebenen Menuetitel vom |
||
68 | //# uebergeordneten Eintrag aus mkparameters_messages.h (also Multilanguage) |
||
69 | //# - chg: fav_add() - erweitert um Menue-Separatoren (Trennlinien) aufzunehmen |
||
70 | //# - chg: Menu_EditCategory() umgestellt auf MenuCtrl_PushSeparatorID() |
||
71 | //# |
||
72 | //# 06.05.2014 OG |
||
73 | //# - add: Favoriten-Verwaltung implementiert (Aenderungen an verschiedenen Funktionen) |
||
74 | //# |
||
75 | //# 18.04.2014 OG |
||
76 | //# - fix: im ID_MENU_NAVICTRL fehlten param_NaviStickThreshold ("GPS Stick-Schwelle") |
||
77 | //# und param_NaviGpsMinSat ("Min. Sat") |
||
78 | //# |
||
79 | //# 17.04.2014 OG |
||
80 | //# - add: param_Servo3OnValue, param_Servo3OffValue, param_Servo4OnValue |
||
81 | //# param_Servo4OffValue |
||
82 | //# - add: param_NaviMaxFlyingRange, param_NaviDescendRange |
||
83 | //# - chg: Menu_EditCategory() blendet ggf. doppelt aufeinanderfolgenden |
||
84 | //# Menue-Separatoren aus |
||
85 | //# |
||
86 | //# 30.03.2014 OG |
||
87 | //# - chg: Sprache Hollaendisch vollstaendig entfernt |
||
88 | //# - chg: MenuCtrl_PushML_P() umgestellt auf MenuCtrl_PushML2_P() |
||
89 | //# |
||
90 | //# 29.03.2014 OG |
||
91 | //# - chg: versch. Funktioionen del: MenuCtrl_SetShowBatt() wegen Aenderung Default auf true |
||
92 | //# - add: Unterstuetzung fuer Rev. 100 |
||
93 | //# (param_AutoPhotoDistance, param_AutoPhotoAtitudes, param_SingleWpSpeed) |
||
94 | //# |
||
95 | //# 27.03.2014 OG |
||
96 | //# kompletter neuer Code fuer ein erstes Release |
||
97 | //# |
||
98 | //# 23.02.2014 OG |
||
99 | //# - chg: MK_Parameters_Menu() umbenannt zu MK_Parameters() |
||
100 | //# |
||
101 | //# 20.02.2014 OG |
||
102 | //# - chg: MK_Parameters_Menu() meldet "nicht verfügbar" |
||
103 | //# |
||
104 | //# 12.02.2014 OG - NEU |
||
105 | //############################################################################ |
||
106 | |||
107 | |||
108 | #include "../cpu.h" |
||
109 | #include <avr/io.h> |
||
110 | #include <inttypes.h> |
||
111 | #include <stdlib.h> |
||
112 | #include <avr/pgmspace.h> |
||
113 | #include <avr/wdt.h> |
||
114 | #include <util/delay.h> |
||
115 | #include <avr/eeprom.h> |
||
116 | #include <util/delay.h> |
||
117 | #include <string.h> |
||
118 | #include <util/atomic.h> |
||
119 | |||
120 | //#include "../lipo/lipo.h" |
||
121 | #include "../main.h" |
||
122 | #include "../lipo/lipo.h" |
||
123 | #include "../lcd/lcd.h" |
||
124 | #include "../uart/usart.h" |
||
125 | #include "../utils/menuctrl.h" |
||
126 | #include "../utils/xutils.h" |
||
127 | |||
128 | #include "../uart/uart1.h" |
||
129 | #include "../mk-data-structs.h" |
||
130 | //#include "../menu.h" |
||
131 | #include "../timer/timer.h" |
||
132 | #include "../eeprom/eeprom.h" |
||
133 | #include "../messages.h" |
||
134 | #include "../pkt/pkt.h" |
||
135 | #include "../mk/mkbase.h" |
||
136 | #include "paramset.h" |
||
137 | #include "mkparameters.h" |
||
138 | #include "mkparameters_messages.h" |
||
139 | |||
140 | |||
141 | //############################################################################################# |
||
142 | //# Strukturen; Forward-Deklarationen |
||
143 | //############################################################################################# |
||
144 | |||
145 | #define DEBUG_PARAMEDIT // schaltet zusaetzliche Debug-Ausgaben ein |
||
146 | |||
147 | #define EOF 255 // End Of File (bzw. end of Table...) |
||
148 | |||
149 | #define SEPARATOR 254 // ID fuer einen Separator in einem Menue (Trennlinie) |
||
150 | |||
151 | |||
152 | #define SCREEN_REFRESH 1 // neuzeichnen/refresh der Anzeige |
||
153 | #define SCREEN_REDRAW 2 // neuzeichnen/refresh der Anzeige |
||
154 | |||
155 | |||
156 | //-------------------------------------------- |
||
157 | // editGenericCode_t |
||
158 | // deklariert ein einzelnes Code-Zeichen fuer Edit-Generic |
||
159 | //-------------------------------------------- |
||
160 | typedef struct |
||
161 | { |
||
162 | unsigned char code; // z.B. '0', '1', 'v', 'P', 'C' ... (einzelnes Zeichen aus paramEditItem_t.format ) |
||
163 | unsigned char min; |
||
164 | unsigned char max; |
||
165 | const char *shortText_de; // |
||
166 | const char *shortText_en; |
||
167 | const char *longText_de; |
||
168 | const char *longText_en; |
||
169 | } editGenericCode_t; |
||
170 | |||
171 | |||
172 | |||
173 | //--------------------------------------------- |
||
174 | //----- globale Modulvariablen |
||
175 | //--------------------------------------------- |
||
176 | |||
177 | editGenericCode_t genericCode; // Daten eines einzelnen Code-Zeichen (im RAM) |
||
178 | paramEditItem_t paramEditItem; // RAM Buffer: fuer ein Element von paramEditDef |
||
179 | char paramEditFormat[MKPARAM_STRBUFFER_LEN]; // RAM Buffer: fuer 'str' von paramEdit (Format; editGeneric) |
||
180 | char mkparam_strValueBuffer[MKPARAM_STRBUFFER_LEN]; // Anzeige eines Values als Klartext; Kurz (fuer das Menue) oder Lang (in der Edit-Funktion) |
||
181 | |||
182 | |||
183 | |||
184 | //############################################################################################# |
||
185 | //# |
||
186 | //############################################################################################# |
||
187 | |||
188 | static const char GENERIC_SHORT_VALUE_de[] PROGMEM = "%3u"; // nur Wert anzeigen - min/max wird uebergeordnet definiert |
||
189 | #define GENERIC_SHORT_VALUE_en GENERIC_SHORT_VALUE_de |
||
190 | #define GENERIC_LONG_VALUE_de GENERIC_SHORT_VALUE_de |
||
191 | #define GENERIC_LONG_VALUE_en GENERIC_SHORT_VALUE_de |
||
192 | // |
||
193 | //static const char GENERIC_SHORT_VALUE_ACCZ_de[] PROGMEM = "%4u"; // nur Wert anzeigen - min/max wird uebergeordnet definiert |
||
194 | //#define GENERIC_SHORT_VALUE_ACCZ_en GENERIC_SHORT_VALUE_ACCZ_de |
||
195 | //#define GENERIC_LONG_VALUE_ACCZ_de GENERIC_SHORT_VALUE_ACCZ_de |
||
196 | //#define GENERIC_LONG_VALUE_ACCZ_en GENERIC_SHORT_VALUE_ACCZ_de |
||
197 | |||
198 | |||
199 | static const char GENERIC_SHORT_NO_de[] PROGMEM = " N"; |
||
200 | #define GENERIC_SHORT_NO_en GENERIC_SHORT_NO_de |
||
201 | static const char GENERIC_LONG_NO_de[] PROGMEM = "Nein"; |
||
202 | static const char GENERIC_LONG_NO_en[] PROGMEM = "No"; |
||
203 | |||
204 | static const char GENERIC_SHORT_YES_de[] PROGMEM = " J"; |
||
205 | static const char GENERIC_SHORT_YES_en[] PROGMEM = " Y"; |
||
206 | static const char GENERIC_LONG_YES_de[] PROGMEM = "Ja"; |
||
207 | static const char GENERIC_LONG_YES_en[] PROGMEM = "Yes"; |
||
208 | |||
209 | static const char GENERIC_SHORT_POTI_de[] PROGMEM = " P%u"; |
||
210 | #define GENERIC_SHORT_POTI_en GENERIC_SHORT_POTI_de |
||
211 | static const char GENERIC_LONG_POTI_de[] PROGMEM = "Poti %u"; |
||
212 | #define GENERIC_LONG_POTI_en GENERIC_LONG_POTI_de |
||
213 | |||
214 | static const char GENERIC_SHORT_CHANNEL_de[] PROGMEM = "C%2u"; |
||
215 | #define GENERIC_SHORT_CHANNEL_en GENERIC_SHORT_CHANNEL_de |
||
216 | static const char GENERIC_LONG_CHANNEL_de[] PROGMEM = "Kanal %u"; |
||
217 | static const char GENERIC_LONG_CHANNEL_en[] PROGMEM = "Channel %u"; |
||
218 | |||
219 | static const char GENERIC_SHORT_SERCHANNEL_de[] PROGMEM = "S%2u"; |
||
220 | #define GENERIC_SHORT_SERCHANNEL_en GENERIC_SHORT_SERCHANNEL_de |
||
221 | static const char GENERIC_LONG_SERCHANNEL_de[] PROGMEM = "Ser. Kanal %u"; |
||
222 | static const char GENERIC_LONG_SERCHANNEL_en[] PROGMEM = "Ser. Channel %u"; |
||
223 | |||
224 | static const char GENERIC_SHORT_AUS_de[] PROGMEM = "Aus"; |
||
225 | static const char GENERIC_SHORT_AUS_en[] PROGMEM = "Off"; |
||
226 | #define GENERIC_LONG_AUS_de GENERIC_SHORT_AUS_de |
||
227 | #define GENERIC_LONG_AUS_en GENERIC_SHORT_AUS_en |
||
228 | |||
229 | static const char GENERIC_SHORT_INACTIV_de[] PROGMEM = "Ina"; |
||
230 | #define GENERIC_SHORT_INACTIV_en GENERIC_SHORT_INACTIV_de |
||
231 | static const char GENERIC_LONG_INACTIV_de[] PROGMEM = "Inaktiv"; |
||
232 | #define GENERIC_LONG_INACTIV_en GENERIC_LONG_INACTIV_de |
||
233 | |||
234 | static const char GENERIC_SHORT_WPEVENT_de[] PROGMEM = "WPE"; |
||
235 | #define GENERIC_SHORT_WPEVENT_en GENERIC_SHORT_WPEVENT_de |
||
236 | static const char GENERIC_LONG_WPEVENT_de[] PROGMEM = "WP-Event"; |
||
237 | #define GENERIC_LONG_WPEVENT_en GENERIC_LONG_WPEVENT_de |
||
238 | |||
239 | static const char GENERIC_SHORT_MINIMUM_de[] PROGMEM = "Min"; |
||
240 | #define GENERIC_SHORT_MINIMUM_en GENERIC_SHORT_MINIMUM_de |
||
241 | static const char GENERIC_LONG_MINIMUM_de[] PROGMEM = "Minimum"; |
||
242 | #define GENERIC_LONG_MINIMUM_en GENERIC_LONG_MINIMUM_de |
||
243 | |||
244 | static const char GENERIC_SHORT_MIDDLE_de[] PROGMEM = "Mid"; |
||
245 | #define GENERIC_SHORT_MIDDLE_en GENERIC_SHORT_MIDDLE_de |
||
246 | static const char GENERIC_LONG_MIDDLE_de[] PROGMEM = "Mitte"; |
||
247 | static const char GENERIC_LONG_MIDDLE_en[] PROGMEM = "Middle"; |
||
248 | |||
249 | static const char GENERIC_SHORT_MAXIMUM_de[] PROGMEM = "Max"; |
||
250 | #define GENERIC_SHORT_MAXIMUM_en GENERIC_SHORT_MAXIMUM_de |
||
251 | static const char GENERIC_LONG_MAXIMUM_de[] PROGMEM = "Maximum"; |
||
252 | #define GENERIC_LONG_MAXIMUM_en GENERIC_LONG_MAXIMUM_de |
||
253 | |||
254 | static const char GENERIC_SHORT_AN_de[] PROGMEM = " An"; |
||
255 | static const char GENERIC_SHORT_AN_en[] PROGMEM = " On"; |
||
256 | #define GENERIC_LONG_AN_de GENERIC_SHORT_AN_de |
||
257 | #define GENERIC_LONG_AN_en GENERIC_SHORT_AN_en |
||
258 | |||
259 | static const char GENERIC_SHORT_FREE_de[] PROGMEM = "Fre"; // z.b. "GPS Modus Steuerung" |
||
260 | #define GENERIC_SHORT_FREE_en GENERIC_SHORT_FREE_de |
||
261 | static const char GENERIC_LONG_FREE_de[] PROGMEM = "Free"; |
||
262 | #define GENERIC_LONG_FREE_en GENERIC_LONG_FREE_de |
||
263 | |||
264 | static const char GENERIC_SHORT_CH_de[] PROGMEM = " CH"; // z.b. "GPS Modus Steuerung" |
||
265 | #define GENERIC_SHORT_CH_en GENERIC_SHORT_CH_de |
||
266 | static const char GENERIC_LONG_CH_de[] PROGMEM = "Coming Home (CH)"; |
||
267 | #define GENERIC_LONG_CH_en GENERIC_LONG_CH_de |
||
268 | |||
269 | static const char GENERIC_SHORT_PH_de[] PROGMEM = " PH"; // z.b. "GPS Modus Steuerung" |
||
270 | #define GENERIC_SHORT_PH_en GENERIC_SHORT_PH_de |
||
271 | static const char GENERIC_LONG_PH_de[] PROGMEM = "Position Hold (PH)"; |
||
272 | #define GENERIC_LONG_PH_en GENERIC_LONG_PH_de |
||
273 | |||
274 | static const char GENERIC_SHORT_DISABLED_de[] PROGMEM = "Dis"; // z.b. "Auto Start / Land" |
||
275 | #define GENERIC_SHORT_DISABLED_en GENERIC_SHORT_DISABLED_de |
||
276 | static const char GENERIC_LONG_DISABLED_de[] PROGMEM = "Disabled"; |
||
277 | #define GENERIC_LONG_DISABLED_en GENERIC_LONG_DISABLED_de |
||
278 | |||
279 | static const char GENERIC_SHORT_OUT_de[] PROGMEM = "Ou%1u"; // z.B. Servo 3 und Servo 4 |
||
280 | #define GENERIC_SHORT_OUT_en GENERIC_SHORT_OUT_de |
||
281 | static const char GENERIC_LONG_OUT_de[] PROGMEM = "Out %1u"; |
||
282 | #define GENERIC_LONG_OUT_en GENERIC_LONG_OUT_de |
||
283 | |||
284 | static const char GENERIC_SHORT_CH_OR_NC_de[] PROGMEM = "kÄn"; |
||
285 | static const char GENERIC_SHORT_CH_OR_NC_en[] PROGMEM = "nCh"; |
||
286 | static const char GENERIC_LONG_CH_OR_NC_de[] PROGMEM = "Keine Änderung"; |
||
287 | static const char GENERIC_LONG_CH_OR_NC_en[] PROGMEM = "no change"; |
||
288 | |||
289 | static const char GENERIC_SHORT_CH_OR_FH_de[] PROGMEM = "FzH"; |
||
290 | static const char GENERIC_SHORT_CH_OR_FH_en[] PROGMEM = "FtH"; |
||
291 | static const char GENERIC_LONG_CH_OR_FH_de[] PROGMEM = "Front zu Home"; |
||
292 | static const char GENERIC_LONG_CH_OR_FH_en[] PROGMEM = "front to home"; |
||
293 | |||
294 | static const char GENERIC_SHORT_CH_OR_RH_de[] PROGMEM = "HzH"; |
||
295 | static const char GENERIC_SHORT_CH_OR_RH_en[] PROGMEM = "RtH"; |
||
296 | static const char GENERIC_LONG_CH_OR_RH_de[] PROGMEM = "Heck zu Home"; |
||
297 | static const char GENERIC_LONG_CH_OR_RH_en[] PROGMEM = "rear to home"; |
||
298 | |||
299 | static const char GENERIC_SHORT_CH_OR_SO_de[] PROGMEM = "wSt"; |
||
300 | static const char GENERIC_SHORT_CH_OR_SO_en[] PROGMEM = "sOr"; |
||
301 | static const char GENERIC_LONG_CH_OR_SO_de[] PROGMEM = "wie beim Start"; |
||
302 | static const char GENERIC_LONG_CH_OR_SO_en[] PROGMEM = "same as start"; |
||
303 | |||
304 | |||
305 | |||
306 | //------------------------------------------------ |
||
307 | |||
308 | |||
309 | |||
310 | /************************************************* |
||
311 | //------------- |
||
312 | // ZUR INFO |
||
313 | //------------- |
||
314 | typedef struct |
||
315 | { |
||
316 | unsigned char code; // '0', '1', 'v', 'P', 'C' ... |
||
317 | unsigned char min; |
||
318 | unsigned char max; |
||
319 | const char *shortText_de; |
||
320 | const char *shortText_en; |
||
321 | const char *longText_de; |
||
322 | const char *longText_en; |
||
323 | } editGenericCode_t; |
||
324 | *************************************************/ |
||
325 | |||
326 | // Anmerkung: kann bei Bedarf evtl. zu PROGMEM umschreiben |
||
327 | //editGenericCode_t const editGenericCode[] PROGMEM = |
||
328 | |||
329 | editGenericCode_t editGenericCode[] = |
||
330 | { |
||
331 | { 'v', 0, 0, GENERIC_SHORT_VALUE_de, GENERIC_SHORT_VALUE_en, GENERIC_LONG_VALUE_de, GENERIC_LONG_VALUE_en }, // nur Wert anzeigen - min/max wird uebergeordnet definiert |
||
332 | // { 'z', 0, 0, GENERIC_SHORT_VALUE_ACCZ_de, GENERIC_SHORT_VALUE_ACCZ_en, GENERIC_LONG_VALUE_ACCZ_de, GENERIC_LONG_VALUE_ACCZ_en }, // nur Wert anzeigen x 4- min/max wird uebergeordnet definiert |
||
333 | { '0', 0, 0, GENERIC_SHORT_NO_de, GENERIC_SHORT_NO_en, GENERIC_LONG_NO_de, GENERIC_LONG_NO_en }, |
||
334 | { '1', 1, 1, GENERIC_SHORT_YES_de, GENERIC_SHORT_YES_en, GENERIC_LONG_YES_de, GENERIC_LONG_YES_en }, |
||
335 | { 'P', 255,248, GENERIC_SHORT_POTI_de, GENERIC_SHORT_POTI_en, GENERIC_LONG_POTI_de, GENERIC_LONG_POTI_en }, |
||
336 | { 'C', 1, 16, GENERIC_SHORT_CHANNEL_de, GENERIC_SHORT_CHANNEL_en, GENERIC_LONG_CHANNEL_de, GENERIC_LONG_CHANNEL_en }, |
||
337 | { 'S', 17, 28, GENERIC_SHORT_SERCHANNEL_de, GENERIC_SHORT_SERCHANNEL_en, GENERIC_LONG_SERCHANNEL_de, GENERIC_LONG_SERCHANNEL_en }, |
||
338 | { 'A', 0, 0, GENERIC_SHORT_AUS_de, GENERIC_SHORT_AUS_en, GENERIC_LONG_AUS_de, GENERIC_LONG_AUS_en }, |
||
339 | { 'I', 0, 0, GENERIC_SHORT_INACTIV_de, GENERIC_SHORT_INACTIV_en, GENERIC_LONG_INACTIV_de, GENERIC_LONG_INACTIV_en }, |
||
340 | { 'W', 29, 29, GENERIC_SHORT_WPEVENT_de, GENERIC_SHORT_WPEVENT_en, GENERIC_LONG_WPEVENT_de, GENERIC_LONG_WPEVENT_en }, |
||
341 | { 'U', 30, 30, GENERIC_SHORT_MINIMUM_de, GENERIC_SHORT_MINIMUM_en, GENERIC_LONG_MINIMUM_de, GENERIC_LONG_MINIMUM_en }, |
||
342 | { 'M', 31, 31, GENERIC_SHORT_MIDDLE_de, GENERIC_SHORT_MIDDLE_en, GENERIC_LONG_MIDDLE_de, GENERIC_LONG_MIDDLE_en }, |
||
343 | { 'X', 32, 32, GENERIC_SHORT_MAXIMUM_de, GENERIC_SHORT_MAXIMUM_en, GENERIC_LONG_MAXIMUM_de, GENERIC_LONG_MAXIMUM_en }, |
||
344 | { 'O', 30, 30, GENERIC_SHORT_AUS_de, GENERIC_SHORT_AUS_en, GENERIC_LONG_AUS_de, GENERIC_LONG_AUS_en }, // ein weiteres "Aus"; z.b. "Motors-Sicherheitsschalter" |
||
345 | { 'N', 31, 31, GENERIC_SHORT_AN_de, GENERIC_SHORT_AN_en, GENERIC_LONG_AN_de, GENERIC_LONG_AN_en }, // z.b. "Carefree" |
||
346 | { 'F', 30, 30, GENERIC_SHORT_FREE_de, GENERIC_SHORT_FREE_en, GENERIC_LONG_FREE_de, GENERIC_LONG_FREE_en }, // Free - z.b. "Carefree" |
||
347 | { 'H', 31, 31, GENERIC_SHORT_CH_de, GENERIC_SHORT_CH_en, GENERIC_LONG_CH_de, GENERIC_LONG_CH_en }, // Coming Home - z.b. "Carefree" |
||
348 | { 'Q', 32, 32, GENERIC_SHORT_PH_de, GENERIC_SHORT_PH_en, GENERIC_LONG_PH_de, GENERIC_LONG_PH_en }, // Positiosn Hold - z.b. "Carefree" |
||
349 | { 'D', 0, 0, GENERIC_SHORT_DISABLED_de, GENERIC_SHORT_DISABLED_en, GENERIC_LONG_DISABLED_de, GENERIC_LONG_DISABLED_en }, // Inaktiv - z.b. "Auto Start / Land" |
||
350 | { 'T', 247,246, GENERIC_SHORT_OUT_de, GENERIC_SHORT_OUT_en, GENERIC_LONG_OUT_de, GENERIC_LONG_OUT_en }, |
||
351 | { 'K', 0, 0, GENERIC_SHORT_CH_OR_NC_de, GENERIC_SHORT_CH_OR_NC_en, GENERIC_LONG_CH_OR_NC_de, GENERIC_LONG_CH_OR_NC_en }, // CommingHome Orientation, |
||
352 | { 'V', 1, 1, GENERIC_SHORT_CH_OR_FH_de, GENERIC_SHORT_CH_OR_FH_en, GENERIC_LONG_CH_OR_FH_de, GENERIC_LONG_CH_OR_FH_en }, // CommingHome Orientation, |
||
353 | { 'R', 2, 2, GENERIC_SHORT_CH_OR_RH_de, GENERIC_SHORT_CH_OR_RH_en, GENERIC_LONG_CH_OR_RH_de, GENERIC_LONG_CH_OR_RH_en }, // CommingHome Orientation, |
||
354 | { 'G', 3, 3, GENERIC_SHORT_CH_OR_SO_de, GENERIC_SHORT_CH_OR_SO_en, GENERIC_LONG_CH_OR_SO_de, GENERIC_LONG_CH_OR_SO_en }, // CommingHome Orientation, |
||
355 | |||
356 | { EOF, 0, 0, 0,0,0,0 } // END OF LIST - MUST BE THE LAST!! |
||
357 | }; |
||
358 | |||
359 | |||
360 | |||
361 | |||
362 | |||
363 | |||
364 | |||
365 | //############################################################################################# |
||
366 | //# |
||
367 | //############################################################################################# |
||
368 | |||
369 | |||
370 | static const char GENERIC_NoYes[] PROGMEM = "01"; // Nein, Ja (z.B. (fast) alle Checkboxen) |
||
371 | static const char GENERIC_Value[] PROGMEM = "v"; // value mit min,max aus paramEditItem (in paramEditItemTable) (z.B. Nick/Roll P (0..20) / Min. Gas (0..247) ) |
||
372 | static const char GENERIC_ValueACCZ[] PROGMEM = "D"; // value mit min,max aus paramEditItem (in paramEditItemTable) x 4 (ACC Z Landing pulse ) |
||
373 | static const char GENERIC_ValuePoti[] PROGMEM = "vP"; // value, Poti (z.B. Gyro Gier P) |
||
374 | static const char GENERIC_ValueOutPoti[] PROGMEM = "vTP"; // value, Out, Poti (z.B. Servo 3 & 4) |
||
375 | static const char GENERIC_Cannel[] PROGMEM = "C"; // Channel (z.B. Gas / Gier / Nick / Roll) |
||
376 | static const char GENERIC_AusChSerWpeMMM[] PROGMEM = "ACSWUMX"; // Aus, Channel, Ser. Channel, WP Event, Minimum, Mitte, Maximum (z.B. Poti 1..8) |
||
377 | static const char GENERIC_DisChSerWpeOff[] PROGMEM = "DCSWO"; // Disabled, Channel, Ser. Channel, WP Event, Off (z.B. Motors-Sicherheitsschalter) |
||
378 | static const char GENERIC_DisChSerWpeOffOn[] PROGMEM = "DCSWON"; // Disabled, Channel, Ser. Channel, WP Event, Off, On (z.B. Carefree) |
||
379 | static const char GENERIC_DisChSerWpeFreeCHPH[] PROGMEM = "DCSWFHQ"; // Disabled, Channel, Ser. Channel, WP Event, Free, CH, PH (z.B. GPS Modus Steuerung) |
||
380 | static const char GENERIC_DisChSer[] PROGMEM = "DCS"; // Disabled, Channel, Ser. Channel (z.B. Auto Start / Land) |
||
381 | static const char GENERIC_CH_Orientation[] PROGMEM = "KVRG"; // Keine Änderung, vorne Home, Heck Home, gleiche Richtung (Comming Home Orientation |
||
382 | static const char GENERIC_InaChSerWpeMMM[] PROGMEM = "ICSWUMX"; // Inactiv, Channel, Ser. Channel, WP Event, Minimum, Mitte, Maximum(z.B. Menu Key Channel |
||
383 | |||
384 | |||
385 | |||
386 | |||
387 | /************************************************* |
||
388 | //------------- |
||
389 | // ZUR INFO |
||
390 | //------------- |
||
391 | typedef struct |
||
392 | { |
||
393 | unsigned char paramID; // paramID aus paramset.h |
||
394 | void (*editfunc)(unsigned char paramID, uint8_t cmd); // Edit-Funktion - z.B. editGeneric(); cmd = MKPARAM_EDIT oder MKPARAM_SHORTVALUE |
||
395 | const char *format; // Parameter: String (PROGMEM) (vorallem fuer editGeneric() ) |
||
396 | unsigned char min; // Parameter: min (P1) |
||
397 | unsigned char max; // Parameter: max (P2) |
||
398 | const char *title_de; // Text in PROGMEM - Menuetext und Beschreibung im Edit-Screen |
||
399 | const char *title_en; // Text in PROGMEM |
||
400 | } paramEditItem_t; |
||
401 | *************************************************/ |
||
402 | |||
403 | //---------------------- |
||
404 | // HINWEIS! |
||
405 | // Die unten stehende Aufgliederung in die verschiedenen Menue-Bereiche ist nur zur ORIENTIERUNG! |
||
406 | // Jede paramID wird nur EINMAL deklariert - die Zuordnung in die Menues erfolgt in den |
||
407 | // nachfolgenden ID_MENU_xyz_Items Strukturen! |
||
408 | //---------------------- |
||
409 | paramEditItem_t const paramEditItemTable[] PROGMEM = |
||
410 | { |
||
411 | //----------------------------------- |
||
412 | // Menue: ID_MENU_KANAELE (Kanäle) |
||
413 | //----------------------------------- |
||
414 | { param_Kanalbelegung_Gas , &editGeneric, GENERIC_Cannel , 0, 0, param_Kanalbelegung_Gas_de, param_Kanalbelegung_Gas_en }, |
||
415 | { param_Kanalbelegung_Gear , &editGeneric, GENERIC_Cannel , 0, 0, param_Kanalbelegung_Gear_de, param_Kanalbelegung_Gear_en }, |
||
416 | { param_Kanalbelegung_Nick , &editGeneric, GENERIC_Cannel , 0, 0, param_Kanalbelegung_Nick_de, param_Kanalbelegung_Nick_en }, |
||
417 | { param_Kanalbelegung_Roll , &editGeneric, GENERIC_Cannel , 0, 0, param_Kanalbelegung_Roll_de, param_Kanalbelegung_Roll_en }, |
||
418 | { param_Kanalbelegung_Poti1 , &editGeneric, GENERIC_AusChSerWpeMMM , 0, 0, param_Kanalbelegung_Poti1_de, param_Kanalbelegung_Poti1_en }, |
||
419 | { param_Kanalbelegung_Poti2 , &editGeneric, GENERIC_AusChSerWpeMMM , 0, 0, param_Kanalbelegung_Poti2_de, param_Kanalbelegung_Poti2_en }, |
||
420 | { param_Kanalbelegung_Poti3 , &editGeneric, GENERIC_AusChSerWpeMMM , 0, 0, param_Kanalbelegung_Poti3_de, param_Kanalbelegung_Poti3_en }, |
||
421 | { param_Kanalbelegung_Poti4 , &editGeneric, GENERIC_AusChSerWpeMMM , 0, 0, param_Kanalbelegung_Poti4_de, param_Kanalbelegung_Poti4_en }, |
||
422 | { param_Kanalbelegung_Poti5 , &editGeneric, GENERIC_AusChSerWpeMMM , 0, 0, param_Kanalbelegung_Poti5_de, param_Kanalbelegung_Poti5_en }, |
||
423 | { param_Kanalbelegung_Poti6 , &editGeneric, GENERIC_AusChSerWpeMMM , 0, 0, param_Kanalbelegung_Poti6_de, param_Kanalbelegung_Poti6_en }, |
||
424 | { param_Kanalbelegung_Poti7 , &editGeneric, GENERIC_AusChSerWpeMMM , 0, 0, param_Kanalbelegung_Poti7_de, param_Kanalbelegung_Poti7_en }, |
||
425 | { param_Kanalbelegung_Poti8 , &editGeneric, GENERIC_AusChSerWpeMMM , 0, 0, param_Kanalbelegung_Poti8_de, param_Kanalbelegung_Poti8_en }, |
||
426 | { param_MotorSafetySwitch , &editGeneric, GENERIC_DisChSerWpeOff , 0, 0, param_MotorSafetySwitch_de, param_MotorSafetySwitch_en }, |
||
427 | { param_GlobalConfig3_MotorSwitchMode , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig3_MotorSwitchMode_de, param_GlobalConfig3_MotorSwitchMode_en }, |
||
428 | { param_ExtraConfig_SensitiveRc , &editGeneric, GENERIC_NoYes , 0, 0, param_ExtraConfig_SensitiveRc_de, param_ExtraConfig_SensitiveRc_en }, |
||
429 | { param_GlobalConfig3_SpeakAll , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig3_SpeakAll_de, param_GlobalConfig3_SpeakAll_en }, |
||
430 | |||
431 | |||
432 | //----------------------------------- |
||
433 | // Menue: ID_MENU_KONFIGURATION (Konfiguration) |
||
434 | //----------------------------------- |
||
435 | { param_GlobalConfig_HoehenRegelung , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig_HoehenRegelung_de, param_GlobalConfig_HoehenRegelung_en }, |
||
436 | { param_GlobalConfig_GpsAktiv , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig_GpsAktiv_de, param_GlobalConfig_GpsAktiv_en }, |
||
437 | { param_GlobalConfig_KompassAktiv , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig_KompassAktiv_de, param_GlobalConfig_KompassAktiv_en }, |
||
438 | { param_GlobalConfig_KompassFix , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig_KompassFix_de, param_GlobalConfig_KompassFix_en }, |
||
439 | // param_ExtraConfig_SensitiveRc |
||
440 | { param_GlobalConfig_AchsenkopplungAktiv , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig_AchsenkopplungAktiv_de, param_GlobalConfig_AchsenkopplungAktiv_en }, |
||
441 | { param_GlobalConfig_DrehratenBegrenzer , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig_DrehratenBegrenzer_de, param_GlobalConfig_DrehratenBegrenzer_en }, |
||
442 | { param_GlobalConfig_HeadingHold , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig_HeadingHold_de, param_GlobalConfig_HeadingHold_en }, |
||
443 | |||
444 | |||
445 | //----------------------------------- |
||
446 | // Menue: ID_MENU_STICK (Stick) |
||
447 | //----------------------------------- |
||
448 | { param_Stick_P , &editGeneric, GENERIC_Value , 0, 20, param_Stick_P_de, param_Stick_P_en }, |
||
449 | { param_Stick_D , &editGeneric, GENERIC_Value , 0, 20, param_Stick_D_de, param_Stick_D_en }, |
||
450 | { param_StickGier_P , &editGeneric, GENERIC_ValuePoti , 0, 247, param_Gyro_Gier_P_de, param_Gyro_Gier_P_en }, |
||
451 | { param_ExternalControl , &editGeneric, GENERIC_ValuePoti , 0, 247, param_ExternalControl_de, param_ExternalControl_en }, |
||
452 | |||
453 | |||
454 | //----------------------------------- |
||
455 | // Menue: ID_MENU_LOOPING (Looping) |
||
456 | //----------------------------------- |
||
457 | { param_BitConfig_LoopOben , &editGeneric, GENERIC_NoYes , 0, 0, param_BitConfig_LoopOben_de, param_BitConfig_LoopOben_en }, |
||
458 | { param_BitConfig_LoopUnten , &editGeneric, GENERIC_NoYes , 0, 0, param_BitConfig_LoopUnten_de, param_BitConfig_LoopUnten_en }, |
||
459 | { param_BitConfig_LoopLinks , &editGeneric, GENERIC_NoYes , 0, 0, param_BitConfig_LoopLinks_de, param_BitConfig_LoopLinks_en }, |
||
460 | { param_BitConfig_LoopRechts , &editGeneric, GENERIC_NoYes , 0, 0, param_BitConfig_LoopRechts_de, param_BitConfig_LoopRechts_en }, |
||
461 | { param_LoopGasLimit , &editGeneric, GENERIC_ValuePoti , 0, 247, param_LoopGasLimit_de, param_LoopGasLimit_en }, |
||
462 | { param_LoopThreshold , &editGeneric, GENERIC_Value , 0, 247, param_LoopThreshold_de, param_LoopThreshold_en }, |
||
463 | { param_LoopHysterese , &editGeneric, GENERIC_Value , 0, 247, param_LoopHysterese_de, param_LoopHysterese_en }, |
||
464 | { param_WinkelUmschlagNick , &editGeneric, GENERIC_Value , 0, 247, param_WinkelUmschlagNick_de, param_WinkelUmschlagNick_en }, |
||
465 | { param_WinkelUmschlagRoll , &editGeneric, GENERIC_Value , 0, 247, param_WinkelUmschlagRoll_de, param_WinkelUmschlagRoll_en }, |
||
466 | |||
467 | |||
468 | //----------------------------------- |
||
469 | // Menue: ID_MENU_HOEHE (Höhe) |
||
470 | //----------------------------------- |
||
471 | { param_GlobalConfig_HoehenRegelung , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig_HoehenRegelung_de, param_GlobalConfig_HoehenRegelung_en}, |
||
472 | { param_ExtraConfig_HeightLimit , &editGeneric, GENERIC_NoYes , 0, 0, param_ExtraConfig_HeightLimit_de, param_ExtraConfig_HeightLimit_en }, |
||
473 | { param_ExtraConfig_HeightVario , &editGeneric, GENERIC_NoYes , 0, 0, param_ExtraConfig_HeightVario_de, param_ExtraConfig_HeightVario_en }, // negiertes param_ExtraConfig_HeightLimit |
||
474 | { param_GlobalConfig_HoehenSchalter , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig_HoehenSchalter_de, param_GlobalConfig_HoehenSchalter_en}, |
||
475 | { param_ExtraConfig_VarioBeep , &editGeneric, GENERIC_NoYes , 0, 0, param_ExtraConfig_VarioBeep_de, param_ExtraConfig_VarioBeep_en }, |
||
476 | { param_HoeheChannel , &editGeneric, GENERIC_DisChSerWpeOffOn, 0, 0, param_HoeheChannel_de, param_HoeheChannel_en }, |
||
477 | { param_Hoehe_MinGas , &editGeneric, GENERIC_Value , 0, 247, param_Hoehe_MinGas_de, param_Hoehe_MinGas_en }, |
||
478 | { param_Hoehe_P , &editGeneric, GENERIC_ValuePoti , 0, 247, param_Hoehe_P_de, param_Hoehe_P_en }, |
||
479 | { param_Luftdruck_D , &editGeneric, GENERIC_ValuePoti , 0, 247, param_Luftdruck_D_de, param_Luftdruck_D_en }, |
||
480 | { param_Hoehe_ACC_Wirkung , &editGeneric, GENERIC_ValuePoti , 0, 247, param_Hoehe_ACC_Wirkung_de, param_Hoehe_ACC_Wirkung_en }, |
||
481 | { param_MaxAltitude , &editGeneric, GENERIC_ValuePoti , 0, 247, param_MaxAltitude_de, param_MaxAltitude_en }, |
||
482 | { param_Hoehe_Verstaerkung , &editGeneric, GENERIC_Value , 0, 247, param_Hoehe_Verstaerkung_de, param_Hoehe_Verstaerkung_en }, |
||
483 | { param_Hoehe_HoverBand , &editGeneric, GENERIC_Value , 0, 247, param_Hoehe_HoverBand_de, param_Hoehe_HoverBand_en }, |
||
484 | { param_Hoehe_GPS_Z , &editGeneric, GENERIC_ValuePoti , 0, 247, param_Hoehe_GPS_Z_de, param_Hoehe_GPS_Z_en }, |
||
485 | { param_Hoehe_TiltCompensation , &editGeneric, GENERIC_ValuePoti , 0, 247, param_Hoehe_Tilt_Comp_de, param_Hoehe_Tilt_Comp_en }, |
||
486 | { param_Hoehe_StickNeutralPoint , &editGeneric, GENERIC_Value , 0, 160, param_Hoehe_StickNeutralPoint_de, param_Hoehe_StickNeutralPoint_en }, |
||
487 | { param_StartLandChannel , &editGeneric, GENERIC_DisChSer , 0, 0, param_StartLandChannel_de, param_StartLandChannel_en }, |
||
488 | { param_LandingSpeed , &editGeneric, GENERIC_Value , 0, 247, param_LandingSpeed_de, param_LandingSpeed_en }, |
||
489 | { param_LandingPulse , &editACCZLandingPulse, GENERIC_ValueACCZ , 0, 0, param_LandingPulse_de, param_LandingPulse_en }, |
||
490 | |||
491 | |||
492 | //----------------------------------- |
||
493 | // Menue: ID_MENU_KAMERA (Kamera) |
||
494 | //----------------------------------- |
||
495 | { param_ServoNickControl , &editGeneric, GENERIC_ValuePoti , 0, 247, param_ServoNickControl_de, param_ServoNickControl_en }, |
||
496 | { param_ServoNickComp , &editGeneric, GENERIC_ValuePoti , 0, 247, param_ServoNickComp_de, param_ServoNickComp_en }, |
||
497 | { param_ServoNickFailsave , &editGeneric, GENERIC_Value , 0, 247, param_ServoNickFails_de, param_ServoNickFails_en }, |
||
498 | { param_GlobalConfig3_ServoNickCompOff , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig3_ServoNickCompOff_de, param_GlobalConfig3_ServoNickCompOff_en }, // TODO: pruefen: ab welcher Version ist das drin ??? |
||
499 | { param_ServoCompInvert_SERVO_NICK_INV , &editGeneric, GENERIC_NoYes , 0, 0, param_ServoCompInvert_SVNick_de, param_ServoCompInvert_SVNick_en }, |
||
500 | { param_ServoCompInvert_SERVO_RELATIVE , &editGeneric, GENERIC_NoYes , 0, 0, param_ServoCompInvert_SVRelMov_de, param_ServoCompInvert_SVRelMov_en }, |
||
501 | { param_ServoNickMin , &editGeneric, GENERIC_Value , 0, 247, param_ServoNickMin_de, param_ServoNickMin_en }, |
||
502 | { param_ServoNickMax , &editGeneric, GENERIC_Value , 0, 247, param_ServoNickMax_de, param_ServoNickMax_en }, |
||
503 | { param_ServoFilterNick , &editGeneric, GENERIC_Value , 0, 25, param_ServoFilterNick_de, param_ServoFilterNick_en }, |
||
504 | { param_ServoRollControl , &editGeneric, GENERIC_ValuePoti , 0, 247, param_ServoRollControl_de, param_ServoRollControl_en }, |
||
505 | { param_ServoRollComp , &editGeneric, GENERIC_ValuePoti , 0, 247, param_ServoRollComp_de, param_ServoRollComp_en }, |
||
506 | { param_ServoRollFailsave , &editGeneric, GENERIC_Value , 0, 247, param_ServoRollFails_de, param_ServoRollFails_en }, |
||
507 | { param_ServoCompInvert_SERVO_ROLL_INV , &editGeneric, GENERIC_NoYes , 0, 0, param_ServoCompInvert_SVRoll_de, param_ServoCompInvert_SVRoll_en }, |
||
508 | { param_ServoRollMin , &editGeneric, GENERIC_Value , 0, 247, param_ServoRollMin_de, param_ServoRollMin_en }, |
||
509 | { param_ServoRollMax , &editGeneric, GENERIC_Value , 0, 247, param_ServoRollMax_de, param_ServoRollMax_en }, |
||
510 | { param_ServoFilterRoll , &editGeneric, GENERIC_Value , 0, 25, param_ServoFilterRoll_de, param_ServoFilterRoll_en }, |
||
511 | { param_ServoNickRefresh , &editGeneric, GENERIC_Value , 2, 8, param_ServoNickRefresh_de, param_ServoNickRefresh_en }, |
||
512 | { param_ServoManualControlSpeed , &editGeneric, GENERIC_Value , 0, 247, param_ServoManualControlSpeed_de, param_ServoManualControlSpeed_en }, |
||
513 | { param_Servo3 , &editGeneric, GENERIC_ValueOutPoti , 0, 245, param_Servo3_de, param_Servo3_en }, |
||
514 | { param_Servo3Failsave , &editGeneric, GENERIC_Value , 0, 247, param_Servo3Fails_de, param_Servo3Fails_en }, |
||
515 | { param_Servo4 , &editGeneric, GENERIC_ValueOutPoti , 0, 245, param_Servo4_de, param_Servo4_en }, |
||
516 | { param_Servo4Failsave , &editGeneric, GENERIC_Value , 0, 247, param_Servo4Fails_de, param_Servo4Fails_en }, |
||
517 | { param_Servo5 , &editGeneric, GENERIC_ValuePoti , 0, 247, param_Servo5_de, param_Servo5_en }, |
||
518 | { param_Servo5Failsave , &editGeneric, GENERIC_Value , 0, 247, param_Servo5Fails_de, param_Servo5Fails_en }, |
||
519 | |||
520 | { param_Servo3OnValue , &editGeneric, GENERIC_Value , 0, 247, param_Servo3OnValue_de, param_Servo3OnValue_en }, |
||
521 | { param_Servo3OffValue , &editGeneric, GENERIC_Value , 0, 247, param_Servo3OffValue_de, param_Servo3OffValue_en }, |
||
522 | { param_Servo4OnValue , &editGeneric, GENERIC_Value , 0, 247, param_Servo4OnValue_de, param_Servo4OnValue_en }, |
||
523 | { param_Servo4OffValue , &editGeneric, GENERIC_Value , 0, 247, param_Servo4OffValue_de, param_Servo4OffValue_en }, |
||
524 | //{ param_CamOrientation , &editNA , 0 , 0, 0, param_CamOrientation_de, param_CamOrientation_en }, // wird evtl. nicht mehr unterstuetzt |
||
525 | |||
526 | |||
527 | //----------------------------------- |
||
528 | // Menue: ID_MENU_NAVICTRL (NaviCtrl) |
||
529 | //----------------------------------- |
||
530 | { param_GlobalConfig_GpsAktiv , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig_GpsAktiv_de, param_GlobalConfig_GpsAktiv_en }, |
||
531 | { param_NaviGpsModeChannel , &editGeneric, GENERIC_DisChSerWpeFreeCHPH , 0, 0, param_NaviGpsModeChannel_de, param_NaviGpsModeChannel_en }, |
||
532 | { param_NaviGpsGain , &editGeneric, GENERIC_ValuePoti , 0, 247, param_NaviGpsGain_de, param_NaviGpsGain_en }, |
||
533 | { param_NaviStickThreshold , &editGeneric, GENERIC_Value , 0, 247, param_NaviStickThreshold_de, param_NaviStickThreshold_en }, |
||
534 | { param_NaviGpsMinSat , &editGeneric, GENERIC_Value , 0, 247, param_NaviGpsMinSat_de, param_NaviGpsMinSat_en }, |
||
535 | { param_NaviGpsP , &editGeneric, GENERIC_ValuePoti , 0, 247, param_NaviGpsP_de, param_NaviGpsP_en }, |
||
536 | { param_NaviGpsI , &editGeneric, GENERIC_ValuePoti , 0, 247, param_NaviGpsI_de, param_NaviGpsI_en }, |
||
537 | { param_NaviGpsD , &editGeneric, GENERIC_ValuePoti , 0, 247, param_NaviGpsD_de, param_NaviGpsD_en }, |
||
538 | { param_NaviGpsPLimit , &editGeneric, GENERIC_ValuePoti , 0, 247, param_NaviGpsPLimit_de, param_NaviGpsPLimit_en }, |
||
539 | { param_NaviGpsILimit , &editGeneric, GENERIC_ValuePoti , 0, 247, param_NaviGpsILimit_de, param_NaviGpsILimit_en }, |
||
540 | { param_NaviGpsDLimit , &editGeneric, GENERIC_ValuePoti , 0, 247, param_NaviGpsDLimit_de, param_NaviGpsDLimit_en }, |
||
541 | { param_NaviGpsA , &editGeneric, GENERIC_ValuePoti , 0, 247, param_NaviGpsA_de, param_NaviGpsA_en }, |
||
542 | { param_NaviWindCorrection , &editGeneric, GENERIC_ValuePoti , 0, 247, param_NaviWindCorrection_de, param_NaviWindCorrection_en }, |
||
543 | { param_NaviAccCompensation , &editGeneric, GENERIC_ValuePoti , 0, 247, param_NaviAccCompensation_de, param_NaviAccCompensation_en }, |
||
544 | { param_NaviMaxFlyingRange , &editGeneric, GENERIC_Value , 0, 250, param_NaviMaxFlyingRange_de, param_NaviMaxFlyingRange_en }, |
||
545 | { param_NaviOperatingRadius , &editGeneric, GENERIC_ValuePoti , 0, 247, param_NaviOperatingRadius_de, param_NaviOperatingRadius_en }, |
||
546 | { param_NaviAngleLimitation , &editGeneric, GENERIC_ValuePoti , 0, 247, param_NaviAngleLimitation_de, param_NaviAngleLimitation_en }, |
||
547 | { param_NaviPH_LoginTime , &editGeneric, GENERIC_Value , 0, 247, param_NaviPH_LoginTime_de, param_NaviPH_LoginTime_en }, |
||
548 | { param_ExtraConfig_GpsAid , &editGeneric, GENERIC_NoYes , 0, 0, param_ExtraConfig_GpsAid_de, param_ExtraConfig_GpsAid_en }, |
||
549 | { param_GlobalConfig3_DphMaxRadius , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig3_DphMaxRadius_de, param_GlobalConfig3_DphMaxRadius_en }, |
||
550 | { param_ComingHomeAltitude , &editGeneric, GENERIC_Value , 0, 247, param_ComingHomeAltitude_de, param_ComingHomeAltitude_en }, |
||
551 | { param_ComingHomeOrientation , &editGeneric, GENERIC_CH_Orientation , 0, 3, param_ComingHomeOrientation_de, param_ComingHomeOrientation_en }, |
||
552 | { param_SingleWpControlChannel , &editGeneric, GENERIC_InaChSerWpeMMM , 0, 0, param_SingleWpControlChannel_de, param_SingleWpControlChannel_en }, //ab Rev.106 |
||
553 | { param_MenuKeyChannel , &editGeneric, GENERIC_InaChSerWpeMMM , 0, 0, param_MenuKeyChannel_de, param_MenuKeyChannel_en }, |
||
554 | { param_SingleWpSpeed , &editGeneric, GENERIC_ValuePoti , 0, 247, param_SingleWpSpeed_de, param_SingleWpSpeed_en }, // ab Rev. 100 |
||
555 | { param_NaviDescendRange , &editGeneric, GENERIC_Value , 0, 250, param_NaviDescendRange_de, param_NaviDescendRange_en }, |
||
556 | |||
557 | |||
558 | //----------------------------------- |
||
559 | // Menue: ID_MENU_AUSGAENGE (Ausgänge) |
||
560 | //----------------------------------- |
||
561 | { param_J16Bitmask , &editBitmask, 0 , 0, 0, param_J16Bitmask_de, param_J16Bitmask_en }, |
||
562 | { param_J16Timing , &editGeneric, GENERIC_ValuePoti , 0, 247, param_J16Timing_de, param_J16Timing_en }, |
||
563 | { param_BitConfig_MotorBlink1 , &editGeneric, GENERIC_NoYes , 0, 0, param_BitConfig_MotorBlink1_de, param_BitConfig_MotorBlink1_en }, // "nur nach Start der Motoren aktiv" |
||
564 | { param_BitConfig_MotorOffLed1 , &editGeneric, GENERIC_NoYes , 0, 0, param_BitConfig_MotorOffLed1_de, param_BitConfig_MotorOffLed1_en }, // nur wenn "nur nach Start der Motoren aktiv" = JA ist -> bestimmt ob LED's an oder aus sind wenn die Motoren aus sind |
||
565 | { param_GlobalConfig3_UseNcForOut1 , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig3_UseNcForOut1_de, param_GlobalConfig3_UseNcForOut1_en }, // "mit WP-Event verknüpfen" |
||
566 | { param_NaviOut1Parameter , &editGeneric, GENERIC_ValuePoti , 0, 247, param_NaviOut1Parameter_de, param_NaviOut1Parameter_en }, // "AutoTrigger alle...[meter]" (bis Rev.98) |
||
567 | { param_AutoPhotoDistance , &editGeneric, GENERIC_ValuePoti , 0, 247, param_AutoPhotoDistance_de, param_AutoPhotoDistance_en }, // "AutoTrigger alle [meter] in Distance" (ab Rev.100) |
||
568 | { param_AutoPhotoAtitudes , &editGeneric, GENERIC_ValuePoti , 0, 247, param_AutoPhotoAtitudes_de, param_AutoPhotoAtitudes_en }, // "AutoTrigger alle [meter] in Altitude" (ab Rev.100) |
||
569 | |||
570 | { param_J17Bitmask , &editBitmask, 0 , 0, 0, param_J17Bitmask_de, param_J17Bitmask_en }, |
||
571 | { param_J17Timing , &editGeneric, GENERIC_ValuePoti , 0, 247, param_J17Timing_de, param_J17Timing_en }, |
||
572 | { param_BitConfig_MotorBlink2 , &editGeneric, GENERIC_NoYes , 0, 0, param_BitConfig_MotorBlink2_de, param_BitConfig_MotorBlink2_en }, // "nur nach Start der Motoren aktiv" |
||
573 | { param_BitConfig_MotorOffLed2 , &editGeneric, GENERIC_NoYes , 0, 0, param_BitConfig_MotorOffLed2_de, param_BitConfig_MotorOffLed2_en }, // nur wenn "nur nach Start der Motoren aktiv" = JA ist -> bestimmt ob LED's an oder aus sind wenn die Motoren aus sind |
||
574 | |||
575 | { param_WARN_J16_Bitmask , &editBitmask, 0 , 0, 0, param_WARN_J16_Bitmask_de, param_WARN_J16_Bitmask_en }, // Bitmaske fuer Unterspannungswarnung |
||
576 | { param_WARN_J17_Bitmask , &editBitmask, 0 , 0, 0, param_WARN_J17_Bitmask_de, param_WARN_J17_Bitmask_en }, // Bitmaske fuer Unterspannungswarnung |
||
577 | |||
578 | |||
579 | //----------------------------------- |
||
580 | // Menue: ID_MENU_VERSCHIEDENES (Verschiedenes) |
||
581 | //----------------------------------- |
||
582 | { param_Gas_Min , &editGeneric, GENERIC_Value , 0, 247, param_Gas_Min_de, param_Gas_Min_en }, |
||
583 | { param_Gas_Max , &editGeneric, GENERIC_Value , 0, 247, param_Gas_Max_de, param_Gas_Max_en }, |
||
584 | { param_KompassWirkung , &editGeneric, GENERIC_ValuePoti , 0, 247, param_KompassWirkung_de, param_KompassWirkung_en }, |
||
585 | //{ param_CompassOffset , &editGeneric, GENERIC_Value , 0, 255, param_CompassOffset_de, param_CompassOffset_en }, // TODO: +/- Werte sind dort kodiert |
||
586 | { param_CompassOffset , &editCompassOffset, 0 , 0, 0, param_CompassOffset_de, param_CompassOffset_en }, // TODO: +/- Werte sind dort kodiert |
||
587 | { param_CompassOffset_DisableDeclCalc , &editGeneric, GENERIC_NoYes , 0, 0, param_CompassOffset_DisableDeclCalc_de, param_CompassOffset_DisableDeclCalc_en }, // TODO: +/- Werte sind dort kodiert |
||
588 | { param_CareFreeChannel , &editGeneric, GENERIC_DisChSerWpeOffOn , 0, 0, param_CareFreeChannel_de, param_CareFreeChannel_en }, |
||
589 | { param_ExtraConfig_LearnableCarefree , &editGeneric, GENERIC_NoYes , 0, 0, param_ExtraConfig_LearnableCarefree_de, param_ExtraConfig_LearnableCarefree_en }, |
||
590 | |||
591 | { param_UnterspannungsWarnung , &editGeneric, GENERIC_Value , 0, 247, param_UnterspannungsWarnung_de, param_UnterspannungsWarnung_en }, |
||
592 | { param_ComingHomeVoltage , &editGeneric, GENERIC_Value , 0, 247, param_ComingHomeVoltage_de, param_ComingHomeVoltage_en }, |
||
593 | { param_AutoLandingVoltage , &editGeneric, GENERIC_Value , 0, 247, param_AutoLandingVoltage_de, param_AutoLandingVoltage_en }, |
||
594 | |||
595 | //{ param_ExtraConfig_33vReference , &editGeneric, GENERIC_NoYes , 0, 0, param_ExtraConfig_33vReference_de, param_ExtraConfig_33vReference_en }, // nicht mehr unterstuetzt! |
||
596 | { param_NotGasZeit , &editGeneric, GENERIC_Value , 0, 247, param_NotGasZeit_de, param_NotGasZeit_en }, |
||
597 | { param_GlobalConfig3_VarioFailsafe , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig3_VarioFailsafe_de, param_GlobalConfig3_VarioFailsafe_en }, |
||
598 | { param_NotGas , &editGeneric, GENERIC_Value , 0, 247, param_NotGas_de, param_NotGas_en }, |
||
599 | { param_FailSafeTime , &editGeneric, GENERIC_Value , 0, 247, param_FailSafeTime_de, param_FailSafeTime_en }, |
||
600 | { param_FailsafeChannel , &editGeneric, GENERIC_Value , 0, 16, param_FailsafeChannel_de, param_FailsafeChannel_en }, |
||
601 | |||
602 | { param_ExtraConfig_NoRcOffBeeping , &editGeneric, GENERIC_NoYes , 0, 0, param_ExtraConfig_NoRcOffBeeping_de, param_ExtraConfig_NoRcOffBeeping_en }, |
||
603 | { param_ExtraConfig_IgnoreMagErrAtStartup , &editGeneric, GENERIC_NoYes , 0, 0, param_ExtraConfig_IgnoreMagErrAtStartup_de, param_ExtraConfig_IgnoreMagErrAtStartup_en }, |
||
604 | { param_GlobalConfig3_NoSdCardNoStart , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig3_NoSdCardNoStart_de, param_GlobalConfig3_NoSdCardNoStart_en }, |
||
605 | { param_GlobalConfig3_NoGpsFixNoStart , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig3_NoGpsFixNoStart_de, param_GlobalConfig3_NoGpsFixNoStart_en }, |
||
606 | |||
607 | |||
608 | //----------------------------------- |
||
609 | // Menue: ID_MENU_GYRO (Gyro) |
||
610 | //----------------------------------- |
||
611 | { param_Gyro_P , &editGeneric, GENERIC_ValuePoti , 0, 247, param_Gyro_P_de, param_Gyro_P_en }, |
||
612 | { param_Gyro_Gier_P , &editGeneric, GENERIC_ValuePoti , 0, 247, param_Gyro_Gier_P_de, param_Gyro_Gier_P_en }, |
||
613 | { param_Gyro_I , &editGeneric, GENERIC_ValuePoti , 0, 247, param_Gyro_I_de, param_Gyro_I_en }, |
||
614 | { param_Gyro_Gier_I , &editGeneric, GENERIC_ValuePoti , 0, 247, param_Gyro_Gier_I_de, param_Gyro_Gier_I_en }, |
||
615 | { param_Gyro_D , &editGeneric, GENERIC_ValuePoti , 0, 247, param_Gyro_D_de, param_Gyro_D_en }, |
||
616 | |||
617 | { param_DynamicStability , &editGeneric, GENERIC_ValuePoti , 0, 247, param_DynamicStability_de, param_DynamicStability_en }, |
||
618 | { param_GlobalConfig_DrehratenBegrenzer , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig_DrehratenBegrenzer_de, param_GlobalConfig_DrehratenBegrenzer_en }, |
||
619 | |||
620 | { param_GyroAccFaktor , &editGeneric, GENERIC_Value , 0, 247, param_GyroAccFaktor_de, param_GyroAccFaktor_en }, |
||
621 | { param_GyroAccAbgleich , &editGeneric, GENERIC_Value , 0, 247, param_GyroAccAbgleich_de, param_GyroAccAbgleich_en }, |
||
622 | |||
623 | { param_I_Faktor , &editGeneric, GENERIC_ValuePoti , 0, 247, param_I_Faktor_de, param_I_Faktor_en }, |
||
624 | { param_Driftkomp , &editGeneric, GENERIC_Value , 0, 247, param_Driftkomp_de, param_Driftkomp_en }, |
||
625 | { param_Gyro_Stability , &editGeneric, GENERIC_Value , 0, 247, param_Gyro_Stability_de, param_Gyro_Stability_en }, |
||
626 | { param_MotorSmooth , &editGeneric, GENERIC_Value , 0, 247, param_MotorSmooth_de, param_MotorSmooth_en }, |
||
627 | |||
628 | |||
629 | //----------------------------------- |
||
630 | // Menue: ID_MENU_BENUTZER (Benutzer) |
||
631 | //----------------------------------- |
||
632 | { param_UserParam1 , &editGeneric, GENERIC_ValuePoti , 0, 247, param_UserParam1_de, param_UserParam1_en }, |
||
633 | { param_UserParam2 , &editGeneric, GENERIC_ValuePoti , 0, 247, param_UserParam2_de, param_UserParam2_en }, |
||
634 | { param_UserParam3 , &editGeneric, GENERIC_ValuePoti , 0, 247, param_UserParam3_de, param_UserParam3_en }, |
||
635 | { param_UserParam4 , &editGeneric, GENERIC_ValuePoti , 0, 247, param_UserParam4_de, param_UserParam4_en }, |
||
636 | { param_UserParam5 , &editGeneric, GENERIC_ValuePoti , 0, 247, param_UserParam5_de, param_UserParam5_en }, |
||
637 | { param_UserParam6 , &editGeneric, GENERIC_ValuePoti , 0, 247, param_UserParam6_de, param_UserParam6_en }, |
||
638 | { param_UserParam7 , &editGeneric, GENERIC_ValuePoti , 0, 247, param_UserParam7_de, param_UserParam7_en }, |
||
639 | { param_UserParam8 , &editGeneric, GENERIC_ValuePoti , 0, 247, param_UserParam8_de, param_UserParam8_en }, |
||
640 | |||
641 | |||
642 | //----------------------------------- |
||
643 | // Menue: ID_MENU_ACHSKOPPLUNG (Achskopplung) |
||
644 | //----------------------------------- |
||
645 | { param_GlobalConfig_AchsenkopplungAktiv , &editGeneric, GENERIC_NoYes , 0, 0, param_GlobalConfig_AchsenkopplungAktiv_de, param_GlobalConfig_AchsenkopplungAktiv_en }, |
||
646 | { param_AchsKopplung1 , &editGeneric, GENERIC_ValuePoti , 0, 247, param_AchsKopplung1_de, param_AchsKopplung1_en }, |
||
647 | { param_AchsKopplung2 , &editGeneric, GENERIC_ValuePoti , 0, 247, param_AchsKopplung2_de, param_AchsKopplung2_en }, |
||
648 | { param_CouplingYawCorrection , &editGeneric, GENERIC_ValuePoti , 0, 247, param_CouplingYawCorrection_de, param_CouplingYawCorrection_en }, |
||
649 | |||
650 | |||
651 | //----------------------------------- |
||
652 | // ENDE |
||
653 | //----------------------------------- |
||
654 | { param_EOF, NOFUNC, 0,0,0, 0,0 } // END OF LIST - MUST BE THE LAST!! |
||
655 | }; |
||
656 | |||
657 | |||
658 | /************************************************************ |
||
659 | NICHT MEHR UNTERSTUEZT: |
||
660 | param_Receiver (Empfänger Typ: Hott, Jeti, Spektrum,...) |
||
661 | ************************************************************/ |
||
662 | |||
663 | |||
664 | |||
665 | |||
666 | |||
667 | //############################################################################################# |
||
668 | //# Menue's und Menuezuordnung |
||
669 | //############################################################################################# |
||
670 | |||
671 | //----------------------------------- |
||
672 | // Menue ID's: Parameters Hauptmenue |
||
673 | //----------------------------------- |
||
674 | #define ID_MENU_FAVORITEN 1 // fuer spaeter reserviert.... |
||
675 | #define ID_MENU_KANAELE 2 |
||
676 | #define ID_MENU_KONFIGURATION 3 |
||
677 | #define ID_MENU_STICK 4 |
||
678 | #define ID_MENU_LOOPING 5 |
||
679 | #define ID_MENU_HOEHE 6 |
||
680 | #define ID_MENU_KAMERA 7 |
||
681 | #define ID_MENU_NAVICTRL 8 |
||
682 | #define ID_MENU_AUSGAENGE 9 |
||
683 | #define ID_MENU_VERSCHIEDENES 10 |
||
684 | #define ID_MENU_GYRO 11 |
||
685 | #define ID_MENU_BENUTZER 12 |
||
686 | #define ID_MENU_ACHSKOPPLUNG 13 |
||
687 | #define ID_MENU_MIXERSETUP 14 // nicht verwendet / unterstuetzt |
||
688 | #define ID_MENU_EASYSETUP 15 |
||
689 | |||
690 | #define ID_MENU_TEST 66 // TEST / DEBUG |
||
691 | |||
692 | |||
693 | //----------------------------------- |
||
694 | // Zuordnungen von paramID's zu den jeweiligen Menue's |
||
695 | // |
||
696 | // Eintrag "SEPARATOR" - damit wird eine Trennlinie |
||
697 | // im Menue dargestellt |
||
698 | //----------------------------------- |
||
699 | |||
700 | //------------------------------- |
||
701 | // Menue: ID_MENU_KANAELE |
||
702 | //------------------------------- |
||
703 | unsigned char const ID_MENU_KANAELE_Items[] = |
||
704 | { |
||
705 | param_Kanalbelegung_Gas, |
||
706 | param_Kanalbelegung_Gear, |
||
707 | param_Kanalbelegung_Nick, |
||
708 | param_Kanalbelegung_Roll, |
||
709 | param_Kanalbelegung_Poti1, |
||
710 | param_Kanalbelegung_Poti2, |
||
711 | param_Kanalbelegung_Poti3, |
||
712 | param_Kanalbelegung_Poti4, |
||
713 | param_Kanalbelegung_Poti5, |
||
714 | param_Kanalbelegung_Poti6, |
||
715 | param_Kanalbelegung_Poti7, |
||
716 | param_Kanalbelegung_Poti8, |
||
717 | SEPARATOR, |
||
718 | param_MotorSafetySwitch, |
||
719 | param_GlobalConfig3_MotorSwitchMode, |
||
720 | SEPARATOR, |
||
721 | param_ExtraConfig_SensitiveRc, |
||
722 | param_GlobalConfig3_SpeakAll, |
||
723 | |||
724 | |||
725 | EOF // *** MUST BE THE LAST! *** |
||
726 | }; |
||
727 | |||
728 | |||
729 | //------------------------------- |
||
730 | // Menue: ID_MENU_KONFIGURATION |
||
731 | //------------------------------- |
||
732 | unsigned char const ID_MENU_KONFIGURATION_Items[] = |
||
733 | { |
||
734 | param_GlobalConfig_HoehenRegelung, |
||
735 | param_GlobalConfig_GpsAktiv, |
||
736 | param_GlobalConfig_KompassAktiv, |
||
737 | param_GlobalConfig_KompassFix, |
||
738 | param_ExtraConfig_SensitiveRc, |
||
739 | param_GlobalConfig_AchsenkopplungAktiv, |
||
740 | param_GlobalConfig_DrehratenBegrenzer, |
||
741 | param_GlobalConfig_HeadingHold, |
||
742 | |||
743 | EOF // *** MUST BE THE LAST! *** |
||
744 | }; |
||
745 | |||
746 | |||
747 | //------------------------------- |
||
748 | // Menue: ID_MENU_STICK |
||
749 | //------------------------------- |
||
750 | unsigned char const ID_MENU_STICK_Items[] = |
||
751 | { |
||
752 | param_Stick_P, |
||
753 | param_Stick_D, |
||
754 | param_StickGier_P, |
||
755 | SEPARATOR, |
||
756 | param_ExternalControl, |
||
757 | |||
758 | EOF // *** MUST BE THE LAST! *** |
||
759 | }; |
||
760 | |||
761 | |||
762 | //------------------------------- |
||
763 | // Menue: ID_MENU_LOOPING |
||
764 | //------------------------------- |
||
765 | unsigned char const ID_MENU_LOOPING_Items[] = |
||
766 | { |
||
767 | param_BitConfig_LoopOben, |
||
768 | param_BitConfig_LoopUnten, |
||
769 | param_BitConfig_LoopLinks, |
||
770 | param_BitConfig_LoopRechts, |
||
771 | SEPARATOR, |
||
772 | param_LoopGasLimit, |
||
773 | param_LoopThreshold, |
||
774 | param_LoopHysterese, |
||
775 | param_WinkelUmschlagNick, |
||
776 | param_WinkelUmschlagRoll, |
||
777 | |||
778 | EOF // *** MUST BE THE LAST! *** |
||
779 | }; |
||
780 | |||
781 | |||
782 | //------------------------------- |
||
783 | // Menue: ID_MENU_HOEHE |
||
784 | //------------------------------- |
||
785 | unsigned char const ID_MENU_HOEHE_Items[] = |
||
786 | { |
||
787 | param_GlobalConfig_HoehenRegelung, |
||
788 | param_ExtraConfig_HeightLimit, |
||
789 | param_ExtraConfig_HeightVario, |
||
790 | param_GlobalConfig_HoehenSchalter, |
||
791 | param_ExtraConfig_VarioBeep, |
||
792 | SEPARATOR, |
||
793 | param_HoeheChannel, |
||
794 | param_Hoehe_Verstaerkung, |
||
795 | param_Hoehe_MinGas, |
||
796 | param_Hoehe_HoverBand, |
||
797 | param_Hoehe_P, |
||
798 | param_Hoehe_GPS_Z, |
||
799 | param_Hoehe_TiltCompensation, |
||
800 | param_Luftdruck_D, |
||
801 | param_Hoehe_StickNeutralPoint, |
||
802 | param_Hoehe_ACC_Wirkung, |
||
803 | param_MaxAltitude, |
||
804 | SEPARATOR, |
||
805 | param_StartLandChannel, |
||
806 | param_LandingSpeed, |
||
807 | param_LandingPulse, |
||
808 | EOF // *** MUST BE THE LAST! *** |
||
809 | }; |
||
810 | |||
811 | |||
812 | |||
813 | //------------------------------- |
||
814 | // Menue: ID_MENU_KAMERA |
||
815 | //------------------------------- |
||
816 | unsigned char const ID_MENU_KAMERA_Items[] = |
||
817 | { |
||
818 | param_ServoNickControl, |
||
819 | param_ServoNickComp, |
||
820 | param_ServoNickFailsave, |
||
821 | param_GlobalConfig3_ServoNickCompOff, // erst ab FC-Rev 96 |
||
822 | param_ServoCompInvert_SERVO_NICK_INV, |
||
823 | param_ServoCompInvert_SERVO_RELATIVE, |
||
824 | param_ServoNickMin, |
||
825 | param_ServoNickMax, |
||
826 | param_ServoFilterNick, |
||
827 | SEPARATOR, |
||
828 | param_ServoRollControl, |
||
829 | param_ServoRollComp, |
||
830 | param_ServoRollFailsave, |
||
831 | param_ServoCompInvert_SERVO_ROLL_INV, |
||
832 | param_ServoRollMin, |
||
833 | param_ServoRollMax, |
||
834 | param_ServoFilterRoll, |
||
835 | SEPARATOR, |
||
836 | param_ServoNickRefresh, |
||
837 | param_ServoManualControlSpeed, |
||
838 | param_Servo3, |
||
839 | param_Servo3Failsave, |
||
840 | param_Servo4, |
||
841 | param_Servo4Failsave, |
||
842 | param_Servo5, |
||
843 | param_Servo5Failsave, |
||
844 | SEPARATOR, |
||
845 | param_Servo3OnValue, |
||
846 | param_Servo3OffValue, |
||
847 | param_Servo4OnValue, |
||
848 | param_Servo4OffValue, |
||
849 | |||
850 | EOF // *** MUST BE THE LAST! *** |
||
851 | }; |
||
852 | |||
853 | |||
854 | |||
855 | //------------------------------- |
||
856 | // Menue: ID_MENU_NAVICTRL |
||
857 | //------------------------------- |
||
858 | unsigned char const ID_MENU_NAVICTRL_Items[] = |
||
859 | { |
||
860 | param_GlobalConfig_GpsAktiv, |
||
861 | param_NaviGpsModeChannel, |
||
862 | param_NaviGpsGain, |
||
863 | param_NaviStickThreshold, |
||
864 | param_NaviGpsMinSat, |
||
865 | param_NaviGpsP, |
||
866 | param_NaviGpsPLimit, |
||
867 | param_NaviGpsI, |
||
868 | param_NaviGpsILimit, |
||
869 | param_NaviGpsD, |
||
870 | param_NaviGpsDLimit, |
||
871 | param_NaviGpsA, |
||
872 | SEPARATOR, |
||
873 | param_NaviWindCorrection, |
||
874 | param_NaviAccCompensation, |
||
875 | param_NaviMaxFlyingRange, |
||
876 | param_NaviOperatingRadius, |
||
877 | param_NaviAngleLimitation, |
||
878 | param_NaviPH_LoginTime, |
||
879 | param_ExtraConfig_GpsAid, |
||
880 | param_GlobalConfig3_DphMaxRadius, |
||
881 | SEPARATOR, |
||
882 | param_ComingHomeAltitude, |
||
883 | param_ComingHomeOrientation, |
||
884 | SEPARATOR, |
||
885 | param_SingleWpControlChannel, |
||
886 | param_MenuKeyChannel, |
||
887 | param_SingleWpSpeed, |
||
888 | SEPARATOR, |
||
889 | param_NaviDescendRange, |
||
890 | |||
891 | EOF // *** MUST BE THE LAST! *** |
||
892 | }; |
||
893 | |||
894 | |||
895 | //------------------------------- |
||
896 | // Menue: ID_MENU_AUSGAENGE |
||
897 | //------------------------------- |
||
898 | unsigned char const ID_MENU_AUSGAENGE_Items[] = |
||
899 | { |
||
900 | param_J16Bitmask, // LED 1 Bitmaske |
||
901 | param_J16Timing, |
||
902 | param_BitConfig_MotorBlink1, |
||
903 | param_BitConfig_MotorOffLed1, |
||
904 | param_GlobalConfig3_UseNcForOut1, |
||
905 | param_NaviOut1Parameter, |
||
906 | param_AutoPhotoDistance, |
||
907 | param_AutoPhotoAtitudes, |
||
908 | SEPARATOR, |
||
909 | param_J17Bitmask, // LED 2 Bitmaske |
||
910 | param_J17Timing, |
||
911 | param_BitConfig_MotorBlink2, |
||
912 | param_BitConfig_MotorOffLed2, |
||
913 | SEPARATOR, |
||
914 | param_WARN_J16_Bitmask, |
||
915 | param_WARN_J17_Bitmask, |
||
916 | |||
917 | EOF // *** MUST BE THE LAST! *** |
||
918 | }; |
||
919 | |||
920 | |||
921 | //------------------------------- |
||
922 | // Menue: ID_MENU_VERSCHIEDENES |
||
923 | //------------------------------- |
||
924 | unsigned char const ID_MENU_VERSCHIEDENES_Items[] = |
||
925 | { |
||
926 | param_Gas_Min, |
||
927 | param_Gas_Max, |
||
928 | param_KompassWirkung, |
||
929 | param_CompassOffset, |
||
930 | param_CompassOffset_DisableDeclCalc, |
||
931 | param_CareFreeChannel, |
||
932 | param_ExtraConfig_LearnableCarefree, |
||
933 | SEPARATOR, |
||
934 | param_UnterspannungsWarnung, |
||
935 | param_ComingHomeVoltage, |
||
936 | param_AutoLandingVoltage, |
||
937 | SEPARATOR, |
||
938 | param_NotGasZeit, |
||
939 | param_GlobalConfig3_VarioFailsafe, // Nutze "Vario-Höhe" für "Not-Gas" -> beeinflusst 'param_NotGas' bzgl. "%" |
||
940 | param_NotGas, |
||
941 | param_FailSafeTime, |
||
942 | param_FailsafeChannel, |
||
943 | param_ExtraConfig_NoRcOffBeeping, |
||
944 | SEPARATOR, |
||
945 | param_ExtraConfig_IgnoreMagErrAtStartup, |
||
946 | param_GlobalConfig3_NoSdCardNoStart, |
||
947 | param_GlobalConfig3_NoGpsFixNoStart, |
||
948 | |||
949 | EOF // *** MUST BE THE LAST! *** |
||
950 | }; |
||
951 | |||
952 | |||
953 | //------------------------------- |
||
954 | // Menue: ID_MENU_GYRO |
||
955 | //------------------------------- |
||
956 | unsigned char const ID_MENU_GYRO_Items[] = |
||
957 | { |
||
958 | param_Gyro_P, |
||
959 | param_Gyro_I, |
||
960 | param_Gyro_D, |
||
961 | param_Gyro_Gier_P, |
||
962 | param_Gyro_Gier_I, |
||
963 | SEPARATOR, |
||
964 | param_DynamicStability, |
||
965 | param_GlobalConfig_DrehratenBegrenzer, |
||
966 | SEPARATOR, |
||
967 | param_GyroAccFaktor, |
||
968 | param_GyroAccAbgleich, |
||
969 | SEPARATOR, |
||
970 | param_I_Faktor, |
||
971 | param_Driftkomp, |
||
972 | param_Gyro_Stability, |
||
973 | param_MotorSmooth, |
||
974 | |||
975 | EOF // *** MUST BE THE LAST! *** |
||
976 | }; |
||
977 | |||
978 | |||
979 | //------------------------------- |
||
980 | // Menue: ID_MENU_BENUTZER |
||
981 | //------------------------------- |
||
982 | unsigned char const ID_MENU_BENUTZER_Items[] = |
||
983 | { |
||
984 | param_UserParam1, |
||
985 | param_UserParam2, |
||
986 | param_UserParam3, |
||
987 | param_UserParam4, |
||
988 | param_UserParam5, |
||
989 | param_UserParam6, |
||
990 | param_UserParam7, |
||
991 | param_UserParam8, |
||
992 | |||
993 | EOF // *** MUST BE THE LAST! *** |
||
994 | }; |
||
995 | |||
996 | |||
997 | //------------------------------- |
||
998 | // Menue: ID_MENU_ACHSKOPPLUNG |
||
999 | //------------------------------- |
||
1000 | unsigned char const ID_MENU_ACHSKOPPLUNG_Items[] = |
||
1001 | { |
||
1002 | param_GlobalConfig_AchsenkopplungAktiv, |
||
1003 | param_AchsKopplung1, |
||
1004 | param_AchsKopplung2, |
||
1005 | param_CouplingYawCorrection, |
||
1006 | |||
1007 | EOF // *** MUST BE THE LAST! *** |
||
1008 | }; |
||
1009 | |||
1010 | |||
1011 | //------------------------------- |
||
1012 | // Menue: ID_MENU_EASYSETUP |
||
1013 | //------------------------------- |
||
1014 | unsigned char const ID_MENU_EASYSETUP_Items[] = |
||
1015 | { |
||
1016 | param_GlobalConfig_HoehenRegelung, |
||
1017 | param_HoeheChannel, |
||
1018 | param_Hoehe_StickNeutralPoint, |
||
1019 | param_StartLandChannel, |
||
1020 | SEPARATOR, |
||
1021 | param_GlobalConfig_GpsAktiv, |
||
1022 | param_NaviGpsModeChannel, |
||
1023 | param_ExtraConfig_GpsAid, |
||
1024 | param_ComingHomeAltitude, |
||
1025 | SEPARATOR, |
||
1026 | param_CareFreeChannel, |
||
1027 | param_ExtraConfig_LearnableCarefree, |
||
1028 | |||
1029 | EOF // *** MUST BE THE LAST! *** |
||
1030 | }; |
||
1031 | |||
1032 | |||
1033 | |||
1034 | |||
1035 | //############################################################################################# |
||
1036 | //# Error-Handling |
||
1037 | //############################################################################################# |
||
1038 | //# mittels des auf dem PKT angezeigten Errocodes (z.B. "E32") kann man hier schauen was bzw. |
||
1039 | //# wo (in welcher Funktion) der Fehler aufgetreten ist. |
||
1040 | //# |
||
1041 | //# Im Menue wird der Fehlercode rechts bei den Values dargestellt (dabei ertönen immer wieder |
||
1042 | //# Fehler-Beep's). |
||
1043 | //# In der Vollbildanzeige wird zusaetzlich ein uebergebener Wert (value) angezeigt - im Code |
||
1044 | //# kann man ermitteln was der Wert darstellt. |
||
1045 | //############################################################################################# |
||
1046 | |||
1047 | #define E01_PARAMID_MENUEDITCATEGORY 1 // Menu_EditCategory() - FEHLER: paramEditItem (=paramID) nicht in Tabelle paramEditItemTable gefunden |
||
1048 | |||
1049 | #define E11_PARAMID_EDITGENERIC 11 // editGeneric() - FEHLER: paramEditItem (=paramID) nicht in Tabelle paramEditItemTable gefunden |
||
1050 | #define E12_PARAMID_EDITBITMASK 12 // editBitmask() - FEHLER: paramEditItem (=paramID) nicht in Tabelle paramEditItemTable gefunden |
||
1051 | |||
1052 | #define E30_CODECHAR_NOT_FOUND 30 // find_genericCode() - FEHLER: Code-Zeichen nicht in Tabelle editGenericCode gefunden |
||
1053 | #define E31_PARAMEDIT_ITEM_NOT_FOUND 31 // find_genericCodeByValue() - FEHLER: paramEditItem (=paramID) nicht in Tabelle paramEditItemTable gefunden |
||
1054 | #define E32_CODECHAR_NOT_FOUND 32 // find_genericCodeByValue() - FEHLER: Code-Zeichen nicht in Tabelle editGenericCode gefunden |
||
1055 | #define E33_VALUE_NOT_IN_FORMAT 33 // find_genericCodeByValue() - FEHLER: Ende des Format-Strings erreicht - fuer das gegebene value konnte kein passender Code im Format-String gefunden werden |
||
1056 | |||
1057 | #define E41_VALUE_MIN_MAX_RANGE 41 // strValueGeneric() - FEHLER: fuer die Range von 'v' (Value) wurde max < min angegeben bei Generic -> nicht unterstuetzt |
||
1058 | |||
1059 | |||
1060 | |||
1061 | |||
1062 | //-------------------------------------------------------------- |
||
1063 | // _error( errorcode, value, showscreen) |
||
1064 | // |
||
1065 | // zeigt Fehlermeldungen an |
||
1066 | // |
||
1067 | // PARAMETER: |
||
1068 | // errorcode : siehe Error-defines |
||
1069 | // value : zusaetzlicher Anzeigeparameter (nur in Screen-Anzeige) |
||
1070 | // showscreen: true = Fehlermeldung wird vollstaendig angezeigt. |
||
1071 | // - er Screen wird dabei geloescht |
||
1072 | // - Ende mit Taste 'Ende' |
||
1073 | // - langer Fehler-Beep |
||
1074 | // |
||
1075 | // false = es wird nur der Buffer mkparam_strValueBuffer |
||
1076 | // mit dem Fehlercode befuellt |
||
1077 | // - Anzeige im Menue ganz recht als "Enn" |
||
1078 | // - kurzer Fehler-Beep der jedoch bei jeder |
||
1079 | // Aktion im Menue zu hoeren ist |
||
1080 | // => dann auf Anzeige "Enn" achten! |
||
1081 | //-------------------------------------------------------------- |
||
1082 | void _error( uint8_t errorcode, uint8_t value, uint8_t showscreen) |
||
1083 | { |
||
1084 | xsnprintf_P( mkparam_strValueBuffer, MKPARAM_STRBUFFER_LEN, PSTR("E%02u"), errorcode); // in mkparam_strValueBuffer ausgeben fuer das Menue |
||
1085 | |||
1086 | if( showscreen ) |
||
1087 | { |
||
1088 | lcd_cls(); |
||
1089 | |||
1090 | lcdx_printp_center( 1, PSTR(" ERROR "), MINVERS, 0,-3); |
||
1091 | lcdx_printp_center( 2, PSTR("mkparameters.c"), MNORMAL, 0,0); |
||
1092 | |||
1093 | lcd_printf_at_P( 0, 4, MNORMAL, PSTR("Code : E%02u"), errorcode ); |
||
1094 | lcd_printf_at_P( 0, 5, MNORMAL, PSTR("Value: %3u"), value ); |
||
1095 | |||
1096 | lcd_printp_at(11, 7, strGet(ENDE), MNORMAL ); |
||
1097 | |||
1098 | set_beep( 500, 0x000f, BeepNormal); // Beep Error |
||
1099 | |||
1100 | while( !get_key_press(1 << KEY_ESC) ) |
||
1101 | { |
||
1102 | //-------------------------------- |
||
1103 | // Anmerkung: OG 25.03.2014 |
||
1104 | // |
||
1105 | // Ohne diese Verzoegerung funkioniert die Update-Erkennung via PKT-UpdateTool |
||
1106 | // meist nicht - ist das PKT zu schnell? |
||
1107 | // Kann man evtl. das PKT-UpdateTool diesbezueglich mal ueberpruefen ob man |
||
1108 | // Timings/Timeout's anpassen kann? |
||
1109 | // |
||
1110 | // Hinweis dazu: PKT_CtrlHook() bzw. die dort enthaltene Update-Anforderungspruefung |
||
1111 | // ist in den letzten Wochen beschleunigt geworden da unnoetiger Code fuer nicht |
||
1112 | // benoetigte Bildschirmausgaben entfernt wurde - das ist grundsaetzlich fuer das PKT |
||
1113 | // besser. |
||
1114 | // |
||
1115 | // Um das nachzustellen: |
||
1116 | // Unten das Delay auskommentieren und einen Fehler in Menu_EditCategory() provozieren |
||
1117 | // indem "paramID = 0;" einkommentiert wird (ist dort beschrieben) |
||
1118 | // Dann den Fehlerscreen im PKT anzeigen lassen und ein Update via PKT-UpdateTool initiieren, |
||
1119 | //-------------------------------- |
||
1120 | _delay_ms(150); |
||
1121 | |||
1122 | PKT_CtrlHook(); |
||
1123 | } |
||
1124 | } |
||
1125 | else |
||
1126 | { |
||
1127 | // kurzer Fehler-Beep - der kann wiederholt im Menue auftreten bei jedem Refresh des Menues |
||
1128 | set_beep( 160, 0x000f, BeepNormal); // Beep Error |
||
1129 | } |
||
1130 | } |
||
1131 | |||
1132 | |||
1133 | |||
1134 | |||
1135 | //############################################################################################# |
||
1136 | //# Edit-Funktionen |
||
1137 | //############################################################################################# |
||
1138 | |||
1139 | |||
1140 | //-------------------------------------------------------------- |
||
1141 | // ok = find_paramEditItem( paramID ) |
||
1142 | // |
||
1143 | // sucht in paramEditItemTable (PROGMEM) eine paramID und |
||
1144 | // kopiert den Eintrag in das RAM |
||
1145 | // |
||
1146 | // PARAMETER: |
||
1147 | // paramID |
||
1148 | // |
||
1149 | // RUECKGABE: |
||
1150 | // true = paramID gefunden |
||
1151 | // false = nicht gefunden (Fehler) |
||
1152 | // |
||
1153 | // -- globale Modulvariablen -- |
||
1154 | // Ergebnisse in: |
||
1155 | // |
||
1156 | // paramEditItem : der gefundene Eintrag vom Typ paramEditItem_t (im RAM) |
||
1157 | // paramEditFormat: der Format-String paramEditItem.format im RAM |
||
1158 | //-------------------------------------------------------------- |
||
1159 | unsigned char find_paramEditItem( unsigned char paramID ) |
||
1160 | { |
||
1161 | unsigned char id; |
||
1162 | unsigned char *p; |
||
1163 | |||
1164 | p = (unsigned char *) paramEditItemTable; |
||
1165 | |||
1166 | while( true ) |
||
1167 | { |
||
1168 | id = pgm_read_byte(p); // die aktuelle paramID aus paramEditDef |
||
1169 | |||
1170 | if( id == paramID || id == param_EOF ) |
||
1171 | break; |
||
1172 | |||
1173 | p += sizeof( paramEditItem_t ); |
||
1174 | } |
||
1175 | |||
1176 | //----- |
||
1177 | // wenn die gesuchte paramID nicht gefunden wurde steht |
||
1178 | // im RAM-Buffer paramEdit.paramID == param_EOF !! |
||
1179 | //----- |
||
1180 | memcpy_P ( ¶mEditItem , p, sizeof(paramEditItem_t) ); // die Struktur -> in den RAM-Buffer kopieren (Zugriff: paramEditItem) |
||
1181 | strncpy_P( paramEditFormat, paramEditItem.format, MKPARAM_STRBUFFER_LEN); // format String -> in den RAM-Buffer kopieren (Zugriff: paramEditFormat) |
||
1182 | |||
1183 | return( id!=param_EOF ); |
||
1184 | } |
||
1185 | |||
1186 | |||
1187 | |||
1188 | //-------------------------------------------------------------- |
||
1189 | // ptrP = paramEditItemTitle() |
||
1190 | // |
||
1191 | // gibt einen Zeiger in PROGMEM auf den Titel/Bezeichnung eines |
||
1192 | // paramID's in der richtigen Sprache zurueck |
||
1193 | // |
||
1194 | // ACHTUNG! paramEditItem muss vorher initialisert worden sein! |
||
1195 | //-------------------------------------------------------------- |
||
1196 | /* |
||
1197 | const char * paramEditItemTitle( void ) |
||
1198 | { |
||
1199 | if( Config.DisplayLanguage == 0 ) |
||
1200 | return( paramEditItem.title_de ); |
||
1201 | else |
||
1202 | return( paramEditItem.title_en ); |
||
1203 | } |
||
1204 | */ |
||
1205 | |||
1206 | |||
1207 | |||
1208 | //-------------------------------------------------------------- |
||
1209 | // print_paramEditItemTitle() |
||
1210 | // |
||
1211 | // gibt Titel/Bezeichnung auf den Bildschirm bei x=0, y=2 aus |
||
1212 | // |
||
1213 | // ACHTUNG! paramEditItem muss vorher initialisert worden sein! |
||
1214 | //-------------------------------------------------------------- |
||
1215 | void print_paramEditItemTitle( void ) |
||
1216 | { |
||
1217 | lcd_printp_at( 0, 2, (Config.DisplayLanguage == 0 ? paramEditItem.title_de : paramEditItem.title_en ), MNORMAL); // Bezeichnung des paramID's |
||
1218 | } |
||
1219 | |||
1220 | |||
1221 | |||
1222 | //-------------------------------------------------------------- |
||
1223 | // ok = find_genericCode( code ) |
||
1224 | // |
||
1225 | // Ergebnis steht in: (globale Modulvariablen) |
||
1226 | // genericCode |
||
1227 | //-------------------------------------------------------------- |
||
1228 | unsigned char find_genericCode( unsigned char code ) |
||
1229 | { |
||
1230 | unsigned char codeIdx; |
||
1231 | |||
1232 | codeIdx = 0; |
||
1233 | while( (editGenericCode[codeIdx].code != code ) && (editGenericCode[codeIdx].code != EOF) ) |
||
1234 | codeIdx++; |
||
1235 | |||
1236 | //----------------------------- |
||
1237 | // find_genericCode() - FEHLER: Code-Zeichen nicht in Tabelle editGenericCode gefunden |
||
1238 | //----------------------------- |
||
1239 | if( editGenericCode[codeIdx].code == EOF ) |
||
1240 | { |
||
1241 | _error( E30_CODECHAR_NOT_FOUND, code, false); |
||
1242 | return false; |
||
1243 | } |
||
1244 | |||
1245 | memcpy( &genericCode, &editGenericCode[codeIdx], sizeof(editGenericCode_t) ); // die gefundene Struktur in den RAM-Buffer kopieren |
||
1246 | |||
1247 | return true; |
||
1248 | } |
||
1249 | |||
1250 | |||
1251 | |||
1252 | //-------------------------------------------------------------- |
||
1253 | // ok = find_genericCode( paramID, &v, &min, &max, pFormat) |
||
1254 | // |
||
1255 | // PARAMETER: |
||
1256 | // paramID |
||
1257 | // *v |
||
1258 | // *min |
||
1259 | // *max |
||
1260 | // *pFormat |
||
1261 | // |
||
1262 | // Ergebnis steht in: (globale Modulvariablen) |
||
1263 | // paramEditItem |
||
1264 | // paramEditFormat: der zugehoerige Format-String |
||
1265 | // genericCode |
||
1266 | //-------------------------------------------------------------- |
||
1267 | unsigned char find_genericCodeByValue( unsigned char paramID, unsigned char *v, unsigned char *min, unsigned char *max ) |
||
1268 | { |
||
1269 | unsigned char codeIdx; |
||
1270 | char *pFormat; |
||
1271 | |||
1272 | |||
1273 | //------------------------------------------------- |
||
1274 | // 1. finde paramID in der paramEditItem-Tabelle |
||
1275 | // |
||
1276 | // sollte der RAM-Buffer paramEditItem bereits das |
||
1277 | // gesuchte enthalten dann ok |
||
1278 | //------------------------------------------------- |
||
1279 | if( paramEditItem.paramID != paramID ) |
||
1280 | find_paramEditItem( paramID ); |
||
1281 | |||
1282 | //--- |
||
1283 | // FEHLER: paramEditItem nicht in Tabelle paramEditItemTable gefunden |
||
1284 | //--- |
||
1285 | if( paramEditItem.paramID == param_EOF ) |
||
1286 | { |
||
1287 | _error( E31_PARAMEDIT_ITEM_NOT_FOUND, paramID, false); |
||
1288 | return false; |
||
1289 | } |
||
1290 | |||
1291 | pFormat = paramEditFormat; // Zeiger auf das erste Zeichen vom Format-String (z.B. "DCSWFHQ") |
||
1292 | *v = paramGet( paramID ); // der aktuelle Wert des paraID |
||
1293 | |||
1294 | while( true ) |
||
1295 | { |
||
1296 | //------ |
||
1297 | // suche editGenericCode mittels aktuelles Zeichens *pFormat |
||
1298 | //------ |
||
1299 | codeIdx = 0; |
||
1300 | while( (editGenericCode[codeIdx].code != *pFormat) && (editGenericCode[codeIdx].code != EOF) ) |
||
1301 | codeIdx++; |
||
1302 | |||
1303 | |||
1304 | //------ |
||
1305 | // FEHLER: Code-Zeichen nicht in Tabelle editGenericCode gefunden |
||
1306 | //------ |
||
1307 | if( editGenericCode[codeIdx].code == EOF ) |
||
1308 | { |
||
1309 | _error( E32_CODECHAR_NOT_FOUND, *pFormat, false); |
||
1310 | return false; |
||
1311 | } |
||
1312 | |||
1313 | |||
1314 | //------ |
||
1315 | // suche den Value-Bereich (min/max) fuer das Code-Zeichen |
||
1316 | //------ |
||
1317 | if( editGenericCode[codeIdx].code == 'v' ) |
||
1318 | { |
||
1319 | // bei code 'v' kommt min/max aus paramEditItem |
||
1320 | *min = paramEditItem.min; |
||
1321 | *max = paramEditItem.max; |
||
1322 | } |
||
1323 | else |
||
1324 | { |
||
1325 | // ansonsten kommt min/max aus dem Code selber |
||
1326 | *min = editGenericCode[codeIdx].min; |
||
1327 | *max = editGenericCode[codeIdx].max; |
||
1328 | } |
||
1329 | |||
1330 | // value gefunden (innerhalb von min/max)? |
||
1331 | // beruecksichtigt 'gedrehte' min/max (z.B. Poti1..8) |
||
1332 | if( (*min <= *max && *v >= *min && *v <= *max) || (*min > *max && *v >= *max && *v <= *min) ) |
||
1333 | { |
||
1334 | // gefunden - Schleife verlassen |
||
1335 | break; |
||
1336 | } |
||
1337 | |||
1338 | |||
1339 | //------ |
||
1340 | // naechstes Code-Zeichen aus der Format-Maske |
||
1341 | //------ |
||
1342 | pFormat++; |
||
1343 | |||
1344 | |||
1345 | //------ |
||
1346 | // FEHLER: Ende des Format-Strings erreicht - fuer das gegebene value konnte kein passender Code im Format-String gefunden werden |
||
1347 | //------ |
||
1348 | if( *pFormat == 0 ) // Ende des Format-Strings erreicht - Fehler... |
||
1349 | { |
||
1350 | _error( E33_VALUE_NOT_IN_FORMAT, *v, false); |
||
1351 | return false; |
||
1352 | } |
||
1353 | } |
||
1354 | |||
1355 | memcpy( &genericCode, &editGenericCode[codeIdx], sizeof(editGenericCode_t) ); // die gefundene Struktur in den RAM-Buffer kopieren |
||
1356 | |||
1357 | genericCode.min = *min; // ggf. min/max ueberschreiben durch min/max von paramEditItem |
||
1358 | genericCode.max = *max; |
||
1359 | |||
1360 | return true; |
||
1361 | } |
||
1362 | |||
1363 | |||
1364 | |||
1365 | //-------------------------------------------------------------- |
||
1366 | //-------------------------------------------------------------- |
||
1367 | const char * get_genericCodeText( uint8_t cmd ) |
||
1368 | { |
||
1369 | if( cmd == MKPARAM_LONGVALUE ) |
||
1370 | { |
||
1371 | if( Config.DisplayLanguage == 0 ) return genericCode.longText_de; |
||
1372 | else return genericCode.longText_en; |
||
1373 | } |
||
1374 | else |
||
1375 | { |
||
1376 | if( Config.DisplayLanguage == 0 ) return genericCode.shortText_de; |
||
1377 | else return genericCode.shortText_en; |
||
1378 | } |
||
1379 | return 0; |
||
1380 | } |
||
1381 | |||
1382 | |||
1383 | |||
1384 | //-------------------------------------------------------------- |
||
1385 | // ok = strValueGeneric( paramID, cmd ) |
||
1386 | // |
||
1387 | // erstellt die String Representation des Wertes von paramID |
||
1388 | // im Buffer mkparam_strValueBuffer. |
||
1389 | // |
||
1390 | // Mit 'cmd' wird gesteuert ob es der Lang-Text oder der |
||
1391 | // Kurztext (3 Zeichen) ist. |
||
1392 | // |
||
1393 | // PARAMETER: |
||
1394 | // paramID: |
||
1395 | // cmd: MKPARAM_SHORTVALUE oder MKPARAM_LONGVALUE |
||
1396 | //-------------------------------------------------------------- |
||
1397 | uint8_t strValueGeneric( unsigned char paramID, uint8_t cmd ) |
||
1398 | { |
||
1399 | unsigned char v; |
||
1400 | unsigned char min; |
||
1401 | unsigned char max; |
||
1402 | |||
1403 | if( find_genericCodeByValue( paramID, &v, &min, &max) ) |
||
1404 | { |
||
1405 | //------------------- |
||
1406 | // value gefunden! |
||
1407 | //------------------- |
||
1408 | if( genericCode.code == 'v' ) // Code 'v' (Value) - keine Umrechnung von min/max |
||
1409 | { |
||
1410 | if( max < min ) |
||
1411 | { |
||
1412 | // max < min bei 'v' (Value) wird aktuell nicht unterstuezt da |
||
1413 | // kein Beispiel vorhanden ist was damit ggf. gemeint ist. |
||
1414 | // Wenn das irgendwann benoetigt wird muss das hier gecoded werden. |
||
1415 | // Bis dahin wird das als Fehler angesehen (ggf. vertippt beim coden). |
||
1416 | _error( E41_VALUE_MIN_MAX_RANGE, v, false); |
||
1417 | return false; |
||
1418 | } |
||
1419 | } |
||
1420 | else // alles andere ausser 'v' - der Wert wird in die Range von min/max umgerechnet |
||
1421 | { |
||
1422 | if( min <= max ) |
||
1423 | v = v-min; |
||
1424 | else |
||
1425 | v = min-v; // OG Notiz: v = 248 = 8 # 248 = 8, 255 = 1 # min 255 max = 248 |
||
1426 | v++; // fuer Anzeige +1: statt '0' eine '1' anzeigen - Beispiel: statt "Poti0" zeige "Poti1" |
||
1427 | } |
||
1428 | |||
1429 | |||
1430 | //------------------- |
||
1431 | // ertstelle String |
||
1432 | //------------------- |
||
1433 | xsnprintf_P( mkparam_strValueBuffer, MKPARAM_STRBUFFER_LEN, get_genericCodeText(cmd), v); // erzeuge den Ausgabestring in mkparam_strValueBuffer |
||
1434 | |||
1435 | return true; |
||
1436 | } |
||
1437 | |||
1438 | return false; |
||
1439 | } |
||
1440 | |||
1441 | |||
1442 | |||
1443 | |||
1444 | //-------------------------------------------------------------- |
||
1445 | // ok = getGenericNextValue( paramID, vInc ) |
||
1446 | // |
||
1447 | // PARAMETER: |
||
1448 | //-------------------------------------------------------------- |
||
1449 | uint8_t getGenericNextValue( unsigned char paramID, int8_t vInc ) |
||
1450 | { |
||
1451 | int v; // value von paramID - signed int: damit -1 und >255 ausgewertet werden kann |
||
1452 | unsigned char value; // zum holen von v via find_genericCodeByValue() |
||
1453 | unsigned char min; |
||
1454 | unsigned char max; |
||
1455 | unsigned char codeIdx; |
||
1456 | char *pFormat; |
||
1457 | |||
1458 | |||
1459 | if( find_genericCodeByValue( paramID, &value, &min, &max) ) |
||
1460 | { |
||
1461 | v = (int)value; // value vom paramID wird gecastet auf int um -1 und >255 fuer edit zu erkennen |
||
1462 | |||
1463 | //------------------------------------------------------ |
||
1464 | // Pointer auf das Zeichen im Format-String ermitteln |
||
1465 | //------------------------------------------------------ |
||
1466 | pFormat = paramEditFormat; |
||
1467 | while( *pFormat != genericCode.code ) pFormat++; |
||
1468 | |||
1469 | |||
1470 | if( min > max ) // 'umgedrehte' min/max Werte wie bei Poti1..8 |
||
1471 | vInc = vInc * -1; |
||
1472 | |||
1473 | |||
1474 | v = v + vInc; |
||
1475 | |||
1476 | |||
1477 | //------------------------------------------------------ |
||
1478 | // min/max Grenzen des Code-Zeichens ueberschritten? |
||
1479 | //------------------------------------------------------ |
||
1480 | if( (min <= max && v < min) || (min > max && v > min) ) |
||
1481 | { |
||
1482 | if( pFormat == paramEditFormat ) // Anfang vom Code-String? -> dann gehe zum Ende (letztes Zeichen) |
||
1483 | { |
||
1484 | while( *(pFormat+1) ) pFormat++; |
||
1485 | } |
||
1486 | else |
||
1487 | { |
||
1488 | pFormat--; // vorheriges Format-Zeichen = vorheriger Code |
||
1489 | } |
||
1490 | |||
1491 | |||
1492 | codeIdx = 0; // code-Zeichen suchen in Tabelle editGenericCode |
||
1493 | while( (editGenericCode[codeIdx].code != *pFormat) && (editGenericCode[codeIdx].code != EOF) ) |
||
1494 | codeIdx++; |
||
1495 | |||
1496 | if( editGenericCode[codeIdx].code == EOF ) // Fehler? -> exit |
||
1497 | { |
||
1498 | return false; |
||
1499 | } |
||
1500 | |||
1501 | if( editGenericCode[codeIdx].code == 'v' ) |
||
1502 | v = paramEditItem.max; |
||
1503 | else |
||
1504 | v = editGenericCode[codeIdx].max; |
||
1505 | |||
1506 | } |
||
1507 | else if( (min <= max && v > max) || (min > max && v < max) ) |
||
1508 | { |
||
1509 | pFormat++; // naechstes Format-Zeichen = naechster Code |
||
1510 | if( *pFormat == 0 ) // Ende des Format-Strings? |
||
1511 | pFormat = paramEditFormat; |
||
1512 | |||
1513 | codeIdx = 0; // code-Zeichen suchen in Tabelle editGenericCode |
||
1514 | while( (editGenericCode[codeIdx].code != *pFormat) && (editGenericCode[codeIdx].code != EOF) ) |
||
1515 | codeIdx++; |
||
1516 | |||
1517 | if( editGenericCode[codeIdx].code == EOF ) // Fehler? -> exit |
||
1518 | { |
||
1519 | return false; |
||
1520 | } |
||
1521 | |||
1522 | if( editGenericCode[codeIdx].code == 'v' ) |
||
1523 | v = paramEditItem.min; |
||
1524 | else |
||
1525 | v = editGenericCode[codeIdx].min; |
||
1526 | } |
||
1527 | |||
1528 | |||
1529 | //------------------------------------------------------ |
||
1530 | // neuen Wert setzen |
||
1531 | //------------------------------------------------------ |
||
1532 | paramSet( paramID, (unsigned char)v ); |
||
1533 | |||
1534 | return true; |
||
1535 | |||
1536 | } // end: if( find_genericCode( paramID, &v, &min, &max) ) |
||
1537 | |||
1538 | |||
1539 | return false; |
||
1540 | } |
||
1541 | |||
1542 | |||
1543 | |||
1544 | //-------------------------------------------------------------- |
||
1545 | // editGeneric( paramID, cmd ) |
||
1546 | // |
||
1547 | // PARAMETER: |
||
1548 | // cmd: MKPARAM_EDIT oder MKPARAM_SHORTVALUE oder MKPARAM_LONGVALUE |
||
1549 | //-------------------------------------------------------------- |
||
1550 | void editGeneric( unsigned char paramID, uint8_t cmd ) |
||
1551 | { |
||
1552 | unsigned char v_org; |
||
1553 | uint8_t redraw; |
||
1554 | int8_t vInc; |
||
1555 | |||
1556 | if( cmd != MKPARAM_EDIT ) |
||
1557 | { |
||
1558 | // wenn cmd = MKPARAM_SHORTVALUE oder MKPARAM_LONGVALUE |
||
1559 | strValueGeneric( paramID, cmd); // Ergebnis in: mkparam_strValueBuffer |
||
1560 | return; |
||
1561 | } |
||
1562 | |||
1563 | find_paramEditItem( paramID ); |
||
1564 | |||
1565 | //------------------------ |
||
1566 | // editGeneric() - FEHLER: paramEditItem (=paramID) nicht in Tabelle paramEditItemTable gefunden |
||
1567 | //------------------------ |
||
1568 | if( paramEditItem.paramID == param_EOF ) |
||
1569 | { |
||
1570 | _error( E11_PARAMID_EDITGENERIC, paramID, true); |
||
1571 | return; |
||
1572 | } |
||
1573 | |||
1574 | lcd_cls(); |
||
1575 | |||
1576 | v_org = paramGet( paramID ); |
||
1577 | redraw = SCREEN_REDRAW; |
||
1578 | vInc = 0; // 0, +1, -1 (inc/dec) |
||
1579 | |||
1580 | while( true ) |
||
1581 | { |
||
1582 | //----------------------- |
||
1583 | // Anzeige: Titel, usw.. |
||
1584 | //----------------------- |
||
1585 | if( redraw == SCREEN_REDRAW ) |
||
1586 | { |
||
1587 | lcd_frect( 0, 0, 127, 7, 1); // Headline: Box fill |
||
1588 | lcdx_printp_at( 1, 0, PSTR("Ändern"), MINVERS, 0,0); // Titel |
||
1589 | lcd_printp_at( 0, 7, strGet(KEYLINE2), MNORMAL); // Keyline: <- -> Ende OK |
||
1590 | lcd_printp_at(11, 7, strGet(KEYCANCEL), MNORMAL); // Keyline: "Abbr." statt "Ende" einsetzen |
||
1591 | |||
1592 | print_paramEditItemTitle(); // Bezeichnung des paramID's anzeigen |
||
1593 | |||
1594 | redraw = SCREEN_REFRESH; |
||
1595 | } |
||
1596 | |||
1597 | |||
1598 | //--------------- |
||
1599 | // LiPo Anzeigen |
||
1600 | //--------------- |
||
1601 | show_Lipo(); // LiPo anzeigen |
||
1602 | |||
1603 | |||
1604 | //----------------------- |
||
1605 | // Anzeige: nur Wert |
||
1606 | //----------------------- |
||
1607 | if( redraw == SCREEN_REFRESH ) |
||
1608 | { |
||
1609 | strValueGeneric( paramID, MKPARAM_LONGVALUE); // Lang-Text des Values anzeigen |
||
1610 | // nach strValueGeneric() ist auch genericCode initialisiert! |
||
1611 | lcd_printf_at_P( 0, 4, MNORMAL, PSTR("> %18s"), mkparam_strValueBuffer ); |
||
1612 | |||
1613 | |||
1614 | // DEBUG... |
||
1615 | #ifdef DEBUG_PARAMEDIT |
||
1616 | //lcd_printf_at_P( 16, 1, MNORMAL, PSTR("%c %3u"), genericCode.code, paramGet(paramID) ); |
||
1617 | #endif |
||
1618 | |||
1619 | //lcd_printf_at_P( 16, 4, MNORMAL, PSTR("= %03u"), v ); |
||
1620 | |||
1621 | |||
1622 | if( abs(genericCode.max-genericCode.min) <= 20 ) |
||
1623 | _delay_ms( 200 ); // Verzoegerung |
||
1624 | |||
1625 | vInc = 0; |
||
1626 | redraw = 0; |
||
1627 | } |
||
1628 | |||
1629 | |||
1630 | //----------------- |
||
1631 | // TASTEN |
||
1632 | //----------------- |
||
1633 | if( get_key_press(1 << KEY_ESC) ) // Key: Cancel |
||
1634 | { |
||
1635 | paramSet( paramID, v_org ); // org. Wert wieder herstellen |
||
1636 | break; |
||
1637 | } |
||
1638 | |||
1639 | if( get_key_press(1 << KEY_ENTER) ) // Key: OK |
||
1640 | { |
||
1641 | break; |
||
1642 | } |
||
1643 | |||
1644 | if( get_key_press(1 << KEY_PLUS) || get_key_long_rpt_sp( (1 << KEY_PLUS),2) ) // Key: rechts / +1 |
||
1645 | { |
||
1646 | vInc = +1; |
||
1647 | } |
||
1648 | |||
1649 | |||
1650 | if( get_key_press(1 << KEY_MINUS) || get_key_long_rpt_sp( (1 << KEY_MINUS),2) ) // Key: links / -1 |
||
1651 | { |
||
1652 | vInc = -1; |
||
1653 | } |
||
1654 | |||
1655 | if( vInc != 0 ) |
||
1656 | { |
||
1657 | getGenericNextValue( paramID, vInc ); |
||
1658 | redraw = SCREEN_REFRESH; |
||
1659 | } |
||
1660 | |||
1661 | |||
1662 | //------------------------------------------ |
||
1663 | // Pruefe PKT-Update oder andere PKT-Aktion |
||
1664 | //------------------------------------------ |
||
1665 | if( PKT_CtrlHook() ) // Update vom Updatetool angefordert? |
||
1666 | { |
||
1667 | lcd_cls(); |
||
1668 | redraw = SCREEN_REDRAW; |
||
1669 | } |
||
1670 | |||
1671 | } // end: while( true ) |
||
1672 | |||
1673 | } |
||
1674 | |||
1675 | |||
1676 | |||
1677 | //-------------------------------------------------------------- |
||
1678 | // editBitmask( paramID, cmd ) |
||
1679 | // |
||
1680 | // PARAMETER: |
||
1681 | // paramID: die paramID |
||
1682 | // cmd: MKPARAM_EDIT oder MKPARAM_SHORTVALUE oder MKPARAM_LONGVALUE |
||
1683 | //-------------------------------------------------------------- |
||
1684 | void editBitmask( unsigned char paramID, uint8_t cmd ) |
||
1685 | { |
||
1686 | unsigned char v; |
||
1687 | uint8_t redraw; |
||
1688 | uint8_t i; |
||
1689 | int8_t pos; |
||
1690 | |||
1691 | find_paramEditItem( paramID ); |
||
1692 | |||
1693 | //----------------------- |
||
1694 | // editBitmask() - FEHLER: paramEditItem (=paramID) nicht in Tabelle paramEditItemTable gefunden |
||
1695 | //----------------------- |
||
1696 | if( paramEditItem.paramID == param_EOF ) |
||
1697 | { |
||
1698 | _error( E12_PARAMID_EDITBITMASK, paramID, (cmd==MKPARAM_EDIT) ); |
||
1699 | return; |
||
1700 | } |
||
1701 | |||
1702 | |||
1703 | //----------------------- |
||
1704 | // nur Rueckgabe des Wertes in mkparam_strValueBuffer ? |
||
1705 | //----------------------- |
||
1706 | if( cmd != MKPARAM_EDIT ) |
||
1707 | { |
||
1708 | v = paramGet( paramID ); |
||
1709 | xsnprintf_P( mkparam_strValueBuffer, MKPARAM_STRBUFFER_LEN, PSTR("%03u"), v); // erzeuge den Ausgabestring in mkparam_strValueBuffer |
||
1710 | return; |
||
1711 | } |
||
1712 | |||
1713 | |||
1714 | lcd_cls(); |
||
1715 | |||
1716 | v = paramGet( paramID ); |
||
1717 | redraw = SCREEN_REDRAW; |
||
1718 | pos = 0; |
||
1719 | |||
1720 | while( true ) |
||
1721 | { |
||
1722 | //----------------------- |
||
1723 | // Anzeige: Titel, usw.. |
||
1724 | //----------------------- |
||
1725 | if( redraw == SCREEN_REDRAW ) |
||
1726 | { |
||
1727 | lcd_frect( 0, 0, 127, 7, 1); // Headline: Box fill |
||
1728 | lcdx_printp_at( 1, 0, PSTR("Ändern"), MINVERS, 0,0); // Titel |
||
1729 | lcd_printp_at( 1, 7, PSTR("0/1 \x19 OK"), MNORMAL); // Keyline: -> 0/1 OK |
||
1730 | lcd_printp_at( 11, 7, strGet(KEYCANCEL), MNORMAL); // Keyline: "Abbr." bzw "Cancel" |
||
1731 | lcdx_printp_at( 7, 6, PSTR("\x18"), MNORMAL, -2,2); // Keyline langer Tastendruck: -> 0/1 OK |
||
1732 | |||
1733 | if( (paramID == param_J16Bitmask) || (paramID == param_J17Bitmask) ) |
||
1734 | { |
||
1735 | lcdx_printp_at( 10, 5, PSTR("(Bit1=Idle)"), MNORMAL, 0,2); // |
||
1736 | } |
||
1737 | |||
1738 | print_paramEditItemTitle(); // Bezeichnung des paramID's (Stelle x=0, y=2) |
||
1739 | |||
1740 | redraw = SCREEN_REFRESH; |
||
1741 | } |
||
1742 | |||
1743 | |||
1744 | //--------------- |
||
1745 | // LiPo Anzeigen |
||
1746 | //--------------- |
||
1747 | show_Lipo(); // LiPo anzeigen |
||
1748 | |||
1749 | |||
1750 | //----------------------- |
||
1751 | // Anzeige: nur Wert |
||
1752 | //----------------------- |
||
1753 | if( redraw == SCREEN_REFRESH ) |
||
1754 | { |
||
1755 | for(i = 0; i < 8; i++) |
||
1756 | { |
||
1757 | lcd_putc( 8-i, 4, ( (v & (1 << i)) ? '1' : '0'), MNORMAL); |
||
1758 | } |
||
1759 | |||
1760 | lcd_frect( 0, (8*5), 125-(11*6), 7, 0); // clear: Eingabemarkierung |
||
1761 | lcd_printp_at (pos+1, 5,PSTR("\x12"), MNORMAL); // Eingabemarkierung (Pfeil nach oben) |
||
1762 | |||
1763 | lcd_printf_at_P( 15, 4, MNORMAL, PSTR("= %03u"), v ); // Anzeige des aktuellen Wertes Dezimal |
||
1764 | |||
1765 | // _delay_ms( 200 ); // Verzoegerung |
||
1766 | redraw = 0; |
||
1767 | } |
||
1768 | |||
1769 | |||
1770 | //----------------- |
||
1771 | // TASTEN |
||
1772 | //----------------- |
||
1773 | if( get_key_short(1 << KEY_ESC) ) // Key: Cancel |
||
1774 | { |
||
1775 | break; // verlassen |
||
1776 | } |
||
1777 | |||
1778 | if (get_key_short(1 << KEY_ENTER)) // Key: OK |
||
1779 | { |
||
1780 | paramSet( paramID, v ); // Wert speichern |
||
1781 | break; // und verlassen |
||
1782 | } |
||
1783 | |||
1784 | if( get_key_short(1 << KEY_PLUS) ) |
||
1785 | { |
||
1786 | if(pos == 7) pos = 0; |
||
1787 | else pos++; |
||
1788 | redraw = SCREEN_REFRESH; |
||
1789 | } |
||
1790 | |||
1791 | if( get_key_long(1 << KEY_PLUS) ) |
||
1792 | { |
||
1793 | if(pos == 0) pos = 7; |
||
1794 | else pos--; |
||
1795 | redraw = SCREEN_REFRESH; |
||
1796 | } |
||
1797 | |||
1798 | |||
1799 | if( get_key_short (1 << KEY_MINUS) ) |
||
1800 | { |
||
1801 | v ^= (1<<(7-pos)); |
||
1802 | redraw = SCREEN_REFRESH; |
||
1803 | } |
||
1804 | |||
1805 | |||
1806 | //------------------------------------------ |
||
1807 | // evtl. weitere lange Tasten abfangen, da es |
||
1808 | // ansonsten ggf. Nebeneffekte bzgl. dem Menue |
||
1809 | // beim verlassen der Funktion gibt |
||
1810 | //------------------------------------------ |
||
1811 | get_key_long_rpt_sp( KEY_ALL,2); |
||
1812 | |||
1813 | |||
1814 | //------------------------------------------ |
||
1815 | // Pruefe PKT-Update oder andere PKT-Aktion |
||
1816 | //------------------------------------------ |
||
1817 | if( PKT_CtrlHook() ) // Update vom Updatetool angefordert? |
||
1818 | { |
||
1819 | lcd_cls(); |
||
1820 | redraw = SCREEN_REDRAW; |
||
1821 | } |
||
1822 | |||
1823 | } // end: while( true ) |
||
1824 | } |
||
1825 | |||
1826 | |||
1827 | |||
1828 | //-------------------------------------------------------------- |
||
1829 | //-------------------------------------------------------------- |
||
1830 | void editCompassOffset( unsigned char paramID, uint8_t cmd ) |
||
1831 | { |
||
1832 | unsigned char vu; // unsigned byte |
||
1833 | int v; // signed |
||
1834 | uint8_t redraw; |
||
1835 | uint8_t bit7; |
||
1836 | uint8_t bit8; |
||
1837 | uint8_t lDisDeclCalc; |
||
1838 | |||
1839 | find_paramEditItem( paramID ); |
||
1840 | |||
1841 | //----------------------- |
||
1842 | // editCompassOffset() - FEHLER: paramEditItem (=paramID) nicht in Tabelle paramEditItemTable gefunden |
||
1843 | //----------------------- |
||
1844 | if( paramEditItem.paramID == param_EOF ) |
||
1845 | { |
||
1846 | // TODO: Fehlercode anpassen! |
||
1847 | _error( E12_PARAMID_EDITBITMASK, paramID, (cmd==MKPARAM_EDIT) ); |
||
1848 | return; |
||
1849 | } |
||
1850 | |||
1851 | |||
1852 | //----------------------- |
||
1853 | // Wert ermitteln (-60 bis 60) |
||
1854 | //----------------------- |
||
1855 | vu = paramGet( paramID ); |
||
1856 | |||
1857 | bit7 = ((vu & 0x40) ? true : false); // Bit 7: 1 = negativ; 0 = positiv |
||
1858 | bit8 = ((vu & 0x80) ? true : false); // Bit 8 in Kombination mit Bit 7 = "Disable dec. Calc" |
||
1859 | |||
1860 | // Bit 8 == Bit 7: "Disable dec. Calc" AUS |
||
1861 | // Bit 8 != Bit 7: "Disable dec. Calc" AN |
||
1862 | lDisDeclCalc = ((bit8 == bit7) ? 0 : 1); // merken um das spaeter wieder in den Wert einzubauen |
||
1863 | |||
1864 | vu = (vu & (0x80 ^ 0xff)); // Bit 8 loeschen |
||
1865 | |||
1866 | if( bit7 ) // Wert negativ? |
||
1867 | { |
||
1868 | vu = vu - 1; // Umrechnung: 7-Bit Zweierkomplement |
||
1869 | vu = (vu ^ 0xff); // invertieren |
||
1870 | vu = (vu & (0x80 ^ 0xff)); // Bit 8 loeschen |
||
1871 | v = (int)vu; |
||
1872 | v = v * -1; |
||
1873 | } |
||
1874 | else // Wert ist positiv |
||
1875 | { |
||
1876 | v = (int)vu; |
||
1877 | } |
||
1878 | |||
1879 | |||
1880 | //----------------------- |
||
1881 | // nur Rueckgabe des Wertes in mkparam_strValueBuffer ? |
||
1882 | //----------------------- |
||
1883 | if( cmd != MKPARAM_EDIT ) |
||
1884 | { |
||
1885 | xsnprintf_P( mkparam_strValueBuffer, MKPARAM_STRBUFFER_LEN, PSTR("%3d"), v ); // erzeuge den Ausgabestring in mkparam_strValueBuffer |
||
1886 | return; |
||
1887 | } |
||
1888 | |||
1889 | |||
1890 | //----------------------- |
||
1891 | // Wert Editieren |
||
1892 | //----------------------- |
||
1893 | lcd_cls(); |
||
1894 | |||
1895 | redraw = SCREEN_REDRAW; |
||
1896 | |||
1897 | while( true ) |
||
1898 | { |
||
1899 | //----------------------- |
||
1900 | // Anzeige: Titel, usw.. |
||
1901 | //----------------------- |
||
1902 | if( redraw == SCREEN_REDRAW ) |
||
1903 | { |
||
1904 | lcd_frect( 0, 0, 127, 7, 1); // Headline: Box fill |
||
1905 | lcdx_printp_at( 1, 0, PSTR("Ändern") , MINVERS, 0,0); // Titel |
||
1906 | lcd_printp_at( 0, 7, strGet(KEYLINE2) , MNORMAL); // Keyline: <- -> Ende OK |
||
1907 | lcd_printp_at( 11, 7, strGet(KEYCANCEL), MNORMAL); // Keyline: "Abbr." statt "Ende" einsetzen |
||
1908 | |||
1909 | print_paramEditItemTitle(); // Bezeichnung des paramID's anzeigen |
||
1910 | |||
1911 | redraw = SCREEN_REFRESH; |
||
1912 | } |
||
1913 | |||
1914 | |||
1915 | //--------------- |
||
1916 | // LiPo Anzeigen |
||
1917 | //--------------- |
||
1918 | show_Lipo(); // LiPo anzeigen |
||
1919 | |||
1920 | |||
1921 | //----------------------- |
||
1922 | // Anzeige: Wert |
||
1923 | //----------------------- |
||
1924 | if( redraw == SCREEN_REFRESH ) |
||
1925 | { |
||
1926 | lcd_printf_at_P( 0, 4, MNORMAL, PSTR("> %3d"), v ); |
||
1927 | redraw = false; |
||
1928 | } |
||
1929 | |||
1930 | |||
1931 | //----------------- |
||
1932 | // TASTEN |
||
1933 | //----------------- |
||
1934 | if( get_key_short(1 << KEY_ESC) ) // Key: Cancel |
||
1935 | { |
||
1936 | break; // verlassen |
||
1937 | } |
||
1938 | |||
1939 | if( get_key_short(1 << KEY_ENTER) ) // Key: OK |
||
1940 | { |
||
1941 | //------------------------------------- |
||
1942 | // signed int in unsigned byte wandeln |
||
1943 | //------------------------------------- |
||
1944 | if( v < 0 ) // Wert negativ? |
||
1945 | { |
||
1946 | // Umwandeln in 7-Bit Zweierkomplement |
||
1947 | v = v * -1; // Wert positiv machen |
||
1948 | vu = (unsigned char)v; // in unsigned Byte speichern |
||
1949 | vu = (vu ^ 0xff); // invertieren |
||
1950 | vu = vu + 1; // +1 |
||
1951 | } |
||
1952 | else // Wert ist positiv |
||
1953 | { |
||
1954 | vu = (unsigned char)v; // in unsigned Byte speichern |
||
1955 | } |
||
1956 | |||
1957 | //------------------------------------- |
||
1958 | // "Disable declination calc" wieder einrechnen |
||
1959 | //------------------------------------- |
||
1960 | bit7 = ((vu & 0x40) ? true : false); // Bit 7: 1 = negativ; 0 = positiv |
||
1961 | |||
1962 | if( lDisDeclCalc ) bit8 = !bit7; // Bit 8 != Bit 7: "Disable dec. Calc" AN |
||
1963 | else bit8 = bit7; // Bit 8 == Bit 7: "Disable dec. Calc" AUS |
||
1964 | |||
1965 | if( bit8 ) vu = (vu | 0x80); // Bit 8 setzen |
||
1966 | else vu = (vu & (0x80 ^ 0xff)); // Bit 8 loeschen |
||
1967 | |||
1968 | //------------------------------------- |
||
1969 | // Wert speichern |
||
1970 | //------------------------------------- |
||
1971 | paramSet( paramID, vu ); // Wert speichern |
||
1972 | break; // und verlassen |
||
1973 | } // end: KEY_ENTER |
||
1974 | |||
1975 | |||
1976 | if( get_key_short(1 << KEY_MINUS) || get_key_long_rpt_sp( (1 << KEY_MINUS),2) ) |
||
1977 | { |
||
1978 | if( v <= -60 ) v = 60; |
||
1979 | else v = v - 1; |
||
1980 | redraw = SCREEN_REFRESH; |
||
1981 | } |
||
1982 | |||
1983 | |||
1984 | if( get_key_short(1 << KEY_PLUS) || get_key_long_rpt_sp( (1 << KEY_PLUS),2) ) |
||
1985 | { |
||
1986 | if( v >= 60 ) v = -60; |
||
1987 | else v = v + 1; |
||
1988 | redraw = SCREEN_REFRESH; |
||
1989 | } |
||
1990 | |||
1991 | //------------------------------------------ |
||
1992 | // evtl. weitere lange Tasten abfangen, da es |
||
1993 | // ansonsten ggf. Nebeneffekte bzgl. dem Menue |
||
1994 | // beim verlassen der Funktion gibt |
||
1995 | //------------------------------------------ |
||
1996 | get_key_long_rpt_sp( KEY_ALL,2); |
||
1997 | |||
1998 | |||
1999 | //------------------------------------------ |
||
2000 | // Pruefe PKT-Update oder andere PKT-Aktion |
||
2001 | //------------------------------------------ |
||
2002 | if( PKT_CtrlHook() ) // Update vom Updatetool angefordert? |
||
2003 | { |
||
2004 | lcd_cls(); |
||
2005 | redraw = SCREEN_REDRAW; |
||
2006 | } |
||
2007 | |||
2008 | } // end: while( true ) |
||
2009 | } |
||
2010 | |||
2011 | //-------------------------------------------------------------- |
||
2012 | void editACCZLandingPulse( unsigned char paramID, uint8_t cmd ) |
||
2013 | { |
||
2014 | unsigned char vu; // unsigned byte |
||
2015 | // int v; // signed |
||
2016 | uint8_t redraw; |
||
2017 | // uint8_t bit7; |
||
2018 | // uint8_t bit8; |
||
2019 | // uint8_t lDisDeclCalc; |
||
2020 | |||
2021 | find_paramEditItem( paramID ); |
||
2022 | |||
2023 | //----------------------- |
||
2024 | // editACCZLandingPulse() - FEHLER: paramEditItem (=paramID) nicht in Tabelle paramEditItemTable gefunden |
||
2025 | //----------------------- |
||
2026 | if( paramEditItem.paramID == param_EOF ) |
||
2027 | { |
||
2028 | // TODO: Fehlercode anpassen! |
||
2029 | _error( E12_PARAMID_EDITBITMASK, paramID, (cmd==MKPARAM_EDIT) ); |
||
2030 | return; |
||
2031 | } |
||
2032 | |||
2033 | vu = paramGet( paramID ); |
||
2034 | |||
2035 | //----------------------- |
||
2036 | // nur Rueckgabe des Wertes in mkparam_strValueBuffer ? |
||
2037 | //----------------------- |
||
2038 | if( cmd != MKPARAM_EDIT ) |
||
2039 | { |
||
2040 | xsnprintf_P( mkparam_strValueBuffer, MKPARAM_STRBUFFER_LEN, PSTR("%4d"), vu*4 ); // erzeuge den Ausgabestring in mkparam_strValueBuffer |
||
2041 | return; |
||
2042 | } |
||
2043 | |||
2044 | |||
2045 | //----------------------- |
||
2046 | // Wert Editieren |
||
2047 | //----------------------- |
||
2048 | lcd_cls(); |
||
2049 | |||
2050 | redraw = SCREEN_REDRAW; |
||
2051 | |||
2052 | while( true ) |
||
2053 | { |
||
2054 | //----------------------- |
||
2055 | // Anzeige: Titel, usw.. |
||
2056 | //----------------------- |
||
2057 | if( redraw == SCREEN_REDRAW ) |
||
2058 | { |
||
2059 | lcd_frect( 0, 0, 127, 7, 1); // Headline: Box fill |
||
2060 | lcdx_printp_at( 1, 0, PSTR("Ändern") , MINVERS, 0,0); // Titel |
||
2061 | lcd_printp_at( 0, 7, strGet(KEYLINE2) , MNORMAL); // Keyline: <- -> Ende OK |
||
2062 | lcd_printp_at( 11, 7, strGet(KEYCANCEL), MNORMAL); // Keyline: "Abbr." statt "Ende" einsetzen |
||
2063 | |||
2064 | print_paramEditItemTitle(); // Bezeichnung des paramID's anzeigen |
||
2065 | |||
2066 | redraw = SCREEN_REFRESH; |
||
2067 | } |
||
2068 | |||
2069 | |||
2070 | //--------------- |
||
2071 | // LiPo Anzeigen |
||
2072 | //--------------- |
||
2073 | show_Lipo(); // LiPo anzeigen |
||
2074 | |||
2075 | |||
2076 | //----------------------- |
||
2077 | // Anzeige: Wert |
||
2078 | //----------------------- |
||
2079 | if( redraw == SCREEN_REFRESH ) |
||
2080 | { |
||
2081 | lcd_printf_at_P( 0, 4, MNORMAL, PSTR("> %4d"), vu *4 ); |
||
2082 | redraw = false; |
||
2083 | } |
||
2084 | |||
2085 | |||
2086 | //----------------- |
||
2087 | // TASTEN |
||
2088 | //----------------- |
||
2089 | if( get_key_short(1 << KEY_ESC) ) // Key: Cancel |
||
2090 | { |
||
2091 | break; // verlassen |
||
2092 | } |
||
2093 | |||
2094 | if( get_key_short(1 << KEY_ENTER) ) // Key: OK |
||
2095 | { |
||
2096 | // //------------------------------------- |
||
2097 | // // signed int in unsigned byte wandeln |
||
2098 | // //------------------------------------- |
||
2099 | // if( v < 0 ) // Wert negativ? |
||
2100 | // { |
||
2101 | // // Umwandeln in 7-Bit Zweierkomplement |
||
2102 | // v = v * -1; // Wert positiv machen |
||
2103 | // vu = (unsigned char)v; // in unsigned Byte speichern |
||
2104 | // vu = (vu ^ 0xff); // invertieren |
||
2105 | // vu = vu + 1; // +1 |
||
2106 | // } |
||
2107 | // else // Wert ist positiv |
||
2108 | // { |
||
2109 | // vu = (unsigned char)v; // in unsigned Byte speichern |
||
2110 | // } |
||
2111 | // |
||
2112 | // //------------------------------------- |
||
2113 | // // "Disable declination calc" wieder einrechnen |
||
2114 | // //------------------------------------- |
||
2115 | // bit7 = ((vu & 0x40) ? true : false); // Bit 7: 1 = negativ; 0 = positiv |
||
2116 | // |
||
2117 | // if( lDisDeclCalc ) bit8 = !bit7; // Bit 8 != Bit 7: "Disable dec. Calc" AN |
||
2118 | // else bit8 = bit7; // Bit 8 == Bit 7: "Disable dec. Calc" AUS |
||
2119 | // |
||
2120 | // if( bit8 ) vu = (vu | 0x80); // Bit 8 setzen |
||
2121 | // else vu = (vu & (0x80 ^ 0xff)); // Bit 8 loeschen |
||
2122 | |||
2123 | //------------------------------------- |
||
2124 | // Wert speichern |
||
2125 | //------------------------------------- |
||
2126 | paramSet( paramID, vu ); // Wert speichern |
||
2127 | break; // und verlassen |
||
2128 | } // end: KEY_ENTER |
||
2129 | |||
2130 | |||
2131 | if( get_key_short(1 << KEY_MINUS) || get_key_long_rpt_sp( (1 << KEY_MINUS),2) ) |
||
2132 | { |
||
2133 | // if( v <= -60 ) v = 60; |
||
2134 | // else v = v - 1; |
||
2135 | // |
||
2136 | if( vu < 191 ) vu = 190; |
||
2137 | else vu = vu -1; |
||
2138 | |||
2139 | redraw = SCREEN_REFRESH; |
||
2140 | } |
||
2141 | |||
2142 | |||
2143 | if( get_key_short(1 << KEY_PLUS) || get_key_long_rpt_sp( (1 << KEY_PLUS),2) ) |
||
2144 | { |
||
2145 | // if( v >= 60 ) v = -60; |
||
2146 | // else v = v + 1; |
||
2147 | if( vu >= 255 ) vu = 255; |
||
2148 | // if( vu == 1 ) vu = 191; |
||
2149 | else vu = vu +1; |
||
2150 | redraw = SCREEN_REFRESH; |
||
2151 | } |
||
2152 | |||
2153 | //------------------------------------------ |
||
2154 | // evtl. weitere lange Tasten abfangen, da es |
||
2155 | // ansonsten ggf. Nebeneffekte bzgl. dem Menue |
||
2156 | // beim verlassen der Funktion gibt |
||
2157 | //------------------------------------------ |
||
2158 | get_key_long_rpt_sp( KEY_ALL,2); |
||
2159 | |||
2160 | |||
2161 | //------------------------------------------ |
||
2162 | // Pruefe PKT-Update oder andere PKT-Aktion |
||
2163 | //------------------------------------------ |
||
2164 | if( PKT_CtrlHook() ) // Update vom Updatetool angefordert? |
||
2165 | { |
||
2166 | lcd_cls(); |
||
2167 | redraw = SCREEN_REDRAW; |
||
2168 | } |
||
2169 | |||
2170 | } // end: while( true ) |
||
2171 | } |
||
2172 | |||
2173 | //-------------------------------------------------------------- |
||
2174 | |||
2175 | |||
2176 | //-------------------------------------------------------------- |
||
2177 | // editNA( paramID, cmd ) |
||
2178 | // |
||
2179 | // Hilfsfunktion die nur "nicht verfügbar" anzeigt wenn die |
||
2180 | // paramID noch nicht implementiert ist |
||
2181 | // |
||
2182 | // PARAMETER: |
||
2183 | // paramID: die paramID |
||
2184 | // cmd: MKPARAM_EDIT oder MKPARAM_SHORTVALUE oder MKPARAM_LONGVALUE |
||
2185 | //-------------------------------------------------------------- |
||
2186 | void editNA( unsigned char paramID, uint8_t cmd ) |
||
2187 | { |
||
2188 | if( cmd != MKPARAM_EDIT ) |
||
2189 | { |
||
2190 | strncpy_P( mkparam_strValueBuffer, PSTR("NA!"), MKPARAM_STRBUFFER_LEN); // "NA!" bzw, "not available" |
||
2191 | return; |
||
2192 | } |
||
2193 | |||
2194 | //PKT_Message_P( *text, error, timeout, beep, clearscreen ) |
||
2195 | PKT_Message_P( PSTR("nicht verfügbar"), false, 2000, true, true ); // "nicht verfügbar" |
||
2196 | } |
||
2197 | |||
2198 | |||
2199 | |||
2200 | |||
2201 | //############################################################################################# |
||
2202 | //# TEST / DEBUG |
||
2203 | //############################################################################################# |
||
2204 | |||
2205 | //-------------------------------------------------------------- |
||
2206 | //-------------------------------------------------------------- |
||
2207 | void editGenericTEST( unsigned char paramID ) |
||
2208 | { |
||
2209 | lcd_cls(); |
||
2210 | |||
2211 | //lcdx_printp_at( 0, 0, PSTR("NEW PARAM TEST..."), MNORMAL, 0,0); |
||
2212 | lcd_printp_at(12, 7, strGet(ENDE), MNORMAL); // Keyline |
||
2213 | |||
2214 | find_paramEditItem( paramID ); // Ergebnis in paramEditItem (RAM) |
||
2215 | |||
2216 | if( paramEditItem.paramID == paramID ) |
||
2217 | { |
||
2218 | lcd_printf_at_P( 0, 1, MNORMAL, PSTR("%S"), paramEditItem.title_de ); |
||
2219 | |||
2220 | lcd_printf_at_P( 0, 2, MNORMAL, PSTR("format: %s"), paramEditFormat ); |
||
2221 | |||
2222 | lcd_printf_at_P( 0, 3, MNORMAL, PSTR("value:%u"), paramGet(paramID) ); |
||
2223 | |||
2224 | strValueGeneric( paramID, MKPARAM_LONGVALUE); |
||
2225 | lcd_printf_at_P( 0, 4, MNORMAL, PSTR("vstr: %s"), mkparam_strValueBuffer ); |
||
2226 | |||
2227 | strValueGeneric( paramID, MKPARAM_SHORTVALUE); |
||
2228 | lcd_printf_at_P( 0, 5, MNORMAL, PSTR("vstr: %s"), mkparam_strValueBuffer ); |
||
2229 | } |
||
2230 | |||
2231 | |||
2232 | if( paramEditItem.paramID == param_EOF ) |
||
2233 | { |
||
2234 | lcd_printf_at_P( 0, 5, MNORMAL, PSTR("! ERROR !") ); |
||
2235 | } |
||
2236 | |||
2237 | |||
2238 | //----------------------------------------- |
||
2239 | // Tasten... |
||
2240 | while( true ) |
||
2241 | { |
||
2242 | PKT_CtrlHook(); |
||
2243 | if (get_key_press (1 << KEY_ESC)) |
||
2244 | { |
||
2245 | break; |
||
2246 | } |
||
2247 | } |
||
2248 | } |
||
2249 | |||
2250 | |||
2251 | |||
2252 | //-------------------------------------------------------------- |
||
2253 | //-------------------------------------------------------------- |
||
2254 | void TEST(void) |
||
2255 | { |
||
2256 | //editGeneric( param_Gyro_Gier_P, MKPARAM_EDIT ); |
||
2257 | editGeneric( param_Kanalbelegung_Gas, MKPARAM_EDIT ); |
||
2258 | } |
||
2259 | |||
2260 | |||
2261 | |||
2262 | |||
2263 | //############################################################################################# |
||
2264 | //# Menues & Favoriten |
||
2265 | //############################################################################################# |
||
2266 | |||
2267 | |||
2268 | //-------------------------------------------------------------- |
||
2269 | // fav_add() |
||
2270 | // |
||
2271 | // einen Favoriten hinzufuegen |
||
2272 | // |
||
2273 | // Aufruf durch: wird durch den Menu-Controller aufgerufen |
||
2274 | //-------------------------------------------------------------- |
||
2275 | void fav_add( void ) |
||
2276 | { |
||
2277 | uint8_t paramID; |
||
2278 | uint8_t i; |
||
2279 | |||
2280 | |||
2281 | //------------------------------ |
||
2282 | // welche paramID wurde gewaehlt? |
||
2283 | //------------------------------ |
||
2284 | paramID = MenuCtrl_GetItemId(); // gewaehlter Menuepunkt bzw. paramID (0 = keine itemID) |
||
2285 | |||
2286 | |||
2287 | //------------------------------ |
||
2288 | // ungueltige paramID? |
||
2289 | //------------------------------ |
||
2290 | if( paramID==0 || paramID==EOF ) |
||
2291 | { |
||
2292 | return; // keine gueltige paramID gewaehlt -> ZURUECK |
||
2293 | } |
||
2294 | |||
2295 | |||
2296 | //------------------------------ |
||
2297 | // Duplikatsuche bzgl. paramID |
||
2298 | // (gilt nicht fuer SEPARATOR) |
||
2299 | //------------------------------ |
||
2300 | if( paramID!=SEPARATOR ) |
||
2301 | { |
||
2302 | //------------------------------ |
||
2303 | // suche Duplikate fuer paramID |
||
2304 | //------------------------------ |
||
2305 | for( i=0; (i<MAX_MKPARAM_FAVORITES) && (Config.MKParam_Favs[i]!=paramID); i++); |
||
2306 | |||
2307 | //------------------------------ |
||
2308 | // Favoriten bereits vorhanden? |
||
2309 | // -> exit |
||
2310 | //------------------------------ |
||
2311 | if( Config.MKParam_Favs[i] == paramID ) |
||
2312 | { |
||
2313 | set_beep( 300, 0x000f, BeepNormal); // Error Beep kurz |
||
2314 | PKT_Popup_P( 400, strGet(STR_FAV_EXIST),0,0,0); // "* Fav vorhanden *" (ca. 4 sec max.) |
||
2315 | return; |
||
2316 | } |
||
2317 | } // end: if( paramID!=SEPARATOR ) |
||
2318 | |||
2319 | |||
2320 | //------------------------------ |
||
2321 | // suche freien Speicherplatz fuer paramID |
||
2322 | //------------------------------ |
||
2323 | for( i=0; (i<MAX_MKPARAM_FAVORITES) && (Config.MKParam_Favs[i]!=0); i++); |
||
2324 | |||
2325 | //------------------------------ |
||
2326 | // Favoriten voll? |
||
2327 | // -> exit |
||
2328 | //------------------------------ |
||
2329 | if( i >= MAX_MKPARAM_FAVORITES ) |
||
2330 | { |
||
2331 | set_beep( 500, 0x000f, BeepNormal); // Error Beep lang |
||
2332 | PKT_Popup_P( 400, strGet(STR_FAV_FULL),0,0,0); // "* Fav ist voll *" (ca. 4 sec max.) |
||
2333 | return; |
||
2334 | } |
||
2335 | |||
2336 | //------------------------------ |
||
2337 | // neuen Fav merken |
||
2338 | //------------------------------ |
||
2339 | Config.MKParam_Favs[i] = paramID; |
||
2340 | set_beep( 25, 0xffff, BeepNormal ); // kurzer Bestaetigungs-Beep |
||
2341 | PKT_Popup_P( 400, strGet(STR_FAV_ADD),0,0,0); // "Fav hinzugefügt!" (ca. 4 sec max.) |
||
2342 | } |
||
2343 | |||
2344 | |||
2345 | |||
2346 | //-------------------------------------------------------------- |
||
2347 | //-------------------------------------------------------------- |
||
2348 | void Menu_Favoriten( void ) |
||
2349 | { |
||
2350 | uint8_t paramID; |
||
2351 | uint8_t i; |
||
2352 | |||
2353 | //unsigned char MKParam_Favs[MAX_MKPARAM_FAVORITES]; // Array von MK-Parameter Favoriten des Benutzers |
||
2354 | |||
2355 | if( Config.MKParam_Favs[0] == 0 ) // Favoriten vorhanden |
||
2356 | { |
||
2357 | //PKT_Message_P( *text, error, timeout, beep, clearscreen ) |
||
2358 | PKT_Message_P( strGet(STR_FAV_NOTEXIST), false, 500, true, true ); // Anzeige "nicht verfügbar" (max. 2 Sekunden anzeigen) |
||
2359 | return; |
||
2360 | } |
||
2361 | |||
2362 | |||
2363 | //--------------- |
||
2364 | // Create |
||
2365 | //--------------- |
||
2366 | MenuCtrl_Create(); |
||
2367 | MenuCtrl_SetTitleFromParentItem(); // uebernimmt den Titel vom uebergeordneten Menuepunkt |
||
2368 | MenuCtrl_ShowLevel( false ); |
||
2369 | MenuCtrl_SetDelete( true ); // Menueeintraege loeschen (langer Druck auf "OK") |
||
2370 | MenuCtrl_SetMove( true ); // Menueeintraege verschieben (langer Druck auf hoch/runter) |
||
2371 | //MenuCtrl_SetShowBatt( true ); |
||
2372 | //MenuCtrl_SetCycle( false ); |
||
2373 | //MenuCtrl_SetBeep( true ); |
||
2374 | |||
2375 | |||
2376 | //--------------- |
||
2377 | // Menu-Items |
||
2378 | //--------------- |
||
2379 | i = 0; |
||
2380 | while( (i<MAX_MKPARAM_FAVORITES) && (Config.MKParam_Favs[i]!=0) ) |
||
2381 | { |
||
2382 | paramID = Config.MKParam_Favs[i]; |
||
2383 | |||
2384 | if( paramID == SEPARATOR ) |
||
2385 | { |
||
2386 | MenuCtrl_PushSeparatorID( SEPARATOR ); // Trennlinie im Menue hinzufuegen |
||
2387 | } |
||
2388 | else |
||
2389 | { |
||
2390 | find_paramEditItem( paramID ); |
||
2391 | |||
2392 | //-------- |
||
2393 | // FEHLER: paramEditItem (=paramID) nicht in Tabelle paramEditItemTable gefunden - Menu_EditCategory() |
||
2394 | //-------- |
||
2395 | if( paramEditItem.paramID == param_EOF ) |
||
2396 | { |
||
2397 | _error( E01_PARAMID_MENUEDITCATEGORY, paramID, true); |
||
2398 | MenuCtrl_Destroy(); |
||
2399 | return; |
||
2400 | } |
||
2401 | |||
2402 | MenuCtrl_PushParamEdit( paramID ); |
||
2403 | |||
2404 | // existiert die paramID in der Firmware des Kopters? |
||
2405 | if( !paramExist(paramID) ) |
||
2406 | { |
||
2407 | MenuCtrl_ItemActive( paramID, false ); // paramID deaktivieren |
||
2408 | } |
||
2409 | |||
2410 | // DEBUG! (Simulation eines deaktivierten Fav's) |
||
2411 | // if( i==2 ) MenuCtrl_ItemActive( paramID, false ); // paramID deaktivieren |
||
2412 | |||
2413 | } // end: else: if( paramID == SEPARATOR ) |
||
2414 | |||
2415 | i++; |
||
2416 | } // end: while(..) |
||
2417 | |||
2418 | |||
2419 | |||
2420 | //--------------- |
||
2421 | // Control |
||
2422 | //--------------- |
||
2423 | while( true ) |
||
2424 | { |
||
2425 | MenuCtrl_Control( MENUCTRL_EVENT ); |
||
2426 | if( MenuCtrl_GetKey() == KEY_ESC ) break; // KEY_ESC = Menue beenden |
||
2427 | |||
2428 | paramID = MenuCtrl_GetItemId(); // welcher Menu-Punkt (= paramID) |
||
2429 | |||
2430 | find_paramEditItem( paramID ); // Edit-Definitionen heraussuchen (initialisiert: paramEditItem) |
||
2431 | |||
2432 | paramEditItem.editfunc( paramID, MKPARAM_EDIT ); // zugeordnete Edit-Funktion aufrufen |
||
2433 | } |
||
2434 | |||
2435 | |||
2436 | //--------------- |
||
2437 | // ggf. neue Menuereihenfolge |
||
2438 | // in der Config speichern |
||
2439 | //--------------- |
||
2440 | for( i=0; (i<MAX_MKPARAM_FAVORITES); i++) |
||
2441 | { |
||
2442 | Config.MKParam_Favs[i] = MenuCtrl_GetItemIdByIndex( i ); |
||
2443 | } |
||
2444 | |||
2445 | |||
2446 | //--------------- |
||
2447 | // Destroy |
||
2448 | //--------------- |
||
2449 | MenuCtrl_Destroy(); |
||
2450 | } |
||
2451 | |||
2452 | |||
2453 | |||
2454 | //-------------------------------------------------------------- |
||
2455 | //-------------------------------------------------------------- |
||
2456 | void Menu_EditCategory( const unsigned char *menuitems ) |
||
2457 | { |
||
2458 | unsigned char paramID; |
||
2459 | unsigned char lastmenuitem = 0; |
||
2460 | |||
2461 | //--------------- |
||
2462 | // Create |
||
2463 | //--------------- |
||
2464 | MenuCtrl_Create(); |
||
2465 | |||
2466 | //--------------- |
||
2467 | // Einstellungen |
||
2468 | //--------------- |
||
2469 | MenuCtrl_SetTitleFromParentItem(); // uebernimmt den Titel vom uebergeordneten Menuepunkt |
||
2470 | MenuCtrl_ShowLevel( false ); |
||
2471 | //MenuCtrl_SetShowBatt( true ); |
||
2472 | //MenuCtrl_SetCycle( false ); |
||
2473 | //MenuCtrl_SetBeep( true ); |
||
2474 | |||
2475 | //MenuCtrl_SetKey( uint8_t key, const char *keytext, void (*keyfunc)(void) ) |
||
2476 | MenuCtrl_SetKey( KEY_ENTER_LONG, 0, &fav_add ); |
||
2477 | |||
2478 | |||
2479 | //--------------- |
||
2480 | // Menuitems |
||
2481 | //--------------- |
||
2482 | while( *menuitems != EOF ) |
||
2483 | { |
||
2484 | paramID = *menuitems; |
||
2485 | |||
2486 | if( paramID == SEPARATOR ) |
||
2487 | { |
||
2488 | // wenn der vorherige Menueeintrag bereits ein SEPARATOR war |
||
2489 | // dann nicht erneut einen Separator anzeigen! |
||
2490 | // |
||
2491 | // Das kann ggf. passieren wenn z.B. aufgrund der FC-Revision |
||
2492 | // alle Zwischeneintraege ausgeblendet wurden |
||
2493 | if( lastmenuitem != SEPARATOR ) |
||
2494 | { |
||
2495 | MenuCtrl_PushSeparatorID( SEPARATOR ); // Trennlinie im Menue hinzufuegen |
||
2496 | lastmenuitem = paramID; |
||
2497 | } |
||
2498 | } |
||
2499 | else |
||
2500 | { |
||
2501 | //------------------------------------------------------ |
||
2502 | // TEST / DEBUG fuer beschriebenes Problem in _error() |
||
2503 | // |
||
2504 | // Wenn man das dortige Problem nachstellen will kann |
||
2505 | // man hier einen Fehlerscreen provozieren! |
||
2506 | //------------------------------------------------------ |
||
2507 | //paramID = 0; |
||
2508 | |||
2509 | |||
2510 | find_paramEditItem( paramID ); |
||
2511 | |||
2512 | //-------- |
||
2513 | // FEHLER: paramEditItem (=paramID) nicht in Tabelle paramEditItemTable gefunden - Menu_EditCategory() |
||
2514 | //-------- |
||
2515 | if( paramEditItem.paramID == param_EOF ) |
||
2516 | { |
||
2517 | _error( E01_PARAMID_MENUEDITCATEGORY, paramID, true); |
||
2518 | MenuCtrl_Destroy(); |
||
2519 | return; |
||
2520 | } |
||
2521 | |||
2522 | // existiert die paramID in der Firmware des Kopters? |
||
2523 | if( paramExist(paramEditItem.paramID) ) |
||
2524 | { |
||
2525 | MenuCtrl_PushParamEdit( paramEditItem.paramID ); |
||
2526 | lastmenuitem = paramID; |
||
2527 | } |
||
2528 | } |
||
2529 | |||
2530 | menuitems++; |
||
2531 | } |
||
2532 | |||
2533 | |||
2534 | //--------------- |
||
2535 | // Control |
||
2536 | //--------------- |
||
2537 | while( true ) |
||
2538 | { |
||
2539 | MenuCtrl_Control( MENUCTRL_EVENT ); |
||
2540 | if( MenuCtrl_GetKey() == KEY_ESC ) break; // Menue beenden |
||
2541 | |||
2542 | paramID = MenuCtrl_GetItemId(); // welcher Menu-Punkt (= paramID) |
||
2543 | |||
2544 | find_paramEditItem( paramID ); // Edit-Definitionen heraussuchen (initialisiert: paramEditItem) |
||
2545 | |||
2546 | paramEditItem.editfunc( paramID, MKPARAM_EDIT ); // zugeordnete Edit-Funktion aufrufen |
||
2547 | } |
||
2548 | |||
2549 | //--------------- |
||
2550 | // Destroy |
||
2551 | //--------------- |
||
2552 | MenuCtrl_Destroy(); |
||
2553 | } |
||
2554 | |||
2555 | |||
2556 | |||
2557 | |||
2558 | //-------------------------------------------------------------- |
||
2559 | //-------------------------------------------------------------- |
||
2560 | void MK_Parameters_MenuMain( uint8_t setting, char *settingname ) |
||
2561 | { |
||
2562 | uint8_t itemid; |
||
2563 | |||
2564 | //--------------- |
||
2565 | // Create |
||
2566 | //--------------- |
||
2567 | MenuCtrl_Create(); |
||
2568 | |||
2569 | //--------------- |
||
2570 | // Einstellungen |
||
2571 | //--------------- |
||
2572 | MenuCtrl_SetTitle( settingname ); |
||
2573 | MenuCtrl_ShowLevel( false ); |
||
2574 | //MenuCtrl_SetShowBatt( true ); |
||
2575 | //MenuCtrl_SetCycle( false ); |
||
2576 | //MenuCtrl_SetBeep( true ); |
||
2577 | |||
2578 | //--------------- |
||
2579 | // Menuitems |
||
2580 | //--------------- |
||
2581 | //MenuCtrl_PushML2_P( ID_MENU_TEST , MENU_ITEM, &TEST, ID_MENU_TEST_de , ID_MENU_TEST_en ); |
||
2582 | |||
2583 | MenuCtrl_PushML2_P( ID_MENU_FAVORITEN , MENU_ITEM, NOFUNC, ID_MENU_FAVORITEN_de , ID_MENU_FAVORITEN_en ); // Favoriten: noch nicht implementiert... |
||
2584 | |||
2585 | MenuCtrl_PushSeparator(); // MENUE TRENNLINIE |
||
2586 | |||
2587 | MenuCtrl_PushML2_P( ID_MENU_KANAELE , MENU_ITEM, NOFUNC, ID_MENU_KANAELE_de , ID_MENU_KANAELE_en ); |
||
2588 | MenuCtrl_PushML2_P( ID_MENU_KONFIGURATION, MENU_ITEM, NOFUNC, ID_MENU_KONFIGURATION_de, ID_MENU_KONFIGURATION_en ); |
||
2589 | MenuCtrl_PushML2_P( ID_MENU_STICK , MENU_ITEM, NOFUNC, ID_MENU_STICK_de , ID_MENU_STICK_en ); |
||
2590 | MenuCtrl_PushML2_P( ID_MENU_LOOPING , MENU_ITEM, NOFUNC, ID_MENU_LOOPING_de , ID_MENU_LOOPING_en ); |
||
2591 | MenuCtrl_PushML2_P( ID_MENU_HOEHE , MENU_ITEM, NOFUNC, ID_MENU_HOEHE_de , ID_MENU_HOEHE_en ); |
||
2592 | MenuCtrl_PushML2_P( ID_MENU_KAMERA , MENU_ITEM, NOFUNC, ID_MENU_KAMERA_de , ID_MENU_KAMERA_en ); |
||
2593 | MenuCtrl_PushML2_P( ID_MENU_NAVICTRL , MENU_ITEM, NOFUNC, ID_MENU_NAVICTRL_de , ID_MENU_NAVICTRL_en ); |
||
2594 | MenuCtrl_PushML2_P( ID_MENU_AUSGAENGE , MENU_ITEM, NOFUNC, ID_MENU_AUSGAENGE_de , ID_MENU_AUSGAENGE_en ); |
||
2595 | MenuCtrl_PushML2_P( ID_MENU_VERSCHIEDENES, MENU_ITEM, NOFUNC, ID_MENU_VERSCHIEDENES_de, ID_MENU_VERSCHIEDENES_en ); |
||
2596 | MenuCtrl_PushML2_P( ID_MENU_GYRO , MENU_ITEM, NOFUNC, ID_MENU_GYRO_de , ID_MENU_GYRO_en ); |
||
2597 | MenuCtrl_PushML2_P( ID_MENU_BENUTZER , MENU_ITEM, NOFUNC, ID_MENU_BENUTZER_de , ID_MENU_BENUTZER_en ); |
||
2598 | MenuCtrl_PushML2_P( ID_MENU_ACHSKOPPLUNG , MENU_ITEM, NOFUNC, ID_MENU_ACHSKOPPLUNG_de , ID_MENU_ACHSKOPPLUNG_en ); |
||
2599 | //MenuCtrl_PushML2_P( ID_MENU_MIXERSETUP , MENU_ITEM, NOFUNC, ID_MENU_MIXERSETUP_de , ID_MENU_MIXERSETUP_en ); // nicht mehr unterstuetzt! |
||
2600 | MenuCtrl_PushML2_P( ID_MENU_EASYSETUP , MENU_ITEM, NOFUNC, ID_MENU_EASYSETUP_de , ID_MENU_EASYSETUP_en ); |
||
2601 | |||
2602 | |||
2603 | //--------------- |
||
2604 | // Control |
||
2605 | //--------------- |
||
2606 | while( true ) |
||
2607 | { |
||
2608 | MenuCtrl_Control( MENUCTRL_EVENT ); |
||
2609 | if( MenuCtrl_GetKey() == KEY_ESC ) break; |
||
2610 | |||
2611 | itemid = MenuCtrl_GetItemId(); // welcher Menu-Punkt (ID) |
||
2612 | |||
2613 | switch( itemid ) |
||
2614 | { |
||
2615 | case ID_MENU_FAVORITEN: Menu_Favoriten(); break; |
||
2616 | |||
2617 | case ID_MENU_KANAELE: Menu_EditCategory( ID_MENU_KANAELE_Items ); break; |
||
2618 | case ID_MENU_KONFIGURATION: Menu_EditCategory( ID_MENU_KONFIGURATION_Items ); break; |
||
2619 | case ID_MENU_STICK: Menu_EditCategory( ID_MENU_STICK_Items ); break; |
||
2620 | case ID_MENU_LOOPING: Menu_EditCategory( ID_MENU_LOOPING_Items ); break; |
||
2621 | case ID_MENU_HOEHE: Menu_EditCategory( ID_MENU_HOEHE_Items ); break; |
||
2622 | case ID_MENU_KAMERA: Menu_EditCategory( ID_MENU_KAMERA_Items ); break; |
||
2623 | case ID_MENU_NAVICTRL: Menu_EditCategory( ID_MENU_NAVICTRL_Items ); break; |
||
2624 | case ID_MENU_AUSGAENGE: Menu_EditCategory( ID_MENU_AUSGAENGE_Items ); break; |
||
2625 | case ID_MENU_VERSCHIEDENES: Menu_EditCategory( ID_MENU_VERSCHIEDENES_Items ); break; |
||
2626 | case ID_MENU_GYRO: Menu_EditCategory( ID_MENU_GYRO_Items ); break; |
||
2627 | case ID_MENU_BENUTZER: Menu_EditCategory( ID_MENU_BENUTZER_Items ); break; |
||
2628 | case ID_MENU_ACHSKOPPLUNG: Menu_EditCategory( ID_MENU_ACHSKOPPLUNG_Items ); break; |
||
2629 | case ID_MENU_EASYSETUP: Menu_EditCategory( ID_MENU_EASYSETUP_Items ); break; |
||
2630 | |||
2631 | default: //PKT_Message_P( *text, error, timeout, beep, clearscreen ) |
||
2632 | PKT_Message_P( PSTR("nicht verfügbar"), false, 200, true, true ); // Anzeige "nicht verfügbar" (max. 2 Sekunden anzeigen) |
||
2633 | break; |
||
2634 | } |
||
2635 | } |
||
2636 | |||
2637 | |||
2638 | //--------------- |
||
2639 | // Destroy |
||
2640 | //--------------- |
||
2641 | MenuCtrl_Destroy(); |
||
2642 | } |
||
2643 | |||
2644 | |||
2645 | |||
2646 | |||
2647 | |||
2648 | //############################################################################################# |
||
2649 | //# MK_Parameters() - Main-Function |
||
2650 | //############################################################################################# |
||
2651 | |||
2652 | //-------------------------------------------------------------- |
||
2653 | // changed = MK_Parameters( setting, settingname ) |
||
2654 | //-------------------------------------------------------------- |
||
2655 | uint8_t MK_Parameters( uint8_t setting, char *settingname ) |
||
2656 | { |
||
2657 | int changed; |
||
2658 | unsigned char *org_parameters; |
||
2659 | uint8_t size = paramsetSize(); |
||
2660 | |||
2661 | //----------------------------------------------------------------- |
||
2662 | // Erkennung ob Aenderungen durch den Benutzer vorgenommen wurde |
||
2663 | // -> das aktuelle Paramset wird gespeichert um es spaeter mit |
||
2664 | // der bearbeiteten Version via memcmp zu vergleichen |
||
2665 | //----------------------------------------------------------------- |
||
2666 | org_parameters = malloc( size+1 ); // +1 fuer das erste settings-byte |
||
2667 | |||
2668 | if( !org_parameters ) |
||
2669 | { |
||
2670 | //PKT_Message_P( *text, error, timeout, beep, clearscreen ) |
||
2671 | PKT_Message_P( PSTR("NO RAM!"), true, 800, true, true ); // FEHLER! (NO RAM) |
||
2672 | return false; |
||
2673 | } |
||
2674 | memcpy( org_parameters, (unsigned char *)(pRxData), size+1 ); // memcpy( dst, src, size)) |
||
2675 | |||
2676 | |||
2677 | //----------------------------------------------------------------- |
||
2678 | // MK-Parameter bearbeiten |
||
2679 | //----------------------------------------------------------------- |
||
2680 | MK_Parameters_MenuMain( setting, settingname ); |
||
2681 | |||
2682 | |||
2683 | //----------------------------------------------------------------- |
||
2684 | // Vergleich: Orginal-Daten <-> ggf. geaenderte Daten |
||
2685 | //----------------------------------------------------------------- |
||
2686 | changed = memcmp( org_parameters, (unsigned char *)(pRxData), size+1 ); |
||
2687 | |||
2688 | free( org_parameters ); |
||
2689 | |||
2690 | return( changed!=0 ); |
||
2691 | } |
||
2692 |