Mercurial > public > ostc4
annotate Discovery/Src/tMenu.c @ 815:ce8f71217f45
Bugfix CustomView selection during dive mode:
The CustomView selection during dive mode was limited to two pages, while meanwhile three are needed to show all options. The problem did not showup in surface mode selection. Rootcause was a static definition instead of the dynamic one used in surface mode. In addition with every page shift a new page was created which might cause display errors after some times. To solve this the pages are now updated instead of rebuilding the pages.
author | Ideenmodellierer |
---|---|
date | Sun, 03 Sep 2023 18:03:49 +0200 |
parents | 4c41d9a18c7f |
children | c4ee952b9425 |
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 |
815
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
255 void resetLineMask(uint32_t lineId) |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
256 { |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
257 SStateList idList; |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
258 get_idSpecificStateList(lineId, &idList); |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
259 if(idList.page < MAXPAGES) |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
260 { |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
261 menu.disableLineMask[idList.page] = 0; |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
262 } |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
263 } |
811
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
264 void enableLine(uint32_t lineId) |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
265 { |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
266 SStateList idList; |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
267 |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
268 get_idSpecificStateList(lineId, &idList); |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
269 |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
270 if((idList.page < MAXPAGES) && (idList.line < MAXLINES)) |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
271 { |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
272 menu.disableLineMask[idList.page] &= ~(1 << idList.line); |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
273 } |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
274 } |
38 | 275 |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
276 static void clean_line_actual_page(void) |
38 | 277 { |
278 uint8_t line, page; | |
279 | |
280 page = menu.pageMemoryForNavigation; | |
281 line = menu.lineMemoryForNavigationForPage[page]; | |
122
871baf20776b
Take care for display orientation if deleting lines
Ideenmodellierer
parents:
110
diff
changeset
|
282 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
|
283 { |
871baf20776b
Take care for display orientation if deleting lines
Ideenmodellierer
parents:
110
diff
changeset
|
284 line = 6 - line + 1; |
871baf20776b
Take care for display orientation if deleting lines
Ideenmodellierer
parents:
110
diff
changeset
|
285 } |
38 | 286 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; |
287 GFX_clean_line(&tMwindow, line); | |
288 } | |
289 | |
290 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
291 static void update_content_actual_page(char *text, uint16_t tab, char *subtext) |
38 | 292 { |
293 uint8_t page; | |
294 | |
295 page = menu.pageMemoryForNavigation; | |
296 | |
297 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; | |
298 if(tab == 0) | |
299 tMwindow.WindowTab = 400; | |
300 else | |
301 tMwindow.WindowTab = tab; | |
302 | |
303 tMenu_write(page, text, subtext); | |
304 } | |
305 | |
306 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
307 static void update_content_with_new_frame(uint8_t page, char *text, uint16_t tab, char *subtext) |
38 | 308 { |
309 char localtext[32]; | |
310 | |
311 uint32_t rememberPage = menu.StartAddressForPage[page]; | |
312 menu.StartAddressForPage[page] = getFrame(5); | |
313 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; | |
314 | |
315 if(tab == 0) | |
316 tMwindow.WindowTab = 400; | |
317 else | |
318 tMwindow.WindowTab = tab; | |
319 | |
320 draw_tMheader(page); | |
321 tMenu_write(page, text, subtext); | |
322 | |
323 localtext[0] = TXT_2BYTE; | |
324 localtext[1] = TXT2BYTE_ButtonBack; | |
325 localtext[2] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
326 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen); |
38 | 327 |
328 localtext[0] = '\001'; | |
329 localtext[1] = TXT_2BYTE; | |
330 localtext[2] = TXT2BYTE_ButtonEnter; | |
331 localtext[3] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
332 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen); |
38 | 333 |
334 localtext[0] = '\002'; | |
335 localtext[1] = TXT_2BYTE; | |
336 localtext[2] = TXT2BYTE_ButtonNext; | |
337 localtext[3] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
338 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen); |
38 | 339 |
340 // gfx_write_page_number(&tMscreen ,menu.pageCountNumber[page],menu.pageCountTotal,0); | |
341 | |
342 if(page == menu.pageMemoryForNavigation) | |
343 GFX_SetFrameTop(tMscreen.FBStartAdress); | |
344 releaseFrame(5,rememberPage); | |
345 } | |
346 | |
347 | |
169
842f57bbaaad
Bugfix: highlight the menu underline correctly on selected state
Jan Mulder <jlmulder@xs4all.nl>
parents:
167
diff
changeset
|
348 static void tM_create_pagenumbering(void) |
38 | 349 { |
350 menu.pageCountTotal = 0; | |
351 | |
352 for(int i=0;i<=MAXPAGES;i++) | |
353 { | |
354 if(menu.pageCountNumber[i]) | |
355 { | |
356 menu.pageCountTotal++; | |
357 menu.pageCountNumber[i] = menu.pageCountTotal; | |
358 } | |
359 } | |
360 } | |
361 | |
362 | |
379 | 363 void tM_build_page(uint32_t id, char *text, uint16_t tab, char *subtext) |
38 | 364 { |
365 uint8_t linesFound; | |
366 uint16_t i; | |
367 SStateList idList; | |
368 uint8_t page; | |
369 | |
370 char localtext[32]; | |
371 | |
372 if(menu.pagesAvailable > MAXPAGES) | |
373 return; | |
374 | |
375 get_idSpecificStateList(id, &idList); | |
376 | |
377 if(idList.base != BaseMenu) | |
378 return; | |
379 | |
380 if(idList.page == 0) | |
381 return; | |
382 | |
383 if(idList.page > MAXPAGES) | |
384 return; | |
385 | |
386 page = idList.page; | |
387 | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
388 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
|
389 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
390 return; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
391 } |
38 | 392 |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
393 if(menu.pagesAvailable == 0) |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
394 tM_create_pagenumbering(); |
38 | 395 |
396 if(*text == 0) | |
397 return; | |
398 | |
399 linesFound = 1; | |
400 | |
401 if(menu.StartAddressForPage[page]) | |
402 releaseFrame(5,menu.StartAddressForPage[page]); | |
403 | |
404 menu.StartAddressForPage[page] = getFrame(5); | |
405 | |
406 if(menu.StartAddressForPage[page] == 0) | |
407 return; | |
408 | |
409 i = 0; | |
410 while((i < MAX_PAGE_TEXTSIZE) && text[i]) | |
411 { | |
412 if((text[i] == '\n') && ((i + 2) < MAX_PAGE_TEXTSIZE) && text[i+1] && text[i+2]) | |
413 linesFound += 1; | |
414 i++; | |
415 } | |
416 | |
417 menu.linesAvailableForPage[page] = linesFound; | |
418 menu.pagesAvailable++; /* even if it was used before */ | |
419 | |
420 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; | |
421 if(tab == 0) | |
422 tMwindow.WindowTab = 400; | |
423 else | |
424 tMwindow.WindowTab = tab; | |
425 | |
426 draw_tMheader(page); | |
427 | |
428 tMenu_write(page, text, subtext); | |
429 | |
430 localtext[0] = TXT_2BYTE; | |
431 localtext[1] = TXT2BYTE_ButtonBack; | |
432 localtext[2] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
433 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen); |
38 | 434 |
435 localtext[0] = '\001'; | |
436 localtext[1] = TXT_2BYTE; | |
437 localtext[2] = TXT2BYTE_ButtonEnter; | |
438 localtext[3] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
439 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen); |
38 | 440 |
441 localtext[0] = '\002'; | |
442 localtext[1] = TXT_2BYTE; | |
443 localtext[2] = TXT2BYTE_ButtonNext; | |
444 localtext[3] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
445 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen); |
38 | 446 } |
447 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
448 static void findValidPosition(uint8_t *pageOuput, uint8_t *lineOutput) |
38 | 449 { |
51
8f8ea3a32e82
Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents:
38
diff
changeset
|
450 uint8_t page = 0; |
8f8ea3a32e82
Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents:
38
diff
changeset
|
451 uint8_t line = 0; |
8f8ea3a32e82
Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents:
38
diff
changeset
|
452 uint8_t first = 0; |
38 | 453 |
454 *pageOuput = 0; | |
455 *lineOutput = 0; | |
456 | |
457 /* test */ | |
458 if(menu.pagesAvailable == 0) | |
459 return; | |
460 | |
461 for(int i=1;i<=MAXPAGES;i++) | |
462 { | |
463 if((menu.pageCountNumber[i] != 0) | |
464 && (menu.linesAvailableForPage[i] != 0) | |
465 && (menu.StartAddressForPage[i] != 0)) | |
466 { | |
467 first = i; | |
468 break; | |
469 } | |
470 } | |
471 | |
472 /* select */ | |
473 if(menu.pageMemoryForNavigation > MAXPAGES) | |
474 menu.pageMemoryForNavigation = first; | |
475 | |
476 page = menu.pageMemoryForNavigation; | |
477 | |
478 if(page == 0) | |
479 page = first; | |
480 | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
481 while((page <= MAXPAGES) && ((menu.linesAvailableForPage[page] == 0) || (menu.StartAddressForPage[page] == 0) || ((menu.pageCountNumber[page] == 0) && !((menu.shadowPage[page]) && (menu.pageMemoryForNavigation == page))))) |
38 | 482 page += 1; |
483 | |
484 if(page > MAXPAGES) | |
485 page = first; | |
486 | |
487 line = menu.lineMemoryForNavigationForPage[page]; | |
488 | |
489 if(line == 0) | |
490 line = 1; | |
491 | |
815
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
492 while(menu.disableLineMask[page] & ( 1 << line)) |
811
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
493 { |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
494 line++; |
815
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
495 if(line > menu.linesAvailableForPage[page]) |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
496 { |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
497 line = 1; |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
498 } |
811
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
499 } |
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
788
diff
changeset
|
500 |
38 | 501 if(line > menu.linesAvailableForPage[page]) |
502 line = 1; | |
503 | |
504 *pageOuput = page; | |
505 *lineOutput = line; | |
506 } | |
507 | |
508 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
509 static void tM_add(uint32_t id) |
38 | 510 { |
511 SStateList idList; | |
512 uint8_t page; | |
513 | |
514 get_idSpecificStateList(id, &idList); | |
515 | |
516 page = idList.page; | |
517 | |
518 if(page > MAXPAGES) | |
519 return; | |
520 | |
521 menu.pageCountNumber[page] = 1; | |
522 } | |
523 | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
524 static void tM_addShadow(uint32_t id) |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
525 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
526 SStateList idList; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
527 uint8_t page; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
528 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
529 get_idSpecificStateList(id, &idList); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
530 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
531 page = idList.page; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
532 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
533 if(page > MAXPAGES) |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
534 return; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
535 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
536 menu.shadowPage[page] = 1; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
537 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
538 |
38 | 539 |
540 void tM_build_pages(void) | |
541 { | |
542 char text[MAX_PAGE_TEXTSIZE]; | |
543 char subtext[MAX_PAGE_TEXTSIZE]; | |
544 uint32_t id; | |
545 uint16_t tabPosition; | |
546 SSettings *pSettings = settingsGetPointer(); | |
547 | |
548 menu.pagesAvailable = 0; | |
549 for(int i=0;i<=MAXPAGES;i++) | |
550 menu.pageCountNumber[i] = 0; | |
551 | |
552 tabPosition = 400; | |
553 *text = 0; | |
554 *subtext = 0; | |
555 | |
556 /* 2015 Feb 02, hw | |
557 * max 8 Menu Pages | |
558 */ | |
559 | |
560 | |
561 tM_add(StMSYS); //now in both modes | |
562 if(actual_menu_content == MENU_SURFACE) | |
563 { | |
564 tM_add(StMDECO); | |
565 tM_add(StMHARD); | |
507 | 566 tM_add(StMCustom); |
38 | 567 // tM_add(StMSYS); now in both modes |
568 } | |
569 else | |
570 { | |
571 tM_add(StMXTRA); | |
572 } | |
573 if(actual_menu_content == MENU_SURFACE) | |
574 { | |
575 tM_add(StMPLAN); | |
576 } | |
577 // if((pSettings->dive_mode != DIVEMODE_Gauge) && (pSettings->dive_mode != DIVEMODE_Apnea)) | |
578 // { | |
579 tM_add(StMDECOP); | |
580 // } | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
581 |
662 | 582 if((isLoopMode(pSettings->dive_mode)) || (stateUsed->diveSettings.ccrOption == 1)) |
38 | 583 { |
584 tM_add(StMCG); | |
585 tM_add(StMSP); | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
586 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
|
587 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
588 tM_add(StMXTRA); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
589 tM_addShadow(StMOG); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
590 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
591 else |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
592 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
593 tM_add(StMOG); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
594 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
595 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
596 else |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
597 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
598 tM_add(StMOG); |
38 | 599 } |
600 | |
601 id = tMOG_refresh(0, text, &tabPosition, subtext); | |
602 tM_build_page(id, text, tabPosition, subtext); | |
603 | |
604 id = tMCG_refresh(0, text, &tabPosition, subtext); | |
605 tM_build_page(id, text, tabPosition, subtext); | |
606 | |
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
|
607 id = tMSP_refresh(text, &tabPosition, subtext); |
38 | 608 tM_build_page(id, text, tabPosition, subtext); |
609 | |
610 id = tMXtra_refresh(0, text, &tabPosition, subtext); | |
611 tM_build_page(id, text, tabPosition, subtext); | |
612 | |
613 id = tMPlanner_refresh(0, text, &tabPosition, subtext); | |
614 tM_build_page(id, text, tabPosition, subtext); | |
615 | |
616 id = tMDeco_refresh(0, text, &tabPosition, subtext); | |
617 tM_build_page(id, text, tabPosition, subtext); | |
618 | |
619 id = tMDecoParameters_refresh(0, text, &tabPosition, subtext); | |
620 tM_build_page(id, text, tabPosition, subtext); | |
621 | |
622 id = tMPlanner_refresh(0, text, &tabPosition, subtext); | |
623 tM_build_page(id, text, tabPosition, subtext); | |
624 | |
625 id = tMHardware_refresh(0, text, &tabPosition, subtext); | |
626 tM_build_page(id, text, tabPosition, subtext); | |
627 | |
628 id = tMSystem_refresh(0, text, &tabPosition, subtext); | |
629 tM_build_page(id, text, tabPosition, subtext); | |
507 | 630 |
631 id = tMCustom_refresh(0, text, &tabPosition, subtext); | |
632 tM_build_page(id, text, tabPosition, subtext); | |
38 | 633 } |
634 | |
635 | |
636 void tM_refresh_live_content(void) | |
637 { | |
662 | 638 static uint8_t slowUpdate = SLOW_UPDATE_CNT; |
51
8f8ea3a32e82
Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents:
38
diff
changeset
|
639 uint8_t page = 0; |
38 | 640 char text[MAX_PAGE_TEXTSIZE]; |
641 char subtext[MAX_PAGE_TEXTSIZE]; | |
642 uint16_t tabPosition; | |
643 | |
662 | 644 uint32_t globalState = get_globalState(); |
645 | |
646 slowUpdate--; | |
647 page = menu.pageMemoryForNavigation; | |
648 switch(globalState) | |
38 | 649 { |
662 | 650 case StMSYS: if(actual_menu_content == MENU_SURFACE) |
651 { | |
652 tMSystem_refresh(0, text, &tabPosition, subtext); | |
653 update_content_with_new_frame(page, text, tabPosition, subtext); | |
654 } | |
655 break; | |
656 case StMHARD: tMHardware_refresh(0, text, &tabPosition, subtext); | |
657 update_content_with_new_frame(page, text, tabPosition, subtext); | |
658 break; | |
659 case StMOG: if((actual_menu_content != MENU_SURFACE) && (slowUpdate == 0)) | |
660 { | |
661 tMOG_refresh(0, text, &tabPosition, subtext); | |
662 update_content_with_new_frame(page, text, tabPosition, subtext); | |
663 } | |
664 break; | |
665 case StMCG: if((actual_menu_content != MENU_SURFACE) && (slowUpdate == 0)) | |
666 { | |
667 tMCG_refresh(0, text, &tabPosition, subtext); | |
668 update_content_with_new_frame(page, text, tabPosition, subtext); | |
669 } | |
670 break; | |
671 default: | |
672 break; | |
38 | 673 } |
662 | 674 if(slowUpdate == 0) |
38 | 675 { |
662 | 676 slowUpdate = SLOW_UPDATE_CNT; |
38 | 677 } |
678 | |
679 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; | |
680 tHome_show_lost_connection_count(&tMscreen); | |
681 /* | |
682 SStateList idList; | |
683 if(actual_menu_content == MENU_SURFACE) | |
684 { | |
685 page = menu.pageMemoryForNavigation; | |
686 get_idSpecificStateList(StMSYS, &idList); | |
687 if(page == idList.page) | |
688 { | |
689 tMSystem_refresh(0, text, &tabPosition, subtext); | |
690 update_content_with_new_frame(page, text, tabPosition, subtext); | |
691 } | |
692 } | |
693 */ | |
694 } | |
695 | |
696 | |
697 /* new frame only! */ | |
698 void updateSpecificMenu(uint32_t id) | |
699 { | |
700 uint8_t page; | |
701 SStateList idList; | |
702 | |
703 char text[MAX_PAGE_TEXTSIZE]; | |
704 char subtext[MAX_PAGE_TEXTSIZE]; | |
705 uint16_t tabPosition; | |
706 | |
707 *subtext = 0; | |
708 *text = 0; | |
709 tabPosition = 400; | |
710 | |
711 get_idSpecificStateList(id, &idList); | |
712 page = idList.page; | |
713 | |
714 switch(id) | |
715 { | |
716 case StMOG: | |
717 tMOG_refresh(0, text, &tabPosition, subtext); | |
718 update_content_with_new_frame(page, text, tabPosition, subtext); | |
719 break; | |
720 case StMCG: | |
721 tMCG_refresh(0, text, &tabPosition, subtext); | |
722 update_content_with_new_frame(page, text, tabPosition, subtext); | |
723 break; | |
724 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
|
725 tMSP_refresh(text, &tabPosition, subtext); |
38 | 726 update_content_with_new_frame(page, text, tabPosition, subtext); |
727 break; | |
815
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
728 case StMSYS: |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
729 tMSystem_refresh(0, text, &tabPosition, NULL); |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
730 update_content_with_new_frame(page, text, tabPosition, subtext); |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
731 break; |
ce8f71217f45
Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents:
811
diff
changeset
|
732 |
38 | 733 default: |
734 break; | |
735 } | |
736 } | |
737 | |
738 | |
739 void updateMenu(void) | |
740 { | |
741 uint8_t page, line; | |
742 | |
743 char text[MAX_PAGE_TEXTSIZE]; | |
744 char subtext[MAX_PAGE_TEXTSIZE]; | |
745 uint16_t tabPosition; | |
746 | |
747 *subtext = 0; | |
748 *text = 0; | |
749 tabPosition = 400; | |
750 | |
751 page = menu.pageMemoryForNavigation; | |
752 line = menu.lineMemoryForNavigationForPage[page]; | |
753 | |
754 switch(get_globalState()) | |
755 { | |
756 case StMOG: | |
757 tMOG_refresh(0, text, &tabPosition, subtext); | |
758 update_content_with_new_frame(page, text, tabPosition, subtext); | |
759 break; | |
760 case StMCG: | |
761 tMCG_refresh(0, text, &tabPosition, subtext); | |
762 update_content_with_new_frame(page, text, tabPosition, subtext); | |
763 break; | |
764 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
|
765 tMSP_refresh(text, &tabPosition, subtext); |
38 | 766 update_content_with_new_frame(page, text, tabPosition, subtext); |
767 break; | |
768 case StMXTRA: | |
769 tMXtra_refresh(0, text, &tabPosition, subtext); | |
770 update_content_with_new_frame(page, text, tabPosition, subtext); | |
771 break; | |
772 case StMDECO: | |
773 if((line == 1) || (line == 3)) // dive mode or ppO2 limits (the later for correct MOD in gaslists) | |
774 { | |
775 tM_rebuild_pages(); | |
776 menu.lineMemoryForNavigationForPage[page] = line; // fix 160623 | |
777 GFX_SetFrameTop(menu.StartAddressForPage[page]); | |
778 } | |
779 else | |
780 { | |
781 tMDeco_refresh(line, text, &tabPosition, subtext); | |
782 clean_line_actual_page(); | |
783 update_content_actual_page(text, tabPosition, subtext); | |
784 } | |
785 break; | |
786 case StMDECOP: | |
787 tMDecoParameters_refresh(line, text, &tabPosition, subtext); | |
788 clean_line_actual_page(); | |
789 update_content_actual_page(text, tabPosition, subtext); | |
790 break; | |
791 case StMPLAN: | |
792 tMPlanner_refresh(line, text, &tabPosition, subtext); | |
793 clean_line_actual_page(); | |
794 update_content_actual_page(text, tabPosition, subtext); | |
795 break; | |
796 case StMHARD: | |
797 tMHardware_refresh(line, text, &tabPosition, subtext); | |
798 clean_line_actual_page(); | |
799 update_content_actual_page(text, tabPosition, subtext); | |
800 break; | |
801 case StMSYS: | |
802 if((line == 2) || (line == 3) || (line == 6)) | |
803 { | |
804 tM_rebuild_pages(); | |
805 menu.lineMemoryForNavigationForPage[page] = line; // fix 160623 | |
806 GFX_SetFrameTop(menu.StartAddressForPage[page]); | |
807 menu.lineMemoryForNavigationForPage[page] = line; | |
808 } | |
809 else | |
810 { | |
811 tMSystem_refresh(line, text, &tabPosition, subtext); | |
812 clean_line_actual_page(); | |
813 update_content_actual_page(text, tabPosition, subtext); | |
814 } | |
815 break; | |
507 | 816 case StMCustom: |
817 tMCustom_refresh(line, text, &tabPosition, subtext); | |
818 clean_line_actual_page(); | |
819 update_content_actual_page(text, tabPosition, subtext); | |
820 break; | |
38 | 821 default: |
822 break; | |
823 } | |
824 } | |
825 | |
826 void openMenu_first_page_with_OC_gas_update(void) | |
827 { | |
828 menu.pageMemoryForNavigation = 1; | |
829 for(int i=0;i<=MAXPAGES;i++) | |
830 menu.lineMemoryForNavigationForPage[i] = 0; | |
831 | |
832 set_globalState(StMOG); | |
833 updateMenu(); | |
834 openMenu(1); | |
835 } | |
836 | |
837 | |
838 void openMenu(uint8_t freshWithFlipPages) | |
839 { | |
840 uint8_t page, line; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
841 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
842 pSettings = settingsGetPointer(); |
38 | 843 |
844 findValidPosition(&page, &line); | |
845 if((page == 0) || (line == 0)) | |
846 return; | |
847 | |
848 menu.pageMemoryForNavigation = page; | |
849 /* new test for 3button design */ | |
850 if(freshWithFlipPages) | |
851 { | |
852 menu.lineMemoryForNavigationForPage[page] = 0; | |
853 menu.modeFlipPages = 1; | |
854 } | |
855 else | |
856 { | |
857 menu.lineMemoryForNavigationForPage[page] = line; | |
858 menu.modeFlipPages = 0; | |
859 } | |
860 | |
861 set_globalState_Menu_Page(page); | |
862 | |
863 | |
864 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 1)); | |
865 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 1)); | |
866 | |
867 | |
868 if(((page == 6) || (page == 8)) && (menu.pageCountNumber[page-1] == 0)) | |
869 { | |
870 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 2)); | |
871 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 2)); | |
872 | |
873 } | |
874 | |
875 GFX_SetFrameTop(menu.StartAddressForPage[page]); | |
876 /* new test for 3button design */ | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
877 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
878 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
879 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
880 if(freshWithFlipPages) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
881 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
882 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
883 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
|
884 } |
38 | 885 else |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
886 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
887 if(freshWithFlipPages) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
888 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
889 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
|
890 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
891 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
892 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
|
893 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
894 |
38 | 895 } |
896 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
897 static void block_diluent_handler(_Bool Unblock) |
38 | 898 { |
899 SStateList list; | |
900 static uint8_t linesAvailableForPageDiluent = 0; | |
901 get_idSpecificStateList(StMCG, &list); | |
902 | |
903 if(Unblock && linesAvailableForPageDiluent) | |
904 { | |
905 menu.linesAvailableForPage[list.page] = linesAvailableForPageDiluent; | |
906 } | |
907 else | |
908 { | |
909 linesAvailableForPageDiluent = menu.linesAvailableForPage[list.page]; | |
910 menu.linesAvailableForPage[list.page] = 0; | |
911 } | |
912 } | |
913 | |
914 void block_diluent_page(void) | |
915 { | |
916 block_diluent_handler(0); | |
917 } | |
918 | |
919 | |
920 void unblock_diluent_page(void) | |
921 { | |
922 block_diluent_handler(1); | |
923 } | |
924 | |
925 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
926 static void nextPage(void) |
38 | 927 { |
928 uint8_t page, line; | |
929 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
930 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
931 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
932 |
38 | 933 menu.pageMemoryForNavigation += 1; |
934 | |
935 findValidPosition(&page, &line); | |
936 menu.pageMemoryForNavigation = page; | |
937 /* new test for 3button design */ | |
938 //menu.lineMemoryForNavigationForPage[page] = line; | |
939 menu.lineMemoryForNavigationForPage[page] = 0; | |
940 menu.modeFlipPages = 1; | |
941 | |
942 set_globalState_Menu_Page(page); | |
943 | |
944 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 1)); | |
945 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 1)); | |
946 | |
947 GFX_SetFrameTop(menu.StartAddressForPage[page]); | |
948 /* new test for 3button design */ | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
949 //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
|
950 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
951 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
952 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
953 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
954 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
955 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
956 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 65, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
957 } |
38 | 958 } |
959 | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
960 void selectPage(uint32_t selection) |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
961 { |
650 | 962 uint8_t page; |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
963 SStateList idList; |
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 SSettings* pSettings; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
966 pSettings = settingsGetPointer(); |
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 = selection; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
969 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
970 // findValidPosition(&page, &line); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
971 if(selection > MAXPAGES) /* selection via structure */ |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
972 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
973 get_idSpecificStateList(selection, &idList); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
974 page = idList.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 else |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
977 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
978 page = selection; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
979 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
980 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
981 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
|
982 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
983 menu.activeShadow = menu.pageMemoryForNavigation; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
984 } |
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 menu.pageMemoryForNavigation = page; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
987 /* new test for 3button design */ |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
988 //menu.lineMemoryForNavigationForPage[page] = line; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
989 menu.lineMemoryForNavigationForPage[page] = 0; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
990 menu.modeFlipPages = 1; |
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 set_globalState_Menu_Page(page); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
993 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
994 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 1)); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
995 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 1)); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
996 |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
997 GFX_SetFrameTop(menu.StartAddressForPage[page]); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
998 /* new test for 3button design */ |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
999 //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
|
1000 if(!pSettings->FlipDisplay) |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1001 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1002 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1003 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1004 else |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1005 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1006 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 65, 800, 390); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1007 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1008 nextLine(); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1009 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1010 |
38 | 1011 |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1012 static void nextLine(void) |
38 | 1013 { |
1014 uint8_t page, line; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1015 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1016 pSettings = settingsGetPointer(); |
38 | 1017 |
1018 page = menu.pageMemoryForNavigation; | |
1019 menu.lineMemoryForNavigationForPage[page] += 1; | |
1020 | |
1021 findValidPosition(&page, &line); | |
1022 menu.lineMemoryForNavigationForPage[page] = line; | |
1023 | |
1024 /* new test for 3button design */ | |
1025 menu.modeFlipPages = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1026 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1027 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1028 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
|
1029 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1030 else |
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((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
|
1033 } |
38 | 1034 } |
1035 | |
1036 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1037 static void stepBackMenu(void) |
38 | 1038 { |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1039 if(menu.activeShadow) /* restore base page */ |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1040 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1041 selectPage(menu.activeShadow); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1042 menu.activeShadow = 0; |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1043 } |
38 | 1044 if(menu.modeFlipPages == 0) |
1045 { | |
1046 menu.lineMemoryForNavigationForPage[menu.pageMemoryForNavigation] = 0; | |
1047 menu.modeFlipPages = 1; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1048 if(!settingsGetPointer()->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1049 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1050 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1051 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1052 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1053 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1054 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
|
1055 } |
38 | 1056 } |
1057 else | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1058 { |
38 | 1059 exitMenu(); |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1060 } |
38 | 1061 } |
1062 | |
1063 | |
1064 void exitMenu(void) | |
1065 { | |
1066 set_globalState_tHome(); | |
1067 } | |
1068 | |
1069 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1070 static void stepForwardMenu(void) |
38 | 1071 { |
1072 if(menu.modeFlipPages == 1) | |
1073 { | |
1074 nextLine(); | |
1075 } | |
1076 else | |
1077 gotoMenuEdit(); | |
1078 } | |
1079 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1080 static void gotoMenuEdit(void) |
38 | 1081 { |
1082 uint8_t line; | |
1083 | |
1084 line = menu.lineMemoryForNavigationForPage[menu.pageMemoryForNavigation]; | |
1085 | |
1086 switch(get_globalState()) | |
1087 { | |
1088 case StMOG: | |
1089 openEdit_GasOC(line); | |
1090 break; | |
1091 case StMCG: | |
1092 openEdit_GasCC(line); | |
1093 break; | |
1094 case StMSP: | |
1095 openEdit_Setpoint(line); | |
1096 break; | |
1097 case StMXTRA: | |
1098 openEdit_Xtra(line); | |
1099 break; | |
1100 case StMDECO: | |
1101 openEdit_Deco(line); | |
1102 break; | |
1103 case StMDECOP: | |
1104 openEdit_DecoParameter(line); | |
1105 break; | |
1106 case StMPLAN: | |
1107 openEdit_Planner(line); | |
1108 break; | |
1109 case StMHARD: | |
1110 openEdit_Hardware(line); | |
1111 break; | |
1112 case StMSYS: | |
1113 openEdit_System(line); | |
1114 break; | |
507 | 1115 case StMCustom: |
1116 openEdit_Custom(line); | |
1117 break; | |
38 | 1118 default: |
1119 break; | |
1120 } | |
1121 } | |
1122 | |
1123 | |
1124 void sendActionToMenu(uint8_t sendAction) | |
1125 { | |
1126 switch(sendAction) | |
1127 { | |
1128 case ACTION_BUTTON_ENTER: | |
1129 stepForwardMenu(); | |
1130 break; | |
1131 case ACTION_BUTTON_NEXT: | |
1132 if(menu.modeFlipPages) | |
1133 nextPage(); | |
1134 else | |
1135 nextLine(); | |
1136 break; | |
1137 case ACTION_TIMEOUT: | |
1138 case ACTION_MODE_CHANGE: | |
1139 case ACTION_BUTTON_BACK: | |
1140 /* new test for 3button design */ | |
1141 stepBackMenu(); | |
1142 break; | |
1143 default: | |
1144 break; | |
1145 case ACTION_IDLE_TICK: | |
1146 case ACTION_IDLE_SECOND: | |
1147 break; | |
1148 } | |
1149 /* tMC_OC_Gas(StMOG1, pSettings); */ | |
1150 } | |
1151 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1152 static void tMenu_write(uint8_t page, char *text, char *subtext) |
38 | 1153 { |
1154 if(page > MAXPAGES) | |
1155 return; | |
1156 if(menu.linesAvailableForPage[page] == 0) | |
1157 return; | |
1158 | |
1159 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; | |
1160 GFX_write_string(&FontT48, &tMwindow, text,1); | |
1161 if((*subtext) && (menu.linesAvailableForPage[page] < 6)) | |
1162 { | |
1163 GFX_write_string(&FontT42, &tMwindow, subtext, (menu.linesAvailableForPage[page] + 1)); | |
1164 } | |
1165 } | |
1166 | |
1167 | |
1168 /* Private functions ---------------------------------------------------------*/ | |
1169 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1170 static void draw_tMdesignSubUnselected(uint32_t *ppDestination) |
38 | 1171 { |
1172 union al88_u | |
1173 { | |
1174 uint8_t al8[2]; | |
1175 uint16_t al88; | |
1176 }; | |
1177 | |
130
b7689d9e888a
Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents:
122
diff
changeset
|
1178 uint16_t* prunning = (uint16_t*)*ppDestination; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1179 |
38 | 1180 union al88_u color_seperator; |
1181 union al88_u color_unselected; | |
1182 int i; | |
1183 | |
1184 color_seperator.al8[0] = CLUT_MenuLineUnselectedSeperator; | |
1185 color_unselected.al8[0] = CLUT_MenuLineUnselected; | |
1186 | |
1187 color_seperator.al8[1] = 0xFF; | |
1188 color_unselected.al8[1] = 0xFF; | |
1189 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1190 *(__IO uint16_t*)prunning++ = color_seperator.al88; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1191 *(__IO uint16_t*)prunning++ = color_seperator.al88; |
38 | 1192 |
1193 for(i = 61; i > 0; i--) | |
1194 { | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1195 *(__IO uint16_t*)prunning++ = color_unselected.al88; |
38 | 1196 } |
1197 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1198 *(__IO uint16_t*)prunning++ = color_seperator.al88; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1199 *(__IO uint16_t*)prunning++ = color_seperator.al88; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1200 |
130
b7689d9e888a
Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents:
122
diff
changeset
|
1201 *ppDestination = (uint32_t)prunning; |
38 | 1202 } |
1203 | |
1204 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1205 static void draw_tMdesignSubSelected(uint32_t *ppDestination) |
38 | 1206 { |
1207 union al88_u | |
1208 { | |
1209 uint8_t al8[2]; | |
1210 uint16_t al88; | |
1211 }; | |
1212 | |
1213 union al88_u color_selected; | |
1214 union al88_u color_seperator; | |
1215 int i; | |
1216 | |
1217 color_selected.al8[0] = CLUT_MenuLineSelected; | |
1218 color_selected.al8[1] = 0xFF; | |
1219 | |
1220 color_seperator.al8[0] = CLUT_MenuLineSelectedSeperator; | |
1221 color_seperator.al8[1] = 0xFF; | |
1222 | |
1223 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
1224 *ppDestination += 2; | |
1225 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
1226 *ppDestination += 2; | |
1227 | |
1228 for(i = 61; i > 0; i--) | |
1229 { | |
1230 *(__IO uint16_t*)*ppDestination = color_selected.al88; | |
1231 *ppDestination += 2; | |
1232 } | |
1233 | |
1234 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
1235 *ppDestination += 2; | |
1236 *(__IO uint16_t*)*ppDestination = color_seperator.al88; | |
1237 *ppDestination += 2; | |
1238 } | |
1239 | |
1240 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1241 static void draw_tMdesignSubSelectedBorder(uint32_t *ppDestination) |
38 | 1242 { |
1243 union al88_u | |
1244 { | |
1245 uint8_t al8[2]; | |
1246 uint16_t al88; | |
1247 }; | |
1248 | |
1249 union al88_u color_selected_sides; | |
1250 | |
1251 int i; | |
1252 | |
1253 color_selected_sides.al8[0] = CLUT_MenuLineSelectedSides; | |
1254 color_selected_sides.al8[1] = 0xFF; | |
1255 | |
1256 for(i = 65; i > 0; i--) | |
1257 { | |
1258 *(__IO uint16_t*)*ppDestination = color_selected_sides.al88; | |
1259 *ppDestination += 2; | |
1260 } | |
1261 } | |
1262 | |
1263 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1264 static void draw_tMcursorDesign(void) |
38 | 1265 { |
1266 int i,j; | |
1267 uint32_t pDestination; | |
1268 | |
1269 pDestination = tMdesignCursor.FBStartAdress; | |
1270 | |
1271 for(j = 801; j > 0; j--) | |
1272 { | |
1273 for(i = 5; i > 0; i--) | |
1274 { | |
1275 draw_tMdesignSubUnselected(&pDestination); | |
1276 } | |
1277 if((j > 787) || (j < 17)) | |
1278 draw_tMdesignSubSelectedBorder(&pDestination); | |
1279 else | |
1280 draw_tMdesignSubSelected(&pDestination); | |
1281 } | |
1282 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1283 /* Draw menu background boxes which are visible if nothing is selected */ |
38 | 1284 pDestination = tMdesignSolo.FBStartAdress; |
1285 | |
1286 for(j = 801; j > 0; j--) | |
1287 { | |
1288 for(i = 6; i > 0; i--) | |
1289 { | |
1290 draw_tMdesignSubUnselected(&pDestination); | |
1291 } | |
1292 } | |
1293 } | |
1294 | |
1295 | |
167
5e41365ff0d8
cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents:
130
diff
changeset
|
1296 static void draw_tMheader(uint8_t page) |
38 | 1297 { |
1298 union al88_u | |
1299 { | |
1300 uint8_t al8[2]; | |
1301 uint16_t al88; | |
1302 }; | |
1303 union al88_u color_top; | |
1304 int i,j, k, k4text; | |
1305 uint32_t pBackup; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1306 uint16_t* pDestination; |
38 | 1307 uint8_t colorText; |
1308 uint16_t positionText; | |
1309 uint8_t pageText; | |
1310 | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1311 char text8max[MAXPAGES+1][8] = |
38 | 1312 { "", |
1313 "OC", | |
1314 "CC", | |
1315 "SP", | |
1316 "DATA", | |
1317 "DECO", | |
1318 "", | |
1319 "SYS", | |
1320 "", | |
507 | 1321 "", |
1322 "SIM" | |
38 | 1323 }; |
1324 | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1325 _Bool spacing[MAXPAGES+1] = |
38 | 1326 { 0, |
1327 0, // behind OC | |
1328 0, // behind CC | |
1329 1, // behind SP | |
1330 1, // behind DATA | |
1331 0, // behind DECO1 | |
1332 1, // behind DECO2 | |
1333 0, // behind SYS1 | |
507 | 1334 0, // behind SYS2 |
1335 1, // behind SYS3 | |
38 | 1336 1, // behind SIM |
1337 0 | |
1338 }; | |
1339 | |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1340 if(actual_menu_content == MENU_SURFACE) |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1341 { |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1342 spacing[3] = 0; /* Display extra menu directly after setpoint */ |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1343 sprintf(text8max[4],"OP"); |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1344 } |
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1345 |
38 | 1346 pBackup = tMscreen.FBStartAdress; |
1347 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; | |
130
b7689d9e888a
Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents:
122
diff
changeset
|
1348 pDestination = (uint16_t*) menu.StartAddressForPage[page]; |
38 | 1349 positionText = 10; |
1350 pageText = page; | |
1351 | |
1352 gfx_write_page_number(&tMscreen ,menu.pageCountNumber[page],menu.pageCountTotal,0); | |
1353 | |
1354 while((text8max[pageText][0] == 0) && (pageText > 1)) | |
1355 { | |
1356 pageText--; | |
1357 } | |
1358 | |
1359 for(k = 1; k <= MAXPAGES; k++) | |
1360 { | |
1361 if(menu.pageCountNumber[k] != 0) | |
1362 { | |
1363 k4text = k; // new hw 170522 | |
1364 if((text8max[k][0] == 0) && (menu.pageCountNumber[k-1] == 0)) | |
1365 k4text = k-1; | |
1366 | |
1367 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
|
1368 if (k == page) |
38 | 1369 { |
1370 color_top.al8[1] = 0xFF; | |
1371 } | |
1372 else | |
1373 { | |
1374 color_top.al8[1] = 0x50; | |
1375 } | |
1376 | |
1377 if(k4text == pageText) | |
1378 { | |
1379 colorText = CLUT_Font020; | |
1380 } | |
1381 else | |
1382 { | |
1383 colorText = CLUT_Font021; | |
1384 } | |
1385 | |
1386 write_content_simple(&tMscreen,positionText,775,0,&FontT42,text8max[k4text],colorText); | |
1387 /* | |
1388 write_content_simple(&tMscreen,positionText,775,0,&FontT42,text8max[k],colorText); | |
1389 if((text8max[k][0] == 0) && (menu.pageCountNumber[k-1] == 0)) | |
1390 write_content_simple(&tMscreen,positionText,775,0,&FontT42,text8max[k-1],colorText); | |
1391 */ | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1392 /* Draw color bars */ |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1393 if(!settingsGetPointer()->FlipDisplay) |
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 += 5 * 480; |
38 | 1396 |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1397 for(j = 60; j > 0; j--) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1398 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1399 pDestination += (390 + 26); |
38 | 1400 |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1401 for(i = 16; i > 0; i--) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1402 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1403 *(__IO uint16_t*)pDestination++ = color_top.al88; |
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 pDestination += 48; |
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 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1408 pDestination += 5 * 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1409 positionText += 70; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1410 |
647
15f6f0b5786c
Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents:
521
diff
changeset
|
1411 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
|
1412 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1413 pDestination += 70 * 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1414 positionText += 70; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1415 } |
38 | 1416 |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1417 if(spacing[k]) |
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 pDestination += 35 * 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1420 positionText += 35; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1421 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1422 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1423 else |
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 += (800 - 5)* 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1426 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1427 for(j = 60; j > 0; j--) |
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 pDestination -= (390 + 26); |
38 | 1430 |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1431 for(i = 16; i > 0; i--) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1432 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1433 *(__IO uint16_t*)pDestination-- = color_top.al88; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1434 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1435 pDestination -= 48; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1436 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1437 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1438 pDestination -= (800) * 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1439 positionText += 70; |
38 | 1440 |
658
4df22790dc0c
Bugfix handling of new menu tab in flipped mode:
Ideenmodellierer
parents:
650
diff
changeset
|
1441 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
|
1442 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1443 pDestination -= 70 * 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1444 positionText += 70; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1445 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1446 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1447 if(spacing[k]) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1448 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1449 pDestination -= 35 * 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1450 positionText += 35; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1451 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1452 } |
38 | 1453 } |
1454 } | |
1455 tMscreen.FBStartAdress = pBackup; | |
1456 } | |
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
|
1457 |
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
|
1458 |
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
|
1459 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
|
1460 { |
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
|
1461 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
|
1462 } |