Mercurial > public > ostc4
annotate Discovery/Src/tMenuEdit.c @ 853:de6023cc0580 Evo_2_23
Potential Bugfix Selection MenuEdit lifecycle:
The "id" as well as the "evid" were used in two workflows. The setup of the menu structure and later in the handling of e.g. actual cursor position. In case of sructure updates while the menu was opened this lead to misbehavior in the menu handling. To avoid this in future the two usecased of the variables have been separated. The creation of the menus is still handles by "id" and "evid". The handling of the actual menu behavior is controlled by "actualId" and"actualevid"
author | Ideenmodellierer |
---|---|
date | Thu, 07 Mar 2024 21:51:18 +0100 |
parents | 17d9d6eddd8d |
children | 48b6a3b1f3f8 |
rev | line source |
---|---|
38 | 1 /////////////////////////////////////////////////////////////////////////////// |
2 /// -*- coding: UTF-8 -*- | |
3 /// | |
4 /// \file Discovery/Src/tMenuEdit.c | |
5 /// \brief Main Template file for Menu Setting Modifications | |
6 /// \author heinrichs weikamp gmbh | |
7 /// \date 04-July-2014 | |
8 /// | |
9 /// \details | |
10 /// | |
11 /// $Id$ | |
12 /////////////////////////////////////////////////////////////////////////////// | |
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
14 /// | |
15 /// This program is free software: you can redistribute it and/or modify | |
16 /// it under the terms of the GNU General Public License as published by | |
17 /// the Free Software Foundation, either version 3 of the License, or | |
18 /// (at your option) any later version. | |
19 /// | |
20 /// This program is distributed in the hope that it will be useful, | |
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 /// GNU General Public License for more details. | |
24 /// | |
25 /// You should have received a copy of the GNU General Public License | |
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
27 ////////////////////////////////////////////////////////////////////////////// | |
28 | |
29 /* Includes ------------------------------------------------------------------*/ | |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
30 #include <stdlib.h> |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
31 |
38 | 32 #include "tMenuEdit.h" |
33 | |
34 #include "externLogbookFlash.h" | |
35 #include "gfx_fonts.h" | |
36 #include "tHome.h" | |
37 #include "tInfoCompass.h" | |
718
b9f699d2e3d0
Updated menu structure to support new sensor information page:
Ideenmodellierer
parents:
707
diff
changeset
|
38 #include "tInfoSensor.h" |
845 | 39 #include "tInfoPreDive.h" |
38 | 40 #include "tMenuEditHardware.h" |
41 #include "tMenuEditPlanner.h" | |
42 #include "tMenuEditSystem.h" | |
43 #include "tMenuEditXtra.h" | |
508 | 44 #include "tMenuEditCustom.h" |
38 | 45 |
46 /* Private types -------------------------------------------------------------*/ | |
47 #define TEXTSIZE 16 | |
48 | |
49 typedef struct | |
50 { | |
51 uint32_t pEventFunction; | |
52 uint32_t callerID; | |
53 } SEventHandler; | |
54 | |
55 typedef struct | |
56 { | |
57 uint32_t pEventFunction; | |
58 uint8_t functionParameter; | |
59 uint8_t line; | |
60 } SBackMenuHandler; | |
61 | |
62 typedef struct | |
63 { | |
64 char orgText[32]; | |
65 char newText[32]; | |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
66 uint32_t input[4]; |
38 | 67 uint16_t coord[3]; |
68 int8_t begin[4], size[4]; | |
69 tFont *fontUsed; | |
70 uint32_t callerID; | |
71 uint8_t maintype; | |
72 uint8_t subtype; | |
73 } SEditIdent; | |
74 | |
75 typedef enum | |
76 { | |
77 FIELD_NUMBERS = 0, | |
78 FIELD_BUTTON, | |
79 FIELD_SELECT, | |
80 FIELD_SYMBOL, | |
81 FIELD_TOGGLE, | |
82 FIELD_ON_OFF, | |
83 FIELD_UDIGIT, | |
84 FIELD_2DIGIT, | |
85 FIELD_3DIGIT, | |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
86 FIELD_SDIGIT, |
38 | 87 FIELD_FLOAT, |
88 FIELD_END | |
89 } SField; | |
90 | |
91 /* Private variables ---------------------------------------------------------*/ | |
92 GFX_DrawCfgScreen tMEscreen; | |
93 GFX_DrawCfgScreen tMEcursor; | |
94 GFX_DrawCfgScreen tMEcursorNew; | |
95 | |
508 | 96 static uint32_t menuID; |
97 static uint8_t menuColor; | |
38 | 98 |
508 | 99 static int8_t id = 0; |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
100 static int8_t actualId = 0; |
508 | 101 static int8_t idLast = -1; |
102 static SEditIdent ident[10]; | |
103 static int8_t tME_stop = 0; | |
38 | 104 |
508 | 105 static int8_t evid = 0; |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
106 static int8_t actualevid = 0; |
508 | 107 static int8_t evidLast = -1; |
108 static SEventHandler event[10]; | |
38 | 109 |
508 | 110 static SBackMenuHandler backmenu; |
38 | 111 |
508 | 112 static int8_t block = 0; |
113 static int8_t subBlockPosition = 0; | |
38 | 114 |
508 | 115 static _Bool EnterPressedBeforeButtonAction = 0; |
116 static _Bool EnterPressed = 0; | |
38 | 117 |
508 | 118 static _Bool WriteSettings = 0; |
38 | 119 |
120 /* Private function prototypes -----------------------------------------------*/ | |
121 void draw_tMEdesign(void); | |
122 void set_cursorNew(uint8_t forThisIdentID); | |
123 void startMenuEditFieldSelect(void); | |
124 void create_newText_for_actual_Id(void); | |
125 void write_content_of_actual_Id(void); | |
126 void clean_content_of_actual_Id(void); | |
127 void write_content_without_Id(void); | |
128 | |
129 void nextMenuEditFieldDigit(void); | |
130 void upMenuEditFieldDigit(void); | |
131 void downMenuEditFieldDigit(void); | |
132 | |
133 void draw_tMEcursorNewDesign(void); | |
134 | |
135 uint8_t split_Content_to_Digit_helper(uint8_t inContentAscii, uint8_t *outDigit100, uint8_t *outDigit10, uint8_t *outDigit1); | |
136 | |
137 /* Exported functions --------------------------------------------------------*/ | |
138 | |
139 void tMenuEdit_init(void) | |
140 { | |
141 tMEcursor.FBStartAdress = getFrame(7); | |
142 tMEcursor.ImageHeight = 480; | |
143 tMEcursor.ImageWidth = 800; | |
144 tMEcursor.LayerIndex = 0; | |
145 | |
146 GFX_fill_buffer(tMEcursor.FBStartAdress, 0xFF, CLUT_MenuEditCursor); | |
147 | |
148 tMEcursorNew.FBStartAdress = getFrame(8); | |
149 tMEcursorNew.ImageHeight = 390; | |
150 tMEcursorNew.ImageWidth = 800; | |
151 tMEcursorNew.LayerIndex = 0; | |
152 | |
153 draw_tMEcursorNewDesign(); | |
154 } | |
155 | |
156 void stop_cursor_fields(void) | |
157 { | |
158 tME_stop = 1; | |
159 } | |
160 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
161 void resetMenuContentStructure() |
38 | 162 { |
163 id = 0; | |
164 idLast = -1; | |
165 evid = 0; | |
166 evidLast = -1; | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
167 } |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
168 |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
169 void resetMenuEdit(uint8_t color) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
170 { |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
171 id = 0; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
172 actualId = 0; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
173 idLast = -1; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
174 evid = 0; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
175 actualevid = 0; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
176 evidLast = -1; |
38 | 177 tME_stop = 0; |
178 EnterPressed = 0; | |
179 EnterPressedBeforeButtonAction = 0; | |
180 | |
181 setBackMenu(0,0,0); | |
182 | |
183 releaseFrame(9,tMEscreen.FBStartAdress); | |
184 | |
185 tMEscreen.FBStartAdress = getFrame(9); | |
186 tMEscreen.ImageHeight = 480; | |
187 tMEscreen.ImageWidth = 800; | |
188 tMEscreen.LayerIndex = 1; | |
189 | |
190 /* | |
191 write_content_simple(&tMEscreen, 0, 38, 0, &Awe48,"x",CLUT_ButtonSymbols); | |
192 write_content_simple(&tMEscreen, 800-46, 800, 0, &Awe48,"u",CLUT_ButtonSymbols); | |
193 write_content_simple(&tMEscreen, 0, 45, 480-45, &Awe48,"d",CLUT_ButtonSymbols); | |
194 write_content_simple(&tMEscreen, 800-48, 800, 480-45, &Awe48,"e",CLUT_ButtonSymbols); | |
195 */ | |
196 menuID = get_globalState(); | |
197 | |
198 menuColor = color; | |
199 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
200 /* set cursor to first line */ |
38 | 201 uint8_t line = 1; |
202 GFX_SetFrameTop(tMEscreen.FBStartAdress); | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
203 if(!settingsGetPointer()->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
204 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
205 GFX_SetFrameBottom((tMEcursorNew.FBStartAdress) + 65*2*(line - 1), 0, 25, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
206 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
207 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
208 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
209 GFX_SetFrameBottom((tMEcursorNew.FBStartAdress)+ (390 - 65 *(line)) *2, 0, 480-390-25, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
210 } |
38 | 211 } |
212 | |
213 | |
214 void tMenuEdit_refresh_live_content(void) | |
215 { | |
508 | 216 uint32_t globState = get_globalState(); |
217 void (*refreshFct)() = NULL; | |
38 | 218 |
508 | 219 |
220 switch(globState) | |
221 { | |
718
b9f699d2e3d0
Updated menu structure to support new sensor information page:
Ideenmodellierer
parents:
707
diff
changeset
|
222 case (StMHARD3_O2_Sensor1): |
562
ec76fa85009e
Added ADC sensor interface to O2 sensore menu structure:
Ideenmodellierer
parents:
552
diff
changeset
|
223 case (StMHARD3_O2_Sensor1 & MaskFieldDigit): |
584 | 224 case (StMHARD3_O2_Calibrate): |
734
190e5814b2f5
Removed interface selection from sensor menu:
Ideenmodellierer
parents:
718
diff
changeset
|
225 case (StMHARD3_Sensor_Detect): |
190e5814b2f5
Removed interface selection from sensor menu:
Ideenmodellierer
parents:
718
diff
changeset
|
226 case (StMHARD3_Sensor_Info): refreshFct = refresh_O2Sensors; |
508 | 227 break; |
774
6169309d6eb9
more menu items for the compass menu: Delete bearing, and reset to land based bearing. I have also re-enabled the real time bearing display in the menu - makes it easier to set the correct bearing. (mikeller)
heinrichsweikamp
parents:
734
diff
changeset
|
228 case (StMHARD2_Compass_SetCourse & MaskFieldDigit): |
6169309d6eb9
more menu items for the compass menu: Delete bearing, and reset to land based bearing. I have also re-enabled the real time bearing display in the menu - makes it easier to set the correct bearing. (mikeller)
heinrichsweikamp
parents:
734
diff
changeset
|
229 refreshFct = refresh_CompassEdit; |
6169309d6eb9
more menu items for the compass menu: Delete bearing, and reset to land based bearing. I have also re-enabled the real time bearing display in the menu - makes it easier to set the correct bearing. (mikeller)
heinrichsweikamp
parents:
734
diff
changeset
|
230 break; |
6169309d6eb9
more menu items for the compass menu: Delete bearing, and reset to land based bearing. I have also re-enabled the real time bearing display in the menu - makes it easier to set the correct bearing. (mikeller)
heinrichsweikamp
parents:
734
diff
changeset
|
231 case (StMXTRA_CompassHeading & MaskFieldDigit): |
6169309d6eb9
more menu items for the compass menu: Delete bearing, and reset to land based bearing. I have also re-enabled the real time bearing display in the menu - makes it easier to set the correct bearing. (mikeller)
heinrichsweikamp
parents:
734
diff
changeset
|
232 refreshFct = refresh_CompassHeading; |
6169309d6eb9
more menu items for the compass menu: Delete bearing, and reset to land based bearing. I have also re-enabled the real time bearing display in the menu - makes it easier to set the correct bearing. (mikeller)
heinrichsweikamp
parents:
734
diff
changeset
|
233 break; |
520 | 234 case (StMSYS4_Info & MaskFieldDigit): refreshFct = &refresh_InformationPage; |
508 | 235 break; |
236 case (StMPLAN5_ExitResult & MaskFieldDigit): refreshFct = refresh_PlanResult; | |
237 break; | |
238 case (StMHARD5_Button1 & MaskFieldDigit): // will not be executed in EditFieldMode as global state is different | |
239 refreshFct = refresh_ButtonValuesFromPIC; | |
240 break; | |
241 case (StMSYS3_Units & MaskFieldDigit): refreshFct = refresh_Design; | |
242 break; | |
520 | 243 case (StMCustom1_CViewTimeout & MaskFieldDigit):refreshFct = refresh_Customviews; |
508 | 244 break; |
531 | 245 case (StMCustom4_CViewSelection1 & MaskFieldDigit): |
246 case (StMCustom3_CViewSelection1 & MaskFieldDigit): | |
521
e221cf762f45
Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents:
520
diff
changeset
|
247 case StMCustom3_CViewSelection2: |
e221cf762f45
Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents:
520
diff
changeset
|
248 case StMCustom3_CViewSelection3: |
e221cf762f45
Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents:
520
diff
changeset
|
249 case StMCustom3_CViewSelection4: |
e221cf762f45
Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents:
520
diff
changeset
|
250 case StMCustom3_CViewSelection5: |
531 | 251 case StMCustom3_CViewSelection6: refreshFct = CustomviewDivemode_refresh; |
508 | 252 break; |
604
fb5bb04ad914
Merged menu items of viewport and motion control:
Ideenmodellierer
parents:
584
diff
changeset
|
253 case (StMCustom5_CViewPortCalib & MaskFieldDigit): |
fb5bb04ad914
Merged menu items of viewport and motion control:
Ideenmodellierer
parents:
584
diff
changeset
|
254 case StMCustom5_CViewPortLayout: |
fb5bb04ad914
Merged menu items of viewport and motion control:
Ideenmodellierer
parents:
584
diff
changeset
|
255 case StMCustom5_CViewPortAmbient: refreshFct = refresh_ViewPort; |
552
531e7818b737
Added menu structure to acces viewport calibration:
Ideenmodellierer
parents:
531
diff
changeset
|
256 break; |
508 | 257 default: /* no menu has been updated */ |
258 break; | |
259 } | |
260 | |
261 if(refreshFct != NULL) | |
262 { | |
263 uint32_t rememberPage = tMEscreen.FBStartAdress; | |
264 tMEscreen.FBStartAdress = getFrame(9); | |
265 | |
266 refreshFct(); | |
267 | |
268 GFX_SetFrameTop(tMEscreen.FBStartAdress); | |
269 releaseFrame(9,rememberPage); | |
270 } | |
38 | 271 } |
272 | |
273 void tMenuEdit_writeSettingsToFlash(void) | |
274 { | |
275 if(WriteSettings) | |
276 { | |
662 | 277 reset_SettingWarning(); |
38 | 278 GFX_logoAutoOff(); |
427 | 279 ext_flash_write_settings(0); |
38 | 280 WriteSettings = 0; |
281 } | |
282 } | |
283 | |
284 void helperLeaveMenuEditField(uint8_t idID) | |
285 { | |
286 if(ident[idID].maintype == FIELD_NUMBERS) | |
287 { | |
288 change_CLUT_entry((CLUT_MenuEditField0 + idID), CLUT_MenuEditFieldRegular); | |
289 } | |
290 } | |
291 | |
292 | |
293 void helperGotoMenuEditField(uint8_t idID) | |
294 { | |
295 /* | |
296 if(ident[idID].maintype == FIELD_NUMBERS) | |
297 { | |
298 change_CLUT_entry((CLUT_MenuEditField0 + idID), CLUT_MenuEditFieldSelected); | |
299 } | |
300 */ | |
301 set_cursorNew(idID); | |
302 // set_cursor(idID); | |
303 } | |
304 | |
305 | |
306 void exitMenuEdit_to_BackMenu(void) | |
307 { | |
308 _Bool EnterPressedBackup = EnterPressed; | |
309 | |
310 if(backmenu.pEventFunction) | |
311 { | |
312 ((void (*)(uint8_t))(backmenu.pEventFunction))(backmenu.functionParameter); | |
313 | |
314 EnterPressed = EnterPressedBackup; | |
315 // if(backmenu.line > 1) | |
316 // helperGotoMenuEditField(backmenu.line); | |
317 } | |
318 } | |
319 | |
320 | |
321 void exitMenuEdit_to_Menu_with_Menu_Update(void) | |
322 { | |
323 EnterPressed = 1; | |
324 exitMenuEdit(1); | |
325 } | |
326 | |
327 | |
328 void exitMenuEdit_to_Menu_with_Menu_Update_do_not_write_settings_for_this_only(void) | |
329 { | |
330 EnterPressed = 1; | |
331 exitMenuEdit(0); | |
332 } | |
333 | |
334 | |
335 void exitMenuEdit_to_Home_with_Menu_Update(void) | |
336 { | |
337 EnterPressed = 1; | |
338 exitMenuEdit(1); | |
339 set_globalState_tHome(); | |
340 } | |
341 | |
342 | |
343 void exitMenuEdit_to_InfoCompassCalibration(void) | |
344 { | |
345 exitMenuEdit(1); | |
346 openInfo_Compass(); | |
347 } | |
348 | |
718
b9f699d2e3d0
Updated menu structure to support new sensor information page:
Ideenmodellierer
parents:
707
diff
changeset
|
349 void exitMenuEdit_to_InfoSensor(void) |
b9f699d2e3d0
Updated menu structure to support new sensor information page:
Ideenmodellierer
parents:
707
diff
changeset
|
350 { |
783 | 351 uint32_t globState = get_globalState(); |
352 | |
718
b9f699d2e3d0
Updated menu structure to support new sensor information page:
Ideenmodellierer
parents:
707
diff
changeset
|
353 exitMenuEdit(1); |
783 | 354 switch(globState) |
355 { | |
786 | 356 case (StMHARD3_O2_Sensor3): openInfo_Sensor(2); |
783 | 357 break; |
786 | 358 case (StMHARD3_O2_Sensor2): openInfo_Sensor(1); |
783 | 359 break; |
360 default: | |
786 | 361 case (StMHARD3_O2_Sensor1): openInfo_Sensor(0); |
783 | 362 break; |
363 } | |
718
b9f699d2e3d0
Updated menu structure to support new sensor information page:
Ideenmodellierer
parents:
707
diff
changeset
|
364 } |
b9f699d2e3d0
Updated menu structure to support new sensor information page:
Ideenmodellierer
parents:
707
diff
changeset
|
365 |
38 | 366 |
367 void exitMenuEdit_to_Home(void) | |
368 { | |
369 exitMenuEdit(1); | |
370 set_globalState_tHome(); | |
371 } | |
372 | |
373 | |
374 void exitMenuEdit(uint8_t writeSettingsIfEnterPressed) | |
375 { | |
376 openMenu(0); | |
377 if(EnterPressed) | |
378 { | |
379 updateMenu(); | |
380 if((stateUsed->mode == MODE_SURFACE) && writeSettingsIfEnterPressed) | |
381 WriteSettings = 1; | |
382 } | |
383 releaseFrame(9,tMEscreen.FBStartAdress); | |
384 } | |
385 | |
386 | |
387 void exitMenuEditBackMenuOption(void) | |
388 { | |
389 if(backmenu.pEventFunction == 0) | |
390 exitMenuEdit(1); | |
391 else | |
392 exitMenuEdit_to_BackMenu(); | |
393 } | |
394 | |
395 | |
396 void startMenuEditFieldSelect(void) | |
397 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
398 actualId = 0; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
399 helperGotoMenuEditField(actualId); |
38 | 400 } |
401 | |
402 | |
403 void nextMenuEditField(void) | |
404 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
405 helperLeaveMenuEditField(actualId); |
38 | 406 |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
407 if(actualId < idLast) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
408 actualId++; |
38 | 409 else |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
410 actualId = 0; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
411 helperGotoMenuEditField(actualId); |
38 | 412 } |
413 | |
414 /* | |
415 void previousMenuEditField(void) | |
416 { | |
417 helperLeaveMenuEditField(id); | |
418 if(id > 0) | |
419 id--; | |
420 else | |
421 id = idLast; | |
422 helperGotoMenuEditField(id); | |
423 } | |
424 */ | |
425 | |
426 _Bool inc_subBlock_or_block_of_actual_id(void) | |
427 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
428 if(event[actualevid].callerID != ident[actualId].callerID) |
38 | 429 return 0; |
430 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
431 if((ident[actualId].subtype != FIELD_3DIGIT) && (ident[actualId].subtype != FIELD_2DIGIT) && ((subBlockPosition + 1) < ident[actualId].size[block])) |
38 | 432 { |
433 subBlockPosition++; | |
434 return 1; | |
435 } | |
436 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
437 if(((block + 1) < 4) && (ident[actualId].size[block+1] > 0)) |
38 | 438 { |
439 block++; | |
440 subBlockPosition = 0; | |
441 return 1; | |
442 } | |
443 | |
444 return 0; | |
445 } | |
446 | |
447 | |
448 uint8_t get_newContent_of_actual_id_block_and_subBlock(uint8_t action) | |
449 { | |
450 uint8_t (*onActionFunc)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t); | |
451 uint8_t content; | |
452 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
453 if(event[actualevid].callerID != ident[actualId].callerID) |
38 | 454 return 0; |
455 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
456 onActionFunc = (uint8_t (*)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t))(event[actualevid].pEventFunction); |
38 | 457 |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
458 if((ident[actualId].maintype == FIELD_NUMBERS) && (ident[actualId].subtype == FIELD_3DIGIT)) |
38 | 459 { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
460 content = 100 * ( ident[id].newText[ident[actualId].begin[block] + 0] - '0'); |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
461 content += 10 * ( ident[id].newText[ident[actualId].begin[block] + 1] - '0'); |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
462 content += ident[id].newText[ident[actualId].begin[block] + 2]; |
38 | 463 } |
464 else | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
465 if((ident[actualId].maintype == FIELD_NUMBERS) && (ident[actualId].subtype == FIELD_2DIGIT)) |
38 | 466 { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
467 content = 10 * (ident[actualId].newText[ident[actualId].begin[block] + 0] - '0'); |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
468 content += ident[actualId].newText[ident[actualId].begin[block] + 1]; |
38 | 469 } |
470 else | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
471 if(ident[actualId].maintype == FIELD_NUMBERS) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
472 content = ident[actualId].newText[ident[actualId].begin[block] + subBlockPosition]; |
38 | 473 else |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
474 if((ident[actualId].maintype == FIELD_ON_OFF) || (ident[actualId].maintype == FIELD_TOGGLE)) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
475 content = ident[actualId].input[block]; |
38 | 476 else |
477 content = 0; /* just a default for protection */ | |
478 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
479 return onActionFunc(ident[actualId].callerID, block, subBlockPosition, content, action); |
38 | 480 } |
481 | |
482 void mark_digit_of_actual_id_with_this_block_and_subBlock(int8_t oldblock, int8_t oldsubblockpos) | |
483 { | |
484 char oneCharText[2]; | |
485 uint16_t positionOffset; | |
486 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
487 if(event[actualevid].callerID != ident[actualId].callerID) |
38 | 488 return; |
489 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
490 if(ident[actualId].maintype == FIELD_NUMBERS) |
38 | 491 { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
492 oneCharText[0] = ident[actualId].newText[ident[actualId].begin[oldblock] + oldsubblockpos]; |
38 | 493 oneCharText[1] = 0; |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
494 positionOffset = GFX_return_offset(ident[actualId].fontUsed, ident[actualId].newText, ident[actualId].begin[oldblock] + oldsubblockpos); |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
495 write_content( ident[actualId].coord[0] + positionOffset, ident[actualId].coord[1], ident[actualId].coord[2], ident[actualId].fontUsed, oneCharText, CLUT_MenuEditFieldSelected); |
38 | 496 } |
497 } | |
498 | |
499 | |
500 void mark_new_2digit_of_actual_id_block(void) | |
501 { | |
502 char oneCharText[3]; | |
503 uint16_t positionOffset; | |
504 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
505 if(event[actualevid].callerID != ident[actualId].callerID) |
38 | 506 return; |
507 | |
508 if(ident[id].maintype == FIELD_NUMBERS) | |
509 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
510 oneCharText[0] = ident[actualId].newText[ident[actualId].begin[block] + 0]; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
511 oneCharText[1] = ident[actualId].newText[ident[actualId].begin[block] + 1]; |
38 | 512 oneCharText[2] = 0; |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
513 positionOffset = GFX_return_offset(ident[actualId].fontUsed, ident[actualId].newText, ident[actualId].begin[block] + 0); |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
514 write_content( ident[actualId].coord[0] + positionOffset, ident[actualId].coord[1], ident[actualId].coord[2], ident[actualId].fontUsed, oneCharText, CLUT_MenuEditDigit); |
38 | 515 } |
516 } | |
517 | |
518 | |
519 void mark_new_3digit_of_actual_id_block(void) | |
520 { | |
521 char oneCharText[4]; | |
522 uint16_t positionOffset; | |
523 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
524 if(event[actualevid].callerID != ident[actualId].callerID) |
38 | 525 return; |
526 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
527 if(ident[actualId].maintype == FIELD_NUMBERS) |
38 | 528 { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
529 oneCharText[0] = ident[actualId].newText[ident[actualId].begin[block] + 0]; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
530 oneCharText[1] = ident[actualId].newText[ident[actualId].begin[block] + 1]; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
531 oneCharText[2] = ident[actualId].newText[ident[actualId].begin[block] + 2]; |
38 | 532 oneCharText[3] = 0; |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
533 positionOffset = GFX_return_offset(ident[actualId].fontUsed, ident[actualId].newText, ident[actualId].begin[block] + 0); |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
534 write_content( ident[actualId].coord[0] + positionOffset, ident[actualId].coord[1], ident[actualId].coord[2], ident[actualId].fontUsed, oneCharText, CLUT_MenuEditDigit); |
38 | 535 } |
536 } | |
537 | |
538 | |
539 void mark_new_digit_of_actual_id_block_and_subBlock(void) | |
540 { | |
541 char oneCharText[2]; | |
542 uint16_t positionOffset; | |
543 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
544 if(event[actualevid].callerID != ident[actualId].callerID) |
38 | 545 return; |
546 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
547 if(ident[actualId].maintype == FIELD_NUMBERS) |
38 | 548 { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
549 oneCharText[0] = ident[actualId].newText[ident[actualId].begin[block] + subBlockPosition]; |
38 | 550 oneCharText[1] = 0; |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
551 positionOffset = GFX_return_offset(ident[actualId].fontUsed, ident[actualId].newText, ident[actualId].begin[block] + subBlockPosition); |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
552 write_content( ident[actualId].coord[0] + positionOffset, ident[actualId].coord[1], ident[id].coord[2], ident[actualId].fontUsed, oneCharText, CLUT_MenuEditDigit); |
38 | 553 } |
554 } | |
555 | |
556 | |
557 void enterMenuEditField(void) | |
558 { | |
559 uint8_t newContent; | |
560 uint8_t digit100; | |
561 uint8_t digit10; | |
562 uint8_t digit1; | |
563 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
564 actualevid = 0; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
565 while((actualevid < evidLast) && (event[actualevid].callerID != ident[actualId].callerID)) |
38 | 566 { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
567 actualevid++; |
38 | 568 } |
569 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
570 if(event[actualevid].callerID != ident[actualId].callerID) |
38 | 571 return; |
572 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
573 set_globalState(event[actualevid].callerID); |
38 | 574 block = 0; |
575 subBlockPosition = 0; | |
576 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
577 if(ident[actualId].maintype == FIELD_NUMBERS) |
38 | 578 { |
579 change_CLUT_entry(CLUT_MenuEditLineSelected, CLUT_MenuEditCursor); | |
580 // old stuff? hw 150916, reactivated 150923, this shows which digit will be changed now as it marks the other grey/black | |
581 // now fixed for button settings with newContent <= '0'+99 condition | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
582 change_CLUT_entry((CLUT_MenuEditField0 + actualId), CLUT_MenuEditFieldSelected); |
38 | 583 } |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
584 if(ident[actualId].maintype == FIELD_TOGGLE) |
584 | 585 { |
586 change_CLUT_entry(CLUT_MenuEditLineSelected, CLUT_MenuEditCursor); | |
587 } | |
588 | |
38 | 589 |
590 newContent = get_newContent_of_actual_id_block_and_subBlock(ACTION_BUTTON_ENTER); | |
591 | |
592 if (((newContent == UPDATE_DIVESETTINGS) || (newContent == UPDATE_AND_EXIT_TO_HOME) || (newContent == UPDATE_AND_EXIT_TO_MENU)) && (actual_menu_content == MENU_SURFACE)) | |
593 createDiveSettings(); | |
594 | |
595 if(newContent == EXIT_TO_MENU_WITH_LOGO) | |
596 { | |
597 GFX_logoAutoOff(); | |
598 } | |
599 | |
600 if((newContent == EXIT_TO_MENU) || (newContent == UPDATE_AND_EXIT_TO_MENU) || (newContent == EXIT_TO_MENU_WITH_LOGO)) | |
601 { | |
602 if(backmenu.pEventFunction == 0) | |
603 exitMenuEdit(1); | |
604 else | |
605 exitMenuEdit_to_BackMenu(); | |
606 return; | |
607 } | |
608 | |
609 if((newContent == EXIT_TO_HOME) || (newContent == UPDATE_AND_EXIT_TO_HOME)) | |
610 { | |
611 exitMenuEdit_to_Home(); | |
612 return; | |
613 } | |
614 | |
615 if(newContent == EXIT_TO_INFO_COMPASS) | |
616 { | |
617 exitMenuEdit_to_InfoCompassCalibration(); | |
618 return; | |
619 } | |
620 | |
718
b9f699d2e3d0
Updated menu structure to support new sensor information page:
Ideenmodellierer
parents:
707
diff
changeset
|
621 if(newContent == EXIT_TO_INFO_SENSOR) |
b9f699d2e3d0
Updated menu structure to support new sensor information page:
Ideenmodellierer
parents:
707
diff
changeset
|
622 { |
b9f699d2e3d0
Updated menu structure to support new sensor information page:
Ideenmodellierer
parents:
707
diff
changeset
|
623 exitMenuEdit_to_InfoSensor(); |
b9f699d2e3d0
Updated menu structure to support new sensor information page:
Ideenmodellierer
parents:
707
diff
changeset
|
624 return; |
b9f699d2e3d0
Updated menu structure to support new sensor information page:
Ideenmodellierer
parents:
707
diff
changeset
|
625 } |
38 | 626 |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
627 switch(ident[actualId].maintype) |
38 | 628 { |
629 case FIELD_NUMBERS: | |
630 write_buttonTextline(TXT2BYTE_ButtonMinus,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonPlus); | |
631 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
632 switch (ident[actualId].subtype) { |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
633 case FIELD_UDIGIT: |
38 | 634 if((newContent >= '0') && (newContent <= '9')) |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
635 ident[actualId].newText[ident[actualId].begin[block] + subBlockPosition] = newContent; |
38 | 636 |
637 mark_new_digit_of_actual_id_block_and_subBlock(); | |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
638 |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
639 break; |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
640 case FIELD_3DIGIT: |
38 | 641 if((newContent >= '0') && (newContent <= '0'+200)) |
642 { | |
643 split_Content_to_Digit_helper( newContent, &digit100, &digit10, &digit1); | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
644 ident[actualId].newText[ident[actualId].begin[block] + 0] = '0' + digit100; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
645 ident[actualId].newText[ident[actualId].begin[block] + 1] = '0' + digit10; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
646 ident[actualId].newText[ident[actualId].begin[block] + 2] = '0' + digit1; |
38 | 647 mark_new_3digit_of_actual_id_block(); |
648 } | |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
649 |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
650 break; |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
651 case FIELD_2DIGIT: |
38 | 652 if((newContent >= '0') && (newContent <= '0'+99)) |
653 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
654 ident[actualId].newText[ident[actualId].begin[block]] = '0' + (newContent - '0')/10; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
655 ident[actualId].newText[ident[actualId].begin[block] + 1] = '0' + ((newContent - '0') - (10*((newContent - '0')/10))); |
38 | 656 mark_new_2digit_of_actual_id_block(); |
657 } | |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
658 |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
659 break; |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
660 case FIELD_SDIGIT: |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
661 if ((subBlockPosition == 0 && (newContent == '+' || newContent == '-')) || (subBlockPosition > 0 && newContent >= '0' && newContent <= '9')) { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
662 ident[actualId].newText[ident[actualId].begin[block] + subBlockPosition] = newContent; |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
663 } |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
664 |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
665 mark_new_digit_of_actual_id_block_and_subBlock(); |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
666 |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
667 break; |
38 | 668 } |
669 break; | |
670 case FIELD_BUTTON: | |
671 case FIELD_ON_OFF: | |
672 set_globalState(menuID); | |
788
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
673 |
38 | 674 break; |
675 case FIELD_SYMBOL: | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
676 ident[actualId].input[0] += 1; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
677 if(ident[actualId].input[0] >= ident[actualId].input[1]) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
678 ident[actualId].input[0] = 0; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
679 ident[actualId].newText[0] = ident[actualId].orgText[ident[actualId].input[0]]; |
38 | 680 write_content_of_actual_Id(); |
681 set_globalState(menuID); | |
682 break; | |
788
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
683 case FIELD_SELECT: |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
684 write_buttonTextline(TXT2BYTE_ButtonMinus, TXT2BYTE_ButtonEnter, TXT2BYTE_ButtonPlus); |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
685 |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
686 break; |
38 | 687 } |
688 } | |
689 | |
690 | |
691 void exitMenuEditField(void) | |
692 { | |
693 uint8_t newContent; | |
694 | |
695 set_globalState(menuID); | |
696 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
697 if(event[actualevid].callerID != ident[actualId].callerID) |
38 | 698 return; |
699 | |
700 newContent = get_newContent_of_actual_id_block_and_subBlock(ACTION_TIMEOUT); | |
701 | |
702 /* | |
703 uint8_t (*onActionFunc)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t); | |
704 uint8_t newContent; | |
705 | |
706 onActionFunc = (uint8_t (*)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t))(event[evid].pEventFunction); | |
707 | |
708 newContent = onActionFunc(ident[id].callerID, 0, 0, 255, ACTION_BUTTON_BACK); | |
709 */ | |
710 | |
711 /* destroy changes of editing in newText */ | |
712 change_CLUT_entry(CLUT_MenuEditLineSelected, CLUT_MenuLineSelected); | |
713 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldRegular); | |
714 | |
715 create_newText_for_actual_Id(); | |
716 write_content_of_actual_Id(); | |
717 | |
718 if((newContent == EXIT_TO_MENU) || (newContent == UPDATE_AND_EXIT_TO_MENU)) | |
719 { | |
720 exitMenuEdit(1); | |
721 return; | |
722 } | |
723 | |
724 if((newContent == EXIT_TO_HOME) || (newContent == UPDATE_AND_EXIT_TO_HOME)) | |
725 { | |
726 exitMenuEdit_to_Home(); | |
727 return; | |
728 } | |
729 | |
730 } | |
731 | |
788
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
732 |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
733 static void startNextEdit(void) |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
734 { |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
735 EnterPressed = 1; |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
736 nextMenuEditField(); |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
737 enterMenuEditField(); |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
738 } |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
739 |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
740 |
38 | 741 void nextMenuEditFieldDigit(void) |
742 { | |
743 uint8_t action; | |
744 uint8_t newContent; | |
745 int8_t blockOld = 0; | |
746 int8_t subBlockPositionOld = 0; | |
747 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
748 if(event[actualevid].callerID != ident[actualId].callerID) |
38 | 749 return; |
750 | |
751 blockOld = block; | |
752 subBlockPositionOld = subBlockPosition; | |
753 | |
754 if(inc_subBlock_or_block_of_actual_id()) | |
755 action = ACTION_BUTTON_ENTER; | |
756 else | |
757 action = ACTION_BUTTON_ENTER_FINAL; | |
758 | |
759 newContent = get_newContent_of_actual_id_block_and_subBlock(action); | |
760 | |
761 if(action == ACTION_BUTTON_ENTER_FINAL) | |
762 { | |
763 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
764 | |
765 change_CLUT_entry(CLUT_MenuEditLineSelected, CLUT_MenuLineSelected); | |
766 for(int i = 0;i<=9;i++) | |
767 change_CLUT_entry((CLUT_MenuEditField0 + i), CLUT_MenuEditFieldRegular); | |
768 | |
769 if(((newContent == UPDATE_DIVESETTINGS) || (newContent == UPDATE_AND_EXIT_TO_HOME) || (newContent == UPDATE_AND_EXIT_TO_MENU)) && (actual_menu_content == MENU_SURFACE)) | |
770 createDiveSettings(); | |
771 | |
772 if((newContent == EXIT_TO_MENU) || (newContent == UPDATE_AND_EXIT_TO_MENU)) | |
773 { | |
774 exitMenuEdit(1); | |
775 return; | |
776 } | |
777 | |
778 if((newContent == EXIT_TO_HOME) || (newContent == UPDATE_AND_EXIT_TO_HOME)) | |
779 { | |
780 exitMenuEdit_to_Home(); | |
781 return; | |
782 } | |
788
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
783 |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
784 if (newContent == EXIT_TO_NEXT_MENU) { |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
785 startNextEdit(); |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
786 |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
787 return; |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
788 } |
38 | 789 } |
790 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
791 if((ident[actualId].maintype == FIELD_NUMBERS) && (ident[actualId].subtype == FIELD_3DIGIT) && (action == ACTION_BUTTON_ENTER) &&(newContent >= '0') && (newContent <= '0' + 99)) |
38 | 792 { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
793 ident[actualId].newText[ident[actualId].begin[block] + 0] = '0' + (newContent - '0')/100; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
794 ident[actualId].newText[ident[actualId].begin[block] + 1] = '0' + (newContent - '0')/10; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
795 ident[actualId].newText[ident[actualId].begin[block] + 2] = '0' + ((newContent - '0') - (10*((newContent - '0')/10))); |
38 | 796 } |
797 else | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
798 if((ident[actualId].maintype == FIELD_NUMBERS) && (ident[actualId].subtype == FIELD_2DIGIT) && (action == ACTION_BUTTON_ENTER) &&(newContent >= '0') && (newContent <= '0' + 99)) |
38 | 799 { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
800 ident[actualId].newText[ident[actualId].begin[block] + 0] = '0' + (newContent - '0')/10; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
801 ident[actualId].newText[ident[actualId].begin[block] + 1] = '0' + ((newContent - '0') - (10*((newContent - '0')/10))); |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
802 } else if (ident[actualId].maintype == FIELD_NUMBERS && ident[actualId].subtype == FIELD_SDIGIT && action == ACTION_BUTTON_ENTER && subBlockPosition == 0) { |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
803 if (newContent == '+' || newContent == '-') { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
804 ident[actualId].newText[ident[actualId].begin[block] + subBlockPosition] = newContent; |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
805 } |
38 | 806 } |
807 else | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
808 if((ident[actualId].maintype == FIELD_NUMBERS) && (action == ACTION_BUTTON_ENTER) && (newContent >= '0') && (newContent <= '9')) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
809 ident[actualId].newText[ident[actualId].begin[block] + subBlockPosition] = newContent; |
38 | 810 |
811 if(action == ACTION_BUTTON_ENTER) | |
812 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
813 if((ident[actualId].maintype == FIELD_NUMBERS) && (ident[actualId].subtype == FIELD_3DIGIT)) |
38 | 814 { |
815 mark_new_3digit_of_actual_id_block(); | |
816 mark_digit_of_actual_id_with_this_block_and_subBlock(blockOld,0); | |
817 mark_digit_of_actual_id_with_this_block_and_subBlock(blockOld,1); | |
818 mark_digit_of_actual_id_with_this_block_and_subBlock(blockOld,2); | |
819 } | |
820 else | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
821 if((ident[actualId].maintype == FIELD_NUMBERS) && (ident[actualId].subtype == FIELD_2DIGIT)) |
38 | 822 { |
823 mark_new_2digit_of_actual_id_block(); | |
824 mark_digit_of_actual_id_with_this_block_and_subBlock(blockOld,0); | |
825 mark_digit_of_actual_id_with_this_block_and_subBlock(blockOld,1); | |
826 } | |
827 else | |
828 { | |
829 mark_new_digit_of_actual_id_block_and_subBlock(); | |
830 mark_digit_of_actual_id_with_this_block_and_subBlock(blockOld,subBlockPositionOld); | |
831 } | |
832 } | |
833 else /* action == ACTION_BUTTON_ENTER_FINAL */ | |
834 set_globalState(menuID); | |
835 } | |
836 | |
837 uint8_t split_Content_to_Digit_helper(uint8_t inContentAscii, uint8_t *outDigit100, uint8_t *outDigit10, uint8_t *outDigit1) | |
838 { | |
839 uint8_t newContent, tempDigit, CopyContent; | |
840 | |
841 newContent = inContentAscii - '0'; | |
842 CopyContent = newContent; | |
843 | |
844 tempDigit = newContent / 100; | |
845 newContent -= tempDigit * 100; | |
846 if(outDigit100) | |
847 *outDigit100 = tempDigit; | |
848 | |
849 tempDigit = newContent / 10; | |
850 newContent -= tempDigit * 10; | |
851 if(outDigit10) | |
852 *outDigit10 = tempDigit; | |
853 | |
854 tempDigit = newContent; | |
855 if(outDigit1) | |
856 *outDigit1 = tempDigit; | |
857 | |
858 return CopyContent; | |
859 } | |
860 | |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
861 |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
862 static void checkUpdateSDigit(uint8_t newContent) |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
863 { |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
864 if ((subBlockPosition == 0 && (newContent == '+' || newContent == '-')) || (subBlockPosition > 0 && newContent >= '0' && newContent <= '9')) { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
865 ident[actualId].newText[ident[actualId].begin[block] + subBlockPosition] = newContent; |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
866 } |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
867 } |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
868 |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
869 |
38 | 870 void upMenuEditFieldDigit(void) |
871 { | |
872 uint8_t newContent; | |
873 uint8_t digit100; | |
874 uint8_t digit10; | |
875 uint8_t digit1; | |
876 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
877 if(event[actualevid].callerID != ident[actualId].callerID) |
38 | 878 return; |
879 | |
880 newContent = get_newContent_of_actual_id_block_and_subBlock(ACTION_BUTTON_NEXT); | |
881 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
882 if((ident[actualId].maintype == FIELD_NUMBERS) && (ident[actualId].subtype == FIELD_3DIGIT) &&(newContent >= '0') && (newContent <= '0' + 200)) |
38 | 883 { |
884 split_Content_to_Digit_helper( newContent, &digit100, &digit10, &digit1); | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
885 ident[actualId].newText[ident[actualId].begin[block] + 0] = '0' + digit100; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
886 ident[actualId].newText[ident[actualId].begin[block] + 1] = '0' + digit10; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
887 ident[actualId].newText[ident[actualId].begin[block] + 2] = '0' + digit1; |
38 | 888 mark_new_3digit_of_actual_id_block(); |
889 return; | |
890 } | |
891 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
892 if((ident[actualId].maintype == FIELD_NUMBERS) && (ident[actualId].subtype == FIELD_2DIGIT) &&(newContent >= '0') && (newContent <= '0' + 99)) |
38 | 893 { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
894 ident[actualId].newText[ident[actualId].begin[block] + 0] = '0' + (newContent - '0')/10; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
895 ident[actualId].newText[ident[actualId].begin[block] + 1] = '0' + ((newContent - '0') - (10*((newContent - '0')/10))); |
38 | 896 mark_new_2digit_of_actual_id_block(); |
897 return; | |
898 } | |
899 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
900 if (ident[actualId].maintype == FIELD_NUMBERS && ident[actualId].subtype == FIELD_SDIGIT) { |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
901 checkUpdateSDigit(newContent); |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
902 } else if (ident[actualId].maintype == FIELD_NUMBERS && newContent >= '0' && newContent <= '9') { |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
903 ident[actualId].newText[ident[actualId].begin[block] + subBlockPosition] = newContent; |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
904 } |
38 | 905 |
906 mark_new_digit_of_actual_id_block_and_subBlock(); | |
907 } | |
908 | |
909 | |
910 void downMenuEditFieldDigit(void) | |
911 { | |
912 uint8_t newContent; | |
913 uint8_t digit100; | |
914 uint8_t digit10; | |
915 uint8_t digit1; | |
916 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
917 if(event[actualevid].callerID != ident[actualId].callerID) |
38 | 918 return; |
919 | |
920 newContent = get_newContent_of_actual_id_block_and_subBlock(ACTION_BUTTON_BACK); | |
921 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
922 if((ident[actualId].maintype == FIELD_NUMBERS) && (ident[actualId].subtype == FIELD_3DIGIT) &&(newContent >= '0') && (newContent <= '0' + 200)) |
38 | 923 { |
924 split_Content_to_Digit_helper( newContent, &digit100, &digit10, &digit1); | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
925 ident[actualId].newText[ident[actualId].begin[block] + 0] = '0' + digit100; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
926 ident[actualId].newText[ident[actualId].begin[block] + 1] = '0' + digit10; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
927 ident[actualId].newText[ident[actualId].begin[block] + 2] = '0' + digit1; |
38 | 928 mark_new_3digit_of_actual_id_block(); |
929 return; | |
930 } | |
931 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
932 if((ident[actualId].maintype == FIELD_NUMBERS) && (ident[actualId].subtype == FIELD_2DIGIT) &&(newContent >= '0') && (newContent <= '0' + 99)) |
38 | 933 { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
934 ident[actualId].newText[ident[actualId].begin[block] + 0] = '0' + (newContent - '0')/10; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
935 ident[actualId].newText[ident[actualId].begin[block] + 1] = '0' + ((newContent - '0') - (10*((newContent - '0')/10))); |
38 | 936 mark_new_2digit_of_actual_id_block(); |
937 return; | |
938 } | |
939 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
940 if (ident[actualId].maintype == FIELD_NUMBERS && ident[actualId].subtype == FIELD_SDIGIT) { |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
941 checkUpdateSDigit(newContent); |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
942 } else if (ident[actualId].maintype == FIELD_NUMBERS && newContent >= '0' && newContent <= '9') { |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
943 ident[actualId].newText[ident[actualId].begin[block] + subBlockPosition] = newContent; |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
944 } |
38 | 945 |
946 mark_new_digit_of_actual_id_block_and_subBlock(); | |
947 } | |
948 | |
949 | |
950 void evaluateNewString(uint32_t editID, uint32_t *pNewValue1, uint32_t *pNewValue2, uint32_t *pNewValue3, uint32_t *pNewValue4) | |
951 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
952 if(editID != ident[actualId].callerID) |
38 | 953 return; |
954 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
955 bool isSigned = ident[actualId].maintype == FIELD_NUMBERS && ident[actualId].subtype == FIELD_SDIGIT; |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
956 |
38 | 957 uint8_t i, digitCount, digit; |
958 uint32_t sum[4], multiplier; | |
959 | |
960 for(i=0;i<4;i++) | |
961 sum[i] = 0; | |
962 | |
963 i = 0; | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
964 while( ident[actualId].size[i] && (i < 4)) |
38 | 965 { |
966 multiplier = 1; | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
967 for(digitCount = 1; digitCount < ident[actualId].size[i]; digitCount++) |
38 | 968 multiplier *= 10; |
969 | |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
970 bool isNegative = false; |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
971 for(digitCount = 0; digitCount < ident[actualId].size[i]; digitCount++) |
38 | 972 { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
973 digit = ident[actualId].newText[ident[actualId].begin[i] + digitCount]; |
38 | 974 |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
975 if (isSigned && digitCount == 0) { |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
976 if (digit == '-') { |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
977 isNegative = true; |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
978 } |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
979 } else { |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
980 if(digit > '0') |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
981 digit -= '0'; |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
982 else |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
983 digit = 0; |
38 | 984 |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
985 if(digit > 9) |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
986 digit = 9; |
38 | 987 |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
988 sum[i] += digit * multiplier; |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
989 } |
38 | 990 |
991 if(multiplier >= 10) | |
992 multiplier /= 10; | |
993 else | |
994 multiplier = 0; | |
995 } | |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
996 |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
997 if (isSigned) { |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
998 int32_t value = sum[i]; |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
999 if (isNegative) { |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
1000 value = -value; |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
1001 } |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
1002 sum[i] = ((input_u)value).uint32; |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
1003 } |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
1004 |
38 | 1005 i++; |
1006 } | |
1007 | |
1008 *pNewValue1 = sum[0]; | |
1009 *pNewValue2 = sum[1]; | |
1010 *pNewValue3 = sum[2]; | |
1011 *pNewValue4 = sum[3]; | |
1012 } | |
1013 | |
1014 | |
1015 uint8_t get_id_of(uint32_t editID) | |
1016 { | |
1017 uint8_t temp_id; | |
1018 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1019 if(editID == ident[actualId].callerID) |
38 | 1020 return id; |
1021 else | |
1022 { | |
1023 temp_id = 0; | |
1024 while((temp_id < 9) && (editID != ident[temp_id].callerID)) | |
1025 temp_id++; | |
1026 if(editID != ident[temp_id].callerID) | |
1027 temp_id = 255; | |
1028 return temp_id; | |
1029 } | |
1030 } | |
1031 | |
1032 | |
1033 void tMenuEdit_newButtonText(uint32_t editID, char *text) | |
1034 { | |
1035 uint8_t backup_id, temp_id; | |
1036 | |
1037 temp_id = get_id_of(editID); | |
1038 if(temp_id == 255) | |
1039 return; | |
1040 | |
1041 backup_id = id; | |
1042 id = temp_id; | |
1043 | |
1044 strncpy(ident[id].newText, text, 32); | |
1045 ident[id].newText[31] = 0; | |
1046 | |
1047 clean_content_of_actual_Id(); | |
1048 write_content_of_actual_Id(); | |
1049 | |
1050 id = backup_id; | |
1051 } | |
1052 | |
1053 | |
1054 void tMenuEdit_set_on_off(uint32_t editID, uint32_t int1) | |
1055 { | |
1056 uint8_t backup_id, temp_id; | |
1057 | |
1058 temp_id = get_id_of(editID); | |
1059 if(temp_id == 255) | |
1060 return; | |
1061 | |
1062 backup_id = id; | |
1063 id = temp_id; | |
1064 | |
1065 ident[id].input[0] = int1; | |
1066 | |
1067 if(int1) | |
1068 ident[id].newText[0] = '\005'; | |
1069 else | |
1070 ident[id].newText[0] = '\006'; | |
1071 | |
1072 clean_content_of_actual_Id(); | |
1073 write_content_of_actual_Id(); | |
1074 | |
1075 id = backup_id; | |
1076 } | |
1077 | |
508 | 1078 void tMenuEdit_select(uint32_t editID) |
1079 { | |
1080 uint8_t id_local = 0; | |
1081 id_local = get_id_of(editID); | |
38 | 1082 |
508 | 1083 if(id_local <= idLast) |
1084 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1085 actualId = id_local; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1086 set_cursorNew(id_local); |
508 | 1087 } |
1088 } | |
1089 | |
1090 #if OLD_SELECTION | |
38 | 1091 void tMenuEdit_select(uint32_t editID, uint32_t int1, uint32_t int2, uint32_t int3, uint32_t int4) |
1092 { | |
1093 if(int1 > 4) | |
1094 return; | |
1095 | |
1096 uint8_t backup_id, temp_id; | |
1097 | |
1098 temp_id = get_id_of(editID); | |
1099 if(temp_id == 255) | |
1100 return; | |
1101 | |
1102 backup_id = id; | |
1103 id = temp_id; | |
1104 | |
1105 ident[id].input[0] = int1; | |
1106 ident[id].input[1] = int1; | |
1107 ident[id].input[2] = int1; | |
1108 ident[id].input[3] = int1; | |
1109 | |
1110 create_newText_for_actual_Id(); | |
1111 clean_content_of_actual_Id(); | |
1112 write_content_of_actual_Id(); | |
1113 | |
1114 id = backup_id; | |
1115 } | |
508 | 1116 #endif |
38 | 1117 |
1118 | |
1119 void tMenuEdit_newInput(uint32_t editID, uint32_t int1, uint32_t int2, uint32_t int3, uint32_t int4) | |
1120 { | |
1121 uint8_t backup_id, temp_id; | |
1122 | |
1123 temp_id = get_id_of(editID); | |
1124 if(temp_id == 255) | |
1125 return; | |
1126 | |
1127 backup_id = id; | |
1128 id = temp_id; | |
1129 | |
1130 if(editID != ident[id].callerID) | |
1131 { | |
1132 temp_id = 0; | |
1133 while((temp_id < 9) && (editID != ident[temp_id].callerID)) | |
1134 temp_id++; | |
1135 if(editID != ident[temp_id].callerID) | |
1136 return; | |
1137 id = temp_id; | |
1138 } | |
1139 ident[id].input[0] = int1; | |
1140 ident[id].input[1] = int2; | |
1141 ident[id].input[2] = int3; | |
1142 ident[id].input[3] = int4; | |
1143 | |
1144 create_newText_for_actual_Id(); | |
1145 if(id <= idLast) | |
1146 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldRegular); | |
1147 write_content_of_actual_Id(); | |
1148 | |
1149 id = backup_id; | |
1150 } | |
1151 | |
1152 | |
1153 void resetEnterPressedToStateBeforeButtonAction(void) | |
1154 { | |
1155 EnterPressed = EnterPressedBeforeButtonAction; | |
1156 } | |
1157 | |
1158 | |
1159 void sendActionToMenuEdit(uint8_t sendAction) | |
1160 { | |
1161 if(get_globalState() == menuID) | |
1162 { | |
1163 switch(sendAction) | |
1164 { | |
1165 case ACTION_BUTTON_ENTER: | |
1166 EnterPressedBeforeButtonAction = EnterPressed; | |
1167 EnterPressed = 1; | |
1168 enterMenuEditField(); | |
1169 break; | |
1170 case ACTION_BUTTON_NEXT: | |
1171 nextMenuEditField(); | |
1172 // previousMenuEditField(); | |
1173 break; | |
1174 case ACTION_BUTTON_BACK: | |
1175 exitMenuEditBackMenuOption(); | |
1176 break; | |
1177 case ACTION_TIMEOUT: | |
1178 case ACTION_MODE_CHANGE: | |
1179 exitMenuEdit(1); | |
1180 break; | |
1181 case ACTION_IDLE_TICK: | |
1182 case ACTION_IDLE_SECOND: | |
219 | 1183 default: |
38 | 1184 break; |
219 | 1185 |
38 | 1186 } |
1187 } | |
1188 else | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1189 if(get_globalState() == event[actualevid].callerID) |
38 | 1190 { |
1191 switch(sendAction) | |
1192 { | |
1193 case ACTION_BUTTON_ENTER: | |
1194 nextMenuEditFieldDigit(); | |
1195 break; | |
1196 case ACTION_BUTTON_NEXT: | |
1197 upMenuEditFieldDigit(); | |
1198 break; | |
1199 case ACTION_BUTTON_BACK: | |
1200 downMenuEditFieldDigit(); | |
1201 break; | |
1202 case ACTION_TIMEOUT: | |
1203 case ACTION_MODE_CHANGE: | |
1204 exitMenuEditField(); | |
1205 break; | |
1206 case ACTION_IDLE_TICK: | |
1207 case ACTION_IDLE_SECOND: | |
1208 break; | |
219 | 1209 default: |
1210 break; | |
38 | 1211 } |
1212 } | |
1213 else | |
1214 { | |
1215 switch(sendAction) | |
1216 { | |
1217 case ACTION_BUTTON_ENTER: | |
1218 break; | |
1219 case ACTION_BUTTON_NEXT: | |
1220 break; | |
1221 case ACTION_BUTTON_BACK: | |
1222 break; | |
1223 case ACTION_TIMEOUT: | |
1224 case ACTION_MODE_CHANGE: | |
1225 exitMenuEdit(1); | |
1226 break; | |
1227 case ACTION_IDLE_TICK: | |
1228 case ACTION_IDLE_SECOND: | |
1229 break; | |
219 | 1230 default: |
1231 break; | |
38 | 1232 } |
1233 } | |
1234 } | |
1235 | |
1236 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1237 void create_newText_for_Id_and_field_select(int8_t localId) |
38 | 1238 { |
1239 uint8_t i; | |
1240 | |
1241 i = 0; | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1242 while( ident[localId].size[i] && (i < 4)) |
38 | 1243 { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1244 if(ident[localId].input[i]) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1245 ident[localId].newText[ident[localId].begin[i]] = '\005'; |
38 | 1246 else |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1247 ident[localId].newText[ident[localId].begin[i]] = '\006'; |
38 | 1248 i++; |
1249 } | |
1250 } | |
1251 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1252 void create_newText_for_actual_Id_and_field_select(void) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1253 { |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1254 create_newText_for_Id_and_field_select(actualId); |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1255 } |
38 | 1256 |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1257 void create_newText_for_Id(int8_t localId) |
38 | 1258 { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1259 bool isSigned = ident[localId].maintype == FIELD_NUMBERS && ident[localId].subtype == FIELD_SDIGIT; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1260 |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1261 uint8_t i, digitCount; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1262 uint32_t remainder, digit, divider; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1263 i = 0; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1264 |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1265 if( ident[localId].maintype == FIELD_SELECT) |
38 | 1266 { |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1267 create_newText_for_Id_and_field_select(localId); |
38 | 1268 return; |
1269 } | |
1270 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1271 while( ident[localId].size[i] && (i < 4)) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1272 { |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1273 bool isNegative = false; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1274 if (isSigned) { |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1275 int32_t value = ((input_u)ident[localId].input[i]).int32; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1276 if (value < 0) { |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1277 isNegative = true; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1278 } |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1279 remainder = abs(value); |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1280 } else { |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1281 remainder = ident[localId].input[i]; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1282 } |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1283 divider = 1; |
38 | 1284 |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1285 for(digitCount = 1; digitCount < ident[localId].size[i]; digitCount++) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1286 divider *= 10; |
38 | 1287 |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1288 for(digitCount = 0; digitCount < ident[localId].size[i]; digitCount++) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1289 { |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1290 if (isSigned && digitCount == 0) { |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1291 ident[localId].newText[ident[localId].begin[i] + digitCount] = isNegative ? '-' : '+'; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1292 } else { |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1293 digit = remainder / divider; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1294 remainder -= digit * divider; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1295 if(digit < 10) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1296 ident[localId].newText[ident[localId].begin[i] + digitCount] = digit + '0'; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1297 else |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1298 ident[localId].newText[ident[localId].begin[i] + digitCount] = 'x'; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1299 } |
38 | 1300 |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1301 divider /= 10; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1302 } |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1303 i++; |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1304 } |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1305 } |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
1306 |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1307 void create_newText_for_actual_Id(void) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1308 { |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1309 create_newText_for_Id(actualId); |
38 | 1310 } |
1311 | |
1312 | |
1313 void write_content_without_Id(void) | |
1314 { | |
1315 write_content( ident[id].coord[0], ident[id].coord[1], ident[id].coord[2], ident[id].fontUsed, ident[id].newText, CLUT_MenuEditFieldRegular); | |
1316 } | |
1317 | |
1318 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1319 void write_content_of_Id(int8_t localId) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1320 { |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1321 write_content( ident[localId].coord[0], ident[localId].coord[1], ident[localId].coord[2], ident[localId].fontUsed, ident[localId].newText, (CLUT_MenuEditField0 + localId)); |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1322 } |
38 | 1323 void write_content_of_actual_Id(void) |
1324 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1325 write_content_of_Id(actualId); |
38 | 1326 } |
1327 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1328 void clean_content_of_Id(int8_t localId) |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1329 { |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1330 clean_content( ident[localId].coord[0], ident[localId].coord[1], ident[localId].coord[2], ident[localId].fontUsed); |
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1331 } |
38 | 1332 |
1333 void clean_content_of_actual_Id(void) | |
1334 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1335 clean_content_of_Id(actualId); |
38 | 1336 } |
1337 | |
1338 void write_field_udigit_and_2digit(uint8_t subtype, uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint32_t int1, uint32_t int2, uint32_t int3, uint32_t int4) | |
1339 { | |
1340 if(id >= 9) | |
1341 return; | |
1342 | |
1343 ident[id].maintype = FIELD_NUMBERS; | |
1344 ident[id].subtype = subtype; | |
1345 | |
1346 ident[id].coord[0] = XleftGimpStyle; | |
1347 ident[id].coord[1] = XrightGimpStyle; | |
1348 ident[id].coord[2] = YtopGimpStyle; | |
1349 ident[id].fontUsed = (tFont *)Font; | |
1350 ident[id].callerID = editID; | |
1351 | |
1352 strncpy(ident[id].orgText, text, 32); | |
1353 strncpy(ident[id].newText, text, 32); | |
1354 ident[id].orgText[31] = 0; | |
1355 ident[id].newText[31] = 0; | |
1356 | |
1357 /* uint32_t has max 10 digits */ | |
1358 | |
1359 int8_t beginTmp, sizeTmp; | |
1360 uint8_t i; | |
1361 | |
1362 ident[id].input[0] = int1; | |
1363 ident[id].input[1] = int2; | |
1364 ident[id].input[2] = int3; | |
1365 ident[id].input[3] = int4; | |
1366 | |
1367 for(i=0;i<4;i++) | |
1368 ident[id].size[i] = 0; | |
1369 | |
1370 beginTmp = 0; | |
1371 for(i=0;i<4;i++) | |
1372 { | |
1373 while((ident[id].orgText[beginTmp] != '#')&& ident[id].orgText[beginTmp]) | |
1374 beginTmp++; | |
1375 | |
1376 if(ident[id].orgText[beginTmp] == '#') | |
1377 { | |
1378 sizeTmp = 1; | |
1379 while(ident[id].orgText[beginTmp + sizeTmp] == '#') | |
1380 sizeTmp++; | |
1381 | |
1382 ident[id].begin[i] = beginTmp; | |
1383 ident[id].size[i] = sizeTmp; | |
1384 beginTmp = ident[id].begin[i] + ident[id].size[i]; | |
1385 } | |
1386 else | |
1387 break; | |
1388 } | |
1389 | |
1390 if(!tME_stop) | |
1391 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldRegular); | |
1392 else | |
1393 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditInfo); | |
1394 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1395 create_newText_for_Id(id); |
38 | 1396 |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
138
diff
changeset
|
1397 if(editID == 0) |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1398 write_content_without_Id(); |
38 | 1399 else |
1400 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1401 write_content_of_Id(id); |
38 | 1402 if(!tME_stop) |
1403 idLast = id; | |
1404 id++; | |
1405 } | |
1406 } | |
1407 | |
1408 void write_field_udigit(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint32_t int1, uint32_t int2, uint32_t int3, uint32_t int4) | |
1409 { | |
1410 write_field_udigit_and_2digit(FIELD_UDIGIT, editID,XleftGimpStyle,XrightGimpStyle,YtopGimpStyle,Font,text,int1,int2,int3,int4); | |
1411 } | |
1412 | |
1413 void write_field_2digit(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint32_t int1, uint32_t int2, uint32_t int3, uint32_t int4) | |
1414 { | |
1415 write_field_udigit_and_2digit(FIELD_2DIGIT, editID,XleftGimpStyle,XrightGimpStyle,YtopGimpStyle,Font,text,int1,int2,int3,int4); | |
1416 } | |
1417 | |
1418 void write_field_3digit(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint32_t int1, uint32_t int2, uint32_t int3, uint32_t int4) | |
1419 { | |
1420 write_field_udigit_and_2digit(FIELD_3DIGIT, editID,XleftGimpStyle,XrightGimpStyle,YtopGimpStyle,Font,text,int1,int2,int3,int4); | |
1421 } | |
1422 | |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
1423 |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
1424 void write_field_sdigit(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, int32_t int1, int32_t int2, int32_t int3, int32_t int4) |
38 | 1425 { |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
1426 write_field_udigit_and_2digit(FIELD_SDIGIT, editID, XleftGimpStyle, XrightGimpStyle, YtopGimpStyle, Font, text, ((input_u)int1).uint32, ((input_u)int2).uint32, ((input_u)int3).uint32, ((input_u)int4).uint32); |
38 | 1427 } |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
1428 |
38 | 1429 |
1430 void write_field_select(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint8_t int1, uint8_t int2, uint8_t int3, uint8_t int4) | |
1431 { | |
1432 if(id >= 9) | |
1433 return; | |
1434 | |
1435 int8_t beginTmp; | |
1436 | |
1437 ident[id].maintype = FIELD_SELECT; | |
1438 ident[id].subtype = FIELD_SELECT; | |
1439 | |
1440 ident[id].coord[0] = XleftGimpStyle; | |
1441 ident[id].coord[1] = XrightGimpStyle; | |
1442 ident[id].coord[2] = YtopGimpStyle; | |
1443 ident[id].fontUsed = (tFont *)Font; | |
1444 ident[id].callerID = editID; | |
1445 | |
1446 strncpy(ident[id].orgText, text, 32); | |
1447 strncpy(ident[id].newText, text, 32); | |
1448 ident[id].orgText[31] = 0; | |
1449 ident[id].newText[31] = 0; | |
1450 | |
1451 ident[id].input[0] = int1; | |
1452 ident[id].input[1] = int2; | |
1453 ident[id].input[2] = int3; | |
1454 ident[id].input[3] = int4; | |
1455 | |
1456 for(int i=0;i<4;i++) | |
1457 ident[id].size[i] = 0; | |
1458 | |
1459 beginTmp = 0; | |
1460 for(int i=0;i<4;i++) | |
1461 { | |
1462 while((ident[id].orgText[beginTmp] != '#')&& ident[id].orgText[beginTmp]) | |
1463 beginTmp++; | |
1464 | |
1465 if(ident[id].orgText[beginTmp] == '#') | |
1466 { | |
1467 | |
1468 ident[id].begin[i] = beginTmp; | |
1469 ident[id].size[i] = 1; | |
1470 beginTmp = ident[id].begin[i] + ident[id].size[i]; | |
1471 } | |
1472 else | |
1473 break; | |
1474 } | |
1475 | |
1476 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldRegular); | |
1477 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1478 create_newText_for_Id(id); |
38 | 1479 |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
138
diff
changeset
|
1480 if(editID == 0) |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1481 write_content_without_Id(); |
38 | 1482 else |
1483 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1484 write_content_of_Id(id); |
38 | 1485 if(!tME_stop) |
1486 idLast = id; | |
1487 id++; | |
1488 } | |
1489 } | |
1490 | |
1491 void write_field_button(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text) | |
1492 { | |
1493 if(id >= 9) | |
1494 return; | |
1495 | |
1496 ident[id].maintype = FIELD_BUTTON; | |
1497 ident[id].subtype = FIELD_BUTTON; | |
1498 | |
1499 ident[id].coord[0] = XleftGimpStyle; | |
1500 ident[id].coord[1] = XrightGimpStyle; | |
1501 ident[id].coord[2] = YtopGimpStyle; | |
1502 ident[id].fontUsed = (tFont *)Font; | |
1503 ident[id].callerID = editID; | |
1504 | |
1505 strncpy(ident[id].orgText, text, 32); | |
1506 strncpy(ident[id].newText, text, 32); | |
1507 ident[id].orgText[31] = 0; | |
1508 ident[id].newText[31] = 0; | |
1509 | |
1510 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditButtonColor1); | |
1511 | |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
138
diff
changeset
|
1512 if(editID == 0) |
38 | 1513 write_content_without_Id(); |
1514 else | |
1515 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1516 write_content_of_Id(id); |
38 | 1517 if(!tME_stop) |
1518 idLast = id; | |
1519 id++; | |
1520 } | |
1521 } | |
1522 | |
1523 | |
1524 void write_field_symbol(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint8_t int1) | |
1525 { | |
1526 if(id >= 9) | |
1527 return; | |
1528 | |
1529 ident[id].maintype = FIELD_SYMBOL; | |
1530 ident[id].subtype = FIELD_SYMBOL; | |
1531 | |
1532 ident[id].coord[0] = XleftGimpStyle; | |
1533 ident[id].coord[1] = XrightGimpStyle; | |
1534 ident[id].coord[2] = YtopGimpStyle; | |
1535 ident[id].fontUsed = (tFont *)Font; | |
1536 ident[id].callerID = editID; | |
1537 | |
1538 strncpy(ident[id].orgText, text, 32); | |
1539 strncpy(ident[id].newText, text, 32); | |
1540 ident[id].orgText[31] = 0; | |
1541 | |
1542 ident[id].newText[0] = text[0]; | |
1543 ident[id].newText[1] = 0; | |
1544 | |
1545 ident[id].input[0] = int1; | |
1546 ident[id].input[1] = strlen(ident[id].orgText); | |
1547 | |
1548 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditButtonColor1); | |
1549 | |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
138
diff
changeset
|
1550 if(editID == 0) |
38 | 1551 write_content_without_Id(); |
1552 else | |
1553 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1554 write_content_of_Id(id); |
38 | 1555 if(!tME_stop) |
1556 idLast = id; | |
1557 id++; | |
1558 } | |
1559 } | |
584 | 1560 void write_field_toggle(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint8_t int1, uint8_t int2) |
1561 { | |
1562 if(id >= 9) return; | |
1563 ident[id].maintype = FIELD_TOGGLE; | |
1564 ident[id].subtype = FIELD_TOGGLE; | |
1565 ident[id].coord[0] = XleftGimpStyle; | |
1566 ident[id].coord[1] = XrightGimpStyle; | |
1567 ident[id].coord[2] = YtopGimpStyle; | |
1568 ident[id].fontUsed = (tFont *)Font; | |
1569 ident[id].callerID = editID; | |
1570 strncpy(ident[id].orgText, text, 32); | |
1571 strncpy(ident[id].newText, text, 32); | |
1572 ident[id].orgText[31] = 0; | |
1573 ident[id].newText[31] = 0; | |
1574 | |
1575 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditButtonColor1); | |
1576 | |
1577 if(editID == 0) write_content_without_Id(); | |
1578 else | |
1579 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1580 write_content_of_Id(id); |
584 | 1581 if(!tME_stop) idLast = id; |
1582 id++; | |
1583 } | |
1584 } | |
1585 | |
38 | 1586 |
1587 | |
1588 /* was build for field_on_off | |
1589 * to be tested for other purposes first | |
1590 */ | |
1591 void tMenuEdit_refresh_field(uint32_t editID) | |
1592 { | |
1593 uint8_t temp_id; | |
1594 | |
1595 temp_id = get_id_of(editID); | |
1596 if(temp_id == 255) | |
1597 return; | |
1598 | |
1599 clean_content( ident[temp_id].coord[0], ident[temp_id].coord[1], ident[temp_id].coord[2], ident[temp_id].fontUsed); | |
1600 write_content( ident[temp_id].coord[0], ident[temp_id].coord[1], ident[temp_id].coord[2], ident[temp_id].fontUsed, ident[temp_id].newText, (CLUT_MenuEditField0 + temp_id)); | |
1601 } | |
1602 | |
1603 | |
1604 void write_field_on_off(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint8_t int1) | |
1605 { | |
1606 if(id >= 9) | |
1607 return; | |
1608 | |
1609 ident[id].maintype = FIELD_ON_OFF; | |
1610 ident[id].subtype = FIELD_ON_OFF; | |
1611 | |
1612 ident[id].coord[0] = XleftGimpStyle; | |
1613 ident[id].coord[1] = XrightGimpStyle; | |
1614 ident[id].coord[2] = YtopGimpStyle; | |
1615 ident[id].fontUsed = (tFont *)Font; | |
1616 ident[id].callerID = editID; | |
1617 | |
1618 if(int1) | |
1619 ident[id].orgText[0] = '\005'; | |
1620 else | |
1621 ident[id].orgText[0] = '\006'; | |
1622 | |
1623 ident[id].orgText[1] = ' '; | |
1624 | |
1625 strncpy(&ident[id].orgText[2], text, 30); | |
1626 strncpy(ident[id].newText, ident[id].orgText, 32); | |
1627 ident[id].orgText[31] = 0; | |
1628 ident[id].newText[31] = 0; | |
1629 | |
1630 if(!tME_stop) | |
1631 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldRegular); | |
1632 else | |
1633 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditInfo); | |
1634 | |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
138
diff
changeset
|
1635 if(editID == 0) |
38 | 1636 write_content_without_Id(); |
1637 else | |
1638 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1639 write_content_of_Id(id); |
38 | 1640 if(!tME_stop) |
1641 idLast = id; | |
1642 id++; | |
1643 } | |
1644 } | |
1645 | |
1646 | |
1647 void write_field_fpoint(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, float input) | |
1648 { | |
1649 if(id >= 9) | |
1650 return; | |
1651 | |
1652 ident[id].maintype = FIELD_NUMBERS; | |
1653 ident[id].subtype = FIELD_FLOAT; | |
1654 | |
1655 ident[id].coord[0] = XleftGimpStyle; | |
1656 ident[id].coord[1] = XrightGimpStyle; | |
1657 ident[id].coord[2] = YtopGimpStyle; | |
1658 ident[id].fontUsed = (tFont *)Font; | |
1659 ident[id].callerID = editID; | |
1660 | |
1661 strncpy(ident[id].orgText, text, 32); | |
1662 strncpy(ident[id].newText, text, 32); | |
1663 ident[id].orgText[31] = 0; | |
1664 ident[id].newText[31] = 0; | |
1665 | |
1666 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldRegular); | |
1667 | |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
138
diff
changeset
|
1668 if(editID == 0) |
38 | 1669 write_content_without_Id(); |
1670 else | |
1671 { | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1672 write_content_of_Id(id); |
38 | 1673 if(!tME_stop) |
1674 idLast = id; | |
1675 id++; | |
1676 } | |
1677 } | |
1678 | |
1679 | |
1680 void setBackMenu(uint32_t inputFunctionCall, uint8_t functionCallParameter, uint8_t gotoMenuEditField) | |
1681 { | |
1682 backmenu.pEventFunction = inputFunctionCall; | |
1683 backmenu.functionParameter = functionCallParameter; | |
1684 backmenu.line = gotoMenuEditField; | |
1685 } | |
1686 | |
1687 | |
1688 void setEvent(uint32_t inputEventID, uint32_t inputFunctionCall) | |
1689 { | |
1690 if(evidLast >= 9) | |
1691 return; | |
1692 | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1693 #if 0 |
38 | 1694 /* set cursor to first field */ |
1695 if(evidLast < 0) | |
1696 { | |
1697 startMenuEditFieldSelect(); | |
1698 } | |
853
de6023cc0580
Potential Bugfix Selection MenuEdit lifecycle:
Ideenmodellierer
parents:
845
diff
changeset
|
1699 #endif |
38 | 1700 event[evid].callerID = inputEventID; |
1701 event[evid].pEventFunction = inputFunctionCall; | |
1702 | |
1703 evidLast = evid; | |
1704 evid++; | |
1705 } | |
1706 | |
1707 void startEdit(void) | |
1708 { | |
1709 EnterPressed = 1; | |
1710 helperGotoMenuEditField(0); | |
1711 enterMenuEditField(); | |
1712 } | |
1713 | |
788
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
786
diff
changeset
|
1714 |
38 | 1715 void exitEditWithUpdate(void) |
1716 { | |
1717 createDiveSettings(); | |
1718 EnterPressed = 1; | |
1719 exitMenuEdit(1); | |
1720 } | |
1721 | |
1722 /* | |
1723 void set_cursor(uint8_t forThisIdentID) | |
1724 { | |
1725 int16_t x0, x1, y0, y1; | |
1726 | |
1727 uint32_t xtra_left_right = 10; | |
1728 uint32_t xtra_top_bottom = 10; | |
1729 | |
1730 // y geht von 0 bis 799 | |
1731 // x geht von 0 bis 479 | |
1732 | |
1733 x0 = (int16_t)ident[forThisIdentID].coord[0]; | |
1734 x1 = (int16_t)ident[forThisIdentID].coord[1]; | |
1735 y0 = (int16_t)ident[forThisIdentID].coord[2]; | |
1736 y1 = y0 + (int16_t)ident[forThisIdentID].fontUsed->height; | |
1737 | |
1738 if(((int16_t)ident[forThisIdentID].fontUsed->height) > 70) | |
1739 { | |
1740 xtra_left_right = 10; | |
1741 xtra_top_bottom = 10; | |
1742 } | |
1743 else | |
1744 { | |
1745 xtra_left_right = 10; | |
1746 xtra_top_bottom = 0; | |
1747 } | |
1748 | |
1749 x0 -= xtra_left_right; | |
1750 x1 += xtra_left_right; | |
1751 y0 -= xtra_top_bottom; | |
1752 y1 += xtra_top_bottom; | |
1753 | |
1754 GFX_SetWindowLayer0(tMEcursor.FBStartAdress, x0, x1, y0, y1); | |
1755 } | |
1756 */ | |
1757 | |
1758 void set_cursorNew(uint8_t forThisIdentID) | |
1759 { | |
1760 int16_t y0; | |
1761 uint8_t lineMinusOne; | |
1762 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1763 if(!settingsGetPointer()->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1764 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1765 y0 = (int16_t)ident[forThisIdentID].coord[2]; |
117 | 1766 y0 -= ME_Y_LINE1; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1767 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1768 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1769 { |
117 | 1770 y0 = 390 + 25 - (int16_t)ident[forThisIdentID].coord[2]; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1771 } |
117 | 1772 |
38 | 1773 y0 /= ME_Y_LINE_STEP; |
117 | 1774 if((y0 >= 0) && (y0 <=6)) |
38 | 1775 lineMinusOne = y0; |
1776 else | |
1777 lineMinusOne = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1778 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1779 if(!settingsGetPointer()->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1780 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1781 GFX_SetFrameBottom((tMEcursorNew.FBStartAdress) + 65*2*(lineMinusOne), 0, 25, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1782 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1783 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1784 { |
117 | 1785 GFX_SetFrameBottom((tMEcursorNew.FBStartAdress)+ (390 - 65 *(6-lineMinusOne)) *2, 0, 480-390-25, 800, 390); |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1786 } |
38 | 1787 } |
1788 | |
1789 | |
1790 void write_topline( char *text) | |
1791 { | |
1792 GFX_DrawCfgWindow hgfx; | |
1793 const tFont *Font = &FontT48; | |
1794 | |
1795 hgfx.Image = &tMEscreen; | |
1796 hgfx.WindowNumberOfTextLines = 1; | |
1797 hgfx.WindowLineSpacing = 0; | |
1798 hgfx.WindowTab = 0; | |
1799 hgfx.WindowX0 = 20; | |
1800 hgfx.WindowX1 = 779; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1801 if(!settingsGetPointer()->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1802 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1803 hgfx.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1804 hgfx.WindowY0 = hgfx.WindowY1 - Font->height; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1805 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1806 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1807 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1808 hgfx.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1809 hgfx.WindowY1 = hgfx.WindowY0 + Font->height; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1810 } |
38 | 1811 GFX_write_label(Font, &hgfx, text, menuColor); |
1812 } | |
1813 | |
1814 | |
1815 void write_buttonTextline( uint8_t left2ByteCode, char middle2ByteCode, char right2ByteCode) | |
1816 { | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1817 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1818 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1819 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1820 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1821 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1822 { |
117 | 1823 GFX_clean_area(&tMEscreen, 0, 800, 479-24,480); |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1824 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1825 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1826 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1827 GFX_clean_area(&tMEscreen, 0, 800, 0, 24); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1828 } |
38 | 1829 |
1830 char localtext[32]; | |
1831 | |
1832 if(left2ByteCode) | |
1833 { | |
1834 localtext[0] = TXT_2BYTE; | |
1835 localtext[1] = left2ByteCode; | |
1836 localtext[2] = 0; | |
117 | 1837 |
1838 write_content_simple(&tMEscreen, 0, 800, 479-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen); | |
38 | 1839 } |
1840 | |
1841 if(middle2ByteCode) | |
1842 { | |
1843 localtext[0] = '\001'; | |
1844 localtext[1] = TXT_2BYTE; | |
1845 localtext[2] = middle2ByteCode; | |
1846 localtext[3] = 0; | |
117 | 1847 |
1848 write_content_simple(&tMEscreen, 0, 800, 479-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen); | |
38 | 1849 } |
1850 | |
1851 if(right2ByteCode) | |
1852 { | |
1853 localtext[0] = '\002'; | |
1854 localtext[1] = TXT_2BYTE; | |
1855 localtext[2] = right2ByteCode; | |
1856 localtext[3] = 0; | |
117 | 1857 |
1858 write_content_simple(&tMEscreen, 0, 800, 479-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen); | |
38 | 1859 } |
1860 } | |
1861 | |
1862 | |
1863 | |
1864 void write_label_var(uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text) | |
1865 { | |
1866 GFX_DrawCfgWindow hgfx; | |
1867 | |
1868 if(XrightGimpStyle > 799) | |
1869 XrightGimpStyle = 799; | |
1870 if(XleftGimpStyle >= XrightGimpStyle) | |
1871 XleftGimpStyle = 0; | |
1872 if(YtopGimpStyle > 479) | |
1873 YtopGimpStyle = 479; | |
1874 hgfx.Image = &tMEscreen; | |
1875 hgfx.WindowNumberOfTextLines = 1; | |
1876 hgfx.WindowLineSpacing = 0; | |
1877 hgfx.WindowTab = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1878 if(!settingsGetPointer()->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1879 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1880 hgfx.WindowX0 = XleftGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1881 hgfx.WindowX1 = XrightGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1882 hgfx.WindowY1 = 479 - YtopGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1883 if(hgfx.WindowY1 < Font->height) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1884 hgfx.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1885 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1886 hgfx.WindowY0 = hgfx.WindowY1 - Font->height; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1887 } |
38 | 1888 else |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1889 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1890 hgfx.WindowX0 = 800 - XrightGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1891 hgfx.WindowX1 = 800 - XleftGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1892 hgfx.WindowY0 = YtopGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1893 if(hgfx.WindowY0 < Font->height) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1894 hgfx.WindowY1 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1895 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1896 hgfx.WindowY1 = hgfx.WindowY0 + Font->height; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1897 } |
38 | 1898 GFX_write_label(Font, &hgfx, text, 0);/*menuColor);*/ |
1899 } | |
1900 | |
1901 | |
1902 void write_content(uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint8_t color) | |
1903 { | |
1904 GFX_DrawCfgWindow hgfx; | |
1905 | |
1906 if(XrightGimpStyle > 799) | |
1907 XrightGimpStyle = 799; | |
1908 if(XleftGimpStyle >= XrightGimpStyle) | |
1909 XleftGimpStyle = 0; | |
1910 if(YtopGimpStyle > 479) | |
1911 YtopGimpStyle = 479; | |
1912 hgfx.Image = &tMEscreen; | |
1913 hgfx.WindowNumberOfTextLines = 1; | |
1914 hgfx.WindowLineSpacing = 0; | |
1915 hgfx.WindowTab = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1916 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1917 if(!settingsGetPointer()->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1918 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1919 hgfx.WindowX0 = XleftGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1920 hgfx.WindowX1 = XrightGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1921 hgfx.WindowY1 = 479 - YtopGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1922 if(hgfx.WindowY1 < Font->height) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1923 hgfx.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1924 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1925 hgfx.WindowY0 = hgfx.WindowY1 - Font->height; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1926 } |
38 | 1927 else |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1928 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1929 hgfx.WindowX0 = 800 - XrightGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1930 hgfx.WindowX1 = 800 - XleftGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1931 hgfx.WindowY0 = YtopGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1932 if(hgfx.WindowY0 < Font->height) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1933 hgfx.WindowY1 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1934 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1935 hgfx.WindowY1 = hgfx.WindowY0 + Font->height; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1936 } |
38 | 1937 GFX_write_label(Font, &hgfx, text, color); |
1938 } | |
1939 | |
1940 | |
1941 void write_label_fix(uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char textId) | |
1942 { | |
1943 char text[2]; | |
1944 | |
1945 text[0] = textId; | |
1946 text[1] = 0; | |
1947 | |
1948 write_label_var(XleftGimpStyle, XrightGimpStyle, YtopGimpStyle, Font, text); | |
1949 } | |
1950 | |
1951 | |
1952 void clean_content(uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font) | |
1953 { | |
1954 GFX_DrawCfgWindow hgfx; | |
1955 | |
1956 if(XrightGimpStyle > 799) | |
1957 XrightGimpStyle = 799; | |
1958 if(XleftGimpStyle >= XrightGimpStyle) | |
1959 XleftGimpStyle = 0; | |
1960 if(YtopGimpStyle > 479) | |
1961 YtopGimpStyle = 479; | |
1962 hgfx.Image = &tMEscreen; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1963 if(!settingsGetPointer()->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1964 { |
38 | 1965 hgfx.WindowX0 = XleftGimpStyle; |
1966 hgfx.WindowX1 = XrightGimpStyle; | |
1967 hgfx.WindowY1 = 479 - YtopGimpStyle; | |
1968 if(hgfx.WindowY1 < Font->height) | |
1969 hgfx.WindowY0 = 0; | |
1970 else | |
1971 hgfx.WindowY0 = hgfx.WindowY1 - Font->height; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1972 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1973 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1974 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1975 hgfx.WindowX0 = 800 - XrightGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1976 hgfx.WindowX1 = 800 - XleftGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1977 hgfx.WindowY0 = YtopGimpStyle; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1978 if(hgfx.WindowY0 < Font->height) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1979 hgfx.WindowY1 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1980 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1981 hgfx.WindowY1 = hgfx.WindowY0 + Font->height; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1982 } |
38 | 1983 GFX_clear_window_immediately(&hgfx); |
1984 } | |
1985 | |
1986 | |
1987 /* Private functions ---------------------------------------------------------*/ | |
1988 | |
1989 void draw_tMEdesign(void) | |
1990 { | |
1991 GFX_draw_header(&tMEscreen,menuColor); | |
1992 } | |
1993 | |
1994 void draw_tMEdesignSubUnselected(uint32_t *ppDestination) | |
1995 { | |
1996 union al88_u | |
1997 { | |
1998 uint8_t al8[2]; | |
1999 uint16_t al88; | |
2000 }; | |
2001 | |
2002 union al88_u color_seperator; | |
2003 union al88_u color_unselected; | |
2004 int i; | |
2005 | |
2006 color_seperator.al8[0] = CLUT_MenuLineUnselectedSeperator; | |
2007 color_unselected.al8[0] = CLUT_MenuLineUnselected; | |
2008 | |
2009 color_seperator.al8[1] = 0xFF; | |
2010 color_unselected.al8[1] = 0xFF; | |
2011 | |
2012 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
2013 *ppDestination += 2; | |
2014 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
2015 *ppDestination += 2; | |
2016 | |
2017 for(i = 61; i > 0; i--) | |
2018 { | |
2019 *(__IO uint16_t*)*ppDestination = color_unselected.al88; | |
2020 *ppDestination += 2; | |
2021 } | |
2022 | |
2023 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
2024 *ppDestination += 2; | |
2025 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
2026 *ppDestination += 2; | |
2027 } | |
2028 | |
2029 | |
2030 void draw_tMEdesignSubSelected(uint32_t *ppDestination) | |
2031 { | |
2032 union al88_u | |
2033 { | |
2034 uint8_t al8[2]; | |
2035 uint16_t al88; | |
2036 }; | |
2037 | |
2038 union al88_u color_selected; | |
2039 union al88_u color_seperator; | |
2040 int i; | |
2041 | |
2042 color_selected.al8[0] = CLUT_MenuEditLineSelected; | |
2043 color_selected.al8[1] = 0xFF; | |
2044 | |
2045 color_seperator.al8[0] = CLUT_MenuLineSelectedSeperator; | |
2046 color_seperator.al8[1] = 0xFF; | |
2047 | |
2048 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
2049 *ppDestination += 2; | |
2050 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
2051 *ppDestination += 2; | |
2052 | |
2053 for(i = 61; i > 0; i--) | |
2054 { | |
2055 *(__IO uint16_t*)*ppDestination = color_selected.al88; | |
2056 *ppDestination += 2; | |
2057 } | |
2058 | |
2059 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
2060 *ppDestination += 2; | |
2061 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
2062 *ppDestination += 2; | |
2063 } | |
2064 | |
2065 | |
2066 void draw_tMEdesignSubSelectedBorder(uint32_t *ppDestination) | |
2067 { | |
2068 union al88_u | |
2069 { | |
2070 uint8_t al8[2]; | |
2071 uint16_t al88; | |
2072 }; | |
2073 | |
2074 union al88_u color_selected_sides; | |
2075 | |
2076 int i; | |
2077 | |
2078 color_selected_sides.al8[0] = CLUT_MenuLineSelectedSides; | |
2079 color_selected_sides.al8[1] = 0xFF; | |
2080 | |
2081 for(i = 65; i > 0; i--) | |
2082 { | |
2083 *(__IO uint16_t*)*ppDestination = color_selected_sides.al88; | |
2084 *ppDestination += 2; | |
2085 } | |
2086 } | |
2087 | |
2088 | |
2089 void draw_tMEcursorNewDesign(void) | |
2090 { | |
2091 int i,j; | |
2092 uint32_t pDestination; | |
2093 | |
2094 pDestination = tMEcursorNew.FBStartAdress; | |
2095 | |
2096 for(j = 801; j > 0; j--) | |
2097 { | |
2098 for(i = 5; i > 0; i--) | |
2099 { | |
2100 draw_tMEdesignSubUnselected(&pDestination); | |
2101 } | |
2102 if((j > 787) || (j < 17)) | |
2103 draw_tMEdesignSubSelectedBorder(&pDestination); | |
2104 else | |
2105 draw_tMEdesignSubSelected(&pDestination); | |
2106 } | |
2107 } | |
552
531e7818b737
Added menu structure to acces viewport calibration:
Ideenmodellierer
parents:
531
diff
changeset
|
2108 |
531e7818b737
Added menu structure to acces viewport calibration:
Ideenmodellierer
parents:
531
diff
changeset
|
2109 GFX_DrawCfgScreen* getMenuEditScreen() |
531e7818b737
Added menu structure to acces viewport calibration:
Ideenmodellierer
parents:
531
diff
changeset
|
2110 { |
531e7818b737
Added menu structure to acces viewport calibration:
Ideenmodellierer
parents:
531
diff
changeset
|
2111 return &tMEscreen; |
531e7818b737
Added menu structure to acces viewport calibration:
Ideenmodellierer
parents:
531
diff
changeset
|
2112 } |
531e7818b737
Added menu structure to acces viewport calibration:
Ideenmodellierer
parents:
531
diff
changeset
|
2113 |
531e7818b737
Added menu structure to acces viewport calibration:
Ideenmodellierer
parents:
531
diff
changeset
|
2114 |