annotate Discovery/Src/tMenu.c @ 1054:8fe6676f28c9 Icon_Integration tip

Restructure reset menu: The reset for custom icon back to the default has been added. Without modification it would not have fit into the reset menu. To add some space all reset operations have been moved into a general "Reset" menu linke it is also implemented for the reboot options. The icon reset option is only show if an icon is stored.
author Ideenmodellierer
date Wed, 31 Dec 2025 17:52:03 +0100
parents 36fa1c44e597
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 /// -*- coding: UTF-8 -*-
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 /// \file Discovery/Src/tMenu.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Major menu with extra page 0 for edit functionality since V0.0.2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 /// \author heinrichs weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 /// \date 30-April-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 /// \details
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 /// $Id$
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 /// This program is free software: you can redistribute it and/or modify
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 /// it under the terms of the GNU General Public License as published by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 /// the Free Software Foundation, either version 3 of the License, or
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 /// (at your option) any later version.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 /// This program is distributed in the hope that it will be useful,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 /// GNU General Public License for more details.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 /// You should have received a copy of the GNU General Public License
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 //////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 #include "tMenu.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 #include "gfx_fonts.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 #include "tHome.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 #include "tMenuDeco.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 #include "tMenuDecoParameter.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 #include "tMenuEditDeco.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 #include "tMenuEditDecoParameter.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 #include "tMenuEditGasOC.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 #include "tMenuEditHardware.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 #include "tMenuEditPlanner.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 #include "tMenuEditSetpoint.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 #include "tMenuEditSystem.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 #include "tMenuEditXtra.h"
507
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
44 #include "tMenuEditCustom.h"
999
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
45 #include "tMenuEditCvOption.h"
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 #include "tMenuGas.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 #include "tMenuHardware.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 #include "tMenuPlanner.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 #include "tMenuSetpoint.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 #include "tMenuSystem.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 #include "tMenuXtra.h"
507
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
52 #include "tMenuCustom.h"
1053
36fa1c44e597 Added upload command for icon:
Ideenmodellierer
parents: 1041
diff changeset
53 #include "tStructure.h"
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 /* Private types -------------------------------------------------------------*/
999
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
56 #define MAXPAGES 12
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
57 #define CURSOR_HIGH 25
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
58 #define TAB_HEADER_HIGH 25
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
59 #define TAB_BAR_HIGH 5
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
60 #define MENU_WDW_HIGH 390
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
61 #define KEY_LABEL_HIGH 25 /* Height of the label used for the the user keys */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62
999
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
63 #define TAB_BAR_WIDTH 50
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
64 #define TAB_BAR_SPACING 5
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
65
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
66 #define SLOW_UPDATE_CNT 10 /* Some content shall not be update in short intervals => add prescalar */
811
4c41d9a18c7f Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents: 788
diff changeset
67 #define MAXLINES 6
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
68
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 uint32_t StartAddressForPage[MAXPAGES+1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 uint8_t lineMemoryForNavigationForPage[MAXPAGES+1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 uint8_t pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 uint8_t linesAvailableForPage[MAXPAGES+1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 uint8_t pagesAvailable;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 uint8_t pageCountNumber[MAXPAGES+1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 uint8_t pageCountTotal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 } SMenuMemory;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 /* Exported variables --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 uint8_t actual_menu_content = MENU_UNDEFINED;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 void tM_build_pages(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 GFX_DrawCfgScreen * get_PointerMenuCursorScreen(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 return &tMdesignCursor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 GFX_DrawCfgScreen * get_PointerMenuCursorDesignSoloScreen(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 return &tMdesignSolo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 void nextline(char * text, uint8_t *textPointer)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 text[(*textPointer)++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 text[(*textPointer)++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 text[*textPointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 void tM_init(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 uint8_t i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 tMdesignCursor.FBStartAdress = getFrame(3);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 tMdesignCursor.ImageHeight = 390;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 tMdesignCursor.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 tMdesignCursor.LayerIndex = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 tMdesignSolo.FBStartAdress = getFrame(4);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 tMdesignSolo.ImageHeight = 390;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 tMdesignSolo.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 tMdesignSolo.LayerIndex = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 menu.pagesAvailable = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 menu.pageMemoryForNavigation = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 for(i=0;i<=MAXPAGES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 menu.lineMemoryForNavigationForPage[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 menu.StartAddressForPage[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 tMscreen.FBStartAdress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 tMscreen.ImageHeight = 480;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 tMscreen.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 tMscreen.LayerIndex = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 draw_tMcursorDesign();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 tMwindow.Image = &tMscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 tMwindow.WindowNumberOfTextLines = 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 tMwindow.WindowLineSpacing = 65;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 tMwindow.WindowTab = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 tMwindow.WindowX0 = 20;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 tMwindow.WindowX1 = 779;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 actual_menu_content = MENU_UNDEFINED;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 void tM_refresh(char *text, uint8_t *textPointer, uint8_t line, const char content[6])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 for(uint8_t i=0; i<6; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 if(((line == 0) || (line == i)) && content[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 text[(*textPointer)++] = content[i];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 text[(*textPointer)++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 text[(*textPointer)++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 text[*textPointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 void tM_rebuild_pages(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 menu.pagesAvailable = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 // menu.pageMemoryForNavigation = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 for(int i=0;i<=MAXPAGES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 menu.lineMemoryForNavigationForPage[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 menu.linesAvailableForPage[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 menu.StartAddressForPage[i] = 0; // only with GFX_forceReleaseFramesWithId(5); !!!!!
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 GFX_forceReleaseFramesWithId(5);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 tM_build_pages();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 void tM_rebuild_menu_after_tComm(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 tM_rebuild_pages();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
236 void tM_check_content(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 uint8_t mode = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 if(stateUsed->mode == MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 if(stateUsed == stateRealGetPointer())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 mode = MENU_DIVE_REAL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 mode = MENU_DIVE_SIM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 mode = MENU_SURFACE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 if(actual_menu_content != mode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 actual_menu_content = mode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 tM_rebuild_pages();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 uint8_t line, page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 page = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 GFX_clean_line(&tMwindow, line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 uint8_t page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 page = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 if(tab == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 tMwindow.WindowTab = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 tMwindow.WindowTab = tab;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 tMenu_write(page, text, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 char localtext[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 uint32_t rememberPage = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 menu.StartAddressForPage[page] = getFrame(5);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 if(tab == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 tMwindow.WindowTab = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 tMwindow.WindowTab = tab;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 draw_tMheader(page);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 tMenu_write(page, text, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 localtext[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 localtext[1] = TXT2BYTE_ButtonBack;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 localtext[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 localtext[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 localtext[2] = TXT2BYTE_ButtonEnter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 localtext[0] = '\002';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 localtext[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 localtext[2] = TXT2BYTE_ButtonNext;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 // gfx_write_page_number(&tMscreen ,menu.pageCountNumber[page],menu.pageCountTotal,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363 if(page == menu.pageMemoryForNavigation)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 GFX_SetFrameTop(tMscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 releaseFrame(5,rememberPage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 menu.pageCountTotal = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 for(int i=0;i<=MAXPAGES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 if(menu.pageCountNumber[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 menu.pageCountTotal++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 menu.pageCountNumber[i] = menu.pageCountTotal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 225
diff changeset
384 void tM_build_page(uint32_t id, char *text, uint16_t tab, char *subtext)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 uint8_t linesFound;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387 uint16_t i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 SStateList idList;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 uint8_t page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 char localtext[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 if(menu.pagesAvailable > MAXPAGES)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 get_idSpecificStateList(id, &idList);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 if(idList.base != BaseMenu)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 if(idList.page == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 if(idList.page > MAXPAGES)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 page = idList.page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 if(*text == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 linesFound = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 if(menu.StartAddressForPage[page])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 releaseFrame(5,menu.StartAddressForPage[page]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 menu.StartAddressForPage[page] = getFrame(5);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 if(menu.StartAddressForPage[page] == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 while((i < MAX_PAGE_TEXTSIZE) && text[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 if((text[i] == '\n') && ((i + 2) < MAX_PAGE_TEXTSIZE) && text[i+1] && text[i+2])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 linesFound += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 i++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 menu.linesAvailableForPage[page] = linesFound;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 menu.pagesAvailable++; /* even if it was used before */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 if(tab == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 tMwindow.WindowTab = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 tMwindow.WindowTab = tab;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447 draw_tMheader(page);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 tMenu_write(page, text, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 localtext[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 localtext[1] = TXT2BYTE_ButtonBack;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456 localtext[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 localtext[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458 localtext[2] = TXT2BYTE_ButtonEnter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 localtext[0] = '\002';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 localtext[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 localtext[2] = TXT2BYTE_ButtonNext;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475 *pageOuput = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 *lineOutput = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 /* test */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 if(menu.pagesAvailable == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 for(int i=1;i<=MAXPAGES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 if((menu.pageCountNumber[i] != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 && (menu.linesAvailableForPage[i] != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486 && (menu.StartAddressForPage[i] != 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 first = i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493 /* select */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 if(menu.pageMemoryForNavigation > MAXPAGES)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 menu.pageMemoryForNavigation = first;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 page = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 if(page == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500 page = first;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503 page += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 if(page > MAXPAGES)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 page = first;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 line = menu.lineMemoryForNavigationForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 if(line == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 line = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 if(line > menu.linesAvailableForPage[page])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 line = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 *pageOuput = page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 *lineOutput = line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532 SStateList idList;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533 uint8_t page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 get_idSpecificStateList(id, &idList);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 page = idList.page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 if(page > MAXPAGES)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 menu.pageCountNumber[page] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 void tM_build_pages(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 char text[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564 char subtext[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 uint32_t id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566 uint16_t tabPosition;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 menu.pagesAvailable = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 for(int i=0;i<=MAXPAGES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 menu.pageCountNumber[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 tabPosition = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 *subtext = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 /* 2015 Feb 02, hw
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 * max 8 Menu Pages
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581
1041
93c98a28406c Bugfix missing SYS header in dive menu:
Ideenmodellierer
parents: 1039
diff changeset
582 tM_add(StMSYS); //now in both modes
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 if(actual_menu_content == MENU_SURFACE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 tM_add(StMDECO);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 tM_add(StMHARD);
1041
93c98a28406c Bugfix missing SYS header in dive menu:
Ideenmodellierer
parents: 1039
diff changeset
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
93c98a28406c Bugfix missing SYS header in dive menu:
Ideenmodellierer
parents: 1039
diff changeset
589 // tM_add(StMSYS); now in both modes
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593 tM_add(StMXTRA);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 if(actual_menu_content == MENU_SURFACE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 tM_add(StMPLAN);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599 // if((pSettings->dive_mode != DIVEMODE_Gauge) && (pSettings->dive_mode != DIVEMODE_Apnea))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 // {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 tM_add(StMDECOP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 // }
647
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
603
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
604 if((isLoopMode(pSettings->dive_mode)) || (stateUsed->diveSettings.ccrOption == 1))
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 id = tMOG_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 id = tMCG_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635 id = tMXtra_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 id = tMPlanner_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 id = tMDeco_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 id = tMDecoParameters_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 id = tMPlanner_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 id = tMHardware_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 id = tMSystem_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 tM_build_page(id, text, tabPosition, subtext);
507
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
655
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
656 id = tMCustom_refresh(0, text, &tabPosition, subtext);
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
657 tM_build_page(id, text, tabPosition, subtext);
999
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
658
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
659 id = tMCvOption_refresh(0, text, &tabPosition, subtext);
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
660 tM_build_page(id, text, tabPosition, subtext);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664 void tM_refresh_live_content(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665 {
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
666 static uint8_t slowUpdate = SLOW_UPDATE_CNT;
51
8f8ea3a32e82 Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents: 38
diff changeset
667 uint8_t page = 0;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 char text[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 char subtext[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 uint16_t tabPosition;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
672 uint32_t globalState = get_globalState();
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
673
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
674 slowUpdate--;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
675 page = menu.pageMemoryForNavigation;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
676 switch(globalState)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 {
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
678 case StMSYS: if(actual_menu_content == MENU_SURFACE)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
679 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
680 tMSystem_refresh(0, text, &tabPosition, subtext);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
681 update_content_with_new_frame(page, text, tabPosition, subtext);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
682 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
683 break;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
684 case StMHARD: tMHardware_refresh(0, text, &tabPosition, subtext);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
685 update_content_with_new_frame(page, text, tabPosition, subtext);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
686 break;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
687 case StMOG: if((actual_menu_content != MENU_SURFACE) && (slowUpdate == 0))
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
688 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
689 tMOG_refresh(0, text, &tabPosition, subtext);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
690 update_content_with_new_frame(page, text, tabPosition, subtext);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
691 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
692 break;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
693 case StMCG: if((actual_menu_content != MENU_SURFACE) && (slowUpdate == 0))
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
694 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
695 tMCG_refresh(0, text, &tabPosition, subtext);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
696 update_content_with_new_frame(page, text, tabPosition, subtext);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
697 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
698 break;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
699 default:
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
700 break;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 }
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
702 if(slowUpdate == 0)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 {
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 658
diff changeset
704 slowUpdate = SLOW_UPDATE_CNT;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 tHome_show_lost_connection_count(&tMscreen);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710 SStateList idList;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711 if(actual_menu_content == MENU_SURFACE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 page = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714 get_idSpecificStateList(StMSYS, &idList);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 if(page == idList.page)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717 tMSystem_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 /* new frame only! */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726 void updateSpecificMenu(uint32_t id)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 uint8_t page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 SStateList idList;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731 char text[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 char subtext[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 uint16_t tabPosition;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 *subtext = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 tabPosition = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 get_idSpecificStateList(id, &idList);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 page = idList.page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 switch(id)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 case StMOG:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745 tMOG_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 case StMCG:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 tMCG_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 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
753 tMSP_refresh(text, &tabPosition, subtext);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 break;
815
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 811
diff changeset
756 case StMSYS:
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 811
diff changeset
757 tMSystem_refresh(0, text, &tabPosition, NULL);
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 811
diff changeset
758 update_content_with_new_frame(page, text, tabPosition, subtext);
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 811
diff changeset
759 break;
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 811
diff changeset
760
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 void updateMenu(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769 uint8_t page, line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771 char text[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772 char subtext[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773 uint16_t tabPosition;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
774
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
775 *subtext = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
776 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
777 tabPosition = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
778
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
779 page = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
780 line = menu.lineMemoryForNavigationForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782 switch(get_globalState())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
783 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
784 case StMOG:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785 tMOG_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
786 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788 case StMCG:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789 tMCG_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
790 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
791 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
792 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
793 tMSP_refresh(text, &tabPosition, subtext);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
794 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
795 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
796 case StMXTRA:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
797 tMXtra_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
798 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
799 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
800 case StMDECO:
1028
3d9552e4997c Code improvment: line <=> menu id function:
Ideenmodellierer
parents: 1018
diff changeset
801 if((line == get_lineOfID(StMDECO1_OC)) || (line == get_lineOfID(StMDECO3_PPO2Max))) // dive mode or ppO2 limits (the later for correct MOD in gaslists)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
802 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
803 tM_rebuild_pages();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
804 menu.lineMemoryForNavigationForPage[page] = line; // fix 160623
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
805 GFX_SetFrameTop(menu.StartAddressForPage[page]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
806 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
807 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
808 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
809 tMDeco_refresh(line, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
810 clean_line_actual_page();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
811 update_content_actual_page(text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
812 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
813 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
814 case StMDECOP:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
815 tMDecoParameters_refresh(line, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
816 clean_line_actual_page();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
817 update_content_actual_page(text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
818 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
819 case StMPLAN:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
820 tMPlanner_refresh(line, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
821 clean_line_actual_page();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
822 update_content_actual_page(text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
823 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
824 case StMHARD:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
825 tMHardware_refresh(line, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
826 clean_line_actual_page();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
827 update_content_actual_page(text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
828 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
829 case StMSYS:
1037
2af07aa38531 Merge with external development branches:
Ideenmodellierer
parents: 1028
diff changeset
830 if((line == get_lineOfID(StMSYS1_DateTime)) || (line == get_lineOfID(StMSYS2_English))
2af07aa38531 Merge with external development branches:
Ideenmodellierer
parents: 1028
diff changeset
831 #ifdef ENABLE_SETTING_PROFILES
2af07aa38531 Merge with external development branches:
Ideenmodellierer
parents: 1028
diff changeset
832 || (line == get_lineOfID(StMSYS_Profile)))
2af07aa38531 Merge with external development branches:
Ideenmodellierer
parents: 1028
diff changeset
833 #else
2af07aa38531 Merge with external development branches:
Ideenmodellierer
parents: 1028
diff changeset
834 )
2af07aa38531 Merge with external development branches:
Ideenmodellierer
parents: 1028
diff changeset
835 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
836 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
837 tM_rebuild_pages();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
838 menu.lineMemoryForNavigationForPage[page] = line; // fix 160623
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
839 GFX_SetFrameTop(menu.StartAddressForPage[page]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
840 menu.lineMemoryForNavigationForPage[page] = line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
841 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
842 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
843 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
844 tMSystem_refresh(line, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
845 clean_line_actual_page();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
846 update_content_actual_page(text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
847 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
848 break;
507
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
849 case StMCustom:
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
850 tMCustom_refresh(line, text, &tabPosition, subtext);
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
851 clean_line_actual_page();
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
852 update_content_actual_page(text, tabPosition, subtext);
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
853 break;
1001
21142f4fa968 Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents: 999
diff changeset
854 case StMOption:
21142f4fa968 Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents: 999
diff changeset
855 tMCvOption_refresh(line, text, &tabPosition, subtext);
21142f4fa968 Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents: 999
diff changeset
856 clean_line_actual_page();
21142f4fa968 Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents: 999
diff changeset
857 update_content_actual_page(text, tabPosition, subtext);
21142f4fa968 Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents: 999
diff changeset
858 break;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
859 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
860 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
861 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
862 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
863
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
864 void openMenu_first_page_with_OC_gas_update(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
865 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
866 menu.pageMemoryForNavigation = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
867 for(int i=0;i<=MAXPAGES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
868 menu.lineMemoryForNavigationForPage[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
869
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
870 set_globalState(StMOG);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
871 updateMenu();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
872 openMenu(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
873 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
874
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
875
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
876 void openMenu(uint8_t freshWithFlipPages)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
877 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
878 uint8_t page, line;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
879 SSettings* pSettings;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
880 pSettings = settingsGetPointer();
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
881
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
882 findValidPosition(&page, &line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
883 if((page == 0) || (line == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
884 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
885
996
8507a87f6401 Improve buzzer opreation:
Ideenmodellierer
parents: 951
diff changeset
886 if( getBuzzerActivationRequest() != REQUEST_BUZZER_ONCE)
8507a87f6401 Improve buzzer opreation:
Ideenmodellierer
parents: 951
diff changeset
887 {
8507a87f6401 Improve buzzer opreation:
Ideenmodellierer
parents: 951
diff changeset
888 requestBuzzerActivation(REQUEST_BUZZER_OFF);
8507a87f6401 Improve buzzer opreation:
Ideenmodellierer
parents: 951
diff changeset
889 }
951
e9c37071933b Added vibration warning:
Ideenmodellierer
parents: 856
diff changeset
890
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
891 menu.pageMemoryForNavigation = page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
892 /* new test for 3button design */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
893 if(freshWithFlipPages)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
894 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
895 menu.lineMemoryForNavigationForPage[page] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
896 menu.modeFlipPages = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
897 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
898 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
899 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
900 menu.lineMemoryForNavigationForPage[page] = line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
901 menu.modeFlipPages = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
902 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
903
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
904 set_globalState_Menu_Page(page);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
905
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
906
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
907 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 1));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
908 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 1));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
909
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
910
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
911 if(((page == 6) || (page == 8)) && (menu.pageCountNumber[page-1] == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
912 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
913 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 2));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
914 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 2));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
915
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
916 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
917
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
918 GFX_SetFrameTop(menu.StartAddressForPage[page]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
919 /* new test for 3button design */
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
920
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
921 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
922 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
923 if(freshWithFlipPages)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
924 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
925 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
926 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
927 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
928 else
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(freshWithFlipPages)
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 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
933 }
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 + (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
936 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
937
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
938 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
939
167
5e41365ff0d8 cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
940 static void block_diluent_handler(_Bool Unblock)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
941 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
942 SStateList list;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
943 static uint8_t linesAvailableForPageDiluent = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
944 get_idSpecificStateList(StMCG, &list);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
945
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
946 if(Unblock && linesAvailableForPageDiluent)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
947 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
948 menu.linesAvailableForPage[list.page] = linesAvailableForPageDiluent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
949 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
950 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
951 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
952 linesAvailableForPageDiluent = menu.linesAvailableForPage[list.page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
953 menu.linesAvailableForPage[list.page] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
954 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
955 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
956
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
957 void block_diluent_page(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
958 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
959 block_diluent_handler(0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
960 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
961
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
962
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
963 void unblock_diluent_page(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
964 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
965 block_diluent_handler(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
966 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
967
850
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 824
diff changeset
968 static void checkLineStatus()
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 824
diff changeset
969 {
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 824
diff changeset
970 switch(get_globalState())
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 824
diff changeset
971 {
1001
21142f4fa968 Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents: 999
diff changeset
972 case StMOption: tMCvOption_checkLineStatus();
851
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 850
diff changeset
973 break;
850
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 824
diff changeset
974 case StMXTRA: tMXtra_checkLineStatus();
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 824
diff changeset
975 break;
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 824
diff changeset
976 default:
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 824
diff changeset
977 break;
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 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
980
167
5e41365ff0d8 cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
981 static void nextPage(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
982 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
983 uint8_t page, line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
984
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
985 SSettings* pSettings;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
986 pSettings = settingsGetPointer();
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
987
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
988 menu.pageMemoryForNavigation += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
989
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
990 findValidPosition(&page, &line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
991 menu.pageMemoryForNavigation = page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
992 /* new test for 3button design */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
993 //menu.lineMemoryForNavigationForPage[page] = line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
994 menu.lineMemoryForNavigationForPage[page] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
995 menu.modeFlipPages = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
996
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
997 set_globalState_Menu_Page(page);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
998
850
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 824
diff changeset
999 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
1000
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1001 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 1));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1002 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 1));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1003
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1004 GFX_SetFrameTop(menu.StartAddressForPage[page]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1005 /* new test for 3button design */
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1006 //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
1007 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1008 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1009 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1010 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1011 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1012 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1013 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 65, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1014 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1015 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1016
647
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1017 void selectPage(uint32_t selection)
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1018 {
650
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 647
diff changeset
1019 uint8_t page;
647
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1020 SStateList idList;
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1021
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1022 SSettings* pSettings;
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1023 pSettings = settingsGetPointer();
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1024
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1025 // menu.pageMemoryForNavigation = selection;
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1026
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1027 // findValidPosition(&page, &line);
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1028 if(selection > MAXPAGES) /* selection via structure */
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1029 {
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1030 get_idSpecificStateList(selection, &idList);
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1031 page = idList.page;
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1032 }
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1033 else
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1034 {
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1035 page = selection;
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1036 }
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1037
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1038 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
1039 {
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1040 menu.activeShadow = menu.pageMemoryForNavigation;
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
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1043 menu.pageMemoryForNavigation = page;
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1044 /* new test for 3button design */
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1045 //menu.lineMemoryForNavigationForPage[page] = line;
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1046 menu.lineMemoryForNavigationForPage[page] = 0;
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1047 menu.modeFlipPages = 1;
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 set_globalState_Menu_Page(page);
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 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 1));
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1052 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 1));
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1053
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1054 GFX_SetFrameTop(menu.StartAddressForPage[page]);
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1055 /* new test for 3button design */
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1056 //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
1057 if(!pSettings->FlipDisplay)
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1058 {
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1059 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390);
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1060 }
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1061 else
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_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 65, 800, 390);
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1064 }
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1065 nextLine();
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1066 }
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1067
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1068
167
5e41365ff0d8 cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
1069 static void nextLine(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1070 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1071 uint8_t page, line;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1072 SSettings* pSettings;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1073 pSettings = settingsGetPointer();
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1074
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1075 page = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1076 menu.lineMemoryForNavigationForPage[page] += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1077
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1078 findValidPosition(&page, &line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1079 menu.lineMemoryForNavigationForPage[page] = line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1080
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1081 /* new test for 3button design */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1082 menu.modeFlipPages = 0;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1083 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1084 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1085 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
1086 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1087 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1088 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1089 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
1090 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1091 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1092
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1093
167
5e41365ff0d8 cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
1094 static void stepBackMenu(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1095 {
647
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1096 if(menu.activeShadow) /* restore base page */
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1097 {
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1098 selectPage(menu.activeShadow);
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1099 menu.activeShadow = 0;
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1100 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1101 if(menu.modeFlipPages == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1102 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1103 menu.lineMemoryForNavigationForPage[menu.pageMemoryForNavigation] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1104 menu.modeFlipPages = 1;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1105 if(!settingsGetPointer()->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1106 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1107 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1108 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1109 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1110 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1111 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
1112 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1113 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1114 else
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1115 {
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1116 exitMenu();
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1117 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1118 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1119
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1120
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1121 void exitMenu(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1122 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1123 set_globalState_tHome();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1124 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1125
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1126
167
5e41365ff0d8 cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
1127 static void stepForwardMenu(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1128 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1129 if(menu.modeFlipPages == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1130 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1131 nextLine();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1132 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1133 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1134 gotoMenuEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1135 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1136
167
5e41365ff0d8 cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
1137 static void gotoMenuEdit(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1138 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1139 uint8_t line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1140
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1141 line = menu.lineMemoryForNavigationForPage[menu.pageMemoryForNavigation];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1142
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1143 switch(get_globalState())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1144 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1145 case StMOG:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1146 openEdit_GasOC(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1147 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1148 case StMCG:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1149 openEdit_GasCC(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1150 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1151 case StMSP:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1152 openEdit_Setpoint(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1153 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1154 case StMXTRA:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1155 openEdit_Xtra(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1156 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1157 case StMDECO:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1158 openEdit_Deco(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1159 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1160 case StMDECOP:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1161 openEdit_DecoParameter(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1162 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1163 case StMPLAN:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1164 openEdit_Planner(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1165 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1166 case StMHARD:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1167 openEdit_Hardware(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1168 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1169 case StMSYS:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1170 openEdit_System(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1171 break;
507
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
1172 case StMCustom:
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
1173 openEdit_Custom(line);
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
1174 break;
999
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1175 case StMOption:
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1176 openEdit_CvOption(line);
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1177 break;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1178 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1179 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1180 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1181 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1182
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1183
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1184 void sendActionToMenu(uint8_t sendAction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1185 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1186 switch(sendAction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1187 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1188 case ACTION_BUTTON_ENTER:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1189 stepForwardMenu();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1190 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1191 case ACTION_BUTTON_NEXT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1192 if(menu.modeFlipPages)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1193 nextPage();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1194 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1195 nextLine();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1196 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1197 case ACTION_TIMEOUT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1198 case ACTION_MODE_CHANGE:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1199 case ACTION_BUTTON_BACK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1200 /* new test for 3button design */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1201 stepBackMenu();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1202 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1203 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1204 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1205 case ACTION_IDLE_TICK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1206 case ACTION_IDLE_SECOND:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1207 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1208 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1209 /* tMC_OC_Gas(StMOG1, pSettings); */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1210 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1211
167
5e41365ff0d8 cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
1212 static void tMenu_write(uint8_t page, char *text, char *subtext)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1213 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1214 if(page > MAXPAGES)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1215 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1216 if(menu.linesAvailableForPage[page] == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1217 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1218
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1219 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1220 GFX_write_string(&FontT48, &tMwindow, text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1221 if((*subtext) && (menu.linesAvailableForPage[page] < 6))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1222 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1223 GFX_write_string(&FontT42, &tMwindow, subtext, (menu.linesAvailableForPage[page] + 1));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1224 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1225 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1226
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1227
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1228 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1229
167
5e41365ff0d8 cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
1230 static void draw_tMdesignSubUnselected(uint32_t *ppDestination)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1231 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1232 union al88_u
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1233 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1234 uint8_t al8[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1235 uint16_t al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1236 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1237
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 122
diff changeset
1238 uint16_t* prunning = (uint16_t*)*ppDestination;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1239
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1240 union al88_u color_seperator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1241 union al88_u color_unselected;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1242 int i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1243
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1244 color_seperator.al8[0] = CLUT_MenuLineUnselectedSeperator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1245 color_unselected.al8[0] = CLUT_MenuLineUnselected;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1246
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1247 color_seperator.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1248 color_unselected.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1249
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1250 *(__IO uint16_t*)prunning++ = color_seperator.al88;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1251 *(__IO uint16_t*)prunning++ = color_seperator.al88;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1252
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1253 for(i = 61; i > 0; i--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1254 {
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1255 *(__IO uint16_t*)prunning++ = color_unselected.al88;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1256 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1257
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1258 *(__IO uint16_t*)prunning++ = color_seperator.al88;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1259 *(__IO uint16_t*)prunning++ = color_seperator.al88;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1260
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 122
diff changeset
1261 *ppDestination = (uint32_t)prunning;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1262 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1263
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1264
167
5e41365ff0d8 cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
1265 static void draw_tMdesignSubSelected(uint32_t *ppDestination)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1266 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1267 union al88_u
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1268 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1269 uint8_t al8[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1270 uint16_t al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1271 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1272
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1273 union al88_u color_selected;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1274 union al88_u color_seperator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1275 int i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1276
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1277 color_selected.al8[0] = CLUT_MenuLineSelected;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1278 color_selected.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1279
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1280 color_seperator.al8[0] = CLUT_MenuLineSelectedSeperator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1281 color_seperator.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1282
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1283 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1284 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1285 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1286 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1287
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1288 for(i = 61; i > 0; i--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1289 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1290 *(__IO uint16_t*)*ppDestination = color_selected.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1291 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1292 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1293
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1294 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1295 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1296 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1297 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1298 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1299
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1300
167
5e41365ff0d8 cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
1301 static void draw_tMdesignSubSelectedBorder(uint32_t *ppDestination)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1302 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1303 union al88_u
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1304 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1305 uint8_t al8[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1306 uint16_t al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1307 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1308
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1309 union al88_u color_selected_sides;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1310
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1311 int i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1312
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1313 color_selected_sides.al8[0] = CLUT_MenuLineSelectedSides;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1314 color_selected_sides.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1315
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1316 for(i = 65; i > 0; i--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1317 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1318 *(__IO uint16_t*)*ppDestination = color_selected_sides.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1319 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1320 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1321 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1322
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1323
167
5e41365ff0d8 cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
1324 static void draw_tMcursorDesign(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1325 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1326 int i,j;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1327 uint32_t pDestination;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1328
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1329 pDestination = tMdesignCursor.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1330
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1331 for(j = 801; j > 0; j--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1332 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1333 for(i = 5; i > 0; i--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1334 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1335 draw_tMdesignSubUnselected(&pDestination);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1336 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1337 if((j > 787) || (j < 17))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1338 draw_tMdesignSubSelectedBorder(&pDestination);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1339 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1340 draw_tMdesignSubSelected(&pDestination);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1341 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1342
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1343 /* Draw menu background boxes which are visible if nothing is selected */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1344 pDestination = tMdesignSolo.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1345
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1346 for(j = 801; j > 0; j--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1347 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1348 for(i = 6; i > 0; i--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1349 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1350 draw_tMdesignSubUnselected(&pDestination);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1351 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1352 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1353 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1354
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1355
167
5e41365ff0d8 cleanup: local data and functions can be static (tMenu)
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
1356 static void draw_tMheader(uint8_t page)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1357 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1358 union al88_u
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1359 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1360 uint8_t al8[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1361 uint16_t al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1362 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1363 union al88_u color_top;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1364 int i,j, k, k4text;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1365 uint32_t pBackup;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1366 uint16_t* pDestination;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1367 uint8_t colorText;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1368 uint16_t positionText;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1369 uint8_t pageText;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1370
647
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1371 char text8max[MAXPAGES+1][8] =
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1372 { "",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1373 "OC",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1374 "CC",
999
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1375 "",
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1376 "DATA",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1377 "DECO",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1378 "",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1379 "SYS",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1380 "",
507
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
1381 "",
999
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1382 "",
1041
93c98a28406c Bugfix missing SYS header in dive menu:
Ideenmodellierer
parents: 1039
diff changeset
1383 "SIM",
93c98a28406c Bugfix missing SYS header in dive menu:
Ideenmodellierer
parents: 1039
diff changeset
1384 ""
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1385 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1386
647
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1387 _Bool spacing[MAXPAGES+1] =
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1388 { 0,
999
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1389 1, // behind OC
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1390 0, // behind CC
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1391 1, // behind SP
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1392 1, // behind DATA
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1393 0, // behind DECO1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1394 1, // behind DECO2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1395 0, // behind SYS1
507
5e3b830b955f Added new menu tab into call structure
Ideenmodellierer
parents: 379
diff changeset
1396 0, // behind SYS2
999
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1397 0, // behind SYS3
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1398 1, // behind SYS4
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1399 1, // behind SIM
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1400 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1401 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1402
647
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1403 if(actual_menu_content == MENU_SURFACE)
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1404 {
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1405 spacing[3] = 0; /* Display extra menu directly after setpoint */
999
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1406 memset(text8max[4],0,8);
647
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1407 }
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1408
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1409 pBackup = tMscreen.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1410 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 122
diff changeset
1411 pDestination = (uint16_t*) menu.StartAddressForPage[page];
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1412 positionText = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1413 pageText = page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1414
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1415 gfx_write_page_number(&tMscreen ,menu.pageCountNumber[page],menu.pageCountTotal,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1416
1041
93c98a28406c Bugfix missing SYS header in dive menu:
Ideenmodellierer
parents: 1039
diff changeset
1417 /* Find the matching master text if a tab has no direct name e.g. SYS subtabs */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1418 while((text8max[pageText][0] == 0) && (pageText > 1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1419 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1420 pageText--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1421 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1422
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1423 for(k = 1; k <= MAXPAGES; k++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1424 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1425 if(menu.pageCountNumber[k] != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1426 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1427 k4text = k; // new hw 170522
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1428 if((text8max[k][0] == 0) && (menu.pageCountNumber[k-1] == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1429 k4text = k-1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1430
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1431 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
1432 if (k == page)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1433 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1434 color_top.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1435 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1436 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1437 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1438 color_top.al8[1] = 0x50;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1439 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1440
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1441 if(k4text == pageText)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1442 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1443 colorText = CLUT_Font020;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1444 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1445 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1446 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1447 colorText = CLUT_Font021;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1448 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1449
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1450 write_content_simple(&tMscreen,positionText,775,0,&FontT42,text8max[k4text],colorText);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1451 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1452 write_content_simple(&tMscreen,positionText,775,0,&FontT42,text8max[k],colorText);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1453 if((text8max[k][0] == 0) && (menu.pageCountNumber[k-1] == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1454 write_content_simple(&tMscreen,positionText,775,0,&FontT42,text8max[k-1],colorText);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1455 */
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1456 /* Draw color bars */
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1457 if(!settingsGetPointer()->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1458 {
999
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1459 pDestination += TAB_BAR_SPACING * 480;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1460
999
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1461 for(j = TAB_BAR_WIDTH; j > 0; j--)
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1462 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1463 pDestination += (390 + 26);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1464
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1465 for(i = 16; i > 0; i--)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1466 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1467 *(__IO uint16_t*)pDestination++ = color_top.al88;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1468 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1469 pDestination += 48;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1470 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1471
999
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1472 pDestination += TAB_BAR_SPACING * 480;
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1473 positionText += TAB_BAR_WIDTH + 2* TAB_BAR_SPACING;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1474
647
15f6f0b5786c Integrated selection of bailout in the diluent selection page:
Ideenmodellierer
parents: 521
diff changeset
1475 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
1476 {
999
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1477 pDestination += (TAB_BAR_WIDTH + 2* TAB_BAR_SPACING) * 480;
ac25c35a3c97 New Tab for dynamic configuration:
Ideenmodellierer
parents: 996
diff changeset
1478 positionText += TAB_BAR_WIDTH + 2* TAB_BAR_SPACING;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1479 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1480
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1481 if(spacing[k])
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1482 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1483 pDestination += 35 * 480;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1484 positionText += 35;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1485 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1486 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1487 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1488 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1489 pDestination += (800 - 5)* 480;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1490
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1491 for(j = 60; j > 0; j--)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1492 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1493 pDestination -= (390 + 26);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1494
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1495 for(i = 16; i > 0; i--)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1496 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1497 *(__IO uint16_t*)pDestination-- = color_top.al88;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1498 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1499 pDestination -= 48;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1500 }
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 -= (800) * 480;
824
2a9a47547b05 Bugfix Flipscreen visualization:
Ideenmodellierer
parents: 816
diff changeset
1503 positionText += 66;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1504
658
4df22790dc0c Bugfix handling of new menu tab in flipped mode:
Ideenmodellierer
parents: 650
diff changeset
1505 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
1506 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1507 pDestination -= 70 * 480;
824
2a9a47547b05 Bugfix Flipscreen visualization:
Ideenmodellierer
parents: 816
diff changeset
1508 positionText += 66;
110
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 if(spacing[k])
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1512 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1513 pDestination -= 35 * 480;
824
2a9a47547b05 Bugfix Flipscreen visualization:
Ideenmodellierer
parents: 816
diff changeset
1514 positionText += 31;
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 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1517 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1518 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1519 tMscreen.FBStartAdress = pBackup;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1520 }
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
1521
6169309d6eb9 more menu items for the compass menu: Delete bearing, and reset to land based bearing. I have also re-enabled the real time bearing display in the menu - makes it easier to set the correct bearing. (mikeller)
heinrichsweikamp
parents: 662
diff changeset
1522
6169309d6eb9 more menu items for the compass menu: Delete bearing, and reset to land based bearing. I have also re-enabled the real time bearing display in the menu - makes it easier to set the correct bearing. (mikeller)
heinrichsweikamp
parents: 662
diff changeset
1523 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
1524 {
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
1525 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
1526 }
1018
808153ba3fec Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents: 1001
diff changeset
1527
808153ba3fec Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents: 1001
diff changeset
1528
808153ba3fec Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents: 1001
diff changeset
1529 char printCheckbox(bool isChecked)
808153ba3fec Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents: 1001
diff changeset
1530 {
808153ba3fec Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents: 1001
diff changeset
1531 return isChecked ? '\005' : '\006';
808153ba3fec Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents: 1001
diff changeset
1532 }