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