annotate Discovery/Src/tMenuEditCustom.c @ 625:028d8f3a9410

Switch Sector / Scroll detection to vector implementation: The vector implementation is mor robust against influences of roll and yaw to the pitch angle. To improve the performance the old sector based implementation has been replaced. In addition after entering focus state the roll angle is ignored. To improve readability and due to removal of some no longer needed function codes, function names have been updated
author Ideenmodellierer
date Mon, 08 Feb 2021 21:35:46 +0100
parents fb5bb04ad914
children 3e1a0e267f38
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"
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
43 #include <math.h>
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
44
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
45
604
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
46 #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
47 #define CV_SUBPAGE_MAX (2u) /* max number of customer view selection pages */
604
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
48 #define MAX_BACKLIGHT_BOOST (2u) /* max number of backlight levels which may be increased during focus state */
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
49
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
50 static uint8_t customviewsSubpage = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
51 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
52 static const uint8_t* pcv_curchangelist;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
53 /* Private function prototypes -----------------------------------------------*/
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
54 void openEdit_Customview(void);
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
55 void openEdit_BigScreen(void);
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
56 void openEdit_MotionCtrl(void);
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
57 void openEdit_ViewPort(void);
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
58 void refresh_Customviews(void);
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
59 char customview_TXT2BYTE_helper(uint8_t customViewId);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
60 /* Announced function prototypes -----------------------------------------------*/
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
61 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
62 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
63 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
64 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
65 uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
66 uint8_t OnAction_CViewPortCalib(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
67 uint8_t OnAction_CViewPortLayout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
68 uint8_t OnAction_CViewPortAmbient(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
604
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
69 uint8_t OnAction_CViewPortControl(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
70 /* Exported functions --------------------------------------------------------*/
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
71
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
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
74
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
75 void refresh_Customviews(void)
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
76 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
77 char text[32];
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
78 uint8_t textpointer = 0;
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 // header
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
81 text[0] = '\001';
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
82 text[1] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
83 text[2] = TXT2BYTE_Customviews;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
84 text[3] = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
85 write_topline(text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
86
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
87 // custom view center return
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
88 textpointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
89 text[textpointer++] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
90 text[textpointer++] = TXT2BYTE_CViewTimeout;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
91 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
92 write_label_var( 30, 700, ME_Y_LINE1, &FontT48, text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
93
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
94 // custom view center primary
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
95 text[0] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
96 text[1] = TXT2BYTE_CViewStandard;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
97 text[2] = ' ';
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
98 text[3] = ' ';
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
99
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
100 text[4] = TXT_2BYTE;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
101 text[5] = customview_TXT2BYTE_helper(settingsGetPointer()->tX_customViewPrimary);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
102 text[6] = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
103 write_label_var( 30, 700, ME_Y_LINE2, &FontT48, text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
104
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
105 // custom view big font
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
106 text[0] = TXT_2BYTE;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
107 text[1] = TXT2BYTE_ExtraDisplay;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
108 text[2] = ' ';
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
109 text[3] = ' ';
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
110 text[4] = TXT_2BYTE;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
111 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
112 text[6] = 0;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
113 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
114
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
115 // field corner return
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
116 textpointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
117 text[textpointer++] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
118 text[textpointer++] = TXT2BYTE_CornerTimeout;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
119 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
120 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
121
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
122 // field corner primary
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
123 text[0] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
124 text[1] = TXT2BYTE_CornerStandard;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
125 text[2] = ' ';
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
126 text[3] = ' ';
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
127 switch(settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
128 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
129 /* Temperature */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
130 case LLC_Temperature:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
131 text[4] = TXT_Temperature;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
132 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
133 /* Average Depth */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
134 case LLC_AverageDepth:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
135 text[4] = TXT_AvgDepth;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
136 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
137 /* ppO2 */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
138 case LLC_ppO2:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
139 text[4] = TXT_ppO2;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
140 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
141 /* Stop Uhr */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
142 case LLC_Stopwatch:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
143 text[4] = TXT_Stopwatch;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
144 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
145 /* Ceiling */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
146 case LLC_Ceiling:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
147 text[4] = TXT_Ceiling;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
148 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
149 /* Future TTS */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
150 case LLC_FutureTTS:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
151 text[4] = TXT_FutureTTS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
152 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
153 /* CNS */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
154 case LLC_CNS:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
155 text[4] = TXT_CNS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
156 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
157 case LLC_GF:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
158 text[4] = TXT_ActualGradient;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
159 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
160 #ifdef ENABLE_BOTTLE_SENSOR
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
161 case LCC_BottleBar:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
162 text[4] = TXT_AtemGasVorrat;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
163 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
164 #endif
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
165 /* none */
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
166 case LLC_Empty:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
167 text[4] = '-';
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
168 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
169 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
170 snprintf(&text[4],2,"%u",settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
171 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
172 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
173 text[5] = 0;
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
174 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
175
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
176 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
177 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
178
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
179 void refresh_ViewPort(void)
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
180 {
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
181 char text[32];
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
182 uint8_t textIndex = 0;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
183 float distance = 0.0;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
184 SSettings* pSettings = settingsGetPointer();
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
185 GFX_DrawCfgScreen* pdrawScreen;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
186 point_t lowerleft = {0,0};
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
187 point_t upperright = {799,479};
575
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
188 float localLimit = 0.1;
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
189
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
190 text[0] = '\001';
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
191 text[1] = TXT_2BYTE;
604
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
192 text[2] = TXT2BYTE_MotionCtrl;
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
193 text[3] = 0;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
194 write_topline(text);
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
195
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
196 text[0] = TXT_2BYTE;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
197 text[1] = TXT2BYTE_CalibView;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
198 text[2] = 0;
604
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
199 write_label_var( 30, 700, ME_Y_LINE2, &FontT48, text);
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
200
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
201 textIndex = 0;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
202 text[textIndex++] = TXT_2BYTE;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
203 text[textIndex++] = TXT2BYTE_IndicateFrame;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
204 text[textIndex++] = ' ';
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
205 text[textIndex++] = '\006' - (settingsGetPointer()->viewPortMode >> 4);
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
206 text[textIndex++] = 0;
604
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
207 write_label_var( 30, 700, ME_Y_LINE3, &FontT48, text);
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
208 textIndex = 0;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
209 text[textIndex++] = TXT_2BYTE;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
210 text[textIndex++] = TXT2BYTE_BoostBacklight;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
211 text[textIndex++] = ' ';
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
212 snprintf(&text[textIndex],32," %d",(settingsGetPointer()->viewPortMode & 0x3));
604
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
213 write_label_var( 30, 700, ME_Y_LINE4, &FontT48, text);
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
214
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
215 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
216
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
217 /* test if we are in focus */
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
218 if((pSettings->viewPitch != 0.0) || (pSettings->viewRoll != 0.0) || (pSettings->viewYaw != 0.0))
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
219 {
625
028d8f3a9410 Switch Sector / Scroll detection to vector implementation:
Ideenmodellierer
parents: 604
diff changeset
220 distance = checkViewport(stateUsed->lifeData.compass_roll, stateUsed->lifeData.compass_pitch, stateUsed->lifeData.compass_heading, MOTION_ENABLE_ALL);
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
221
575
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
222 /* show "bar graph" indicating the distance to the center point */
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
223 textIndex = 0;
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
224 text[textIndex++] = '\001';
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
225
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
226 if(distance < localLimit)
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
227 {
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
228 text[textIndex++] = '+';
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
229 }
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
230 else
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
231 {
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
232 text[textIndex++] = '-';
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
233 while (localLimit < 0.6)
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
234 {
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
235 localLimit += 0.1;
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
236 text[textIndex++] = '-';
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
237 text[textIndex++] = '-';
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
238 if(distance < localLimit)
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
239 {
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
240 break;
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
241 }
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
242 }
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
243 }
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
244 text[textIndex] = 0;
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
245 write_label_var( 30, 700, ME_Y_LINE1, &FontT48, text);
86c4baa6ba29 Change style of viewport calibration menu:
Ideenmodellierer
parents: 572
diff changeset
246
604
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
247 /* MotionCtrl */
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
248 textIndex = 0;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
249
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
250 text[textIndex++] = TXT_2BYTE;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
251 text[textIndex++] = TXT2BYTE_MotionCtrl;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
252 text[textIndex++] = ' ';
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
253 text[textIndex++] = ' ';
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
254 text[textIndex++] = TXT_2BYTE;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
255 switch(settingsGetPointer()->MotionDetection)
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
256 {
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
257 case MOTION_DETECT_OFF:
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
258 text[textIndex++] = TXT2BYTE_MoCtrlNone;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
259 break;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
260 case MOTION_DETECT_MOVE:
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
261 text[textIndex++] = TXT2BYTE_MoCtrlPitch;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
262 break;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
263 case MOTION_DETECT_SECTOR:
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
264 text[textIndex++] = TXT2BYTE_MoCtrlSector;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
265 break;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
266 case MOTION_DETECT_SCROLL:
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
267 text[textIndex++] = TXT2BYTE_MoCtrlScroll;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
268 break;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
269 default:
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
270 snprintf(&text[4],2,"%u",settingsGetPointer()->MotionDetection);
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
271 textIndex++;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
272 break;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
273 }
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
274 text[textIndex] = 0;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
275 write_label_var( 30, 700, ME_Y_LINE6, &FontT48, text);
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
276
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
277 if(distance < 0.5)
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
278 {
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
279 set_Backlight_Boost(settingsGetPointer()->viewPortMode & 0x03);
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
280 if(pSettings->viewPortMode >> 4)
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
281 {
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
282 pdrawScreen = getMenuEditScreen();
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
283 GFX_draw_box(pdrawScreen,lowerleft,upperright,0,CLUT_NiceGreen);
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
284 }
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
285 }
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
286 else
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
287 {
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
288 set_Backlight_Boost(0);
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
289 if(pSettings->viewPortMode >> 4)
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
290 {
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
291 pdrawScreen = getMenuEditScreen();
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
292 GFX_draw_box(pdrawScreen,lowerleft,upperright,0,CLUT_MenuTopBackground);
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
293 }
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
294 }
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
295 resetFocusState(); /* no other instance shall be impacted by the local detection */
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
296 }
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
297 }
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
298
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
299 void openEdit_Custom(uint8_t line)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
300 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
301 set_globalState_Menu_Line(line);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
302 resetMenuEdit(CLUT_MenuPageCustomView);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
303
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
304 switch(line)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
305 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
306 case 1:
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
307 default: openEdit_Customview();
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
308 break;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
309 case 2: openEdit_BigScreen();
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
310 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
311 case 3: openEdit_CustomviewDivemode(cv_changelist);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
312 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
313 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
314 break;
604
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
315 case 5: openEdit_ViewPort();
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
316 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
317 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
318 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
319
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
320 /* Private functions ---------------------------------------------------------*/
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
321 void openEdit_Customview(void)
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
322 {
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
323 refresh_Customviews();
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
324
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
325 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
326 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
327 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
328
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
329 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
330 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
331
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
332 setEvent(StMCustom1_CViewTimeout, (uint32_t)OnAction_CViewTimeout);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
333 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
334 setEvent(StMCustom1_CViewStandardBF, (uint32_t)OnAction_CViewStandardBF);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
335
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
336 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
337 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
338 }
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
339
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
340 void openEdit_BigScreen(void)
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
341 {
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
342 uint8_t newValue = 0;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
343 SSettings *pSettings = settingsGetPointer();
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
344
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
345 newValue = pSettings->extraDisplay + 1;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
346 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
347 {
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
348 newValue++;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
349 }
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
350 if(newValue >= EXTRADISPLAY_END)
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
351 {
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
352 newValue = EXTRADISPLAY_none;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
353 }
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
354 pSettings->extraDisplay = newValue;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
355
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
356 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
357 }
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
358
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
359 void openEdit_MotionCtrl(void)
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
360 {
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
361 uint8_t newValue = 0;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
362 SSettings *pSettings = settingsGetPointer();
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
363
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
364 switch(pSettings->MotionDetection)
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
365 {
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
366 case MOTION_DETECT_OFF:
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
367 newValue = MOTION_DETECT_MOVE;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
368 break;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
369 case MOTION_DETECT_MOVE:
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
370 newValue = MOTION_DETECT_SECTOR;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
371 break;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
372 case MOTION_DETECT_SECTOR:
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
373 newValue = MOTION_DETECT_SCROLL;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
374 break;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
375 case MOTION_DETECT_SCROLL:
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
376 newValue = MOTION_DETECT_OFF;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
377 break;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
378 default:
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
379 newValue = MOTION_DETECT_OFF;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
380 break;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
381 }
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
382 pSettings->MotionDetection = newValue;
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
383 InitMotionDetection();
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
384
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
385 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
386 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
387
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
388
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
389
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
390 void openEdit_ViewPort(void)
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
391 {
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
392 refresh_ViewPort();
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
393
604
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
394 write_field_button(StMCustom5_CViewPortCalib, 400, 700, ME_Y_LINE2, &FontT48, "");
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
395 write_field_button(StMCustom5_CViewPortLayout, 400, 700, ME_Y_LINE3, &FontT48, "");
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
396 write_field_button(StMCustom5_CViewPortAmbient, 400, 700, ME_Y_LINE4, &FontT48, "");
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
397 write_field_button(StMCustom5_CViewPortControl, 400, 700, ME_Y_LINE6, &FontT48, "");
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
398
604
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
399
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
400 setEvent(StMCustom5_CViewPortCalib, (uint32_t)OnAction_CViewPortCalib);
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
401 setEvent(StMCustom5_CViewPortLayout, (uint32_t)OnAction_CViewPortLayout);
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
402 setEvent(StMCustom5_CViewPortAmbient, (uint32_t)OnAction_CViewPortAmbient);
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
403 setEvent(StMCustom5_CViewPortControl, (uint32_t)OnAction_CViewPortControl);
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
404 }
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
405
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
406
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
407 char customview_TXT2BYTE_helper(uint8_t customViewId)
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
408 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
409 char text = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
410
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
411 switch(customViewId)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
412 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
413 case CVIEW_sensors:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
414 text = TXT2BYTE_O2monitor;
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_sensors_mV:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
417 text = TXT2BYTE_O2voltage;
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_Compass:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
420 text = TXT2BYTE_Compass;
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_Decolist:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
423 case CVIEW_T3_Decostop:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
424 text = TXT2BYTE_Decolist;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
425 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
426 case CVIEW_Tissues:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
427 text = TXT2BYTE_Tissues;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
428 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
429 case CVIEW_Profile:
600
a48a1cd983af Added compile switch for new T3 View Profile
Ideenmodellierer
parents: 594
diff changeset
430 #ifdef ENABLE_T3_PROFILE_VIEW
594
280c11153080 Added compile switch for new T3 View Profile
Ideenmodellierer
parents: 575
diff changeset
431 case CVIEW_T3_Profile:
600
a48a1cd983af Added compile switch for new T3 View Profile
Ideenmodellierer
parents: 594
diff changeset
432 #endif
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
433 text = TXT2BYTE_Profile;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
434 break;
531
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
435 case CVIEW_Gaslist:
515
218ac999e96b Added missing display of button labels in refresh function:
Ideenmodellierer
parents: 506
diff changeset
436 case CVIEW_T3_GasList:
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
437 text = TXT2BYTE_Gaslist;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
438 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
439 case CVIEW_EADTime:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
440 text = TXT2BYTE_Info;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
441 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
442 case CVIEW_SummaryOfLeftCorner:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
443 text = TXT2BYTE_Summary;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
444 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
445 case CVIEW_noneOrDebug:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
446 text = TXT2BYTE_DispNoneDbg;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
447 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
448 case CVIEW_T3_MaxDepth:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
449 text = TXT2BYTE_MaxDepth;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
450 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
451 case CVIEW_T3_StopWatch:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
452 text = TXT2BYTE_Stopwatch;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
453 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
454 case CVIEW_T3_TTS:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
455 text = TXT2BYTE_TTS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
456 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
457 case CVIEW_T3_ppO2andGas:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
458 text = TXT2BYTE_ppoNair;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
459 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
460 case CVIEW_T3_Navigation:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
461 text = TXT2BYTE_Navigation;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
462 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
463 case CVIEW_T3_DepthData:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
464 text = TXT2BYTE_DepthData;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
465 break;
542
6960df7ddb09 Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents: 541
diff changeset
466 case CVIEW_T3_DecoTTS:
6960df7ddb09 Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents: 541
diff changeset
467 text = TXT2BYTE_DecoTTS;
6960df7ddb09 Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents: 541
diff changeset
468 break;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
469 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
470 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
471 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
472 return text;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
473 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
474
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
475
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
476 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
477 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
478 uint8_t value;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
479 value = settingsGetPointer()->tX_customViewTimeout;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
480
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
481 if(value < 5)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
482 value = 5;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
483 else if(value < 10)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
484 value = 10;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
485 else if(value < 15)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
486 value = 15;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
487 else if(value < 20)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
488 value = 20;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
489 else if(value < 30)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
490 value = 30;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
491 else if(value < 45)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
492 value = 45;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
493 else if(value < 60)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
494 value = 60;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
495 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
496 value = 0;
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 settingsGetPointer()->tX_customViewTimeout = value;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
499 return UPDATE_DIVESETTINGS;
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
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
502
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
503 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
504 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
505 uint8_t newValue;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
506 switch(settingsGetPointer()->tX_customViewPrimary)
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 case CVIEW_sensors:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
509 newValue = CVIEW_sensors_mV;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
510 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
511 case CVIEW_sensors_mV:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
512 newValue = CVIEW_Compass;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
513 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
514 case CVIEW_Compass:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
515 newValue = CVIEW_Decolist;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
516 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
517 case CVIEW_Decolist:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
518 newValue = CVIEW_Tissues;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
519 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
520 case CVIEW_Tissues:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
521 newValue = CVIEW_Profile;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
522 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
523 case CVIEW_Profile:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
524 newValue = CVIEW_Gaslist;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
525 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
526 case CVIEW_Gaslist:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
527 newValue = CVIEW_EADTime;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
528 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
529 case CVIEW_EADTime:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
530 newValue = CVIEW_SummaryOfLeftCorner;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
531 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
532 case CVIEW_SummaryOfLeftCorner:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
533 newValue = CVIEW_noneOrDebug;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
534 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
535 case CVIEW_noneOrDebug:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
536 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
537 newValue = CVIEW_sensors;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
538 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
539 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
540 settingsGetPointer()->tX_customViewPrimary = newValue;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
541 return UPDATE_DIVESETTINGS;
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
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
544 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
545 {
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
546 uint8_t index = 0;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
547 uint8_t newValue;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
548
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
549 /* 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
550 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
551 {
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
552 index++;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
553 }
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
554 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
555 {
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
556 newValue = cv_changelist_BS[0];
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
557 }
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
558 else
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
559 {
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
560 newValue = cv_changelist_BS[index + 1];
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
561 }
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
562
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
563 settingsGetPointer()->tX_customViewPrimaryBF = newValue;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
564 return UPDATE_DIVESETTINGS;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
565 }
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 531
diff changeset
566
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
567
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
568 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
569 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
570 uint8_t value;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
571 value = settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
572
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
573 if(value < 5)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
574 value = 5;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
575 else if(value < 10)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
576 value = 10;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
577 else if(value < 15)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
578 value = 15;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
579 else if(value < 20)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
580 value = 20;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
581 else if(value < 30)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
582 value = 30;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
583 else if(value < 45)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
584 value = 45;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
585 else if(value < 60)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
586 value = 60;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
587 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
588 value = 0;
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 settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout = value;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
591 return UPDATE_DIVESETTINGS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
592 }
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
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
595 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
596 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
597 uint8_t value;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
598 value = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary;
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 value += 1;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
601
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
602 if(value >= LLC_END)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
603 value = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
604
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
605 settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary = value;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
606 return UPDATE_DIVESETTINGS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
607 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
608
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
609
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
610 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
611 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
612
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
613 uint8_t line = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
614 SSettings *pSettings = settingsGetPointer();
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
615
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
616 switch(editId)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
617 {
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
618 case StMCustom3_CViewSelection1: line = 1;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
619 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
620 case StMCustom3_CViewSelection2: line = 2;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
621 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
622 case StMCustom3_CViewSelection3: line = 3;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
623 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
624 case StMCustom3_CViewSelection4: line = 4;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
625 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
626 case StMCustom3_CViewSelection5: line = 5;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
627 break;
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 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
630 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
631 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
632 if(pcv_curchangelist == cv_changelist)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
633 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
634 pSettings->cv_configuration ^= 1 << (pcv_curchangelist[customviewsSubpage * 5 + line-1]);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
635 if(t7_GetEnabled_customviews() == 0)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
636 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
637 pSettings->cv_configuration ^= (1 << CVIEW_noneOrDebug);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
638 }
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 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
641 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
642 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
643 if(t3_GetEnabled_customviews() == 0)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
644 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
645 pSettings->cv_config_BigScreen ^= (1 << CVIEW_noneOrDebug);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
646 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
647 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
648 return UPDATE_DIVESETTINGS;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
649 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
650
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
651
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
652 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
653 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
654 customviewsSubpage++;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
655 if(customviewsSubpage == customviewsSubpageMax)
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 customviewsSubpage = 0;
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 resetMenuEdit(CLUT_MenuPageCustomView); /* rebuild page */
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
660 openEdit_CustomviewDivemode(pcv_curchangelist);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
661
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
662 tMenuEdit_select(StMCustom3_CViewSelection6);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
663 return UPDATE_DIVESETTINGS;
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
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
666 uint8_t OnAction_CViewPortCalib(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
667 {
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
668 float heading;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
669 if(settingsGetPointer()->compassInertia)
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
670 {
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
671 heading = (uint16_t)compass_getCompensated();
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
672 }
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
673 else
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
674 {
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
675 heading = (uint16_t)stateUsed->lifeData.compass_heading;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
676 }
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
677 calibrateViewport(stateUsed->lifeData.compass_roll,stateUsed->lifeData.compass_pitch,heading);
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
678
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
679 return UPDATE_DIVESETTINGS;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
680 }
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
681 uint8_t OnAction_CViewPortLayout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
682 {
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
683 SSettings* pSettings = settingsGetPointer();
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
684 if(pSettings->viewPortMode >> 4 != 0)
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
685 {
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
686 pSettings->viewPortMode &= 0x0F;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
687 }
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
688 else
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
689 {
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
690 pSettings->viewPortMode |= 0x10;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
691 }
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
692
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
693 return UPDATE_DIVESETTINGS;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
694 }
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
695 uint8_t OnAction_CViewPortAmbient(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
696 {
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
697 SSettings* pSettings = settingsGetPointer();
604
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
698 if(((pSettings->viewPortMode +1) & 0x03) <= MAX_BACKLIGHT_BOOST)
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
699 {
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
700 pSettings->viewPortMode++;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
701 }
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
702 else
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
703 {
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
704 pSettings->viewPortMode &= 0xFC;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
705 }
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
706
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
707 return UPDATE_DIVESETTINGS;
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
708 }
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
709
604
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
710 uint8_t OnAction_CViewPortControl(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
711 {
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
712 uint8_t newValue = 0;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
713 SSettings *pSettings = settingsGetPointer();
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
714
604
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
715 switch(pSettings->MotionDetection)
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
716 {
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
717 case MOTION_DETECT_OFF:
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
718 newValue = MOTION_DETECT_MOVE;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
719 break;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
720 case MOTION_DETECT_MOVE:
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
721 newValue = MOTION_DETECT_SECTOR;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
722 break;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
723 case MOTION_DETECT_SECTOR:
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
724 newValue = MOTION_DETECT_SCROLL;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
725 break;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
726 case MOTION_DETECT_SCROLL:
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
727 newValue = MOTION_DETECT_OFF;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
728 break;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
729 default:
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
730 newValue = MOTION_DETECT_OFF;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
731 break;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
732 }
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
733 pSettings->MotionDetection = newValue;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
734 return UPDATE_DIVESETTINGS;
fb5bb04ad914 Merged menu items of viewport and motion control:
Ideenmodellierer
parents: 600
diff changeset
735 }
552
531e7818b737 Added menu structure to acces viewport calibration:
Ideenmodellierer
parents: 542
diff changeset
736
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
737 void openEdit_CustomviewDivemode(const uint8_t* pcv_changelist)
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
738 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
739
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
740 SSettings *pSettings = settingsGetPointer();
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
741 char text[MAX_PAGE_TEXTSIZE];
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
742 uint8_t textPointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
743 uint32_t id;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
744
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
745 uint8_t i;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
746
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
747 customviewsSubpageMax = (tHome_getNumberOfAvailableCVs(pcv_changelist) / CV_PER_PAGE) + 1;
531
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
748
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
749 if(pcv_curchangelist != pcv_changelist) /* new selection base? => reset page index */
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
750 {
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
751 customviewsSubpage = 0;
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
752 }
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
753 pcv_curchangelist = pcv_changelist;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
754
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
755 CustomviewDivemode_refresh(pcv_changelist);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
756
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
757 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
758 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
759 textPointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
760 id = pcv_changelist[customviewsSubpage * 5 + i];
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
761 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
762 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
763 break;
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 else
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 if(pcv_changelist == cv_changelist)
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_configuration,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 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
772 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
773 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
774 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
775 text[textPointer++] = ' ';
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
776 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
777
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
778 switch(i)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
779 {
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
780 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
781 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
782 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
783 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
784 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
785 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
786 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
787 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
788 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
789 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
790 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
791 break;
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 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
794 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
795
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
796 if(customviewsSubpageMax != 1)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
797 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
798 textPointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
799 text[textPointer++] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
800 text[textPointer++] = TXT2BYTE_ButtonNext;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
801 text[textPointer] = 0;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
802 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
803 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
804
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
805 /* 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
806 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
807 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
808 id = pcv_changelist[customviewsSubpage * 5 + i];
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
809 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
810 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
811 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
812 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
813 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
814 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
815 switch(i)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
816 {
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
817 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
818 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
819 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
820 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
821 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
822 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
823 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
824 break;
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
825 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
826 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
827
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
828 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
829 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
830 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
831
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
832 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
833 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
834 if(customviewsSubpageMax != 1)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
835 {
521
e221cf762f45 Move Bigfont and motion Ctrl selection menu out of custom view submenu:
Ideenmodellierer
parents: 520
diff changeset
836 setEvent(StMCustom3_CViewSelection6,(uint32_t)OnAction_Customview_NextPage);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
837 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
838 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
839 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
840 switch(i)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
841 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
842 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
843 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
844 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
845 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
846 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
847 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
848 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
849 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
850 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
851 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
852 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
853 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
854 };
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
855 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
856 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
857 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
858
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
859 void openEdit_CustomviewDivemodeMenu(uint8_t line)
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
860 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
861 static uint8_t customviewsSubpage = 0;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
862 SSettings *pSettings = settingsGetPointer();
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
863 char text[MAX_PAGE_TEXTSIZE];
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
864 uint16_t tabPosition;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
865 uint32_t id;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
866
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
867
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
868 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
869 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
870 customviewsSubpage++;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
871 if(customviewsSubpage == CV_SUBPAGE_MAX)
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
872 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
873 customviewsSubpage = 0;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
874 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
875 set_CustomsviewsSubpage(customviewsSubpage);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
876 /* rebuild the selection page with the next set of customer views */
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
877 id = tMSystem_refresh(0, text, &tabPosition, NULL);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
878 tM_build_page(id, text, tabPosition, NULL);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
879 openMenu(0);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
880 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
881 else
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
882 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
883 pSettings->cv_configuration ^= 1 << (cv_changelist[customviewsSubpage * 5 + line-1]);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
884 if(t7_GetEnabled_customviews() == 0)
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
885 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
886 pSettings->cv_configuration ^= (1 << CVIEW_noneOrDebug);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
887 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
888 InitMotionDetection(); /* consider new view setup for view selection by motion */
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
889 exitMenuEdit_to_Menu_with_Menu_Update();
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
890 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
891 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
892
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
893 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
894 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
895 uint8_t newValue;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
896
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
897 newValue = settingsGetPointer()->extraDisplay + 1;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
898 if(newValue == EXTRADISPLAY_DECOGAME) /* Decogame not yet implemented */
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
899 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
900 newValue++;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
901 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
902 if(newValue >= EXTRADISPLAY_END)
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
903 {
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
904 newValue = EXTRADISPLAY_none;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
905 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
906 settingsGetPointer()->extraDisplay = newValue;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
907 return UNSPECIFIC_RETURN;
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
908 }
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
909
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
910 void CustomviewDivemode_refresh()
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
911 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
912 SSettings *pSettings = settingsGetPointer();
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
913 char text[MAX_PAGE_TEXTSIZE];
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
914 uint8_t textPointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
915 uint32_t id;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
916
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
917 uint8_t i;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
918
531
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
919 text[textPointer++] = '\001';
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
920 text[textPointer++] = TXT_2BYTE;
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
921 text[textPointer++] = TXT2BYTE_SelectCustomviews;
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
922 text[textPointer++] = ' ';
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
923 text[textPointer++] = '1' + customviewsSubpage;
1721b26335f1 Bugfix custom view selection dialog:
Ideenmodellierer
parents: 521
diff changeset
924 text[textPointer++] = 0;
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
925 write_topline(text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
926
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
927
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
928 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
929 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
930 textPointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
931 id = pcv_curchangelist[customviewsSubpage * 5 + i];
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
932 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
933 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
934 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
935 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
936 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
937 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
938 if(pcv_curchangelist == cv_changelist)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
939 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
940 text[textPointer++] = '\006' - CHECK_BIT_THOME(pSettings->cv_configuration,id);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
941 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
942 else
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
943 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
944 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
945 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
946 text[textPointer++] = ' ';
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 515
diff changeset
947 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
948
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
949 switch(i)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
950 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
951 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
952 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
953 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
954 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
955 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
956 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
957 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
958 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
959 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
960 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
961 default:
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
962 break;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
963 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
964 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
965 }
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
966 if(customviewsSubpageMax != 1)
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
967 {
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
968 textPointer = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
969 text[textPointer++] = TXT_2BYTE;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
970 text[textPointer++] = TXT2BYTE_ButtonNext;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
971 text[textPointer] = 0;
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
972 write_label_var( 30, 800, ME_Y_LINE6, &FontT48, text);
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
973 }
515
218ac999e96b Added missing display of button labels in refresh function:
Ideenmodellierer
parents: 506
diff changeset
974 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
506
998529b3e142 Added new top level menu for customization of views
Ideenmodellierer
parents:
diff changeset
975 }