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