annotate Discovery/Src/tMenu.c @ 862:974648b5ccfe Evo_2_23

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