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