annotate Discovery/Src/tMenuEditSystem.c @ 496:9623f166b0c0

Bugfix display of disabled screen. It is possible to select a screen as default which is in parallel disabled in the selection view. To avoid this the enable / disable state is not also checked when entering dive mode. The check function was depending on an ACTION. The functionality has been changed to allow the function call without ACTION. Changed setting of compass circle position from constant position to variable This was needed to reuse the same function in several views with different compass position Added new views Navigation and Depth data Both views were basically already available but the idea behind the layout is to combine all information needed for navigation dives (compass + timer) in one view. The classic maxdepth view just showed the maxdepth with a black box on the right side. this box is now used for display of average depth (shown in classic view Stopwatch) Minor changes in compass paint function to improve code readability Use same Y offset for all views While switching across the views some number were shown ~20 pixel higher than others. This was caused by the usage of the line selection which works for some fonts but not for all => set linenumber to 0 for all views
author Ideenmodellierer
date Mon, 24 Aug 2020 19:53:27 +0200
parents b560e474e319
children 06b21f1e47a5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 /// -*- coding: UTF-8 -*-
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 /// \file Discovery/Src/tMenuEditSystem.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Main Template file for Menu Edit System settings
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 /// \author heinrichs weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 /// \date 05-Aug-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 /// \details
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 /// $Id$
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 /// This program is free software: you can redistribute it and/or modify
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 /// it under the terms of the GNU General Public License as published by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 /// the Free Software Foundation, either version 3 of the License, or
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 /// (at your option) any later version.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 /// This program is distributed in the hope that it will be useful,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 /// GNU General Public License for more details.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 /// You should have received a copy of the GNU General Public License
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 //////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 #include "tMenuEditSystem.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31
138
cc9c18075e00 Removed no longer supported scooter code
Ideenmodellierer
parents: 118
diff changeset
32 #include "data_exchange_main.h"
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 #include "externLogbookFlash.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 #include "gfx_fonts.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 #include "ostc.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 #include "settings.h" // for getLicence()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass()
343
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
38 #include "tMenu.h"
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 #include "tMenuEdit.h"
343
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
40 #include "tMenuSystem.h"
389
ebc2b571a0b9 Fix case for case sensitive OS
Jan Mulder <jan@jlmulder.nl>
parents: 384
diff changeset
41 #include "motion.h"
343
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
42 #include "t7.h"
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
43
493
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
44
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
45 #define CV_SUBPAGE_MAX (2u) /* max number of customer view selection pages */
343
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
46 /*#define HAVE_DEBUG_VIEW */
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
47 static uint8_t infoPage = 0;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 /* Private function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 void openEdit_DateTime(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 void openEdit_Language(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 void openEdit_Design(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 void openEdit_Customview(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 void openEdit_Information(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 void openEdit_Reset(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 void openEdit_CustomviewDivemode(uint8_t line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 //void openEdit_ShowDebugInfo(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 //void openEdit_Salinity(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 /* Announced function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 uint8_t OnAction_Date (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 uint8_t OnAction_Time (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 uint8_t OnAction_DDMMYY (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 uint8_t OnAction_MMDDYY (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 uint8_t OnAction_YYMMDD (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 uint8_t OnAction_DST (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 uint8_t OnAction_English (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 uint8_t OnAction_German (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 uint8_t OnAction_French (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 uint8_t OnAction_Italian (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 uint8_t OnAction_Espanol (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 //uint8_t OnAction_Design_t7 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 //uint8_t OnAction_Design_t7ft (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 //uint8_t OnAction_Design_t3 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 uint8_t OnAction_Units (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 uint8_t OnAction_Colorscheme (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 uint8_t OnAction_DebugInfo (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 uint8_t OnAction_CViewTimeout (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 uint8_t OnAction_CViewStandard (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 uint8_t OnAction_CornerTimeout (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 uint8_t OnAction_ExtraDisplay (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
368
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
85 uint8_t OnAction_MotionCtrl (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 uint8_t OnAction_Exit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 uint8_t OnAction_Confirm (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 uint8_t OnAction_ResetDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 uint8_t OnAction_ResetAll (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 uint8_t OnAction_ResetLogbook (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
468
aa1d71875e25 Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents: 446
diff changeset
98 #ifdef ENABLE_ANALYSE_SAMPLES
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
99 uint8_t OnAction_RecoverSampleIdx(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
468
aa1d71875e25 Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents: 446
diff changeset
100 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 #ifdef SCREENTEST
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 uint8_t OnAction_ScreenTest (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 uint8_t OnAction_Information (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 uint8_t OnAction_Salinity (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 uint8_t OnAction_TestCLog (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 void openEdit_System(uint8_t line)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 set_globalState_Menu_Line(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 resetMenuEdit(CLUT_MenuPageSystem);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 if(actual_menu_content == MENU_SURFACE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 switch(line)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 case 1:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 openEdit_DateTime();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 case 2:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 openEdit_Language();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 case 3:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 openEdit_Design();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 case 4:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 openEdit_Customview();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 case 5:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 openEdit_Information();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 case 6:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 openEdit_Reset();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 case 3:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 openEdit_DecoFutureTTS();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 case 4:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 openEdit_DecoLastStop();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 openEdit_CustomviewDivemode(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 void openEdit_CustomviewDivemode(uint8_t line)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 {
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
161 static uint8_t customviewsSubpage = 0;
210
b2a9e9b02df0 New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents: 138
diff changeset
162 SSettings *pSettings = settingsGetPointer();
b2a9e9b02df0 New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents: 138
diff changeset
163 extern _Bool WriteSettings;
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
164 char text[MAX_PAGE_TEXTSIZE];
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
165 uint16_t tabPosition;
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
166 uint32_t id;
210
b2a9e9b02df0 New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents: 138
diff changeset
167
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
168
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
169 if((line == 6) || (cv_changelist[customviewsSubpage * 5 + line-1] == CVIEW_END)) /* select next set of views */
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
170 {
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
171 customviewsSubpage++;
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
172 if(customviewsSubpage == CV_SUBPAGE_MAX)
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
173 {
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
174 customviewsSubpage = 0;
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
175 }
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
176 set_CustomsviewsSubpage(customviewsSubpage);
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
177 /* rebuild the selection page with the next set of customer views */
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
178 id = tMSystem_refresh(0, text, &tabPosition, NULL);
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
179 tM_build_page(id, text, tabPosition, NULL);
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
180 openMenu(0);
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
181 }
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
182 else
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
183 {
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
184 pSettings->cv_configuration ^= 1 << (cv_changelist[customviewsSubpage * 5 + line-1]);
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
185 if(t7_GetEnabled_customviews() == 0)
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
186 {
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
187 pSettings->cv_configuration ^= (1 << CVIEW_noneOrDebug);
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
188 }
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
189 WriteSettings = 1;
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
190 InitMotionDetection(); /* consider new view setup for view selection by motion */
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
191 exitMenuEdit_to_Menu_with_Menu_Update();
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 373
diff changeset
192 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 void openEdit_DateTime(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 RTC_DateTypeDef Sdate;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 RTC_TimeTypeDef Stime;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 uint8_t day,month,year,hour,minute, dateFormat, ddmmyy, mmddyy, yymmdd;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 const SDiveState * pStateReal = stateRealGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 translateDate(pStateReal->lifeData.dateBinaryFormat, &Sdate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 translateTime(pStateReal->lifeData.timeBinaryFormat, &Stime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 year = Sdate.Year;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 month = Sdate.Month;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 day = Sdate.Date;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 hour = Stime.Hours;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 minute= Stime.Minutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 if(year < 16)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 year = 16;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 if(month < 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 month = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 if(day < 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 day = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 // daylightsaving = Stime.DayLightSaving;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 dateFormat = pSettings->date_format;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 ddmmyy = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 mmddyy = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 yymmdd = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 if(dateFormat == DDMMYY)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 ddmmyy = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 if(dateFormat == MMDDYY)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 mmddyy = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 yymmdd = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 text[1] = TXT_DateAndTime;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 write_label_fix( 20, 340, ME_Y_LINE1, &FontT42, TXT_TimeConfig);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 write_label_fix( 20, 340, ME_Y_LINE2, &FontT42, TXT_DateConfig);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 write_label_var( 600, 800, ME_Y_LINE2, &FontT48, "\016\016DDMMYY\017");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 write_label_fix( 20, 790, ME_Y_LINE3, &FontT42, TXT_Format);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 // write_label_fix( 350 ,580, 250, &FontT42, TXT_Daylightsaving);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 write_field_2digit(StMSYS1_Time, 320, 780, ME_Y_LINE1, &FontT48, "##:##", (uint32_t)hour, (uint32_t)minute, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 write_field_2digit(StMSYS1_Date, 320, 780, ME_Y_LINE2, &FontT48, "##-##-20##", (uint32_t)day, (uint32_t)month, (uint32_t)year, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 write_field_on_off(StMSYS1_DDMMYY, 320, 790, ME_Y_LINE3, &FontT48, "DDMMYY", ddmmyy);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 write_field_on_off(StMSYS1_MMDDYY, 320, 790, ME_Y_LINE4, &FontT48, "MMDDYY", mmddyy);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 write_field_on_off(StMSYS1_YYMMDD, 320, 790, ME_Y_LINE5, &FontT48, "YYMMDD", yymmdd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 // write_field_on_off(StMSYS1_DST, 350, 580, 310, &FontT48, "Active", daylightsaving);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 setEvent(StMSYS1_Date, (uint32_t)OnAction_Date);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 setEvent(StMSYS1_Time, (uint32_t)OnAction_Time);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 setEvent(StMSYS1_DDMMYY, (uint32_t)OnAction_DDMMYY);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 setEvent(StMSYS1_MMDDYY, (uint32_t)OnAction_MMDDYY);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 setEvent(StMSYS1_YYMMDD, (uint32_t)OnAction_YYMMDD);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 // setEvent(StMSYS1_DST, (uint32_t)OnAction_DST);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 uint8_t OnAction_Date(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 uint8_t digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 uint32_t newDay, newMonth, newYear;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 RTC_DateTypeDef sdatestructure;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 evaluateNewString(editId, &newDay, &newMonth, &newYear, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 if(newDay == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 newDay = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 if(newDay > 31)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 newDay = 31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 if(newMonth == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 newMonth = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 if(newMonth > 12)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 newMonth = 12;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 if((newMonth == 2) && (newDay > 29))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 newDay = 29;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 if((newDay > 30) && ((newMonth == 4) ||(newMonth == 6) ||(newMonth == 9) ||(newMonth == 11)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 newDay = 30;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 if(newYear < 17)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 newYear = 17;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 if(newYear > 99)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 newYear = 99;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 sdatestructure.Date = newDay;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 sdatestructure.Month = newMonth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 sdatestructure.Year = newYear;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 setWeekday(&sdatestructure);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 setDate(sdatestructure);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 tMenuEdit_newInput(editId, newDay, newMonth, newYear, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 if((blockNumber == 0) && (digitContentNew > '0' + 31))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 digitContentNew = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 if((blockNumber == 1) && (digitContentNew > '0' + 12))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 digitContentNew = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 // year range 2017-2018
55
a7683f9765da Italian activated (needs some fine tuning), special characters (?,?,?,?,? and others) currently not working...
heinrichsweikamp
parents: 38
diff changeset
316 if((blockNumber == 2) && (digitContentNew > '0' + 22))
a7683f9765da Italian activated (needs some fine tuning), special characters (?,?,?,?,? and others) currently not working...
heinrichsweikamp
parents: 38
diff changeset
317 digitContentNew = '0' + 18;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 if((blockNumber == 0) && (digitContentNew < '1'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 digitContentNew = '0' + 31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 if((blockNumber == 1) && (digitContentNew < '1'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326 digitContentNew = '0' + 12;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 // year range 2016-2018
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 if((blockNumber == 2) && (digitContentNew < '0' + 17))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 digitContentNew = '0' + 18;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 if((blockNumber == 2) && (digitNumber == 0) && (digitContentNew > '2'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 digitContentNew = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew > '3'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew > '1'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 if(digitContentNew > '9')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 if((blockNumber == 2) && (digitNumber == 0) && (digitContentNew < '1'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 digitContentNew = '2';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 digitContentNew = '3';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 digitContentNew = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 if(digitContentNew < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 digitContentNew = '9';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 uint8_t OnAction_Time(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 uint8_t digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 uint32_t newHour, newMinute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 RTC_TimeTypeDef stimestructure;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 evaluateNewString(editId, &newHour, &newMinute, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 if(newHour > 23)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 newHour = 23;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 if(newMinute > 59)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 newMinute = 59;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 stimestructure.Hours = newHour;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 stimestructure.Minutes = newMinute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 stimestructure.Seconds = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 setTime(stimestructure);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 tMenuEdit_newInput(editId, newHour, newMinute, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 if((blockNumber == 0) && (digitContentNew > '0' + 23))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 if((blockNumber == 1) && (digitContentNew > '0' + 59))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 if((blockNumber == 0) && (digitContentNew < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 digitContentNew = '0' + 23;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 if((blockNumber == 1) && (digitContentNew < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 digitContentNew = '0' + 59;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew > '2'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew > '5'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 if(digitContentNew > '9')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 digitContentNew = '2';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 digitContentNew = '5';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 if(digitContentNew < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 digitContentNew = '9';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 uint8_t OnAction_DDMMYY(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 pSettings->date_format = DDMMYY;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 tMenuEdit_set_on_off(editId, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 tMenuEdit_set_on_off(StMSYS1_MMDDYY, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 tMenuEdit_set_on_off(StMSYS1_YYMMDD, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 uint8_t OnAction_MMDDYY(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 pSettings->date_format = MMDDYY;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 tMenuEdit_set_on_off(editId, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460 tMenuEdit_set_on_off(StMSYS1_DDMMYY, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 tMenuEdit_set_on_off(StMSYS1_YYMMDD, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 uint8_t OnAction_YYMMDD(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472 pSettings->date_format = YYMMDD;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 tMenuEdit_set_on_off(editId, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475 tMenuEdit_set_on_off(StMSYS1_MMDDYY, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 tMenuEdit_set_on_off(StMSYS1_DDMMYY, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 uint8_t OnAction_DST(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 RTC_TimeTypeDef stimestructure;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 uint8_t newDST;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 get_RTC_DateTime(0, &stimestructure);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 newDST = stimestructure.DayLightSaving;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 if(newDST)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 newDST = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 newDST = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493 stimestructure.DayLightSaving = newDST;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 set_RTC_DateTime(0, &stimestructure);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 tMenuEdit_set_on_off(editId, newDST);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 void openEdit_Language(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 uint8_t actualLanguage, active;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 actualLanguage = pSettings->selected_language;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 text[1] = TXT_Language;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 text[0] = TXT_LanguageName;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 text[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 pSettings->selected_language = LANGUAGE_English;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 if( actualLanguage == pSettings->selected_language)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 active = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524 write_field_on_off(StMSYS2_English, 30, 500, ME_Y_LINE1, &FontT48, text, active);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 pSettings->selected_language = LANGUAGE_German;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527 if( actualLanguage == pSettings->selected_language)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 active = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 write_field_on_off(StMSYS2_German, 30, 800, ME_Y_LINE2, &FontT48, text, active);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533 pSettings->selected_language = LANGUAGE_French;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 if( actualLanguage == pSettings->selected_language)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 active = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 write_field_on_off(StMSYS2_French, 30, 800, ME_Y_LINE3, &FontT48, text, active);
55
a7683f9765da Italian activated (needs some fine tuning), special characters (?,?,?,?,? and others) currently not working...
heinrichsweikamp
parents: 38
diff changeset
539
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 pSettings->selected_language = LANGUAGE_Italian;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 if( actualLanguage == pSettings->selected_language)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 active = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546 write_field_on_off(StMSYS2_Italian, 30, 800, ME_Y_LINE4, &FontT48, text, active);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547
102
4276d56eb37c hPa instead of mbar, enabled Spanish language
heinrichsweikamp
parents: 64
diff changeset
548
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 pSettings->selected_language = LANGUAGE_Espanol;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 if( actualLanguage == pSettings->selected_language)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 active = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 write_field_on_off(StMSYS2_Espanol, 30, 800, ME_Y_LINE5, &FontT48, text, active);
102
4276d56eb37c hPa instead of mbar, enabled Spanish language
heinrichsweikamp
parents: 64
diff changeset
555
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 pSettings->selected_language = actualLanguage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 setEvent(StMSYS2_English, (uint32_t)OnAction_English);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 setEvent(StMSYS2_German, (uint32_t)OnAction_German);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 setEvent(StMSYS2_French, (uint32_t)OnAction_French);
55
a7683f9765da Italian activated (needs some fine tuning), special characters (?,?,?,?,? and others) currently not working...
heinrichsweikamp
parents: 38
diff changeset
563 setEvent(StMSYS2_Italian, (uint32_t)OnAction_Italian);
102
4276d56eb37c hPa instead of mbar, enabled Spanish language
heinrichsweikamp
parents: 64
diff changeset
564 setEvent(StMSYS2_Espanol, (uint32_t)OnAction_Espanol);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 uint8_t OnAction_English (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 pSettings->selected_language = LANGUAGE_English;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 return EXIT_TO_MENU_WITH_LOGO;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 uint8_t OnAction_German (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 pSettings->selected_language = LANGUAGE_German;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 return EXIT_TO_MENU_WITH_LOGO;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 uint8_t OnAction_French (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 pSettings->selected_language = LANGUAGE_French;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 return EXIT_TO_MENU_WITH_LOGO;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 uint8_t OnAction_Italian (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 pSettings->selected_language = LANGUAGE_Italian;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 return EXIT_TO_MENU_WITH_LOGO;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 uint8_t OnAction_Espanol (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603 pSettings->selected_language = LANGUAGE_Espanol;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604 return EXIT_TO_MENU_WITH_LOGO;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 void openEdit_Design(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 refresh_Design();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 write_field_button(StMSYS3_Units, 400, 700, ME_Y_LINE1, &FontT48, "");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 write_field_button(StMSYS3_Colors, 400, 700, ME_Y_LINE2, &FontT48, "");
343
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
614 #ifdef HAVE_DEBUG_VIEW
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
615 write_field_button(StMSYS3_Debug, 400, 700, ME_Y_LINE3, &FontT48, "");
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
616 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617 setEvent(StMSYS3_Units, (uint32_t)OnAction_Units);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618 setEvent(StMSYS3_Colors, (uint32_t)OnAction_Colorscheme);
343
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
619 #ifdef HAVE_DEBUG_VIEW
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
620 setEvent(StMSYS3_Debug, (uint32_t)OnAction_DebugInfo);
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
621 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625 void refresh_Design(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 // header
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 text[2] = TXT2BYTE_Layout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 // units
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 text[1] = TXT2BYTE_Units;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 write_label_var( 30, 200, ME_Y_LINE1, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 if(settingsGetPointer()->nonMetricalSystem)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 text[1] = TXT2BYTE_Units_feet;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648 text[1] = TXT2BYTE_Units_metric;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 write_label_var( 400, 700, ME_Y_LINE1, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 // colorscheme
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 text[1] = TXT2BYTE_Farbschema;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655 text[2] = 0;
118
ee7f2cd9b9b4 Enlarge text limits to get string displayed completly
Ideenmodellierer
parents: 103
diff changeset
656 write_label_var( 30, 300, ME_Y_LINE2, &FontT48, text);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658 text[0] = '0' + settingsGetPointer()->tX_colorscheme;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659 text[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660 write_label_var( 400, 700, ME_Y_LINE2, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661
343
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
662 #ifdef HAVE_DEBUG_VIEW
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663 // specials
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665 text[1] = TXT2BYTE_ShowDebug;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667 write_label_var( 30, 700, ME_Y_LINE3, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 if(settingsGetPointer()->showDebugInfo)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 text[0] = '\005';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672 text[0] = '\006';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673 text[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674 write_label_var( 400, 700, ME_Y_LINE3, &FontT48, text);
343
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
675 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 // design
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678 text[0] = TXT_Depth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679 text[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680 write_content( 30, 700, ME_Y_LINE4, &FontT24, text, CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681 write_content( 30, 700, ME_Y_LINE4 + 30 + 70, &FontT48, "___________", CLUT_DIVE_FieldSeperatorLines);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682 write_content(280, 700, ME_Y_LINE4 + 30 + 70 - 3, &FontT48, "|", CLUT_DIVE_pluginbox);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 write_content(290, 700, ME_Y_LINE4 + 30 + 70 - 37, &FontT48, "_______________", CLUT_DIVE_pluginbox);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 write_content( 30, 700, ME_Y_LINE4 + 30, &FontT144, "24.7", CLUT_Font027);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690 uint8_t OnAction_Units(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692 settingsGetPointer()->nonMetricalSystem = !(settingsGetPointer()->nonMetricalSystem);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 return EXIT_TO_MENU_WITH_LOGO;//UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697 uint8_t OnAction_Colorscheme(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699 uint8_t newColorscheme;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 newColorscheme = settingsGetPointer()->tX_colorscheme + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 if(newColorscheme > 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 newColorscheme = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706 settingsGetPointer()->tX_colorscheme = newColorscheme;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 GFX_use_colorscheme(newColorscheme);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 tHome_init_compass();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 uint8_t OnAction_DebugInfo(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 settingsGetPointer()->showDebugInfo = !(settingsGetPointer()->showDebugInfo);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 return UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723 uint8_t OnAction_Design_t7ft (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726 if((pSettings->design == 7) && pSettings->nonMetricalSystem)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 pSettings->design = 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 pSettings->nonMetricalSystem = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730 tMenuEdit_set_on_off(StMSYS3_t7, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731 tMenuEdit_set_on_off(StMSYS3_t7ft, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 tMenuEdit_set_on_off(StMSYS3_t3, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 return UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 uint8_t OnAction_Design_t7 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 if((pSettings->design == 7) && (pSettings->nonMetricalSystem == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 pSettings->design = 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743 pSettings->nonMetricalSystem = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 tMenuEdit_set_on_off(StMSYS3_t7, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745 tMenuEdit_set_on_off(StMSYS3_t7ft, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 tMenuEdit_set_on_off(StMSYS3_t3, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 return UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751 uint8_t OnAction_Design_t3 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 if(pSettings->design == 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756 pSettings->design = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757 pSettings->nonMetricalSystem = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758 tMenuEdit_set_on_off(StMSYS3_t7, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759 tMenuEdit_set_on_off(StMSYS3_t7ft,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760 tMenuEdit_set_on_off(StMSYS3_t3, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 return UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766 void openEdit_Customview(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 refresh_Customviews();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770 write_field_button(StMSYS4_CViewTimeout, 400, 700, ME_Y_LINE1, &FontT48, "");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771 write_field_button(StMSYS4_CViewStandard, 400, 700, ME_Y_LINE2, &FontT48, "");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773 write_field_button(StMSYS4_CornerTimeout, 400, 700, ME_Y_LINE3, &FontT48, "");
343
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
774 write_field_button(StMSYS4_CornerStandard, 400, 700, ME_Y_LINE4, &FontT48, "");
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
775
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
776 write_field_button(StMSYS4_ExtraDisplay, 400, 700, ME_Y_LINE5, &FontT48, "");
368
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
777 write_field_button(StMSYS4_MotionCtrl, 400, 700, ME_Y_LINE6, &FontT48, "");
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
778
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
779 setEvent(StMSYS4_CViewTimeout, (uint32_t)OnAction_CViewTimeout);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
780 setEvent(StMSYS4_CViewStandard, (uint32_t)OnAction_CViewStandard);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782 setEvent(StMSYS4_CornerTimeout, (uint32_t)OnAction_CornerTimeout);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
783 setEvent(StMSYS4_CornerStandard, (uint32_t)OnAction_CornerStandard);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
784
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785 setEvent(StMSYS4_ExtraDisplay, (uint32_t)OnAction_ExtraDisplay);
368
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
786 setEvent(StMSYS4_MotionCtrl, (uint32_t)OnAction_MotionCtrl);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
790 void refresh_Customviews(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
791 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
792 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
793 uint8_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
794
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
795 // header
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
796 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
797 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
798 text[2] = TXT2BYTE_Customviews;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
799 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
800 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
801
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
802 // custom view center return
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
803 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
804 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
805 text[textpointer++] = TXT2BYTE_CViewTimeout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
806 textpointer += snprintf(&text[textpointer],11," %02u\016\016 %c\017",settingsGetPointer()->tX_customViewTimeout,TXT_Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
807 write_label_var( 30, 700, ME_Y_LINE1, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
808
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
809 // custom view center primary
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
810 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
811 text[1] = TXT2BYTE_CViewStandard;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
812 text[2] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
813 text[3] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
814 switch(settingsGetPointer()->tX_customViewPrimary)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
815 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
816 case CVIEW_sensors:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
817 text[4] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
818 text[5] = TXT2BYTE_O2monitor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
819 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
820 case CVIEW_sensors_mV:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
821 text[4] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
822 text[5] = TXT2BYTE_O2voltage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
823 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
824 case CVIEW_Compass:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
825 text[4] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
826 text[5] = TXT2BYTE_Compass;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
827 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
828 case CVIEW_Decolist:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
829 text[4] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
830 text[5] = TXT2BYTE_Decolist;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
831 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
832 case CVIEW_Tissues:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
833 text[4] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
834 text[5] = TXT2BYTE_Tissues;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
835 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
836 case CVIEW_Profile:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
837 text[4] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
838 text[5] = TXT2BYTE_Profile;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
839 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
840 case CVIEW_Gaslist:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
841 text[4] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
842 text[5] = TXT2BYTE_Gaslist;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
843 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
844 case CVIEW_EADTime:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
845 text[4] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
846 text[5] = TXT2BYTE_Info;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
847 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
848 case CVIEW_SummaryOfLeftCorner:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
849 text[4] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
850 text[5] = TXT2BYTE_Summary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
851 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
852 case CVIEW_noneOrDebug:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
853 text[4] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
854 text[5] = '-';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
855 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
856 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
857 snprintf(&text[4],3,"%02u",settingsGetPointer()->tX_customViewPrimary);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
858 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
859 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
860 text[6] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
861 write_label_var( 30, 700, ME_Y_LINE2, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
862
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
863
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
864 // field corner return
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
865 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
866 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
867 text[textpointer++] = TXT2BYTE_CornerTimeout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
868 textpointer += snprintf(&text[textpointer],11," %02u\016\016 %c\017",settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout,TXT_Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
869 write_label_var( 30, 700, ME_Y_LINE3, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
870
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
871 // field corner primary
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
872 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
873 text[1] = TXT2BYTE_CornerStandard;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
874 text[2] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
875 text[3] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
876 switch(settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
877 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
878 /* Temperature */
444
f2c4f5c90540 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 435
diff changeset
879 case LLC_Temperature:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
880 text[4] = TXT_Temperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
881 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
882 /* Average Depth */
444
f2c4f5c90540 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 435
diff changeset
883 case LLC_AverageDepth:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
884 text[4] = TXT_AvgDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
885 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
886 /* ppO2 */
444
f2c4f5c90540 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 435
diff changeset
887 case LLC_ppO2:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
888 text[4] = TXT_ppO2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
889 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
890 /* Stop Uhr */
444
f2c4f5c90540 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 435
diff changeset
891 case LLC_Stopwatch:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
892 text[4] = TXT_Stopwatch;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
893 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
894 /* Ceiling */
444
f2c4f5c90540 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 435
diff changeset
895 case LLC_Ceiling:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
896 text[4] = TXT_Ceiling;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
897 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
898 /* Future TTS */
444
f2c4f5c90540 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 435
diff changeset
899 case LLC_FutureTTS:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
900 text[4] = TXT_FutureTTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
901 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
902 /* CNS */
444
f2c4f5c90540 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 435
diff changeset
903 case LLC_CNS:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
904 text[4] = TXT_CNS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
905 break;
444
f2c4f5c90540 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 435
diff changeset
906 case LLC_GF:
259
26c874cdde0d feature: allow new saturation to be set in lower left corner
Jan Mulder <jlmulder@xs4all.nl>
parents: 210
diff changeset
907 text[4] = TXT_ActualGradient;
26c874cdde0d feature: allow new saturation to be set in lower left corner
Jan Mulder <jlmulder@xs4all.nl>
parents: 210
diff changeset
908 break;
446
f1257a32f2d4 Introduced configuration header for variant managment:
ideenmodellierer
parents: 444
diff changeset
909 #ifdef ENABLE_BOTTLE_SENSOR
444
f2c4f5c90540 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 435
diff changeset
910 case LCC_BottleBar:
f2c4f5c90540 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 435
diff changeset
911 text[4] = TXT_AtemGasVorrat;
f2c4f5c90540 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 435
diff changeset
912 break;
446
f1257a32f2d4 Introduced configuration header for variant managment:
ideenmodellierer
parents: 444
diff changeset
913 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
914 /* none */
446
f1257a32f2d4 Introduced configuration header for variant managment:
ideenmodellierer
parents: 444
diff changeset
915 case LLC_Empty:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
916 text[4] = '-';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
917 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
918 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
919 snprintf(&text[4],2,"%u",settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
920 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
921 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
922 text[5] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
923 write_label_var( 30, 700, ME_Y_LINE4, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
924
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
925
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
926 // extra display
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
927 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
928 text[1] = TXT2BYTE_ExtraDisplay;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
929 text[2] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
930 text[3] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
931 text[4] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
932 switch(settingsGetPointer()->extraDisplay)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
933 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
934 /* BigFont */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
935 case EXTRADISPLAY_BIGFONT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
936 text[5] = TXT2BYTE_ExtraBigFont;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
937 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
938 /* DecoGame */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
939 case EXTRADISPLAY_DECOGAME:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
940 text[5] = TXT2BYTE_ExtraDecoGame;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
941 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
942 /* none */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
943 case EXTRADISPLAY_none:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
944 text[5] = TXT2BYTE_ExtraNone;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
945 break;
493
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
946 #ifdef ENABLE_BIGFONT_VX
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
947 case EXTRADISPLAY_BIGFONT2:
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
948 text[5] = TXT2BYTE_ExtraBigFontV2;
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
949 break;
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
950 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
951 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
952 snprintf(&text[4],2,"%u",settingsGetPointer()->extraDisplay);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
953 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
954 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
955 text[6] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
956 write_label_var( 30, 700, ME_Y_LINE5, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
957
368
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
958
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
959 /* MotionCtrl */
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
960 text[0] = TXT_2BYTE;
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
961 text[1] = TXT2BYTE_MotionCtrl;
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
962 text[2] = ' ';
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
963 text[3] = ' ';
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
964 text[4] = TXT_2BYTE;
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
965 switch(settingsGetPointer()->MotionDetection)
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
966 {
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
967 case MOTION_DETECT_OFF:
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
968 text[5] = TXT2BYTE_MoCtrlNone;
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
969 break;
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
970 case MOTION_DETECT_MOVE:
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
971 text[5] = TXT2BYTE_MoCtrlPitch;
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
972 break;
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
973 case MOTION_DETECT_SECTOR:
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
974 text[5] = TXT2BYTE_MoCtrlSector;
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
975 break;
373
7b981f8bdd41 Add scroll event by pitch angle detection:
ideenmodellierer
parents: 368
diff changeset
976 case MOTION_DETECT_SCROLL:
7b981f8bdd41 Add scroll event by pitch angle detection:
ideenmodellierer
parents: 368
diff changeset
977 text[5] = TXT2BYTE_MoCtrlScroll;
7b981f8bdd41 Add scroll event by pitch angle detection:
ideenmodellierer
parents: 368
diff changeset
978 break;
368
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
979 default:
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
980 snprintf(&text[4],2,"%u",settingsGetPointer()->MotionDetection);
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
981 break;
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
982 }
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
983 text[6] = 0;
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
984 write_label_var( 30, 700, ME_Y_LINE6, &FontT48, text);
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
985
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
986 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
987 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
988
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
989
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
990 uint8_t OnAction_CViewTimeout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
991 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
992 uint8_t value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
993 value = settingsGetPointer()->tX_customViewTimeout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
994
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
995 if(value < 5)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
996 value = 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
997 else if(value < 10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
998 value = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
999 else if(value < 15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1000 value = 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1001 else if(value < 20)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1002 value = 20;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1003 else if(value < 30)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1004 value = 30;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1005 else if(value < 45)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1006 value = 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1007 else if(value < 60)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1008 value = 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1009 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1010 value = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1011
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1012 settingsGetPointer()->tX_customViewTimeout = value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1013 return UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1014 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1015
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1016
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1017 uint8_t OnAction_CViewStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1018 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1019 uint8_t newValue;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1020 switch(settingsGetPointer()->tX_customViewPrimary)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1021 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1022 case CVIEW_sensors:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1023 newValue = CVIEW_sensors_mV;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1024 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1025 case CVIEW_sensors_mV:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1026 newValue = CVIEW_Compass;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1027 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1028 case CVIEW_Compass:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1029 newValue = CVIEW_Decolist;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1030 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1031 case CVIEW_Decolist:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1032 newValue = CVIEW_Tissues;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1033 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1034 case CVIEW_Tissues:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1035 newValue = CVIEW_Profile;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1036 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1037 case CVIEW_Profile:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1038 newValue = CVIEW_Gaslist;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1039 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1040 case CVIEW_Gaslist:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1041 newValue = CVIEW_EADTime;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1042 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1043 case CVIEW_EADTime:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1044 newValue = CVIEW_SummaryOfLeftCorner;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1045 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1046 case CVIEW_SummaryOfLeftCorner:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1047 newValue = CVIEW_noneOrDebug;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1048 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1049 case CVIEW_noneOrDebug:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1050 default:
138
cc9c18075e00 Removed no longer supported scooter code
Ideenmodellierer
parents: 118
diff changeset
1051 newValue = CVIEW_sensors;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1052 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1053 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1054 settingsGetPointer()->tX_customViewPrimary = newValue;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1055 return UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1056 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1057
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1058
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1059 uint8_t OnAction_CornerTimeout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1060 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1061 uint8_t value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1062 value = settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1063
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1064 if(value < 5)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1065 value = 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1066 else if(value < 10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1067 value = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1068 else if(value < 15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1069 value = 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1070 else if(value < 20)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1071 value = 20;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1072 else if(value < 30)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1073 value = 30;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1074 else if(value < 45)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1075 value = 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1076 else if(value < 60)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1077 value = 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1078 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1079 value = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1080
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1081 settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout = value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1082 return UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1083 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1084
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1085
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1086 uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1087 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1088 uint8_t value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1089 value = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1090
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1091 value += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1092
444
f2c4f5c90540 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 435
diff changeset
1093 if(value >= LLC_END)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1094 value = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1095
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1096 settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary = value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1097 return UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1098 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1099
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1100
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1101 uint8_t OnAction_ExtraDisplay (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1102 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1103 uint8_t newValue;
493
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
1104
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
1105 newValue = settingsGetPointer()->extraDisplay + 1;
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
1106 if(newValue == EXTRADISPLAY_DECOGAME) /* Decogame not yet implemented */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1107 {
493
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
1108 newValue++;
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
1109 }
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
1110 if(newValue >= EXTRADISPLAY_END)
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
1111 {
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
1112 newValue = EXTRADISPLAY_none;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1113 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1114 settingsGetPointer()->extraDisplay = newValue;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1115 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1116 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1117
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1118
368
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1119 uint8_t OnAction_MotionCtrl (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1120 {
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1121 uint8_t newValue;
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1122 switch(settingsGetPointer()->MotionDetection)
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1123 {
373
7b981f8bdd41 Add scroll event by pitch angle detection:
ideenmodellierer
parents: 368
diff changeset
1124 case MOTION_DETECT_OFF:
7b981f8bdd41 Add scroll event by pitch angle detection:
ideenmodellierer
parents: 368
diff changeset
1125 newValue = MOTION_DETECT_MOVE;
368
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1126 break;
373
7b981f8bdd41 Add scroll event by pitch angle detection:
ideenmodellierer
parents: 368
diff changeset
1127 case MOTION_DETECT_MOVE:
7b981f8bdd41 Add scroll event by pitch angle detection:
ideenmodellierer
parents: 368
diff changeset
1128 newValue = MOTION_DETECT_SECTOR;
368
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1129 break;
373
7b981f8bdd41 Add scroll event by pitch angle detection:
ideenmodellierer
parents: 368
diff changeset
1130 case MOTION_DETECT_SECTOR:
7b981f8bdd41 Add scroll event by pitch angle detection:
ideenmodellierer
parents: 368
diff changeset
1131 newValue = MOTION_DETECT_SCROLL;
368
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1132 break;
373
7b981f8bdd41 Add scroll event by pitch angle detection:
ideenmodellierer
parents: 368
diff changeset
1133 case MOTION_DETECT_SCROLL:
7b981f8bdd41 Add scroll event by pitch angle detection:
ideenmodellierer
parents: 368
diff changeset
1134 newValue = MOTION_DETECT_OFF;
7b981f8bdd41 Add scroll event by pitch angle detection:
ideenmodellierer
parents: 368
diff changeset
1135 break;
368
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1136 default:
373
7b981f8bdd41 Add scroll event by pitch angle detection:
ideenmodellierer
parents: 368
diff changeset
1137 newValue = MOTION_DETECT_OFF;
368
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1138 break;
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1139 }
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1140 settingsGetPointer()->MotionDetection = newValue;
373
7b981f8bdd41 Add scroll event by pitch angle detection:
ideenmodellierer
parents: 368
diff changeset
1141 InitMotionDetection();
368
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1142 return UNSPECIFIC_RETURN;
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1143 }
50ea68c7a153 Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents: 259
diff changeset
1144
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1145 void openEdit_Information(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1146 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1147 char text[70];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1148
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1149 infoPage = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1150
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1151 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1152 text[1] = TXT_Information;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1153 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1154 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1155
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1156 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1157 text[1] = TXT2BYTE_ButtonNext;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1158 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1159
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1160 write_field_button(StMSYS5_Info, 30, 800, ME_Y_LINE6, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1161
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1162 setEvent(StMSYS5_Info, (uint32_t)OnAction_Information);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1163 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1164
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1165
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1166 uint8_t OnAction_Information (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1167 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1168 resetEnterPressedToStateBeforeButtonAction();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1169
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1170 infoPage++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1171 if(infoPage > 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1172 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1173 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1174 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1175 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1176
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1177
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1178 void refresh_InformationPage(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1179 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1180 char text_header[5];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1181 char text_button[5];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1182 char text_content[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1183 uint8_t date[3], year,month,day;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1184
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1185 RTC_DateTypeDef Sdate, Sdate2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1186 float temperature1, temperature2, voltage, offsetTemperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1187
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1188 //RTC_TimeTypeDef Stime;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1189
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1190 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1191 SDeviceLine batteryChargeCycles;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1192 SDeviceLine batteryChargeCompleteCycles;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1193 SDeviceLine temperatureMinimum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1194 SDeviceLine temperatureMaximum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1195 SDeviceLine depthMaximum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1196 SDeviceLine diveCycles;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1197 SDeviceLine voltageMinimum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1198 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1199
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1200 switch(infoPage)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1201 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1202 case 0:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1203 text_header[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1204 text_header[1] = TXT_Information;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1205 text_header[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1206
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1207 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, "Dive Computer OSTC4");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1208 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, "Design heinrichs/weikamp");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1209
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1210 Sdate.Year = firmwareDataGetPointer()->release_year;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1211 Sdate.Month = firmwareDataGetPointer()->release_month;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1212 Sdate.Date = firmwareDataGetPointer()->release_day;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1213
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1214 if(settingsGetPointer()->date_format == DDMMYY)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1215 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1216 day = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1217 month = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1218 year = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1219 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1220 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1221 if(settingsGetPointer()->date_format == MMDDYY)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1222 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1223 day = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1224 month = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1225 year = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1226 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1227 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1228 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1229 day = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1230 month = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1231 year = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1232 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1233 date[day] = Sdate.Date;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1234 date[month] = Sdate.Month;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1235 date[year] = Sdate.Year;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1236 snprintf(text_content,40,"Firmware release date: %02d.%02d.%02d",date[0],date[1],date[2]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1237 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1238 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, "for more information");
64
98b479d0618f typo in info menu...
heinrichsweikamp
parents: 57
diff changeset
1239 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, "info@heinrichsweikamp.com");
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1240
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1241 text_button[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1242 text_button[1] = TXT2BYTE_ButtonNext;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1243 text_button[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1244 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1245
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1246 case 1:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1247 text_header[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1248 text_header[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1249 text_header[2] = TXT2BYTE_Usage_Battery;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1250 text_header[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1251
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1252 text_content[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1253 text_content[1] = TXT2BYTE_ChargeCycles;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1254 text_content[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1255 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content);
57
e941c9e49f73 Resolve format warnings
Ideenmodellierer
parents: 55
diff changeset
1256 snprintf(text_content,80,"%ld (%ld)",stateDeviceGetPointer()->batteryChargeCycles.value_int32,stateDeviceGetPointer()->batteryChargeCompleteCycles.value_int32);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1257 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1258
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1259 translateDate(stateDeviceGetPointer()->batteryChargeCycles.date_rtc_dr, &Sdate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1260 translateDate(stateDeviceGetPointer()->batteryChargeCompleteCycles.date_rtc_dr, &Sdate2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1261 snprintf(text_content,80,"%u.%u.20%02u (%u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1262 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1263
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1264 text_content[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1265 text_content[1] = TXT2BYTE_LowestVoltage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1266 text_content[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1267 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1268
404
e729b8e7654d Bugfix: display of time of minimum voltag:
ideenmodellierer
parents: 389
diff changeset
1269 translateDate(stateDeviceGetPointer()->voltageMinimum.date_rtc_dr, &Sdate);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1270 voltage = ((float)stateDeviceGetPointer()->voltageMinimum.value_int32) / 1000;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1271 snprintf(text_content,80,"%0.3fV (%u.%u.20%02u)",voltage, Sdate.Date,Sdate.Month,Sdate.Year);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1272 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1273
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1274 text_button[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1275 text_button[1] = TXT2BYTE_ButtonNext;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1276 text_button[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1277 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1278
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1279 case 2:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1280 text_header[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1281 text_header[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1282 text_header[2] = TXT2BYTE_Usage_Dives;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1283 text_header[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1284
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1285 text_content[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1286 text_content[1] = TXT2BYTE_NumberOfDives;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1287 text_content[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1288 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1289
57
e941c9e49f73 Resolve format warnings
Ideenmodellierer
parents: 55
diff changeset
1290 snprintf(text_content,80,"%ld (%ld)",stateDeviceGetPointer()->diveCycles.value_int32,(stateDeviceGetPointer()->depthMaximum.value_int32 - 1000) / 100);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1291 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1292
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1293 translateDate(stateDeviceGetPointer()->diveCycles.date_rtc_dr, &Sdate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1294 translateDate(stateDeviceGetPointer()->depthMaximum.date_rtc_dr, &Sdate2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1295 snprintf(text_content,80,"%u.%u.20%02u (%u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1296 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1297
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1298 text_content[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1299 text_content[1] = TXT2BYTE_HoursOfOperation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1300 text_content[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1301 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1302
57
e941c9e49f73 Resolve format warnings
Ideenmodellierer
parents: 55
diff changeset
1303 snprintf(text_content,80,"%ld",(stateDeviceGetPointer()->hoursOfOperation.value_int32)/3600);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1304 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1305
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1306 text_button[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1307 text_button[1] = TXT2BYTE_ButtonNext;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1308 text_button[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1309 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1310
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1311 case 3:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1312 text_header[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1313 text_header[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1314 text_header[2] = TXT2BYTE_Usage_Environment;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1315 text_header[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1316
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1317 text_content[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1318 text_content[1] = TXT2BYTE_AmbientTemperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1319 text_content[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1320 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1321
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1322 temperature1 = ((float)stateDeviceGetPointer()->temperatureMinimum.value_int32) / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1323 temperature2 = ((float)stateDeviceGetPointer()->temperatureMaximum.value_int32) / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1324 snprintf(text_content,80,"%0.2f\140C / %0.2f\140C",temperature1,temperature2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1325 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1326
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1327 translateDate(stateDeviceGetPointer()->temperatureMinimum.date_rtc_dr, &Sdate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1328 translateDate(stateDeviceGetPointer()->temperatureMaximum.date_rtc_dr, &Sdate2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1329 snprintf(text_content,80,"(%u.%u.20%02u / %u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1330 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1331
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1332 text_content[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1333 text_content[1] = TXT2BYTE_Korrekturwerte;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1334 text_content[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1335 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1336
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1337 offsetTemperature = ((float)settingsGetPointer()->offsetTemperature_centigrad) / 10;
103
f5d2f02dc73f Generalize TEXT of pressure unit
Dmitry Romanov <kitt@bk.ru>
parents: 102
diff changeset
1338 snprintf(text_content,80,"%i %s / %0.2f\140C",settingsGetPointer()->offsetPressure_mbar, TEXT_PRESSURE_UNIT, offsetTemperature);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1339 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1340
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1341 text_button[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1342 text_button[1] = TXT2BYTE_Exit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1343 text_button[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1344 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1345 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1346
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1347 write_topline(text_header);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1348 tMenuEdit_newButtonText(StMSYS5_Info, text_button);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1349 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonNext,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1350 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1351
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1352
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1353 void openEdit_Reset(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1354 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1355 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1356
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1357 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1358 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1359 text[2] = TXT2BYTE_ResetMenu;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1360 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1361 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1362
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1363 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1364 text[1] = TXT2BYTE_LogbookOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1365 text[7] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1366
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1367 write_label_var( 30, 400, ME_Y_LINE1, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1368
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1369 write_field_udigit(StMSYS6_LogbookOffset,420, 800, ME_Y_LINE1, &FontT48, "####", settingsGetPointer()->logbookOffset,0,0,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1370
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1371 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1372 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1373
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1374 text[1] = TXT2BYTE_ResetAll;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1375 write_field_button(StMSYS6_ResetAll, 30, 800, ME_Y_LINE2, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1376
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1377 text[1] = TXT2BYTE_ResetDeco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1378 write_field_button(StMSYS6_ResetDeco, 30, 800, ME_Y_LINE3, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1379
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1380 text[1] = TXT2BYTE_Reboot;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1381 write_field_button(StMSYS6_Reboot, 30, 800, ME_Y_LINE4, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1382
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1383 text[1] = TXT2BYTE_Maintenance;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1384 write_field_button(StMSYS6_Maintenance, 30, 800, ME_Y_LINE5, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1385
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1386 #ifndef RESETLOGBLOCK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1387 text[1] = TXT2BYTE_ResetLogbook;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1388 write_field_button(StMSYS6_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1389 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1390 text[0] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1391 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1392 text[2] = TXT2BYTE_ResetLogbook;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1393 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1394 write_field_button(StMSYS6_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1395 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1396 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1397 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1398
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1399 setEvent(StMSYS6_LogbookOffset, (uint32_t)OnAction_LogbookOffset);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1400 setEvent(StMSYS6_ResetAll, (uint32_t)OnAction_Confirm);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1401 setEvent(StMSYS6_ResetDeco, (uint32_t)OnAction_Confirm);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1402 setEvent(StMSYS6_Reboot, (uint32_t)OnAction_Confirm);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1403 setEvent(StMSYS6_Maintenance, (uint32_t)OnAction_Confirm);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1404 #ifndef RESETLOGBLOCK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1405 setEvent(StMSYS6_ResetLogbook, (uint32_t)OnAction_Confirm);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1406 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1407 setEvent(StMSYS6_ResetLogbook, (uint32_t)OnAction_Nothing);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1408 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1409
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1410 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1411 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1412
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1413
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1414 void openEdit_ResetConfirmation(uint32_t editIdOfCaller)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1415 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1416 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1417
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1418 resetMenuEdit(CLUT_MenuPageSystem);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1419
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1420 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1421 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1422 text[2] = TXT2BYTE_AreYouSure;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1423 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1424 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1425
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1426 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1427 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1428 text[1] = TXT2BYTE_Abort;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1429
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1430 write_field_button(StMSYS6_Exit, 30, 800, ME_Y_LINE1, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1431
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1432 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1433 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1434 switch(editIdOfCaller)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1435 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1436 case StMSYS6_Reboot:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1437 case StMSYS6_RebootRTE:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1438 case StMSYS6_RebootMainCPU:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1439 text[1] = TXT2BYTE_RebootMainCPU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1440 write_field_button(StMSYS6_RebootMainCPU, 30, 800, ME_Y_LINE2, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1441 text[1] = TXT2BYTE_RebootRTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1442 write_field_button(StMSYS6_RebootRTE, 30, 800, ME_Y_LINE3, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1443 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1444 setEvent(StMSYS6_RebootMainCPU, (uint32_t)OnAction_RebootMainCPU);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1445 setEvent(StMSYS6_RebootRTE, (uint32_t)OnAction_RebootRTE);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1446 text[0] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1447 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1448 text[2] = TXT2BYTE_DecoDataLost;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1449 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1450 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1451 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1452
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1453 case StMSYS6_ResetDeco:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1454 text[1] = TXT2BYTE_ResetDeco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1455 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1456 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1457 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetDeco);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1458 text[0] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1459 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1460 text[2] = TXT2BYTE_DecoDataLost;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1461 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1462 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1463 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1464
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1465 case StMSYS6_ResetAll:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1466 text[1] = TXT2BYTE_ResetAll;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1467 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1468 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1469 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetAll);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1470 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1471
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1472 case StMSYS6_ResetLogbook:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1473 text[1] = TXT2BYTE_ResetLogbook;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1474 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1475 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1476 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetLogbook);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1477 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1478
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1479 case StMSYS6_Maintenance:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1480 case StMSYS6_SetBattCharge:
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1481 case StMSYS6_SetSampleIndx:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1482 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1483 text[1] = TXT2BYTE_SetFactoryDefaults;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1484 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1485 write_field_button(StMSYS6_SetFactoryBC, 30, 800, ME_Y_LINE2, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1486
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1487 #ifdef ENABLE_ANALYSE_SAMPLES
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1488 text[0] = TXT_2BYTE;
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1489 text[1] = TXT2BYTE_SetSampleIndex;
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1490 text[2] = 0;
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1491 write_field_button(StMSYS6_SetSampleIndx, 30, 800, ME_Y_LINE3, &FontT48, text);
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1492 #endif
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1493
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1494
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1495 if(stateRealGetPointer()->lifeData.battery_charge == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1496 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1497 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1498 text[1] = TXT2BYTE_SetBatteryCharge;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1499 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1500 snprintf(&text[2],10,": %u%%",settingsGetPointer()->lastKnownBatteryPercentage);
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1501 #ifdef ENABLE_ANALYSE_SAMPLES
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1502 write_field_button(StMSYS6_SetBattCharge, 30, 800, ME_Y_LINE4, &FontT48, text);
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1503 #else
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1504 write_field_button(StMSYS6_SetBattCharge, 30, 800, ME_Y_LINE3, &FontT48, text);
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1505 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1506
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1507 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1508 setEvent(StMSYS6_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults);
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1509 #ifdef ENABLE_ANALYSE_SAMPLES
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1510 setEvent(StMSYS6_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx);
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1511 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1512 setEvent(StMSYS6_SetBattCharge, (uint32_t)OnAction_SetBatteryCharge);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1513 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1514 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1515 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1516 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1517 setEvent(StMSYS6_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults);
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1518 #ifdef ENABLE_ANALYSE_SAMPLES
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1519 setEvent(StMSYS6_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx);
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1520 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1521 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1522 // write_field_button(StMSYS6_ScreenTest, 30, 800, ME_Y_LINE3, &FontT48, "Screen Test");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1523 // setEvent(StMSYS6_ScreenTest, (uint32_t)OnAction_ScreenTest);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1524
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1525 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1526 text[1] = TXT2BYTE_WarnBatteryLow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1527 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1528 snprintf(&text[2],10,": %01.2fV",stateRealGetPointer()->lifeData.battery_voltage);
435
8851702173e0 Bugfix display battery voltage in maintainance menu:
ideenmodellierer
parents: 424
diff changeset
1529 write_label_var( 30, 800, ME_Y_LINE5, &FontT42, text);
8851702173e0 Bugfix display battery voltage in maintainance menu:
ideenmodellierer
parents: 424
diff changeset
1530
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1531 snprintf(&text[0],30,"Code: %X",getLicence());
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1532 write_label_var( 30, 800, ME_Y_LINE6, &FontT42, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1533 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1534
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1535 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1536
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1537 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1538 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1539
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1540 uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1541 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1542 uint8_t digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1543 uint32_t newOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1544
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1545 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1546 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1547
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1548 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1549 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1550 evaluateNewString(editId, &newOffset, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1551 if(newOffset > 9000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1552 newOffset = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1553 tMenuEdit_newInput(editId, newOffset, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1554 settingsGetPointer()->logbookOffset = (uint16_t)newOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1555 return UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1556 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1557
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1558 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1559 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1560 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1561 if(digitContentNew > '9')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1562 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1563 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1564 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1565
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1566 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1567 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1568 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1569 if(digitContentNew < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1570 digitContentNew = '9';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1571 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1572 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1573 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1574 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1575
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1576 uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1577 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1578 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1579 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1580
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1581 uint8_t OnAction_Exit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1582 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1583 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1584 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1585 uint8_t OnAction_Confirm (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1586 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1587 openEdit_ResetConfirmation(editId);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1588 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1589 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1590
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1591 uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1592 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1593 MX_SmallCPU_Reset_To_Standard();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1594 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1595 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1596
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1597 uint8_t OnAction_ResetDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1598 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1599 clearDeco();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1600 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1601 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1602
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1603 uint8_t OnAction_ResetAll (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1604 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1605 set_settings_to_Standard();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1606 check_and_correct_settings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1607
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1608 return UPDATE_AND_EXIT_TO_HOME;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1609 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1610
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1611 uint8_t OnAction_ResetLogbook (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1612 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1613 write_label_var( 430, 740, 350, &FontT42, "Wait");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1614 ext_flash_erase_logbook();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1615
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1616 SSettings * pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1617 pSettings->lastDiveLogId = 255;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1618 pSettings->logFlashNextSampleStartAddress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1619
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1620 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1621 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1622
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1623 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1624 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1625 settingsGetPointer()->showDebugInfo = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1626 extern uint8_t bootToBootloader;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1627 bootToBootloader = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1628 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1629 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1630
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1631
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1632 uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1633 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1634 settingsWriteFactoryDefaults(settingsGetPointer()->ButtonResponsiveness[3], settingsGetPointer()->buttonBalance);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1635 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1636 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1637
468
aa1d71875e25 Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents: 446
diff changeset
1638 #ifdef ENABLE_ANALYSE_SAMPLES
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1639 uint8_t OnAction_RecoverSampleIdx(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1640 {
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1641 char text[32];
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1642 char strResult[20];
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1643
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1644 ext_flash_AnalyseSampleBuffer(strResult);
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1645 snprintf(&text[0],30,"Ring: %s",strResult); //"Code: %X",settingsGetPointer()->logFlashNextSampleStartAddress); //getLicence());
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1646 write_label_var( 30, 800, ME_Y_LINE6, &FontT42, text);
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1647 return UNSPECIFIC_RETURN;
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1648 }
468
aa1d71875e25 Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents: 446
diff changeset
1649 #endif
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1650
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1651 uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1652 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1653 setBatteryPercentage(settingsGetPointer()->lastKnownBatteryPercentage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1654 // setBatteryPercentage(100);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1655 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1656 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1657
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1658 #ifdef SCREENTEST
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1659 uint8_t OnAction_ScreenTest (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1660 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1661 static uint8_t FrameCount = 1; // 0 is invisible frame
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1662 char text[5];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1663 GFX_DrawCfgScreen tTestScreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1664 tTestScreen.FBStartAdress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1665 tTestScreen.ImageHeight = 480;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1666 tTestScreen.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1667 tTestScreen.LayerIndex = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1668
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1669 set_globalState(StMSYS6_ScreenTest);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1670 tTestScreen.FBStartAdress = getFrameByNumber(FrameCount);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1671 if(tTestScreen.FBStartAdress == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1672 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1673 extern uint8_t bootToBootloader;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1674 bootToBootloader = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1675 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1676 GFX_fill_buffer(tTestScreen.FBStartAdress, 0xFF, FrameCount);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1677 snprintf(text,5,"%u",FrameCount);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1678 Gfx_write_label_var(&tTestScreen, 10,100,10,&FontT48,CLUT_Font027,text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1679 GFX_SetFramesTopBottom(tTestScreen.FBStartAdress, NULL,480);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1680 FrameCount++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1681 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1682 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1683 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1684 uint8_t OnAction_TestCLog (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1685 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1686 write_label_var( 430, 740, 350, &FontT42, "Wait");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1687
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1688 test_log_only(20, 5);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1689 test_log_only(30, 10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1690 ext_flash_write_settings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1691 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1692 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1693 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1694