annotate Discovery/Src/tMenuEditCustom.c @ 541:6fbf7cd391cb

Added default view selection and auto return to view to t3 visualization: In previous version the ostc tried to applied the t7 default view selection to t3 view. As t3 has different views than t3, a new selection menu has been added to the custom view menu enabling the selection of the big font default view. In parallel the auto return function has been adapted to use the new parameter.
author Ideenmodellierer
date Sat, 10 Oct 2020 18:34:10 +0200
parents 1721b26335f1
children 6960df7ddb09
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
1 ///////////////////////////////////////////////////////////////////////////////
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
2 /// -*- coding: UTF-8 -*-
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
3 ///
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
4 /// \file Discovery/Src/tMenuEditXtra.c
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
5 /// \brief Menu Edit Xtra - Specials in Divemode like Reset Stopwatch
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
6 /// \author heinrichs weikamp gmbh
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
7 /// \date 02-Mar-2015
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
8 ///
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
9 /// \details
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
10 ///
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
11 /// $Id$
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
12 ///////////////////////////////////////////////////////////////////////////////
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
14 ///
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
15 /// This program is free software: you can redistribute it and/or modify
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
16 /// it under the terms of the GNU General Public License as published by
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
17 /// the Free Software Foundation, either version 3 of the License, or
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
18 /// (at your option) any later version.
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
19 ///
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
20 /// This program is distributed in the hope that it will be useful,
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
23 /// GNU General Public License for more details.
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
24 ///
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
25 /// You should have received a copy of the GNU General Public License
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
27 //////////////////////////////////////////////////////////////////////////////
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
28
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
29 /* Includes ------------------------------------------------------------------*/
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
30 #include "tMenuEditCustom.h"
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
31
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
32 #include "gfx_fonts.h"
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
33 #include "simulation.h"
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
34 #include "timer.h"
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
35 #include "tMenuEdit.h"
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
36 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass()
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
37 #include "t3.h"
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
38 #include "t7.h"
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
39 #include "data_exchange_main.h"
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
40 #include "motion.h"
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
41 #include "tMenu.h"
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
42 #include "tMenuSystem.h"
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
43
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
44
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
45 #define CV_PER_PAGE (5u) /* number of cv selections shown at one page */
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
46 #define CV_SUBPAGE_MAX (2u) /* max number of customer view selection pages */
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
47
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
48 static uint8_t customviewsSubpage = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
49 static uint8_t customviewsSubpageMax = 0; /* number of pages needed to display all selectable views */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
50 static const uint8_t* pcv_curchangelist;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
51 /* Private function prototypes -----------------------------------------------*/
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
52 void openEdit_Customview(void);
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
53 void openEdit_BigScreen(void);
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
54 void openEdit_MotionCtrl(void);
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
55 void refresh_Customviews(void);
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
56 char customview_TXT2BYTE_helper(uint8_t customViewId);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
57 /* Announced function prototypes -----------------------------------------------*/
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
58 uint8_t OnAction_CViewTimeout (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
59 uint8_t OnAction_CViewStandard (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
60 uint8_t OnAction_CViewStandardBF(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
61 uint8_t OnAction_CornerTimeout (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
62 uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
63 /* Exported functions --------------------------------------------------------*/
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
64
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
65
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
66
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
67
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
68 void refresh_Customviews(void)
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
69 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
70 char text[32];
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
71 uint8_t textpointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
72
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
73 // header
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
74 text[0] = '\001';
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
75 text[1] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
76 text[2] = TXT2BYTE_Customviews;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
77 text[3] = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
78 write_topline(text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
79
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
80 // custom view center return
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
81 textpointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
82 text[textpointer++] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
83 text[textpointer++] = TXT2BYTE_CViewTimeout;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
84 textpointer += snprintf(&text[textpointer],11," %02u\016\016 %c\017",settingsGetPointer()->tX_customViewTimeout,TXT_Seconds);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
85 write_label_var( 30, 700, ME_Y_LINE1, &FontT48, text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
86
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
87 // custom view center primary
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
88 text[0] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
89 text[1] = TXT2BYTE_CViewStandard;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
90 text[2] = ' ';
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
91 text[3] = ' ';
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
92
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
93 #if 0
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
94 switch(settingsGetPointer()->tX_customViewPrimary)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
95 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
96 case CVIEW_sensors:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
97 text[4] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
98 text[5] = TXT2BYTE_O2monitor;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
99 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
100 case CVIEW_sensors_mV:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
101 text[4] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
102 text[5] = TXT2BYTE_O2voltage;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
103 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
104 case CVIEW_Compass:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
105 text[4] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
106 text[5] = TXT2BYTE_Compass;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
107 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
108 case CVIEW_Decolist:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
109 text[4] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
110 text[5] = TXT2BYTE_Decolist;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
111 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
112 case CVIEW_Tissues:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
113 text[4] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
114 text[5] = TXT2BYTE_Tissues;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
115 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
116 case CVIEW_Profile:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
117 text[4] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
118 text[5] = TXT2BYTE_Profile;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
119 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
120 case CVIEW_Gaslist:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
121 text[4] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
122 text[5] = TXT2BYTE_Gaslist;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
123 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
124 case CVIEW_EADTime:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
125 text[4] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
126 text[5] = TXT2BYTE_Info;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
127 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
128 case CVIEW_SummaryOfLeftCorner:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
129 text[4] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
130 text[5] = TXT2BYTE_Summary;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
131 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
132 case CVIEW_noneOrDebug:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
133 text[4] = ' ';
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
134 text[5] = '-';
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
135 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
136 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
137 snprintf(&text[4],3,"%02u",settingsGetPointer()->tX_customViewPrimary);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
138 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
139 }
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
140 #endif
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
141 text[4] = TXT_2BYTE;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
142 text[5] = customview_TXT2BYTE_helper(settingsGetPointer()->tX_customViewPrimary);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
143 text[6] = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
144 write_label_var( 30, 700, ME_Y_LINE2, &FontT48, text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
145
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
146 // custom view big font
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
147 text[0] = TXT_2BYTE;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
148 text[1] = TXT2BYTE_ExtraDisplay;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
149 text[2] = ' ';
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
150 text[3] = ' ';
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
151 text[4] = TXT_2BYTE;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
152 text[5] = customview_TXT2BYTE_helper(settingsGetPointer()->tX_customViewPrimaryBF);
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
153 text[6] = 0;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
154 write_label_var( 30, 700, ME_Y_LINE3, &FontT48, text);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
155
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
156 // field corner return
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
157 textpointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
158 text[textpointer++] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
159 text[textpointer++] = TXT2BYTE_CornerTimeout;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
160 textpointer += snprintf(&text[textpointer],11," %02u\016\016 %c\017",settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout,TXT_Seconds);
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
161 write_label_var( 30, 700, ME_Y_LINE5, &FontT48, text);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
162
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
163 // field corner primary
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
164 text[0] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
165 text[1] = TXT2BYTE_CornerStandard;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
166 text[2] = ' ';
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
167 text[3] = ' ';
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
168 switch(settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
169 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
170 /* Temperature */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
171 case LLC_Temperature:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
172 text[4] = TXT_Temperature;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
173 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
174 /* Average Depth */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
175 case LLC_AverageDepth:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
176 text[4] = TXT_AvgDepth;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
177 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
178 /* ppO2 */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
179 case LLC_ppO2:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
180 text[4] = TXT_ppO2;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
181 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
182 /* Stop Uhr */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
183 case LLC_Stopwatch:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
184 text[4] = TXT_Stopwatch;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
185 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
186 /* Ceiling */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
187 case LLC_Ceiling:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
188 text[4] = TXT_Ceiling;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
189 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
190 /* Future TTS */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
191 case LLC_FutureTTS:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
192 text[4] = TXT_FutureTTS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
193 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
194 /* CNS */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
195 case LLC_CNS:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
196 text[4] = TXT_CNS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
197 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
198 case LLC_GF:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
199 text[4] = TXT_ActualGradient;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
200 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
201 #ifdef ENABLE_BOTTLE_SENSOR
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
202 case LCC_BottleBar:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
203 text[4] = TXT_AtemGasVorrat;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
204 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
205 #endif
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
206 /* none */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
207 case LLC_Empty:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
208 text[4] = '-';
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
209 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
210 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
211 snprintf(&text[4],2,"%u",settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
212 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
213 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
214 text[5] = 0;
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
215 write_label_var( 30, 700, ME_Y_LINE6, &FontT48, text);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
216
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
217 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
218 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
219
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
220 void openEdit_Custom(uint8_t line)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
221 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
222 set_globalState_Menu_Line(line);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
223 resetMenuEdit(CLUT_MenuPageCustomView);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
224
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
225 switch(line)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
226 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
227 case 1:
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
228 default: openEdit_Customview();
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
229 break;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
230 case 2: openEdit_BigScreen();
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
231 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
232 case 3: openEdit_CustomviewDivemode(cv_changelist);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
233 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
234 case 4: openEdit_CustomviewDivemode(cv_changelist_BS);
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
235 break;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
236 case 5: openEdit_MotionCtrl();
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
237 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
238 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
239 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
240
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
241 /* Private functions ---------------------------------------------------------*/
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
242 void openEdit_Customview(void)
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
243 {
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
244 refresh_Customviews();
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
245
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
246 write_field_button(StMCustom1_CViewTimeout, 400, 700, ME_Y_LINE1, &FontT48, "");
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
247 write_field_button(StMCustom1_CViewStandard, 400, 700, ME_Y_LINE2, &FontT48, "");
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
248 write_field_button(StMCustom1_CViewStandardBF, 400, 700, ME_Y_LINE3, &FontT48, "");
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
249
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
250 write_field_button(StMCustom1_CornerTimeout, 400, 700, ME_Y_LINE5, &FontT48, "");
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
251 write_field_button(StMCustom1_CornerStandard, 400, 700, ME_Y_LINE6, &FontT48, "");
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
252
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
253 setEvent(StMCustom1_CViewTimeout, (uint32_t)OnAction_CViewTimeout);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
254 setEvent(StMCustom1_CViewStandard, (uint32_t)OnAction_CViewStandard);
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
255 setEvent(StMCustom1_CViewStandardBF, (uint32_t)OnAction_CViewStandardBF);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
256
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
257 setEvent(StMCustom1_CornerTimeout, (uint32_t)OnAction_CornerTimeout);
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
258 setEvent(StMCustom1_CornerStandard, (uint32_t)OnAction_CornerStandard);
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
259 }
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
260
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
261 void openEdit_BigScreen(void)
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
262 {
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
263 uint8_t newValue = 0;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
264 SSettings *pSettings = settingsGetPointer();
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
265
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
266 newValue = pSettings->extraDisplay + 1;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
267 if(newValue == EXTRADISPLAY_DECOGAME) /* Decogame not yet implemented */
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
268 {
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
269 newValue++;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
270 }
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
271 if(newValue >= EXTRADISPLAY_END)
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
272 {
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
273 newValue = EXTRADISPLAY_none;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
274 }
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
275 pSettings->extraDisplay = newValue;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
276
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
277 exitMenuEdit_to_Menu_with_Menu_Update_do_not_write_settings_for_this_only();
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
278 }
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
279
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
280 void openEdit_MotionCtrl(void)
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
281 {
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
282 uint8_t newValue = 0;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
283 SSettings *pSettings = settingsGetPointer();
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
284
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
285 switch(pSettings->MotionDetection)
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
286 {
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
287 case MOTION_DETECT_OFF:
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
288 newValue = MOTION_DETECT_MOVE;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
289 break;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
290 case MOTION_DETECT_MOVE:
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
291 newValue = MOTION_DETECT_SECTOR;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
292 break;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
293 case MOTION_DETECT_SECTOR:
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
294 newValue = MOTION_DETECT_SCROLL;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
295 break;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
296 case MOTION_DETECT_SCROLL:
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
297 newValue = MOTION_DETECT_OFF;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
298 break;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
299 default:
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
300 newValue = MOTION_DETECT_OFF;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
301 break;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
302 }
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
303 pSettings->MotionDetection = newValue;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
304 InitMotionDetection();
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
305
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
306 exitMenuEdit_to_Menu_with_Menu_Update_do_not_write_settings_for_this_only();
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
307 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
308
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
309 char customview_TXT2BYTE_helper(uint8_t customViewId)
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
310 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
311 char text = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
312
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
313 switch(customViewId)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
314 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
315 case CVIEW_sensors:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
316 text = TXT2BYTE_O2monitor;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
317 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
318 case CVIEW_sensors_mV:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
319 text = TXT2BYTE_O2voltage;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
320 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
321 case CVIEW_Compass:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
322 text = TXT2BYTE_Compass;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
323 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
324 case CVIEW_Decolist:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
325 case CVIEW_T3_Decostop:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
326 text = TXT2BYTE_Decolist;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
327 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
328 case CVIEW_Tissues:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
329 text = TXT2BYTE_Tissues;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
330 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
331 case CVIEW_Profile:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
332 text = TXT2BYTE_Profile;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
333 break;
531
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
334 case CVIEW_Gaslist:
515
218ac999e96b Added missing display of button labels in refresh function:
Ideenmodellierer
parents: 506
diff changeset
335 case CVIEW_T3_GasList:
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
336 text = TXT2BYTE_Gaslist;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
337 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
338 case CVIEW_EADTime:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
339 text = TXT2BYTE_Info;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
340 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
341 case CVIEW_SummaryOfLeftCorner:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
342 text = TXT2BYTE_Summary;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
343 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
344 case CVIEW_noneOrDebug:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
345 text = TXT2BYTE_DispNoneDbg;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
346 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
347 case CVIEW_T3_MaxDepth:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
348 text = TXT2BYTE_MaxDepth;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
349 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
350 case CVIEW_T3_StopWatch:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
351 text = TXT2BYTE_Stopwatch;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
352 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
353 case CVIEW_T3_TTS:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
354 text = TXT2BYTE_TTS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
355 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
356 case CVIEW_T3_ppO2andGas:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
357 text = TXT2BYTE_ppoNair;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
358 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
359 case CVIEW_T3_Navigation:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
360 text = TXT2BYTE_Navigation;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
361 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
362 case CVIEW_T3_DepthData:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
363 text = TXT2BYTE_DepthData;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
364 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
365 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
366 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
367 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
368 return text;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
369 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
370
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
371
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
372 uint8_t OnAction_CViewTimeout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
373 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
374 uint8_t value;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
375 value = settingsGetPointer()->tX_customViewTimeout;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
376
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
377 if(value < 5)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
378 value = 5;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
379 else if(value < 10)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
380 value = 10;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
381 else if(value < 15)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
382 value = 15;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
383 else if(value < 20)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
384 value = 20;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
385 else if(value < 30)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
386 value = 30;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
387 else if(value < 45)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
388 value = 45;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
389 else if(value < 60)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
390 value = 60;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
391 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
392 value = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
393
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
394 settingsGetPointer()->tX_customViewTimeout = value;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
395 return UPDATE_DIVESETTINGS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
396 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
397
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
398
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
399 uint8_t OnAction_CViewStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
400 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
401 uint8_t newValue;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
402 switch(settingsGetPointer()->tX_customViewPrimary)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
403 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
404 case CVIEW_sensors:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
405 newValue = CVIEW_sensors_mV;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
406 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
407 case CVIEW_sensors_mV:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
408 newValue = CVIEW_Compass;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
409 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
410 case CVIEW_Compass:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
411 newValue = CVIEW_Decolist;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
412 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
413 case CVIEW_Decolist:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
414 newValue = CVIEW_Tissues;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
415 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
416 case CVIEW_Tissues:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
417 newValue = CVIEW_Profile;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
418 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
419 case CVIEW_Profile:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
420 newValue = CVIEW_Gaslist;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
421 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
422 case CVIEW_Gaslist:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
423 newValue = CVIEW_EADTime;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
424 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
425 case CVIEW_EADTime:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
426 newValue = CVIEW_SummaryOfLeftCorner;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
427 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
428 case CVIEW_SummaryOfLeftCorner:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
429 newValue = CVIEW_noneOrDebug;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
430 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
431 case CVIEW_noneOrDebug:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
432 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
433 newValue = CVIEW_sensors;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
434 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
435 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
436 settingsGetPointer()->tX_customViewPrimary = newValue;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
437 return UPDATE_DIVESETTINGS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
438 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
439
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
440 uint8_t OnAction_CViewStandardBF(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
441 {
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
442 uint8_t index = 0;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
443 uint8_t newValue;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
444
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
445 /* list contains all views which may be selected => get index of current setting */
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
446 while((settingsGetPointer()->tX_customViewPrimaryBF != cv_changelist_BS[index]) || (cv_changelist_BS[index] == CVIEW_T3_END))
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
447 {
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
448 index++;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
449 }
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
450 if((cv_changelist_BS[index] == CVIEW_T3_END) || (cv_changelist_BS[index+1] == CVIEW_T3_END)) /* invalid or last setting */
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
451 {
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
452 newValue = cv_changelist_BS[0];
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
453 }
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
454 else
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
455 {
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
456 newValue = cv_changelist_BS[index + 1];
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
457 }
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
458
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
459 settingsGetPointer()->tX_customViewPrimaryBF = newValue;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
460 return UPDATE_DIVESETTINGS;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
461 }
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
462
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
463
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
464 uint8_t OnAction_CornerTimeout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
465 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
466 uint8_t value;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
467 value = settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
468
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
469 if(value < 5)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
470 value = 5;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
471 else if(value < 10)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
472 value = 10;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
473 else if(value < 15)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
474 value = 15;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
475 else if(value < 20)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
476 value = 20;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
477 else if(value < 30)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
478 value = 30;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
479 else if(value < 45)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
480 value = 45;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
481 else if(value < 60)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
482 value = 60;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
483 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
484 value = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
485
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
486 settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout = value;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
487 return UPDATE_DIVESETTINGS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
488 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
489
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
490
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
491 uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
492 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
493 uint8_t value;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
494 value = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
495
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
496 value += 1;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
497
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
498 if(value >= LLC_END)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
499 value = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
500
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
501 settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary = value;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
502 return UPDATE_DIVESETTINGS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
503 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
504
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
505
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
506 uint8_t OnAction_Customview_Toggle(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
507 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
508
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
509 uint8_t line = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
510 SSettings *pSettings = settingsGetPointer();
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
511
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
512 switch(editId)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
513 {
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
514 case StMCustom3_CViewSelection1: line = 1;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
515 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
516 case StMCustom3_CViewSelection2: line = 2;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
517 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
518 case StMCustom3_CViewSelection3: line = 3;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
519 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
520 case StMCustom3_CViewSelection4: line = 4;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
521 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
522 case StMCustom3_CViewSelection5: line = 5;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
523 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
524
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
525 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
526 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
527 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
528 if(pcv_curchangelist == cv_changelist)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
529 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
530 pSettings->cv_configuration ^= 1 << (pcv_curchangelist[customviewsSubpage * 5 + line-1]);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
531 if(t7_GetEnabled_customviews() == 0)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
532 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
533 pSettings->cv_configuration ^= (1 << CVIEW_noneOrDebug);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
534 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
535 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
536 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
537 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
538 pSettings->cv_config_BigScreen ^= 1 << (pcv_curchangelist[customviewsSubpage * 5 + line-1]);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
539 if(t3_GetEnabled_customviews() == 0)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
540 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
541 pSettings->cv_config_BigScreen ^= (1 << CVIEW_noneOrDebug);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
542 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
543 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
544 return UPDATE_DIVESETTINGS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
545 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
546
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
547
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
548 uint8_t OnAction_Customview_NextPage(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
549 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
550 customviewsSubpage++;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
551 if(customviewsSubpage == customviewsSubpageMax)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
552 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
553 customviewsSubpage = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
554 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
555 resetMenuEdit(CLUT_MenuPageCustomView); /* rebuild page */
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
556 openEdit_CustomviewDivemode(pcv_curchangelist);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
557
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
558 tMenuEdit_select(StMCustom3_CViewSelection6);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
559 return UPDATE_DIVESETTINGS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
560 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
561
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
562 void openEdit_CustomviewDivemode(const uint8_t* pcv_changelist)
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
563 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
564
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
565 SSettings *pSettings = settingsGetPointer();
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
566 char text[MAX_PAGE_TEXTSIZE];
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
567 uint8_t textPointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
568 uint32_t id;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
569
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
570 uint8_t i;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
571
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
572 customviewsSubpageMax = (tHome_getNumberOfAvailableCVs(pcv_changelist) / CV_PER_PAGE) + 1;
531
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
573
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
574 if(pcv_curchangelist != pcv_changelist) /* new selection base? => reset page index */
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
575 {
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
576 customviewsSubpage = 0;
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
577 }
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
578 pcv_curchangelist = pcv_changelist;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
579
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
580 CustomviewDivemode_refresh(pcv_changelist);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
581
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
582 for(i=0; i<5;i++) /* fill maximum 5 items and leave last one for sub page selection */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
583 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
584 textPointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
585 id = pcv_changelist[customviewsSubpage * 5 + i];
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
586 if((id == CVIEW_END) || (id == CVIEW_T3_END)) /* last list item? */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
587 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
588 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
589 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
590 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
591 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
592 if(pcv_changelist == cv_changelist)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
593 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
594 text[textPointer++] = '\006' - CHECK_BIT_THOME(pSettings->cv_configuration,id);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
595 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
596 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
597 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
598 text[textPointer++] = '\006' - CHECK_BIT_THOME(pSettings->cv_config_BigScreen,id);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
599 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
600 text[textPointer++] = ' ';
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
601 textPointer += snprintf(&text[textPointer], 60, "%c%c\n\r", TXT_2BYTE, customview_TXT2BYTE_helper(id));
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
602
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
603 switch(i)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
604 {
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
605 case 0: write_field_button(StMCustom3_CViewSelection1, 30, 800, ME_Y_LINE1, &FontT48, "");
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
606 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
607 case 1: write_field_button(StMCustom3_CViewSelection2, 30, 800, ME_Y_LINE2, &FontT48, "");
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
608 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
609 case 2: write_field_button(StMCustom3_CViewSelection3, 30, 800, ME_Y_LINE3, &FontT48, "");
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
610 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
611 case 3: write_field_button(StMCustom3_CViewSelection4, 30, 800, ME_Y_LINE4, &FontT48, "");
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
612 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
613 case 4: write_field_button(StMCustom3_CViewSelection5, 30, 800, ME_Y_LINE5, &FontT48, "");
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
614 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
615 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
616 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
617 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
618 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
619 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
620
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
621 if(customviewsSubpageMax != 1)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
622 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
623 textPointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
624 text[textPointer++] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
625 text[textPointer++] = TXT2BYTE_ButtonNext;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
626 text[textPointer] = 0;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
627 write_field_button(StMCustom3_CViewSelection6, 30, 800, ME_Y_LINE6, &FontT48, text);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
628 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
629
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
630 /* because of the ID handling inside of the functions, all buttons needs to be assigned before the events may be set => have the same loop twice */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
631 for(i=0; i<5;i++) /* fill maximum 5 items and leave last one for sub page selection */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
632 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
633 id = pcv_changelist[customviewsSubpage * 5 + i];
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
634 if((id == CVIEW_END) || (id == CVIEW_T3_END)) /* last list item? */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
635 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
636 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
637 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
638 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
639 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
640 switch(i)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
641 {
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
642 case 0: setEvent(StMCustom3_CViewSelection1, (uint32_t)OnAction_Customview_Toggle);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
643 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
644 case 1: setEvent(StMCustom3_CViewSelection2, (uint32_t)OnAction_Customview_Toggle);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
645 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
646 case 2: setEvent(StMCustom3_CViewSelection3, (uint32_t)OnAction_Customview_Toggle);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
647 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
648 case 3: setEvent(StMCustom3_CViewSelection4, (uint32_t)OnAction_Customview_Toggle);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
649 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
650 case 4: setEvent(StMCustom3_CViewSelection5, (uint32_t)OnAction_Customview_Toggle);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
651 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
652
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
653 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
654 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
655 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
656
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
657 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
658 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
659 if(customviewsSubpageMax != 1)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
660 {
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
661 setEvent(StMCustom3_CViewSelection6,(uint32_t)OnAction_Customview_NextPage);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
662 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
663 for(;i<5;i++) /* clear empty lines in case menu shows less than 5 entries */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
664 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
665 switch(i)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
666 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
667 case 0: write_label_var( 30, 800, ME_Y_LINE1, &FontT48, "");
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
668 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
669 case 1: write_label_var( 30, 800, ME_Y_LINE2, &FontT48, "");
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
670 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
671 case 2: write_label_var( 30, 800, ME_Y_LINE3, &FontT48, "");
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
672 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
673 case 3: write_label_var( 30, 800, ME_Y_LINE4, &FontT48, "");
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
674 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
675 case 4: write_label_var( 30, 800, ME_Y_LINE5, &FontT48, "");
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
676 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
677 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
678 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
679 };
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
680 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
681 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
682 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
683
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
684 void openEdit_CustomviewDivemodeMenu(uint8_t line)
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
685 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
686 static uint8_t customviewsSubpage = 0;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
687 SSettings *pSettings = settingsGetPointer();
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
688 char text[MAX_PAGE_TEXTSIZE];
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
689 uint16_t tabPosition;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
690 uint32_t id;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
691
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
692
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
693 if((line == 6) || (cv_changelist[customviewsSubpage * 5 + line-1] == CVIEW_END)) /* select next set of views */
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
694 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
695 customviewsSubpage++;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
696 if(customviewsSubpage == CV_SUBPAGE_MAX)
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
697 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
698 customviewsSubpage = 0;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
699 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
700 set_CustomsviewsSubpage(customviewsSubpage);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
701 /* rebuild the selection page with the next set of customer views */
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
702 id = tMSystem_refresh(0, text, &tabPosition, NULL);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
703 tM_build_page(id, text, tabPosition, NULL);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
704 openMenu(0);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
705 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
706 else
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
707 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
708 pSettings->cv_configuration ^= 1 << (cv_changelist[customviewsSubpage * 5 + line-1]);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
709 if(t7_GetEnabled_customviews() == 0)
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
710 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
711 pSettings->cv_configuration ^= (1 << CVIEW_noneOrDebug);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
712 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
713 InitMotionDetection(); /* consider new view setup for view selection by motion */
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
714 exitMenuEdit_to_Menu_with_Menu_Update();
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
715 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
716 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
717
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
718 uint8_t OnAction_ExtraDisplay (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
719 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
720 uint8_t newValue;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
721
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
722 newValue = settingsGetPointer()->extraDisplay + 1;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
723 if(newValue == EXTRADISPLAY_DECOGAME) /* Decogame not yet implemented */
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
724 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
725 newValue++;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
726 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
727 if(newValue >= EXTRADISPLAY_END)
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
728 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
729 newValue = EXTRADISPLAY_none;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
730 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
731 settingsGetPointer()->extraDisplay = newValue;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
732 return UNSPECIFIC_RETURN;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
733 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
734
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
735 void CustomviewDivemode_refresh()
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
736 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
737 SSettings *pSettings = settingsGetPointer();
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
738 char text[MAX_PAGE_TEXTSIZE];
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
739 uint8_t textPointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
740 uint32_t id;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
741
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
742 uint8_t i;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
743
531
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
744 text[textPointer++] = '\001';
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
745 text[textPointer++] = TXT_2BYTE;
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
746 text[textPointer++] = TXT2BYTE_SelectCustomviews;
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
747 text[textPointer++] = ' ';
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
748 text[textPointer++] = '1' + customviewsSubpage;
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
749 text[textPointer++] = 0;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
750 write_topline(text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
751
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
752
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
753 for(i=0; i<5;i++) /* fill maximum 5 items and leave last one for sub page selection */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
754 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
755 textPointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
756 id = pcv_curchangelist[customviewsSubpage * 5 + i];
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
757 if((id == CVIEW_END) || (id == CVIEW_T3_END)) /* last list item? */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
758 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
759 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
760 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
761 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
762 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
763 if(pcv_curchangelist == cv_changelist)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
764 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
765 text[textPointer++] = '\006' - CHECK_BIT_THOME(pSettings->cv_configuration,id);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
766 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
767 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
768 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
769 text[textPointer++] = '\006' - CHECK_BIT_THOME(pSettings->cv_config_BigScreen,id);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
770 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
771 text[textPointer++] = ' ';
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
772 textPointer += snprintf(&text[textPointer], 60, "%c%c\n\r", TXT_2BYTE, customview_TXT2BYTE_helper(id));
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
773
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
774 switch(i)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
775 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
776 case 0: write_label_var( 30, 800, ME_Y_LINE1, &FontT48, text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
777 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
778 case 1: write_label_var( 30, 800, ME_Y_LINE2, &FontT48, text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
779 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
780 case 2: write_label_var( 30, 800, ME_Y_LINE3, &FontT48, text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
781 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
782 case 3: write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
783 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
784 case 4: write_label_var( 30, 800, ME_Y_LINE5, &FontT48, text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
785 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
786 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
787 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
788 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
789 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
790 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
791 if(customviewsSubpageMax != 1)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
792 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
793 textPointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
794 text[textPointer++] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
795 text[textPointer++] = TXT2BYTE_ButtonNext;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
796 text[textPointer] = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
797 write_label_var( 30, 800, ME_Y_LINE6, &FontT48, text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
798 }
515
218ac999e96b Added missing display of button labels in refresh function:
Ideenmodellierer
parents: 506
diff changeset
799 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
800 }