Mercurial > public > ostc4
annotate Discovery/Src/tMenu.c @ 812:6670eb11a842
Testing build
author | heinrichsweikamp |
---|---|
date | Thu, 31 Aug 2023 10:33:25 +0200 |
parents | 4c41d9a18c7f |
children | ce8f71217f45 |
rev | line source |
---|---|
38 | 1 /////////////////////////////////////////////////////////////////////////////// |
2 /// -*- coding: UTF-8 -*- | |
3 /// | |
4 /// \file Discovery/Src/tMenu.c | |
5 /// \brief Major menu with extra page 0 for edit functionality since V0.0.2 | |
6 /// \author heinrichs weikamp gmbh | |
7 /// \date 30-April-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 ------------------------------------------------------------------*/ | |
30 #include "tMenu.h" | |
31 | |
32 #include "gfx_fonts.h" | |
33 #include "tHome.h" | |
34 #include "tMenuDeco.h" | |
35 #include "tMenuDecoParameter.h" | |
36 #include "tMenuEditDeco.h" | |
37 #include "tMenuEditDecoParameter.h" | |
38 #include "tMenuEditGasOC.h" | |
39 #include "tMenuEditHardware.h" | |
40 #include "tMenuEditPlanner.h" | |
41 #include "tMenuEditSetpoint.h" | |
42 #include "tMenuEditSystem.h" | |
43 #include "tMenuEditXtra.h" | |
507 | 44 #include "tMenuEditCustom.h" |
38 | 45 #include "tMenuGas.h" |
46 #include "tMenuHardware.h" | |
47 #include "tMenuPlanner.h" | |
48 #include "tMenuSetpoint.h" | |
49 #include "tMenuSystem.h" | |
50 #include "tMenuXtra.h" | |
507 | 51 #include "tMenuCustom.h" |
38 | 52 |
53 /* Private types -------------------------------------------------------------*/ | |
521
e221cf762f45
Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents:
507
diff
changeset
|
54 #define MAXPAGES 11 |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
55 #define CURSOR_HIGH 25 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
56 #define TAB_HEADER_HIGH 25 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
57 #define TAB_BAR_HIGH 5 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
58 #define MENU_WDW_HIGH 390 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
59 #define KEY_LABEL_HIGH 25 /* Height of the label used for the the user keys */ |
38 | 60 |
662 | 61 #define SLOW_UPDATE_CNT 10 /* Some content shall not be update in short intervals => add prescalar */ |
811
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
62 #define MAXLINES 6 |
662 | 63 |
38 | 64 typedef struct |
65 { | |
66 uint32_t StartAddressForPage[MAXPAGES+1]; | |
67 uint8_t lineMemoryForNavigationForPage[MAXPAGES+1]; | |
68 uint8_t pageMemoryForNavigation; | |
69 uint8_t linesAvailableForPage[MAXPAGES+1]; | |
70 uint8_t pagesAvailable; | |
71 uint8_t pageCountNumber[MAXPAGES+1]; | |
72 uint8_t pageCountTotal; | |
73 uint8_t modeFlipPages; | |
811
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
74 uint8_t shadowPage[MAXPAGES+1]; /* the page is switched in the context of another page */ |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
75 uint8_t activeShadow; /* Base page which is used for the shadow */ |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
76 uint8_t disableLineMask[MAXPAGES+1]; /* Bitfield used to disable a line. The line is visible but will not be selected by cursor) */ |
38 | 77 } SMenuMemory; |
78 | |
79 /* Exported variables --------------------------------------------------------*/ | |
80 | |
81 /* Announced Private variables -----------------------------------------------*/ | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
82 static GFX_DrawCfgScreen tMdesignSolo; |
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
83 static GFX_DrawCfgScreen tMdesignCursor; |
38 | 84 |
85 /* Private variables ---------------------------------------------------------*/ | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
86 static GFX_DrawCfgWindow tMwindow; |
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
87 static GFX_DrawCfgScreen tMscreen; |
38 | 88 |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
89 static SMenuMemory menu; |
38 | 90 |
91 uint8_t actual_menu_content = MENU_UNDEFINED; | |
92 | |
811
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
93 |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
94 |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
95 |
38 | 96 /* Private function prototypes -----------------------------------------------*/ |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
97 static void draw_tMheader(uint8_t page); |
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
98 static void draw_tMcursorDesign(void); |
38 | 99 |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
100 static void draw_tMdesignSubUnselected(uint32_t *ppDestination); |
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
101 static void draw_tMdesignSubSelected(uint32_t *ppDestination); |
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
102 static void draw_tMdesignSubSelectedBorder(uint32_t *ppDestination); |
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
103 static void tMenu_write(uint8_t page, char *text, char *subtext); |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
104 static void nextLine(void); |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
105 static void clean_line_actual_page(void); |
38 | 106 void tM_build_pages(void); |
107 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
108 static void gotoMenuEdit(void); |
38 | 109 |
110 /* Exported functions --------------------------------------------------------*/ | |
111 | |
112 GFX_DrawCfgScreen * get_PointerMenuCursorScreen(void) | |
113 { | |
114 return &tMdesignCursor; | |
115 } | |
116 | |
117 | |
118 GFX_DrawCfgScreen * get_PointerMenuCursorDesignSoloScreen(void) | |
119 { | |
120 return &tMdesignSolo; | |
121 } | |
122 | |
123 | |
124 void nextline(char * text, uint8_t *textPointer) | |
125 { | |
126 text[(*textPointer)++] = '\n'; | |
127 text[(*textPointer)++] = '\r'; | |
128 text[*textPointer] = 0; | |
129 } | |
130 | |
131 | |
132 void tM_init(void) | |
133 { | |
134 uint8_t i; | |
135 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
136 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
137 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
138 |
38 | 139 tMdesignCursor.FBStartAdress = getFrame(3); |
140 tMdesignCursor.ImageHeight = 390; | |
141 tMdesignCursor.ImageWidth = 800; | |
142 tMdesignCursor.LayerIndex = 0; | |
143 | |
144 tMdesignSolo.FBStartAdress = getFrame(4); | |
145 tMdesignSolo.ImageHeight = 390; | |
146 tMdesignSolo.ImageWidth = 800; | |
147 tMdesignSolo.LayerIndex = 0; | |
148 | |
149 menu.pagesAvailable = 0; | |
150 menu.pageMemoryForNavigation = 0; | |
151 for(i=0;i<=MAXPAGES;i++) | |
152 { | |
153 menu.lineMemoryForNavigationForPage[i] = 0; | |
154 menu.StartAddressForPage[i] = 0; | |
155 menu.linesAvailableForPage[i] = 0; | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
156 menu.shadowPage[i] = 0; |
811
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
157 menu.disableLineMask[i] = 0; |
38 | 158 } |
159 | |
160 tMscreen.FBStartAdress = 0; | |
161 tMscreen.ImageHeight = 480; | |
162 tMscreen.ImageWidth = 800; | |
163 tMscreen.LayerIndex = 1; | |
164 | |
165 draw_tMcursorDesign(); | |
166 | |
167 tMwindow.Image = &tMscreen; | |
168 tMwindow.WindowNumberOfTextLines = 6; | |
169 tMwindow.WindowLineSpacing = 65; | |
170 tMwindow.WindowTab = 400; | |
171 tMwindow.WindowX0 = 20; | |
172 tMwindow.WindowX1 = 779; | |
173 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
174 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
175 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
176 tMwindow.WindowY0 = 4 + KEY_LABEL_HIGH; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
177 tMwindow.WindowY1 = 390 + KEY_LABEL_HIGH; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
178 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
179 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
180 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
181 tMwindow.WindowY0 = 480 - MENU_WDW_HIGH - TAB_HEADER_HIGH;// - TAB_BAR_HIGH; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
182 tMwindow.WindowY1 = 480 - TAB_HEADER_HIGH - TAB_BAR_HIGH; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
183 } |
38 | 184 actual_menu_content = MENU_UNDEFINED; |
185 } | |
186 | |
187 void tM_refresh(char *text, uint8_t *textPointer, uint8_t line, const char content[6]) | |
188 { | |
189 for(uint8_t i=0; i<6; i++) | |
190 { | |
191 if(((line == 0) || (line == i)) && content[i]) | |
192 { | |
193 text[(*textPointer)++] = content[i]; | |
194 } | |
195 text[(*textPointer)++] = '\n'; | |
196 text[(*textPointer)++] = '\r'; | |
197 text[*textPointer] = 0; | |
198 } | |
199 } | |
200 | |
201 | |
202 void tM_rebuild_pages(void) | |
203 { | |
204 menu.pagesAvailable = 0; | |
205 // menu.pageMemoryForNavigation = 0; | |
206 for(int i=0;i<=MAXPAGES;i++) | |
207 { | |
208 menu.lineMemoryForNavigationForPage[i] = 0; | |
209 menu.linesAvailableForPage[i] = 0; | |
210 menu.StartAddressForPage[i] = 0; // only with GFX_forceReleaseFramesWithId(5); !!!!! | |
211 } | |
212 GFX_forceReleaseFramesWithId(5); | |
213 tM_build_pages(); | |
214 } | |
215 | |
216 | |
217 void tM_rebuild_menu_after_tComm(void) | |
218 { | |
219 tM_rebuild_pages(); | |
220 } | |
221 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
222 void tM_check_content(void) |
38 | 223 { |
224 uint8_t mode = 0; | |
225 | |
226 if(stateUsed->mode == MODE_DIVE) | |
227 { | |
228 if(stateUsed == stateRealGetPointer()) | |
229 mode = MENU_DIVE_REAL; | |
230 else | |
231 mode = MENU_DIVE_SIM; | |
232 } | |
233 else | |
234 mode = MENU_SURFACE; | |
235 | |
236 if(actual_menu_content != mode) | |
237 { | |
238 actual_menu_content = mode; | |
239 tM_rebuild_pages(); | |
240 } | |
241 } | |
242 | |
811
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
243 void disableLine(uint32_t lineId) |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
244 { |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
245 SStateList idList; |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
246 |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
247 get_idSpecificStateList(lineId, &idList); |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
248 |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
249 if((idList.page < MAXPAGES) && (idList.line < MAXLINES)) |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
250 { |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
251 menu.disableLineMask[idList.page] |= (1 << idList.line); |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
252 } |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
253 } |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
254 |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
255 void enableLine(uint32_t lineId) |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
256 { |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
257 SStateList idList; |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
258 |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
259 get_idSpecificStateList(lineId, &idList); |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
260 |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
261 if((idList.page < MAXPAGES) && (idList.line < MAXLINES)) |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
262 { |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
263 menu.disableLineMask[idList.page] &= ~(1 << idList.line); |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
264 } |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
265 } |
38 | 266 |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
267 static void clean_line_actual_page(void) |
38 | 268 { |
269 uint8_t line, page; | |
270 | |
271 page = menu.pageMemoryForNavigation; | |
272 line = menu.lineMemoryForNavigationForPage[page]; | |
122
871baf20776b
Take care for display orientation if deleting lines
Ideenmodellierer
parents:
110
diff
changeset
|
273 if(settingsGetPointer()->FlipDisplay) /* Reselect line to be deleted if display is rotated */ |
871baf20776b
Take care for display orientation if deleting lines
Ideenmodellierer
parents:
110
diff
changeset
|
274 { |
871baf20776b
Take care for display orientation if deleting lines
Ideenmodellierer
parents:
110
diff
changeset
|
275 line = 6 - line + 1; |
871baf20776b
Take care for display orientation if deleting lines
Ideenmodellierer
parents:
110
diff
changeset
|
276 } |
38 | 277 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; |
278 GFX_clean_line(&tMwindow, line); | |
279 } | |
280 | |
281 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
282 static void update_content_actual_page(char *text, uint16_t tab, char *subtext) |
38 | 283 { |
284 uint8_t page; | |
285 | |
286 page = menu.pageMemoryForNavigation; | |
287 | |
288 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; | |
289 if(tab == 0) | |
290 tMwindow.WindowTab = 400; | |
291 else | |
292 tMwindow.WindowTab = tab; | |
293 | |
294 tMenu_write(page, text, subtext); | |
295 } | |
296 | |
297 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
298 static void update_content_with_new_frame(uint8_t page, char *text, uint16_t tab, char *subtext) |
38 | 299 { |
300 char localtext[32]; | |
301 | |
302 uint32_t rememberPage = menu.StartAddressForPage[page]; | |
303 menu.StartAddressForPage[page] = getFrame(5); | |
304 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; | |
305 | |
306 if(tab == 0) | |
307 tMwindow.WindowTab = 400; | |
308 else | |
309 tMwindow.WindowTab = tab; | |
310 | |
311 draw_tMheader(page); | |
312 tMenu_write(page, text, subtext); | |
313 | |
314 localtext[0] = TXT_2BYTE; | |
315 localtext[1] = TXT2BYTE_ButtonBack; | |
316 localtext[2] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
317 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen); |
38 | 318 |
319 localtext[0] = '\001'; | |
320 localtext[1] = TXT_2BYTE; | |
321 localtext[2] = TXT2BYTE_ButtonEnter; | |
322 localtext[3] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
323 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen); |
38 | 324 |
325 localtext[0] = '\002'; | |
326 localtext[1] = TXT_2BYTE; | |
327 localtext[2] = TXT2BYTE_ButtonNext; | |
328 localtext[3] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
329 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen); |
38 | 330 |
331 // gfx_write_page_number(&tMscreen ,menu.pageCountNumber[page],menu.pageCountTotal,0); | |
332 | |
333 if(page == menu.pageMemoryForNavigation) | |
334 GFX_SetFrameTop(tMscreen.FBStartAdress); | |
335 releaseFrame(5,rememberPage); | |
336 } | |
337 | |
338 | |
169
842f57bbaaad
Bugfix: highlight the menu underline correctly on selected state
Jan Mulder <jlmulder@xs4all.nl>
parents:
167
diff
changeset
|
339 static void tM_create_pagenumbering(void) |
38 | 340 { |
341 menu.pageCountTotal = 0; | |
342 | |
343 for(int i=0;i<=MAXPAGES;i++) | |
344 { | |
345 if(menu.pageCountNumber[i]) | |
346 { | |
347 menu.pageCountTotal++; | |
348 menu.pageCountNumber[i] = menu.pageCountTotal; | |
349 } | |
350 } | |
351 } | |
352 | |
353 | |
379 | 354 void tM_build_page(uint32_t id, char *text, uint16_t tab, char *subtext) |
38 | 355 { |
356 uint8_t linesFound; | |
357 uint16_t i; | |
358 SStateList idList; | |
359 uint8_t page; | |
360 | |
361 char localtext[32]; | |
362 | |
363 if(menu.pagesAvailable > MAXPAGES) | |
364 return; | |
365 | |
366 get_idSpecificStateList(id, &idList); | |
367 | |
368 if(idList.base != BaseMenu) | |
369 return; | |
370 | |
371 if(idList.page == 0) | |
372 return; | |
373 | |
374 if(idList.page > MAXPAGES) | |
375 return; | |
376 | |
377 page = idList.page; | |
378 | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
379 if((!menu.pageCountNumber[page]) && (!menu.shadowPage[page])) /* shadow pages are not visible on top level */ |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
380 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
381 return; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
382 } |
38 | 383 |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
384 if(menu.pagesAvailable == 0) |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
385 tM_create_pagenumbering(); |
38 | 386 |
387 if(*text == 0) | |
388 return; | |
389 | |
390 linesFound = 1; | |
391 | |
392 if(menu.StartAddressForPage[page]) | |
393 releaseFrame(5,menu.StartAddressForPage[page]); | |
394 | |
395 menu.StartAddressForPage[page] = getFrame(5); | |
396 | |
397 if(menu.StartAddressForPage[page] == 0) | |
398 return; | |
399 | |
400 i = 0; | |
401 while((i < MAX_PAGE_TEXTSIZE) && text[i]) | |
402 { | |
403 if((text[i] == '\n') && ((i + 2) < MAX_PAGE_TEXTSIZE) && text[i+1] && text[i+2]) | |
404 linesFound += 1; | |
405 i++; | |
406 } | |
407 | |
408 menu.linesAvailableForPage[page] = linesFound; | |
409 menu.pagesAvailable++; /* even if it was used before */ | |
410 | |
411 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; | |
412 if(tab == 0) | |
413 tMwindow.WindowTab = 400; | |
414 else | |
415 tMwindow.WindowTab = tab; | |
416 | |
417 draw_tMheader(page); | |
418 | |
419 tMenu_write(page, text, subtext); | |
420 | |
421 localtext[0] = TXT_2BYTE; | |
422 localtext[1] = TXT2BYTE_ButtonBack; | |
423 localtext[2] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
424 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen); |
38 | 425 |
426 localtext[0] = '\001'; | |
427 localtext[1] = TXT_2BYTE; | |
428 localtext[2] = TXT2BYTE_ButtonEnter; | |
429 localtext[3] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
430 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen); |
38 | 431 |
432 localtext[0] = '\002'; | |
433 localtext[1] = TXT_2BYTE; | |
434 localtext[2] = TXT2BYTE_ButtonNext; | |
435 localtext[3] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
436 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen); |
38 | 437 } |
438 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
439 static void findValidPosition(uint8_t *pageOuput, uint8_t *lineOutput) |
38 | 440 { |
51
8f8ea3a32e82
Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents:
38
diff
changeset
|
441 uint8_t page = 0; |
8f8ea3a32e82
Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents:
38
diff
changeset
|
442 uint8_t line = 0; |
8f8ea3a32e82
Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents:
38
diff
changeset
|
443 uint8_t first = 0; |
38 | 444 |
445 *pageOuput = 0; | |
446 *lineOutput = 0; | |
447 | |
448 /* test */ | |
449 if(menu.pagesAvailable == 0) | |
450 return; | |
451 | |
452 for(int i=1;i<=MAXPAGES;i++) | |
453 { | |
454 if((menu.pageCountNumber[i] != 0) | |
455 && (menu.linesAvailableForPage[i] != 0) | |
456 && (menu.StartAddressForPage[i] != 0)) | |
457 { | |
458 first = i; | |
459 break; | |
460 } | |
461 } | |
462 | |
463 /* select */ | |
464 if(menu.pageMemoryForNavigation > MAXPAGES) | |
465 menu.pageMemoryForNavigation = first; | |
466 | |
467 page = menu.pageMemoryForNavigation; | |
468 | |
469 if(page == 0) | |
470 page = first; | |
471 | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
472 while((page <= MAXPAGES) && ((menu.linesAvailableForPage[page] == 0) || (menu.StartAddressForPage[page] == 0) || ((menu.pageCountNumber[page] == 0) && !((menu.shadowPage[page]) && (menu.pageMemoryForNavigation == page))))) |
38 | 473 page += 1; |
474 | |
475 if(page > MAXPAGES) | |
476 page = first; | |
477 | |
478 line = menu.lineMemoryForNavigationForPage[page]; | |
479 | |
480 if(line == 0) | |
481 line = 1; | |
482 | |
811
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
483 if(menu.disableLineMask[page] & ( 1 << line)) |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
484 { |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
485 line++; |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
486 } |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
487 |
38 | 488 if(line > menu.linesAvailableForPage[page]) |
489 line = 1; | |
490 | |
491 *pageOuput = page; | |
492 *lineOutput = line; | |
493 } | |
494 | |
495 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
496 static void tM_add(uint32_t id) |
38 | 497 { |
498 SStateList idList; | |
499 uint8_t page; | |
500 | |
501 get_idSpecificStateList(id, &idList); | |
502 | |
503 page = idList.page; | |
504 | |
505 if(page > MAXPAGES) | |
506 return; | |
507 | |
508 menu.pageCountNumber[page] = 1; | |
509 } | |
510 | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
511 static void tM_addShadow(uint32_t id) |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
512 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
513 SStateList idList; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
514 uint8_t page; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
515 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
516 get_idSpecificStateList(id, &idList); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
517 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
518 page = idList.page; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
519 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
520 if(page > MAXPAGES) |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
521 return; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
522 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
523 menu.shadowPage[page] = 1; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
524 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
525 |
38 | 526 |
527 void tM_build_pages(void) | |
528 { | |
529 char text[MAX_PAGE_TEXTSIZE]; | |
530 char subtext[MAX_PAGE_TEXTSIZE]; | |
531 uint32_t id; | |
532 uint16_t tabPosition; | |
533 SSettings *pSettings = settingsGetPointer(); | |
534 | |
535 menu.pagesAvailable = 0; | |
536 for(int i=0;i<=MAXPAGES;i++) | |
537 menu.pageCountNumber[i] = 0; | |
538 | |
539 tabPosition = 400; | |
540 *text = 0; | |
541 *subtext = 0; | |
542 | |
543 /* 2015 Feb 02, hw | |
544 * max 8 Menu Pages | |
545 */ | |
546 | |
547 | |
548 tM_add(StMSYS); //now in both modes | |
549 if(actual_menu_content == MENU_SURFACE) | |
550 { | |
551 tM_add(StMDECO); | |
552 tM_add(StMHARD); | |
507 | 553 tM_add(StMCustom); |
38 | 554 // tM_add(StMSYS); now in both modes |
555 } | |
556 else | |
557 { | |
558 tM_add(StMXTRA); | |
559 } | |
560 if(actual_menu_content == MENU_SURFACE) | |
561 { | |
562 tM_add(StMPLAN); | |
563 } | |
564 // if((pSettings->dive_mode != DIVEMODE_Gauge) && (pSettings->dive_mode != DIVEMODE_Apnea)) | |
565 // { | |
566 tM_add(StMDECOP); | |
567 // } | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
568 |
662 | 569 if((isLoopMode(pSettings->dive_mode)) || (stateUsed->diveSettings.ccrOption == 1)) |
38 | 570 { |
571 tM_add(StMCG); | |
572 tM_add(StMSP); | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
573 if (actual_menu_content == MENU_SURFACE) /* StMOG is now accessed using StMCG in CCR mode*/ |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
574 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
575 tM_add(StMXTRA); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
576 tM_addShadow(StMOG); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
577 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
578 else |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
579 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
580 tM_add(StMOG); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
581 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
582 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
583 else |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
584 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
585 tM_add(StMOG); |
38 | 586 } |
587 | |
588 id = tMOG_refresh(0, text, &tabPosition, subtext); | |
589 tM_build_page(id, text, tabPosition, subtext); | |
590 | |
591 id = tMCG_refresh(0, text, &tabPosition, subtext); | |
592 tM_build_page(id, text, tabPosition, subtext); | |
593 | |
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:
774
diff
changeset
|
594 id = tMSP_refresh(text, &tabPosition, subtext); |
38 | 595 tM_build_page(id, text, tabPosition, subtext); |
596 | |
597 id = tMXtra_refresh(0, text, &tabPosition, subtext); | |
598 tM_build_page(id, text, tabPosition, subtext); | |
599 | |
600 id = tMPlanner_refresh(0, text, &tabPosition, subtext); | |
601 tM_build_page(id, text, tabPosition, subtext); | |
602 | |
603 id = tMDeco_refresh(0, text, &tabPosition, subtext); | |
604 tM_build_page(id, text, tabPosition, subtext); | |
605 | |
606 id = tMDecoParameters_refresh(0, text, &tabPosition, subtext); | |
607 tM_build_page(id, text, tabPosition, subtext); | |
608 | |
609 id = tMPlanner_refresh(0, text, &tabPosition, subtext); | |
610 tM_build_page(id, text, tabPosition, subtext); | |
611 | |
612 id = tMHardware_refresh(0, text, &tabPosition, subtext); | |
613 tM_build_page(id, text, tabPosition, subtext); | |
614 | |
615 id = tMSystem_refresh(0, text, &tabPosition, subtext); | |
616 tM_build_page(id, text, tabPosition, subtext); | |
507 | 617 |
618 id = tMCustom_refresh(0, text, &tabPosition, subtext); | |
619 tM_build_page(id, text, tabPosition, subtext); | |
38 | 620 } |
621 | |
622 | |
623 void tM_refresh_live_content(void) | |
624 { | |
662 | 625 static uint8_t slowUpdate = SLOW_UPDATE_CNT; |
51
8f8ea3a32e82
Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents:
38
diff
changeset
|
626 uint8_t page = 0; |
38 | 627 char text[MAX_PAGE_TEXTSIZE]; |
628 char subtext[MAX_PAGE_TEXTSIZE]; | |
629 uint16_t tabPosition; | |
630 | |
662 | 631 uint32_t globalState = get_globalState(); |
632 | |
633 slowUpdate--; | |
634 page = menu.pageMemoryForNavigation; | |
635 switch(globalState) | |
38 | 636 { |
662 | 637 case StMSYS: if(actual_menu_content == MENU_SURFACE) |
638 { | |
639 tMSystem_refresh(0, text, &tabPosition, subtext); | |
640 update_content_with_new_frame(page, text, tabPosition, subtext); | |
641 } | |
642 break; | |
643 case StMHARD: tMHardware_refresh(0, text, &tabPosition, subtext); | |
644 update_content_with_new_frame(page, text, tabPosition, subtext); | |
645 break; | |
646 case StMOG: if((actual_menu_content != MENU_SURFACE) && (slowUpdate == 0)) | |
647 { | |
648 tMOG_refresh(0, text, &tabPosition, subtext); | |
649 update_content_with_new_frame(page, text, tabPosition, subtext); | |
650 } | |
651 break; | |
652 case StMCG: if((actual_menu_content != MENU_SURFACE) && (slowUpdate == 0)) | |
653 { | |
654 tMCG_refresh(0, text, &tabPosition, subtext); | |
655 update_content_with_new_frame(page, text, tabPosition, subtext); | |
656 } | |
657 break; | |
658 default: | |
659 break; | |
38 | 660 } |
662 | 661 if(slowUpdate == 0) |
38 | 662 { |
662 | 663 slowUpdate = SLOW_UPDATE_CNT; |
38 | 664 } |
665 | |
666 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; | |
667 tHome_show_lost_connection_count(&tMscreen); | |
668 /* | |
669 SStateList idList; | |
670 if(actual_menu_content == MENU_SURFACE) | |
671 { | |
672 page = menu.pageMemoryForNavigation; | |
673 get_idSpecificStateList(StMSYS, &idList); | |
674 if(page == idList.page) | |
675 { | |
676 tMSystem_refresh(0, text, &tabPosition, subtext); | |
677 update_content_with_new_frame(page, text, tabPosition, subtext); | |
678 } | |
679 } | |
680 */ | |
681 } | |
682 | |
683 | |
684 /* new frame only! */ | |
685 void updateSpecificMenu(uint32_t id) | |
686 { | |
687 uint8_t page; | |
688 SStateList idList; | |
689 | |
690 char text[MAX_PAGE_TEXTSIZE]; | |
691 char subtext[MAX_PAGE_TEXTSIZE]; | |
692 uint16_t tabPosition; | |
693 | |
694 *subtext = 0; | |
695 *text = 0; | |
696 tabPosition = 400; | |
697 | |
698 get_idSpecificStateList(id, &idList); | |
699 page = idList.page; | |
700 | |
701 switch(id) | |
702 { | |
703 case StMOG: | |
704 tMOG_refresh(0, text, &tabPosition, subtext); | |
705 update_content_with_new_frame(page, text, tabPosition, subtext); | |
706 break; | |
707 case StMCG: | |
708 tMCG_refresh(0, text, &tabPosition, subtext); | |
709 update_content_with_new_frame(page, text, tabPosition, subtext); | |
710 break; | |
711 case StMSP: | |
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:
774
diff
changeset
|
712 tMSP_refresh(text, &tabPosition, subtext); |
38 | 713 update_content_with_new_frame(page, text, tabPosition, subtext); |
714 break; | |
715 default: | |
716 break; | |
717 } | |
718 } | |
719 | |
720 | |
721 void updateMenu(void) | |
722 { | |
723 uint8_t page, line; | |
724 | |
725 char text[MAX_PAGE_TEXTSIZE]; | |
726 char subtext[MAX_PAGE_TEXTSIZE]; | |
727 uint16_t tabPosition; | |
728 | |
729 *subtext = 0; | |
730 *text = 0; | |
731 tabPosition = 400; | |
732 | |
733 page = menu.pageMemoryForNavigation; | |
734 line = menu.lineMemoryForNavigationForPage[page]; | |
735 | |
736 switch(get_globalState()) | |
737 { | |
738 case StMOG: | |
739 tMOG_refresh(0, text, &tabPosition, subtext); | |
740 update_content_with_new_frame(page, text, tabPosition, subtext); | |
741 break; | |
742 case StMCG: | |
743 tMCG_refresh(0, text, &tabPosition, subtext); | |
744 update_content_with_new_frame(page, text, tabPosition, subtext); | |
745 break; | |
746 case StMSP: | |
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:
774
diff
changeset
|
747 tMSP_refresh(text, &tabPosition, subtext); |
38 | 748 update_content_with_new_frame(page, text, tabPosition, subtext); |
749 break; | |
750 case StMXTRA: | |
751 tMXtra_refresh(0, text, &tabPosition, subtext); | |
752 update_content_with_new_frame(page, text, tabPosition, subtext); | |
753 break; | |
754 case StMDECO: | |
755 if((line == 1) || (line == 3)) // dive mode or ppO2 limits (the later for correct MOD in gaslists) | |
756 { | |
757 tM_rebuild_pages(); | |
758 menu.lineMemoryForNavigationForPage[page] = line; // fix 160623 | |
759 GFX_SetFrameTop(menu.StartAddressForPage[page]); | |
760 } | |
761 else | |
762 { | |
763 tMDeco_refresh(line, text, &tabPosition, subtext); | |
764 clean_line_actual_page(); | |
765 update_content_actual_page(text, tabPosition, subtext); | |
766 } | |
767 break; | |
768 case StMDECOP: | |
769 tMDecoParameters_refresh(line, text, &tabPosition, subtext); | |
770 clean_line_actual_page(); | |
771 update_content_actual_page(text, tabPosition, subtext); | |
772 break; | |
773 case StMPLAN: | |
774 tMPlanner_refresh(line, text, &tabPosition, subtext); | |
775 clean_line_actual_page(); | |
776 update_content_actual_page(text, tabPosition, subtext); | |
777 break; | |
778 case StMHARD: | |
779 tMHardware_refresh(line, text, &tabPosition, subtext); | |
780 clean_line_actual_page(); | |
781 update_content_actual_page(text, tabPosition, subtext); | |
782 break; | |
783 case StMSYS: | |
784 if((line == 2) || (line == 3) || (line == 6)) | |
785 { | |
786 tM_rebuild_pages(); | |
787 menu.lineMemoryForNavigationForPage[page] = line; // fix 160623 | |
788 GFX_SetFrameTop(menu.StartAddressForPage[page]); | |
789 menu.lineMemoryForNavigationForPage[page] = line; | |
790 } | |
791 else | |
792 { | |
793 tMSystem_refresh(line, text, &tabPosition, subtext); | |
794 clean_line_actual_page(); | |
795 update_content_actual_page(text, tabPosition, subtext); | |
796 } | |
797 break; | |
507 | 798 case StMCustom: |
799 tMCustom_refresh(line, text, &tabPosition, subtext); | |
800 clean_line_actual_page(); | |
801 update_content_actual_page(text, tabPosition, subtext); | |
802 break; | |
38 | 803 default: |
804 break; | |
805 } | |
806 } | |
807 | |
808 void openMenu_first_page_with_OC_gas_update(void) | |
809 { | |
810 menu.pageMemoryForNavigation = 1; | |
811 for(int i=0;i<=MAXPAGES;i++) | |
812 menu.lineMemoryForNavigationForPage[i] = 0; | |
813 | |
814 set_globalState(StMOG); | |
815 updateMenu(); | |
816 openMenu(1); | |
817 } | |
818 | |
819 | |
820 void openMenu(uint8_t freshWithFlipPages) | |
821 { | |
822 uint8_t page, line; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
823 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
824 pSettings = settingsGetPointer(); |
38 | 825 |
826 findValidPosition(&page, &line); | |
827 if((page == 0) || (line == 0)) | |
828 return; | |
829 | |
830 menu.pageMemoryForNavigation = page; | |
831 /* new test for 3button design */ | |
832 if(freshWithFlipPages) | |
833 { | |
834 menu.lineMemoryForNavigationForPage[page] = 0; | |
835 menu.modeFlipPages = 1; | |
836 } | |
837 else | |
838 { | |
839 menu.lineMemoryForNavigationForPage[page] = line; | |
840 menu.modeFlipPages = 0; | |
841 } | |
842 | |
843 set_globalState_Menu_Page(page); | |
844 | |
845 | |
846 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 1)); | |
847 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 1)); | |
848 | |
849 | |
850 if(((page == 6) || (page == 8)) && (menu.pageCountNumber[page-1] == 0)) | |
851 { | |
852 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 2)); | |
853 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 2)); | |
854 | |
855 } | |
856 | |
857 GFX_SetFrameTop(menu.StartAddressForPage[page]); | |
858 /* new test for 3button design */ | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
859 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
860 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
861 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
862 if(freshWithFlipPages) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
863 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
864 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
865 GFX_SetFrameBottom((tMdesignCursor.FBStartAdress) + 65*2*(line - 1), 0, 25, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
866 } |
38 | 867 else |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
868 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
869 if(freshWithFlipPages) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
870 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
871 GFX_SetFrameBottom((tMdesignSolo.FBStartAdress), 0, 480-390-KEY_LABEL_HIGH, 800, 390); //- (25 * 2 * 800), 0, 25, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
872 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
873 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
874 GFX_SetFrameBottom((tMdesignCursor.FBStartAdress + (390 - 65 *(line)) *2), 0,480-390-KEY_LABEL_HIGH, 800, 390); //480-390-KEY_LABEL_HIGH + 65*2*(line - 1) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
875 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
876 |
38 | 877 } |
878 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
879 static void block_diluent_handler(_Bool Unblock) |
38 | 880 { |
881 SStateList list; | |
882 static uint8_t linesAvailableForPageDiluent = 0; | |
883 get_idSpecificStateList(StMCG, &list); | |
884 | |
885 if(Unblock && linesAvailableForPageDiluent) | |
886 { | |
887 menu.linesAvailableForPage[list.page] = linesAvailableForPageDiluent; | |
888 } | |
889 else | |
890 { | |
891 linesAvailableForPageDiluent = menu.linesAvailableForPage[list.page]; | |
892 menu.linesAvailableForPage[list.page] = 0; | |
893 } | |
894 } | |
895 | |
896 void block_diluent_page(void) | |
897 { | |
898 block_diluent_handler(0); | |
899 } | |
900 | |
901 | |
902 void unblock_diluent_page(void) | |
903 { | |
904 block_diluent_handler(1); | |
905 } | |
906 | |
907 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
908 static void nextPage(void) |
38 | 909 { |
910 uint8_t page, line; | |
911 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
912 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
913 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
914 |
38 | 915 menu.pageMemoryForNavigation += 1; |
916 | |
917 findValidPosition(&page, &line); | |
918 menu.pageMemoryForNavigation = page; | |
919 /* new test for 3button design */ | |
920 //menu.lineMemoryForNavigationForPage[page] = line; | |
921 menu.lineMemoryForNavigationForPage[page] = 0; | |
922 menu.modeFlipPages = 1; | |
923 | |
924 set_globalState_Menu_Page(page); | |
925 | |
926 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 1)); | |
927 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 1)); | |
928 | |
929 GFX_SetFrameTop(menu.StartAddressForPage[page]); | |
930 /* new test for 3button design */ | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
931 //GFX_SetFrameBottom((.FBStartAdress) + 65*2*(line - 1), 0, 25, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
932 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
933 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
934 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
935 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
936 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
937 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
938 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 65, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
939 } |
38 | 940 } |
941 | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
942 void selectPage(uint32_t selection) |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
943 { |
650 | 944 uint8_t page; |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
945 SStateList idList; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
946 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
947 SSettings* pSettings; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
948 pSettings = settingsGetPointer(); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
949 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
950 // menu.pageMemoryForNavigation = selection; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
951 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
952 // findValidPosition(&page, &line); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
953 if(selection > MAXPAGES) /* selection via structure */ |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
954 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
955 get_idSpecificStateList(selection, &idList); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
956 page = idList.page; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
957 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
958 else |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
959 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
960 page = selection; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
961 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
962 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
963 if(menu.shadowPage[page]) /* backup base page in case a shadow was selected */ |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
964 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
965 menu.activeShadow = menu.pageMemoryForNavigation; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
966 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
967 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
968 menu.pageMemoryForNavigation = page; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
969 /* new test for 3button design */ |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
970 //menu.lineMemoryForNavigationForPage[page] = line; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
971 menu.lineMemoryForNavigationForPage[page] = 0; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
972 menu.modeFlipPages = 1; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
973 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
974 set_globalState_Menu_Page(page); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
975 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
976 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 1)); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
977 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 1)); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
978 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
979 GFX_SetFrameTop(menu.StartAddressForPage[page]); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
980 /* new test for 3button design */ |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
981 //GFX_SetFrameBottom((.FBStartAdress) + 65*2*(line - 1), 0, 25, 800, 390); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
982 if(!pSettings->FlipDisplay) |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
983 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
984 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
985 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
986 else |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
987 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
988 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 65, 800, 390); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
989 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
990 nextLine(); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
991 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
992 |
38 | 993 |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
994 static void nextLine(void) |
38 | 995 { |
996 uint8_t page, line; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
997 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
998 pSettings = settingsGetPointer(); |
38 | 999 |
1000 page = menu.pageMemoryForNavigation; | |
1001 menu.lineMemoryForNavigationForPage[page] += 1; | |
1002 | |
1003 findValidPosition(&page, &line); | |
1004 menu.lineMemoryForNavigationForPage[page] = line; | |
1005 | |
1006 /* new test for 3button design */ | |
1007 menu.modeFlipPages = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1008 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1009 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1010 GFX_SetFrameBottom((tMdesignCursor.FBStartAdress) + 65*2*(line - 1), 0, 25, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1011 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1012 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1013 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1014 GFX_SetFrameBottom((tMdesignCursor.FBStartAdress)+ (390 - 65 *(line)) *2, 0, 480-390-KEY_LABEL_HIGH, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1015 } |
38 | 1016 } |
1017 | |
1018 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1019 static void stepBackMenu(void) |
38 | 1020 { |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1021 if(menu.activeShadow) /* restore base page */ |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1022 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1023 selectPage(menu.activeShadow); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1024 menu.activeShadow = 0; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1025 } |
38 | 1026 if(menu.modeFlipPages == 0) |
1027 { | |
1028 menu.lineMemoryForNavigationForPage[menu.pageMemoryForNavigation] = 0; | |
1029 menu.modeFlipPages = 1; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1030 if(!settingsGetPointer()->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1031 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1032 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1033 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1034 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1035 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1036 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 480-390-KEY_LABEL_HIGH, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1037 } |
38 | 1038 } |
1039 else | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1040 { |
38 | 1041 exitMenu(); |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1042 } |
38 | 1043 } |
1044 | |
1045 | |
1046 void exitMenu(void) | |
1047 { | |
1048 set_globalState_tHome(); | |
1049 } | |
1050 | |
1051 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1052 static void stepForwardMenu(void) |
38 | 1053 { |
1054 if(menu.modeFlipPages == 1) | |
1055 { | |
1056 nextLine(); | |
1057 } | |
1058 else | |
1059 gotoMenuEdit(); | |
1060 } | |
1061 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1062 static void gotoMenuEdit(void) |
38 | 1063 { |
1064 uint8_t line; | |
1065 | |
1066 line = menu.lineMemoryForNavigationForPage[menu.pageMemoryForNavigation]; | |
1067 | |
1068 switch(get_globalState()) | |
1069 { | |
1070 case StMOG: | |
1071 openEdit_GasOC(line); | |
1072 break; | |
1073 case StMCG: | |
1074 openEdit_GasCC(line); | |
1075 break; | |
1076 case StMSP: | |
1077 openEdit_Setpoint(line); | |
1078 break; | |
1079 case StMXTRA: | |
1080 openEdit_Xtra(line); | |
1081 break; | |
1082 case StMDECO: | |
1083 openEdit_Deco(line); | |
1084 break; | |
1085 case StMDECOP: | |
1086 openEdit_DecoParameter(line); | |
1087 break; | |
1088 case StMPLAN: | |
1089 openEdit_Planner(line); | |
1090 break; | |
1091 case StMHARD: | |
1092 openEdit_Hardware(line); | |
1093 break; | |
1094 case StMSYS: | |
1095 openEdit_System(line); | |
1096 break; | |
507 | 1097 case StMCustom: |
1098 openEdit_Custom(line); | |
1099 break; | |
38 | 1100 default: |
1101 break; | |
1102 } | |
1103 } | |
1104 | |
1105 | |
1106 void sendActionToMenu(uint8_t sendAction) | |
1107 { | |
1108 switch(sendAction) | |
1109 { | |
1110 case ACTION_BUTTON_ENTER: | |
1111 stepForwardMenu(); | |
1112 break; | |
1113 case ACTION_BUTTON_NEXT: | |
1114 if(menu.modeFlipPages) | |
1115 nextPage(); | |
1116 else | |
1117 nextLine(); | |
1118 break; | |
1119 case ACTION_TIMEOUT: | |
1120 case ACTION_MODE_CHANGE: | |
1121 case ACTION_BUTTON_BACK: | |
1122 /* new test for 3button design */ | |
1123 stepBackMenu(); | |
1124 break; | |
1125 default: | |
1126 break; | |
1127 case ACTION_IDLE_TICK: | |
1128 case ACTION_IDLE_SECOND: | |
1129 break; | |
1130 } | |
1131 /* tMC_OC_Gas(StMOG1, pSettings); */ | |
1132 } | |
1133 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1134 static void tMenu_write(uint8_t page, char *text, char *subtext) |
38 | 1135 { |
1136 if(page > MAXPAGES) | |
1137 return; | |
1138 if(menu.linesAvailableForPage[page] == 0) | |
1139 return; | |
1140 | |
1141 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; | |
1142 GFX_write_string(&FontT48, &tMwindow, text,1); | |
1143 if((*subtext) && (menu.linesAvailableForPage[page] < 6)) | |
1144 { | |
1145 GFX_write_string(&FontT42, &tMwindow, subtext, (menu.linesAvailableForPage[page] + 1)); | |
1146 } | |
1147 } | |
1148 | |
1149 | |
1150 /* Private functions ---------------------------------------------------------*/ | |
1151 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1152 static void draw_tMdesignSubUnselected(uint32_t *ppDestination) |
38 | 1153 { |
1154 union al88_u | |
1155 { | |
1156 uint8_t al8[2]; | |
1157 uint16_t al88; | |
1158 }; | |
1159 | |
130
b7689d9e888a
Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents:
122
diff
changeset
|
1160 uint16_t* prunning = (uint16_t*)*ppDestination; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1161 |
38 | 1162 union al88_u color_seperator; |
1163 union al88_u color_unselected; | |
1164 int i; | |
1165 | |
1166 color_seperator.al8[0] = CLUT_MenuLineUnselectedSeperator; | |
1167 color_unselected.al8[0] = CLUT_MenuLineUnselected; | |
1168 | |
1169 color_seperator.al8[1] = 0xFF; | |
1170 color_unselected.al8[1] = 0xFF; | |
1171 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1172 *(__IO uint16_t*)prunning++ = color_seperator.al88; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1173 *(__IO uint16_t*)prunning++ = color_seperator.al88; |
38 | 1174 |
1175 for(i = 61; i > 0; i--) | |
1176 { | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1177 *(__IO uint16_t*)prunning++ = color_unselected.al88; |
38 | 1178 } |
1179 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1180 *(__IO uint16_t*)prunning++ = color_seperator.al88; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1181 *(__IO uint16_t*)prunning++ = color_seperator.al88; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1182 |
130
b7689d9e888a
Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents:
122
diff
changeset
|
1183 *ppDestination = (uint32_t)prunning; |
38 | 1184 } |
1185 | |
1186 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1187 static void draw_tMdesignSubSelected(uint32_t *ppDestination) |
38 | 1188 { |
1189 union al88_u | |
1190 { | |
1191 uint8_t al8[2]; | |
1192 uint16_t al88; | |
1193 }; | |
1194 | |
1195 union al88_u color_selected; | |
1196 union al88_u color_seperator; | |
1197 int i; | |
1198 | |
1199 color_selected.al8[0] = CLUT_MenuLineSelected; | |
1200 color_selected.al8[1] = 0xFF; | |
1201 | |
1202 color_seperator.al8[0] = CLUT_MenuLineSelectedSeperator; | |
1203 color_seperator.al8[1] = 0xFF; | |
1204 | |
1205 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
1206 *ppDestination += 2; | |
1207 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
1208 *ppDestination += 2; | |
1209 | |
1210 for(i = 61; i > 0; i--) | |
1211 { | |
1212 *(__IO uint16_t*)*ppDestination = color_selected.al88; | |
1213 *ppDestination += 2; | |
1214 } | |
1215 | |
1216 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
1217 *ppDestination += 2; | |
1218 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
1219 *ppDestination += 2; | |
1220 } | |
1221 | |
1222 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1223 static void draw_tMdesignSubSelectedBorder(uint32_t *ppDestination) |
38 | 1224 { |
1225 union al88_u | |
1226 { | |
1227 uint8_t al8[2]; | |
1228 uint16_t al88; | |
1229 }; | |
1230 | |
1231 union al88_u color_selected_sides; | |
1232 | |
1233 int i; | |
1234 | |
1235 color_selected_sides.al8[0] = CLUT_MenuLineSelectedSides; | |
1236 color_selected_sides.al8[1] = 0xFF; | |
1237 | |
1238 for(i = 65; i > 0; i--) | |
1239 { | |
1240 *(__IO uint16_t*)*ppDestination = color_selected_sides.al88; | |
1241 *ppDestination += 2; | |
1242 } | |
1243 } | |
1244 | |
1245 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1246 static void draw_tMcursorDesign(void) |
38 | 1247 { |
1248 int i,j; | |
1249 uint32_t pDestination; | |
1250 | |
1251 pDestination = tMdesignCursor.FBStartAdress; | |
1252 | |
1253 for(j = 801; j > 0; j--) | |
1254 { | |
1255 for(i = 5; i > 0; i--) | |
1256 { | |
1257 draw_tMdesignSubUnselected(&pDestination); | |
1258 } | |
1259 if((j > 787) || (j < 17)) | |
1260 draw_tMdesignSubSelectedBorder(&pDestination); | |
1261 else | |
1262 draw_tMdesignSubSelected(&pDestination); | |
1263 } | |
1264 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1265 /* Draw menu background boxes which are visible if nothing is selected */ |
38 | 1266 pDestination = tMdesignSolo.FBStartAdress; |
1267 | |
1268 for(j = 801; j > 0; j--) | |
1269 { | |
1270 for(i = 6; i > 0; i--) | |
1271 { | |
1272 draw_tMdesignSubUnselected(&pDestination); | |
1273 } | |
1274 } | |
1275 } | |
1276 | |
1277 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1278 static void draw_tMheader(uint8_t page) |
38 | 1279 { |
1280 union al88_u | |
1281 { | |
1282 uint8_t al8[2]; | |
1283 uint16_t al88; | |
1284 }; | |
1285 union al88_u color_top; | |
1286 int i,j, k, k4text; | |
1287 uint32_t pBackup; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1288 uint16_t* pDestination; |
38 | 1289 uint8_t colorText; |
1290 uint16_t positionText; | |
1291 uint8_t pageText; | |
1292 | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1293 char text8max[MAXPAGES+1][8] = |
38 | 1294 { "", |
1295 "OC", | |
1296 "CC", | |
1297 "SP", | |
1298 "DATA", | |
1299 "DECO", | |
1300 "", | |
1301 "SYS", | |
1302 "", | |
507 | 1303 "", |
1304 "SIM" | |
38 | 1305 }; |
1306 | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1307 _Bool spacing[MAXPAGES+1] = |
38 | 1308 { 0, |
1309 0, // behind OC | |
1310 0, // behind CC | |
1311 1, // behind SP | |
1312 1, // behind DATA | |
1313 0, // behind DECO1 | |
1314 1, // behind DECO2 | |
1315 0, // behind SYS1 | |
507 | 1316 0, // behind SYS2 |
1317 1, // behind SYS3 | |
38 | 1318 1, // behind SIM |
1319 0 | |
1320 }; | |
1321 | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1322 if(actual_menu_content == MENU_SURFACE) |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1323 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1324 spacing[3] = 0; /* Display extra menu directly after setpoint */ |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1325 sprintf(text8max[4],"OP"); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1326 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1327 |
38 | 1328 pBackup = tMscreen.FBStartAdress; |
1329 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; | |
130
b7689d9e888a
Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents:
122
diff
changeset
|
1330 pDestination = (uint16_t*) menu.StartAddressForPage[page]; |
38 | 1331 positionText = 10; |
1332 pageText = page; | |
1333 | |
1334 gfx_write_page_number(&tMscreen ,menu.pageCountNumber[page],menu.pageCountTotal,0); | |
1335 | |
1336 while((text8max[pageText][0] == 0) && (pageText > 1)) | |
1337 { | |
1338 pageText--; | |
1339 } | |
1340 | |
1341 for(k = 1; k <= MAXPAGES; k++) | |
1342 { | |
1343 if(menu.pageCountNumber[k] != 0) | |
1344 { | |
1345 k4text = k; // new hw 170522 | |
1346 if((text8max[k][0] == 0) && (menu.pageCountNumber[k-1] == 0)) | |
1347 k4text = k-1; | |
1348 | |
1349 color_top.al8[0] = CLUT_MenuPageGasOC + k - 1; | |
169
842f57bbaaad
Bugfix: highlight the menu underline correctly on selected state
Jan Mulder <jlmulder@xs4all.nl>
parents:
167
diff
changeset
|
1350 if (k == page) |
38 | 1351 { |
1352 color_top.al8[1] = 0xFF; | |
1353 } | |
1354 else | |
1355 { | |
1356 color_top.al8[1] = 0x50; | |
1357 } | |
1358 | |
1359 if(k4text == pageText) | |
1360 { | |
1361 colorText = CLUT_Font020; | |
1362 } | |
1363 else | |
1364 { | |
1365 colorText = CLUT_Font021; | |
1366 } | |
1367 | |
1368 write_content_simple(&tMscreen,positionText,775,0,&FontT42,text8max[k4text],colorText); | |
1369 /* | |
1370 write_content_simple(&tMscreen,positionText,775,0,&FontT42,text8max[k],colorText); | |
1371 if((text8max[k][0] == 0) && (menu.pageCountNumber[k-1] == 0)) | |
1372 write_content_simple(&tMscreen,positionText,775,0,&FontT42,text8max[k-1],colorText); | |
1373 */ | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1374 /* Draw color bars */ |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1375 if(!settingsGetPointer()->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1376 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1377 pDestination += 5 * 480; |
38 | 1378 |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1379 for(j = 60; j > 0; j--) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1380 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1381 pDestination += (390 + 26); |
38 | 1382 |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1383 for(i = 16; i > 0; i--) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1384 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1385 *(__IO uint16_t*)pDestination++ = color_top.al88; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1386 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1387 pDestination += 48; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1388 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1389 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1390 pDestination += 5 * 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1391 positionText += 70; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1392 |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1393 if(((k == 4) && (actual_menu_content != MENU_SURFACE)) || ((k == 6) && (menu.pageCountNumber[5] == 0))) |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1394 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1395 pDestination += 70 * 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1396 positionText += 70; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1397 } |
38 | 1398 |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1399 if(spacing[k]) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1400 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1401 pDestination += 35 * 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1402 positionText += 35; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1403 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1404 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1405 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1406 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1407 pDestination += (800 - 5)* 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1408 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1409 for(j = 60; j > 0; j--) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1410 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1411 pDestination -= (390 + 26); |
38 | 1412 |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1413 for(i = 16; i > 0; i--) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1414 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1415 *(__IO uint16_t*)pDestination-- = color_top.al88; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1416 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1417 pDestination -= 48; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1418 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1419 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1420 pDestination -= (800) * 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1421 positionText += 70; |
38 | 1422 |
658
4df22790dc0c
Bugfix handling of new menu tab in flipped mode:
Ideenmodellierer
parents:
650
diff
changeset
|
1423 if(((k == 4) && (actual_menu_content != MENU_SURFACE)) || ((k == 6) && (menu.pageCountNumber[5] == 0))) |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1424 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1425 pDestination -= 70 * 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1426 positionText += 70; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1427 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1428 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1429 if(spacing[k]) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1430 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1431 pDestination -= 35 * 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1432 positionText += 35; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1433 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1434 } |
38 | 1435 } |
1436 } | |
1437 tMscreen.FBStartAdress = pBackup; | |
1438 } | |
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:
662
diff
changeset
|
1439 |
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:
662
diff
changeset
|
1440 |
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:
662
diff
changeset
|
1441 char *makeGrey(bool isGrey) |
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:
662
diff
changeset
|
1442 { |
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:
662
diff
changeset
|
1443 return isGrey ? "\031" : ""; |
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:
662
diff
changeset
|
1444 } |