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