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