annotate Discovery/Src/tMenuEditSystem.c @ 950:922ee3d7d2f3 Evo_2_23 tip

Increase brightness for inactive gases to improve readability in the OSTC 5.
author heinrichsweikamp
date Thu, 26 Dec 2024 12:03:08 +0100
parents c6b858f2e025
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 /// -*- coding: UTF-8 -*-
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 /// \file Discovery/Src/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"
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
41 #include "tMenuEditCustom.h"
389
ebc2b571a0b9 Fix case for case sensitive OS
Jan Mulder <jan@jlmulder.nl>
parents: 384
diff changeset
42 #include "motion.h"
343
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
43 #include "t7.h"
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
44
493
b560e474e319 Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents: 468
diff changeset
45
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);
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
51 void openEdit_DateFormat(void);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 void openEdit_Language(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 void openEdit_Design(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);
844
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
56 void openEdit_Maintenance(void);
38
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);
567
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
63 uint8_t OnAction_12HR (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
64 uint8_t OnAction_Format (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
65 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
66 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
67 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
68 uint8_t OnAction_DST (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
949
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
69 uint8_t OnAction_UTC (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
70 uint8_t OnAction_SetGnss (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
71 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
72 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
73 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
74 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
75 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
76 //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
77 //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
78 //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
79
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 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
81 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
82 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
83
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 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
85 uint8_t OnAction_Confirm (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
844
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
86 uint8_t OnAction_Maintenance (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
87 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
88 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
89 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
90 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
91 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
92 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
93 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
94 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
95 uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
844
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
96 uint8_t OnAction_AdjustSurfacePressure (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
97 #ifdef ENABLE_ANALYSE_SAMPLES
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
98 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
99 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 #ifdef SCREENTEST
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 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
102 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 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
104 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 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
106 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
107 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110
805
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
111 static uint8_t OnAction_Timer(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
112 {
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
113 SSettings *settings = settingsGetPointer();
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
114 uint8_t digitContentNew;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
115 switch (action) {
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
116 case ACTION_BUTTON_ENTER:
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
117
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
118 return digitContent;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
119 case ACTION_BUTTON_ENTER_FINAL:
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
120 {
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
121 uint32_t timerM;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
122 uint32_t timerS;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
123 evaluateNewString(editId, &timerM, &timerS, 0, 0);
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
124 if (timerM > 9) {
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
125 timerM = 9;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
126 }
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
127 if (timerS > 59) {
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
128 timerS = 59;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
129 }
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
130
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
131 uint16_t timerDurationS = 60 * timerM + timerS;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
132
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
133 if (timerDurationS < 1) {
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
134 timerDurationS = 1;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
135 }
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
136
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
137 if (timerDurationS != settings->timerDurationS) {
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
138 settings->timerDurationS = timerDurationS;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
139
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
140 disableTimer();
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
141
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
142 tMenuEdit_newInput(editId, settings->timerDurationS / 60, settings->timerDurationS % 60, 0, 0);
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
143 }
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
144
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
145 return EXIT_TO_MENU;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
146 }
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
147 case ACTION_BUTTON_NEXT:
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
148 digitContentNew = digitContent + 1;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
149 if ((blockNumber == 1 && digitNumber == 0 && digitContentNew > '5') || digitContentNew > '9') {
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
150 digitContentNew = '0';
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
151 }
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
152
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
153 return digitContentNew;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
154 case ACTION_BUTTON_BACK:
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
155 digitContentNew = digitContent - 1;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
156 if (digitContentNew < '0') {
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
157 if (blockNumber == 1 && digitNumber == 0) {
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
158 digitContentNew = '5';
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
159 } else {
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
160 digitContentNew = '9';
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
161 }
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
162 }
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
163
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
164 return digitContentNew;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
165 }
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
166
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
167 return EXIT_TO_MENU;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
168 }
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
169
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
170
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
171 static void openEdit_Timer(void)
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
172 {
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
173 SSettings *settings = settingsGetPointer();
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
174
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
175 char text[32];
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
176 snprintf(text, 32, "\001%c%c", TXT_2BYTE, TXT2BYTE_Timer);
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
177 write_topline(text);
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
178
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
179 uint16_t yPos = ME_Y_LINE_BASE + get_globalState_Menu_Line() * ME_Y_LINE_STEP;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
180 snprintf(text, 32, "%c%c", TXT_2BYTE, TXT2BYTE_Timer);
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
181 write_label_var(30, 299, yPos, &FontT48, text);
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
182 write_field_udigit(StMSYS_Timer, 300, 392, yPos, &FontT48, "#:##", settings->timerDurationS / 60, settings->timerDurationS % 60, 0, 0);
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
183 write_label_var(393, 800, yPos, &FontT48, "\016\016 [m:ss]\017");
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
184
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
185 write_buttonTextline(TXT2BYTE_ButtonMinus, TXT2BYTE_ButtonEnter, TXT2BYTE_ButtonPlus);
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
186
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
187 setEvent(StMSYS_Timer, (uint32_t)OnAction_Timer);
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
188 startEdit();
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
189 }
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
190
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
191
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 void openEdit_System(uint8_t line)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 set_globalState_Menu_Line(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 resetMenuEdit(CLUT_MenuPageSystem);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 if(actual_menu_content == MENU_SURFACE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 switch(line)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 case 1:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 openEdit_DateTime();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 case 2:
805
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
206 openEdit_Timer();
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
207 break;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
208 case 3:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 openEdit_Language();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 break;
805
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
211 case 4:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 openEdit_Design();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 break;
805
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
214 case 5:
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
215 openEdit_Information();
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 break;
805
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 730
diff changeset
217 case 6:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 openEdit_Reset();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 case 3:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 openEdit_DecoFutureTTS();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 case 4:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 openEdit_DecoLastStop();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 {
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
232 openEdit_CustomviewDivemodeMenu(line);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239
949
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
240 void refresh_DateTime()
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
241 {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
242 RTC_DateTypeDef Sdate;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
243 RTC_TimeTypeDef Stime;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
244 uint8_t day,month,year,hour,minute;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
245 char text[32];
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
246 char formatStr[20];
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
247 SSettings *pSettings;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
248 const SFirmwareData *pFirmwareInfo;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
249 #if defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
250 uint8_t localHours = 0;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
251 uint8_t localMinutes = 0;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
252 #endif
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
253 pFirmwareInfo = firmwareDataGetPointer();
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
254 const SDiveState * pStateReal = stateRealGetPointer();
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
255
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
256 pSettings = settingsGetPointer();
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
257
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
258 translateDate(pStateReal->lifeData.dateBinaryFormat, &Sdate);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
259 translateTime(pStateReal->lifeData.timeBinaryFormat, &Stime);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
260 year = Sdate.Year;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
261 month = Sdate.Month;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
262 day = Sdate.Date;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
263 hour = Stime.Hours;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
264 minute= Stime.Minutes;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
265
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
266 if(year < pFirmwareInfo->release_year)
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
267 year = pFirmwareInfo->release_year;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
268
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
269 if(month < 1)
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
270 month = 1;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
271
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
272 if(day < 1)
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
273 day = 1;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
274
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
275 getStringOfFormat_DDMMYY(formatStr, 20);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
276
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
277 text[0] = '\001';
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
278 text[1] = TXT_DateAndTime;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
279 text[2] = 0;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
280
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
281 write_topline(text);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
282
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
283 write_label_fix( 20, 340, ME_Y_LINE1, &FontT42, TXT_TimeConfig);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
284 write_label_fix( 20, 340, ME_Y_LINE2, &FontT42, TXT_Format);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
285 write_label_fix( 20, 340, ME_Y_LINE3, &FontT42, TXT_DateConfig);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
286 write_label_fix( 20, 790, ME_Y_LINE4, &FontT42, TXT_Format);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
287 #if defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
288 write_label_var( 20, 340, ME_Y_LINE5, &FontT42, "GNSS");
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
289 snprintf(text, 32, "%c%c", TXT_2BYTE, TXT2BYTE_TIMEZONE);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
290 write_label_var( 20, 340, ME_Y_LINE6, &FontT42, text);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
291 #endif
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
292
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
293
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
294 tMenuEdit_newInput(StMSYS1_Time, hour, minute, 0, 0);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
295 tMenuEdit_set_on_off(StMSYS1_12HR, pSettings->amPMTime);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
296
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
297 switch(pSettings->date_format)
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
298 {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
299 default:
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
300 case DDMMYY: tMenuEdit_newInput(StMSYS1_Date, day, month, year, 0);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
301 break;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
302 case MMDDYY: tMenuEdit_newInput(StMSYS1_Date, month, day, year, 0);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
303 break;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
304 case YYMMDD: tMenuEdit_newInput(StMSYS1_Date, year, month, day, 0);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
305 break;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
306 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
307 tMenuEdit_newButtonText(StMSYS1_FORMAT, formatStr);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
308
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
309 #if defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
310 if(pStateReal->lifeData.gnssData.alive & GNSS_ALIVE_STATE_TIME)
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
311 {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
312 convertUTCToLocal(pStateReal->lifeData.gnssData.DateTime.hour, pStateReal->lifeData.gnssData.DateTime.min, &localHours, &localMinutes);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
313 convertStringOfDate_DDMMYY(formatStr, 20, pStateReal->lifeData.gnssData.DateTime.day
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
314 , pStateReal->lifeData.gnssData.DateTime.month
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
315 , pStateReal->lifeData.gnssData.DateTime.year);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
316 snprintf(text, 32, "%02d:%02d - %s", localHours, localMinutes, formatStr);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
317 tMenuEdit_newButtonText(StMSYS1_GNSSDT, text);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
318 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
319 else
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
320 {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
321 snprintf(text, 32, "--:--");
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
322 write_label_var( 320, 790, ME_Y_LINE5, &FontT42, text);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
323 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
324 tMenuEdit_newInput(StMSYS1_ZONE, pSettings->timeZone.hours, pSettings->timeZone.minutes, 0, 0);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
325 #endif
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
326 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
327 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 void openEdit_DateTime(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 RTC_DateTypeDef Sdate;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 RTC_TimeTypeDef Stime;
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
332 uint8_t day,month,year,hour,minute;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 char text[32];
949
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
334 char formatStr[20];
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 SSettings *pSettings;
730
9c65d226f4f6 Update sensor menu support for automatic sensor detection:
Ideenmodellierer
parents: 720
diff changeset
336 const SFirmwareData *pFirmwareInfo;
949
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
337
720
4f70155362d2 Bugfix set date (year):
Ideenmodellierer
parents: 671
diff changeset
338 pFirmwareInfo = firmwareDataGetPointer();
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 const SDiveState * pStateReal = stateRealGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 pSettings = settingsGetPointer();
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
342
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
343 set_globalState(StMSYS1_DateTime);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
344 resetMenuEdit(CLUT_MenuPageSystem);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
345
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 translateDate(pStateReal->lifeData.dateBinaryFormat, &Sdate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 translateTime(pStateReal->lifeData.timeBinaryFormat, &Stime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348 year = Sdate.Year;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 month = Sdate.Month;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 day = Sdate.Date;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 hour = Stime.Hours;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 minute= Stime.Minutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353
720
4f70155362d2 Bugfix set date (year):
Ideenmodellierer
parents: 671
diff changeset
354 if(year < pFirmwareInfo->release_year)
4f70155362d2 Bugfix set date (year):
Ideenmodellierer
parents: 671
diff changeset
355 year = pFirmwareInfo->release_year;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 if(month < 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 month = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 if(day < 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 day = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362
949
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
363 getStringOfFormat_DDMMYY(formatStr, 20);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 text[1] = TXT_DateAndTime;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 write_label_fix( 20, 340, ME_Y_LINE1, &FontT42, TXT_TimeConfig);
567
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
372 write_label_fix( 20, 340, ME_Y_LINE2, &FontT42, TXT_Format);
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
373 write_label_fix( 20, 340, ME_Y_LINE3, &FontT42, TXT_DateConfig);
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
374 write_label_fix( 20, 790, ME_Y_LINE4, &FontT42, TXT_Format);
949
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
375 #if defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
376 write_label_var( 20, 340, ME_Y_LINE5, &FontT42, "GNSS");
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
377 snprintf(text, 32, "%c%c", TXT_2BYTE, TXT2BYTE_TIMEZONE);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
378 write_label_var( 20, 340, ME_Y_LINE6, &FontT42, text);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
379 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 write_field_2digit(StMSYS1_Time, 320, 780, ME_Y_LINE1, &FontT48, "##:##", (uint32_t)hour, (uint32_t)minute, 0, 0);
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
382 write_field_on_off(StMSYS1_12HR, 320, 790, ME_Y_LINE2, &FontT48, "12 HR", pSettings->amPMTime);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
383
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
384 switch(pSettings->date_format)
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
385 {
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
386 default:
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
387 case DDMMYY: write_field_2digit(StMSYS1_Date, 320, 780, ME_Y_LINE3, &FontT48, "##-##-20##", (uint32_t)day, (uint32_t)month, (uint32_t)year, 0);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
388 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
389 case MMDDYY: write_field_2digit(StMSYS1_Date, 320, 780, ME_Y_LINE3, &FontT48, "##-##-20##", (uint32_t)month, (uint32_t)day, (uint32_t)year, 0);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
390 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
391 case YYMMDD: write_field_2digit(StMSYS1_Date, 320, 780, ME_Y_LINE3, &FontT48, "20##-##-##", (uint32_t)year, (uint32_t)month, (uint32_t)day, 0);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
392 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
393 }
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
394
949
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
395 write_field_button(StMSYS1_FORMAT, 320, 790, ME_Y_LINE4, &FontT48, formatStr);
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
396
949
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
397 #if defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
398 snprintf(text, 32, "--:--");
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
399 write_field_button(StMSYS1_GNSSDT, 320, 790, ME_Y_LINE5, &FontT48, text);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
400 write_field_sdigit(StMSYS1_ZONE, 320, 780, ME_Y_LINE6, &FontT48, "UTC: ###:###", pSettings->timeZone.hours, pSettings->timeZone.minutes,0,0);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
401 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 setEvent(StMSYS1_Date, (uint32_t)OnAction_Date);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 setEvent(StMSYS1_Time, (uint32_t)OnAction_Time);
567
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
405 setEvent(StMSYS1_12HR, (uint32_t)OnAction_12HR);
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
406 setEvent(StMSYS1_FORMAT, (uint32_t)OnAction_Format);
949
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
407 #if defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
408 setEvent(StMSYS1_GNSSDT, (uint32_t)OnAction_SetGnss);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
409 setEvent(StMSYS1_ZONE, (uint32_t)OnAction_UTC);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
410 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 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
416 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 uint8_t digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 uint32_t newDay, newMonth, newYear;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 RTC_DateTypeDef sdatestructure;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420
730
9c65d226f4f6 Update sensor menu support for automatic sensor detection:
Ideenmodellierer
parents: 720
diff changeset
421 const SFirmwareData *pFirmwareInfo;
720
4f70155362d2 Bugfix set date (year):
Ideenmodellierer
parents: 671
diff changeset
422 pFirmwareInfo = firmwareDataGetPointer();
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
424 uint8_t mapDMY[3];
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
425 switch(settingsGetPointer()->date_format)
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
426 {
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
427 default:
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
428 case DDMMYY: mapDMY[0] = 0;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
429 mapDMY[1] = 1;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
430 mapDMY[2] = 2;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
431 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
432 case MMDDYY: mapDMY[0] = 1;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
433 mapDMY[1] = 0;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
434 mapDMY[2] = 2;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
435 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
436 case YYMMDD: mapDMY[0] = 2;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
437 mapDMY[1] = 1;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
438 mapDMY[2] = 0;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
439 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
440 }
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
441
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447 {
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
448 switch(settingsGetPointer()->date_format)
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
449 {
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
450 default:
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
451 case DDMMYY: evaluateNewString(editId, &newDay, &newMonth, &newYear, 0);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
452 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
453 case MMDDYY: evaluateNewString(editId, &newMonth, &newDay, &newYear, 0);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
454 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
455 case YYMMDD: evaluateNewString(editId, &newYear, &newMonth, &newDay, 0);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
456 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
457 }
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
458
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 if(newDay == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460 newDay = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 if(newDay > 31)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 newDay = 31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 if(newMonth == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 newMonth = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 if(newMonth > 12)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466 newMonth = 12;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 if((newMonth == 2) && (newDay > 29))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 newDay = 29;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 if((newDay > 30) && ((newMonth == 4) ||(newMonth == 6) ||(newMonth == 9) ||(newMonth == 11)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 newDay = 30;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471 if(newYear < 17)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472 newYear = 17;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 if(newYear > 99)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 newYear = 99;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 sdatestructure.Date = newDay;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477 sdatestructure.Month = newMonth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 sdatestructure.Year = newYear;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 setWeekday(&sdatestructure);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 setDate(sdatestructure);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
483 switch(settingsGetPointer()->date_format)
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
484 {
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
485 default:
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
486 case DDMMYY: tMenuEdit_newInput(editId, newDay, newMonth, newYear, 0);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
487 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
488 case MMDDYY: tMenuEdit_newInput(editId, newMonth, newDay, newYear, 0);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
489 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
490 case YYMMDD: tMenuEdit_newInput(editId, newYear, newMonth, newDay, 0);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
491 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
492 }
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
493
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 }
720
4f70155362d2 Bugfix set date (year):
Ideenmodellierer
parents: 671
diff changeset
496 if(action == ACTION_BUTTON_NEXT) /* clip values to a specific range e.g. 12 months */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 digitContentNew = digitContent + 1;
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
499
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
500 if((blockNumber == mapDMY[0]) && (digitContentNew > '0' + 31))
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
501 {
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 digitContentNew = '1';
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
503 }
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
504 if((blockNumber == mapDMY[1]) && (digitContentNew > '0' + 12))
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
505 {
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 digitContentNew = '1';
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
507 }
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
508 if((blockNumber == mapDMY[2]) && (digitContentNew > '0' + pFirmwareInfo->release_year + 10))
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
509 {
720
4f70155362d2 Bugfix set date (year):
Ideenmodellierer
parents: 671
diff changeset
510 digitContentNew = '0' + pFirmwareInfo->release_year;
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
511 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513 }
720
4f70155362d2 Bugfix set date (year):
Ideenmodellierer
parents: 671
diff changeset
514 if(action == ACTION_BUTTON_BACK) /* clip values to a specific range e.g. 12 months */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 digitContentNew = digitContent - 1;
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
517 if((blockNumber == mapDMY[0]) && (digitContentNew < '1'))
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
518 {
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 digitContentNew = '0' + 31;
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
520 }
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
521 if((blockNumber == mapDMY[1]) && (digitContentNew < '1'))
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
522 {
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 digitContentNew = '0' + 12;
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
524 }
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
525 if((blockNumber == mapDMY[2]) && (digitContentNew < '0' + pFirmwareInfo->release_year))
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
526 {
720
4f70155362d2 Bugfix set date (year):
Ideenmodellierer
parents: 671
diff changeset
527 digitContentNew = '0' + pFirmwareInfo->release_year + 10;
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
528 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 if((blockNumber == 2) && (digitNumber == 0) && (digitContentNew > '2'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 digitContentNew = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew > '3'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew > '1'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 if(digitContentNew > '9')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 if((blockNumber == 2) && (digitNumber == 0) && (digitContentNew < '1'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 digitContentNew = '2';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 digitContentNew = '3';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 digitContentNew = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 if(digitContentNew < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 digitContentNew = '9';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 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
564 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 uint8_t digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566 uint32_t newHour, newMinute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 RTC_TimeTypeDef stimestructure;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 evaluateNewString(editId, &newHour, &newMinute, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 if(newHour > 23)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 newHour = 23;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 if(newMinute > 59)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 newMinute = 59;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 stimestructure.Hours = newHour;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 stimestructure.Minutes = newMinute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 stimestructure.Seconds = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 setTime(stimestructure);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 tMenuEdit_newInput(editId, newHour, newMinute, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593 if((blockNumber == 0) && (digitContentNew > '0' + 23))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 if((blockNumber == 1) && (digitContentNew > '0' + 59))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 if((blockNumber == 0) && (digitContentNew < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603 digitContentNew = '0' + 23;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604 if((blockNumber == 1) && (digitContentNew < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 digitContentNew = '0' + 59;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew > '2'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew > '5'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616 if(digitContentNew > '9')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 digitContentNew = '2';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 digitContentNew = '5';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 if(digitContentNew < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628 digitContentNew = '9';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634
567
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
635 uint8_t OnAction_12HR(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
636 {
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
637 SSettings *pSettings;
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
638
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
639 pSettings = settingsGetPointer();
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
640 pSettings->amPMTime = !(pSettings->amPMTime);
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
641
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
642 tMenuEdit_set_on_off(editId, pSettings->amPMTime);
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
643
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
644 return UNSPECIFIC_RETURN;
1c95f811967c -Add 12HR Time Support
izzni
parents: 558
diff changeset
645 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646
949
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
647 uint8_t OnAction_SetGnss(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
648 {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
649 RTC_DateTypeDef sdatestructure;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
650 RTC_TimeTypeDef stimestructure;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
651 uint8_t localHours = 0;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
652 uint8_t localMinutes = 0;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
653
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
654 const SDiveState * pStateReal = stateRealGetPointer();
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
655
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
656 if(pStateReal->lifeData.gnssData.alive & GNSS_ALIVE_STATE_TIME)
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
657 {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
658 convertUTCToLocal(pStateReal->lifeData.gnssData.DateTime.hour, pStateReal->lifeData.gnssData.DateTime.min, &localHours, &localMinutes);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
659 stimestructure.Hours = localHours;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
660 stimestructure.Minutes = localMinutes;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
661 stimestructure.Seconds = 0;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
662 setTime(stimestructure);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
663
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
664 sdatestructure.Date = pStateReal->lifeData.gnssData.DateTime.day;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
665 sdatestructure.Month = pStateReal->lifeData.gnssData.DateTime.month;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
666 sdatestructure.Year = pStateReal->lifeData.gnssData.DateTime.year;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
667 setWeekday(&sdatestructure);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
668 setDate(sdatestructure);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
669 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
670 return UNSPECIFIC_RETURN;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
671 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
672
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
673 void openEdit_DateFormat(void)
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
674 {
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
675 char text[32];
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
676 SSettings *pSettings;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
677
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
678 uint8_t ddmmyy = 0;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
679 uint8_t mmddyy= 0;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
680 uint8_t yymmdd = 0;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
681
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
682 pSettings = settingsGetPointer();
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
683
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
684
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
685 set_globalState(StMSYS1_FORMAT);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
686 resetMenuEdit(CLUT_MenuPageSystem);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
687 setBackMenu((uint32_t)openEdit_DateTime,0,4);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
688
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
689 switch(pSettings->date_format)
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
690 {
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
691 default:
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
692 case DDMMYY: ddmmyy = 1;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
693 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
694 case MMDDYY: mmddyy = 1;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
695 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
696 case YYMMDD: yymmdd = 1;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
697 break;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
698 };
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
699
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
700 text[0] = '\001';
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
701 text[1] = TXT_Format;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
702 text[2] = 0;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
703
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
704 write_topline(text);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
705
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
706 write_label_fix( 20, 790, ME_Y_LINE2, &FontT42, TXT_Format);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
707
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
708 write_field_on_off(StMSYS1_DDMMYY, 320, 790, ME_Y_LINE1, &FontT48, "DDMMYY", ddmmyy);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
709 write_field_on_off(StMSYS1_MMDDYY, 320, 790, ME_Y_LINE2, &FontT48, "MMDDYY", mmddyy);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
710 write_field_on_off(StMSYS1_YYMMDD, 320, 790, ME_Y_LINE3, &FontT48, "YYMMDD", yymmdd);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
711
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
712 setEvent(StMSYS1_DDMMYY, (uint32_t)OnAction_DDMMYY);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
713 setEvent(StMSYS1_MMDDYY, (uint32_t)OnAction_MMDDYY);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
714 setEvent(StMSYS1_YYMMDD, (uint32_t)OnAction_YYMMDD);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
715
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
716 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
717 }
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
718
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
719 uint8_t OnAction_Format(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
720 {
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
721 openEdit_DateFormat();
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
722
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
723 return UNSPECIFIC_RETURN;
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
724 }
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 884
diff changeset
725
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726 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
727 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731 pSettings->date_format = DDMMYY;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 tMenuEdit_set_on_off(editId, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734 tMenuEdit_set_on_off(StMSYS1_MMDDYY, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 tMenuEdit_set_on_off(StMSYS1_YYMMDD, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 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
742 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 pSettings->date_format = MMDDYY;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 tMenuEdit_set_on_off(editId, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 tMenuEdit_set_on_off(StMSYS1_DDMMYY, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 tMenuEdit_set_on_off(StMSYS1_YYMMDD, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756 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
757 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 pSettings->date_format = YYMMDD;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 tMenuEdit_set_on_off(editId, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764 tMenuEdit_set_on_off(StMSYS1_MMDDYY, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765 tMenuEdit_set_on_off(StMSYS1_DDMMYY, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769
949
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
770 uint8_t OnAction_UTC(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
771 {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
772 SSettings *settings = settingsGetPointer();
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
773 const SDiveState * pStateReal = stateRealGetPointer();
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
774 int32_t utcHour;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
775 uint32_t utcMinutes;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
776 uint8_t digitContentNew;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
777 uint8_t localHours = 0;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
778 uint8_t localMinutes = 0;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
779 char text[32];
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
780 char timeStr[20];
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
781
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
782 switch (action) {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
783 case ACTION_BUTTON_ENTER:
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
784
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
785 return digitContent;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
786 case ACTION_BUTTON_ENTER_FINAL:
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
787 {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
788
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
789 evaluateNewString(editId, (uint32_t *)&utcHour, &utcMinutes, NULL, NULL);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
790
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
791 if (utcHour > 14) {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
792 utcHour = 14;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
793 } else if (utcHour < -12) {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
794 utcHour = -12;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
795 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
796
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
797 if (utcMinutes % 15 != 0)
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
798 {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
799 utcMinutes = (utcMinutes / 15) * 15;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
800 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
801 if(utcMinutes > 45)
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
802 {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
803 utcMinutes = 45;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
804 } else if (utcMinutes < 0) {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
805 utcMinutes = 0;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
806 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
807 settings->timeZone.hours = utcHour;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
808 settings->timeZone.minutes = utcMinutes;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
809
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
810 tMenuEdit_newInput(editId, ((input_u)utcHour).uint32, utcMinutes, 0, 0);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
811 convertUTCToLocal(pStateReal->lifeData.gnssData.DateTime.hour, pStateReal->lifeData.gnssData.DateTime.min, &localHours, &localMinutes);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
812 convertStringOfDate_DDMMYY(timeStr, 20, pStateReal->lifeData.gnssData.DateTime.day
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
813 , pStateReal->lifeData.gnssData.DateTime.month
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
814 , pStateReal->lifeData.gnssData.DateTime.year);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
815 snprintf(text, 32, "%2d:%2d - %s", localHours, localMinutes, timeStr);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
816 tMenuEdit_newButtonText(StMSYS1_GNSSDT, text);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
817 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
818
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
819 break;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
820 case ACTION_BUTTON_NEXT:
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
821 if ((blockNumber == 0) && (digitNumber == 0)) {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
822 digitContentNew = togglePlusMinus(digitContent);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
823 } else {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
824 digitContentNew = digitContent + 1;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
825 if (digitContentNew > '9') {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
826 digitContentNew = '0';
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
827 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
828 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
829
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
830 return digitContentNew;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
831 case ACTION_BUTTON_BACK:
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
832 if ((blockNumber == 0) && (digitNumber == 0)) {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
833 digitContentNew = togglePlusMinus(digitContent);
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
834 } else {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
835 digitContentNew = digitContent - 1;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
836 if (digitContentNew < '0') {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
837 digitContentNew = '9';
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
838 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
839 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
840 return digitContentNew;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
841 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
842 return UNSPECIFIC_RETURN;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
843 }
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 944
diff changeset
844
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
845
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
846 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
847 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
848 RTC_TimeTypeDef stimestructure;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
849 uint8_t newDST;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
850
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
851 get_RTC_DateTime(0, &stimestructure);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
852 newDST = stimestructure.DayLightSaving;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
853 if(newDST)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
854 newDST = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
855 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
856 newDST = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
857 stimestructure.DayLightSaving = newDST;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
858 set_RTC_DateTime(0, &stimestructure);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
859
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
860 tMenuEdit_set_on_off(editId, newDST);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
861
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
862 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
863 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
864
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
865
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
866 void openEdit_Language(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
867 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
868 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
869 uint8_t actualLanguage, active;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
870 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
871
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
872 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
873 actualLanguage = pSettings->selected_language;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
874
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
875 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
876 text[1] = TXT_Language;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
877 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
878 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
879
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
880 text[0] = TXT_LanguageName;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
881 text[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
882
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
883 pSettings->selected_language = LANGUAGE_English;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
884 if( actualLanguage == pSettings->selected_language)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
885 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
886 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
887 active = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
888 write_field_on_off(StMSYS2_English, 30, 500, ME_Y_LINE1, &FontT48, text, active);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
889
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
890 pSettings->selected_language = LANGUAGE_German;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
891 if( actualLanguage == pSettings->selected_language)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
892 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
893 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
894 active = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
895 write_field_on_off(StMSYS2_German, 30, 800, ME_Y_LINE2, &FontT48, text, active);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
896
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
897 pSettings->selected_language = LANGUAGE_French;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
898 if( actualLanguage == pSettings->selected_language)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
899 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
900 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
901 active = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
902 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
903
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
904
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
905 pSettings->selected_language = LANGUAGE_Italian;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
906 if( actualLanguage == pSettings->selected_language)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
907 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
908 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
909 active = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
910 write_field_on_off(StMSYS2_Italian, 30, 800, ME_Y_LINE4, &FontT48, text, active);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
911
102
4276d56eb37c hPa instead of mbar, enabled Spanish language
heinrichsweikamp
parents: 64
diff changeset
912
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
913 pSettings->selected_language = LANGUAGE_Espanol;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
914 if( actualLanguage == pSettings->selected_language)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
915 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
916 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
917 active = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
918 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
919
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
920 pSettings->selected_language = actualLanguage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
921
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
922 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
923
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
924 setEvent(StMSYS2_English, (uint32_t)OnAction_English);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
925 setEvent(StMSYS2_German, (uint32_t)OnAction_German);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
926 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
927 setEvent(StMSYS2_Italian, (uint32_t)OnAction_Italian);
102
4276d56eb37c hPa instead of mbar, enabled Spanish language
heinrichsweikamp
parents: 64
diff changeset
928 setEvent(StMSYS2_Espanol, (uint32_t)OnAction_Espanol);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
929 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
930
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
931
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
932 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
933 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
934 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
935 pSettings->selected_language = LANGUAGE_English;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
936 return EXIT_TO_MENU_WITH_LOGO;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
937 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
938
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
939
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
940 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
941 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
942 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
943 pSettings->selected_language = LANGUAGE_German;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
944 return EXIT_TO_MENU_WITH_LOGO;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
945 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
946
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
947
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
948 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
949 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
950 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
951 pSettings->selected_language = LANGUAGE_French;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
952 return EXIT_TO_MENU_WITH_LOGO;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
953 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
954
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
955
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
956 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
957 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
958 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
959 pSettings->selected_language = LANGUAGE_Italian;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
960 return EXIT_TO_MENU_WITH_LOGO;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
961 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
962
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
963
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
964 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
965 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
966 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
967 pSettings->selected_language = LANGUAGE_Espanol;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
968 return EXIT_TO_MENU_WITH_LOGO;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
969 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
970
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
971
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
972 void openEdit_Design(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
973 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
974 refresh_Design();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
975
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
976 write_field_button(StMSYS3_Units, 400, 700, ME_Y_LINE1, &FontT48, "");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
977 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
978 #ifdef HAVE_DEBUG_VIEW
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
979 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
980 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
981 setEvent(StMSYS3_Units, (uint32_t)OnAction_Units);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
982 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
983 #ifdef HAVE_DEBUG_VIEW
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
984 setEvent(StMSYS3_Debug, (uint32_t)OnAction_DebugInfo);
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
985 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
986 }
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 void refresh_Design(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
990 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
991 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
992
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
993 // header
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
994 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
995 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
996 text[2] = TXT2BYTE_Layout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
997 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
998 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
999
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1000 // units
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1001 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1002 text[1] = TXT2BYTE_Units;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1003 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1004 write_label_var( 30, 200, ME_Y_LINE1, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1005
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1006 if(settingsGetPointer()->nonMetricalSystem)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1007 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1008 text[1] = TXT2BYTE_Units_feet;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1009 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1010 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1011 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1012 text[1] = TXT2BYTE_Units_metric;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1013 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1014 write_label_var( 400, 700, ME_Y_LINE1, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1015
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1016 // colorscheme
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1017 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1018 text[1] = TXT2BYTE_Farbschema;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1019 text[2] = 0;
118
ee7f2cd9b9b4 Enlarge text limits to get string displayed completly
Ideenmodellierer
parents: 103
diff changeset
1020 write_label_var( 30, 300, ME_Y_LINE2, &FontT48, text);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1021
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1022 text[0] = '0' + settingsGetPointer()->tX_colorscheme;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1023 text[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1024 write_label_var( 400, 700, ME_Y_LINE2, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1025
343
c9d217b110cc Added compile switch to enable debug view option in system menu
ideenmodellierer
parents: 259
diff changeset
1026 #ifdef HAVE_DEBUG_VIEW
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1027 // specials
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1028 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1029 text[1] = TXT2BYTE_ShowDebug;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1030 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1031 write_label_var( 30, 700, ME_Y_LINE3, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1032
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1033 if(settingsGetPointer()->showDebugInfo)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1034 text[0] = '\005';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1035 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1036 text[0] = '\006';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1037 text[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1038 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
1039 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1040
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1041 // design
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1042 text[0] = TXT_Depth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1043 text[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1044 write_content( 30, 700, ME_Y_LINE4, &FontT24, text, CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1045 write_content( 30, 700, ME_Y_LINE4 + 30 + 70, &FontT48, "___________", CLUT_DIVE_FieldSeperatorLines);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1046 write_content(280, 700, ME_Y_LINE4 + 30 + 70 - 3, &FontT48, "|", CLUT_DIVE_pluginbox);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1047 write_content(290, 700, ME_Y_LINE4 + 30 + 70 - 37, &FontT48, "_______________", CLUT_DIVE_pluginbox);
884
940f8e132638 Minor screen cleanup:
Ideenmodellierer
parents: 854
diff changeset
1048 write_content( 30, 700, ME_Y_LINE4 + 42, &FontT144, "24.7", CLUT_Font027);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1049
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1050 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1051 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1052
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1053
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1054 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
1055 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1056 settingsGetPointer()->nonMetricalSystem = !(settingsGetPointer()->nonMetricalSystem);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1057 return EXIT_TO_MENU_WITH_LOGO;//UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1058 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1059
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1060
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1061 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
1062 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1063 uint8_t newColorscheme;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1064
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1065 newColorscheme = settingsGetPointer()->tX_colorscheme + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1066
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1067 if(newColorscheme > 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1068 newColorscheme = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1069
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1070 settingsGetPointer()->tX_colorscheme = newColorscheme;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1071 GFX_use_colorscheme(newColorscheme);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1072 tHome_init_compass();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1073 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1074 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1075
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1076
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1077 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
1078 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1079 settingsGetPointer()->showDebugInfo = !(settingsGetPointer()->showDebugInfo);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1080 return UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1081 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1082
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 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1087 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
1088 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1089 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1090 if((pSettings->design == 7) && pSettings->nonMetricalSystem)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1091 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1092 pSettings->design = 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1093 pSettings->nonMetricalSystem = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1094 tMenuEdit_set_on_off(StMSYS3_t7, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1095 tMenuEdit_set_on_off(StMSYS3_t7ft, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1096 tMenuEdit_set_on_off(StMSYS3_t3, 0);
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_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
1102 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1103 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1104 if((pSettings->design == 7) && (pSettings->nonMetricalSystem == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1105 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1106 pSettings->design = 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1107 pSettings->nonMetricalSystem = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1108 tMenuEdit_set_on_off(StMSYS3_t7, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1109 tMenuEdit_set_on_off(StMSYS3_t7ft, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1110 tMenuEdit_set_on_off(StMSYS3_t3, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1111 return UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1112 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1113
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1114
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1115 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
1116 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1117 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1118 if(pSettings->design == 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1119 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1120 pSettings->design = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1121 pSettings->nonMetricalSystem = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1122 tMenuEdit_set_on_off(StMSYS3_t7, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1123 tMenuEdit_set_on_off(StMSYS3_t7ft,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1124 tMenuEdit_set_on_off(StMSYS3_t3, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1125 return UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1126 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1127 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1128
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1129
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
1130
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1131 void openEdit_Information(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1132 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1133 char text[70];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1134
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1135 infoPage = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1136
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1137 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1138 text[1] = TXT_Information;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1139 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1140 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1141
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1142 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1143 text[1] = TXT2BYTE_ButtonNext;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1144 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1145
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1146 write_field_button(StMSYS4_Info, 30, 800, ME_Y_LINE6, &FontT48, text);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1147
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1148 setEvent(StMSYS4_Info, (uint32_t)OnAction_Information);
854
48b6a3b1f3f8 Development bugfix menu id handling:
Ideenmodellierer
parents: 844
diff changeset
1149 tMenuEdit_select(StMSYS4_Info);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1150 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1151
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1152
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1153 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
1154 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1155 resetEnterPressedToStateBeforeButtonAction();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1156
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1157 infoPage++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1158 if(infoPage > 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1159 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1160 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1161 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1162 }
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 void refresh_InformationPage(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1166 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1167 char text_header[5];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1168 char text_button[5];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1169 char text_content[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1170 uint8_t date[3], year,month,day;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1171
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1172 RTC_DateTypeDef Sdate, Sdate2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1173 float temperature1, temperature2, voltage, offsetTemperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1174
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1175 //RTC_TimeTypeDef Stime;
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 SDeviceLine batteryChargeCycles;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1179 SDeviceLine batteryChargeCompleteCycles;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1180 SDeviceLine temperatureMinimum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1181 SDeviceLine temperatureMaximum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1182 SDeviceLine depthMaximum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1183 SDeviceLine diveCycles;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1184 SDeviceLine voltageMinimum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1185 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1186
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1187 switch(infoPage)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1188 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1189 case 0:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1190 text_header[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1191 text_header[1] = TXT_Information;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1192 text_header[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1193
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1194 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, "Dive Computer OSTC4");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1195 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, "Design heinrichs/weikamp");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1196
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1197 Sdate.Year = firmwareDataGetPointer()->release_year;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1198 Sdate.Month = firmwareDataGetPointer()->release_month;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1199 Sdate.Date = firmwareDataGetPointer()->release_day;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1200
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1201 if(settingsGetPointer()->date_format == DDMMYY)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1202 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1203 day = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1204 month = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1205 year = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1206 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1207 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1208 if(settingsGetPointer()->date_format == MMDDYY)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1209 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1210 day = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1211 month = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1212 year = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1213 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1214 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1215 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1216 day = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1217 month = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1218 year = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1219 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1220 date[day] = Sdate.Date;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1221 date[month] = Sdate.Month;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1222 date[year] = Sdate.Year;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1223 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
1224 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1225 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, "for more information");
64
98b479d0618f typo in info menu...
heinrichsweikamp
parents: 57
diff changeset
1226 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, "info@heinrichsweikamp.com");
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1227
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1228 text_button[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1229 text_button[1] = TXT2BYTE_ButtonNext;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1230 text_button[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1231 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1232
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1233 case 1:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1234 text_header[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1235 text_header[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1236 text_header[2] = TXT2BYTE_Usage_Battery;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1237 text_header[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1238
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1239 text_content[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1240 text_content[1] = TXT2BYTE_ChargeCycles;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1241 text_content[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1242 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content);
646
0fc1b47d2482 Remove battery charge counter from information menu:
Ideenmodellierer
parents: 567
diff changeset
1243 /* snprintf(text_content,80,"%ld (%ld)",stateDeviceGetPointer()->batteryChargeCycles.value_int32,stateDeviceGetPointer()->batteryChargeCompleteCycles.value_int32);
0fc1b47d2482 Remove battery charge counter from information menu:
Ideenmodellierer
parents: 567
diff changeset
1244 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1245
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1246 translateDate(stateDeviceGetPointer()->batteryChargeCycles.date_rtc_dr, &Sdate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1247 translateDate(stateDeviceGetPointer()->batteryChargeCompleteCycles.date_rtc_dr, &Sdate2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1248 snprintf(text_content,80,"%u.%u.20%02u (%u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year);
646
0fc1b47d2482 Remove battery charge counter from information menu:
Ideenmodellierer
parents: 567
diff changeset
1249 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1250
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1251 text_content[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1252 text_content[1] = TXT2BYTE_LowestVoltage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1253 text_content[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1254 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1255
404
e729b8e7654d Bugfix: display of time of minimum voltag:
ideenmodellierer
parents: 389
diff changeset
1256 translateDate(stateDeviceGetPointer()->voltageMinimum.date_rtc_dr, &Sdate);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1257 voltage = ((float)stateDeviceGetPointer()->voltageMinimum.value_int32) / 1000;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1258 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
1259 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1260
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1261 text_button[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1262 text_button[1] = TXT2BYTE_ButtonNext;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1263 text_button[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1264 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1265
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1266 case 2:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1267 text_header[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1268 text_header[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1269 text_header[2] = TXT2BYTE_Usage_Dives;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1270 text_header[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1271
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1272 text_content[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1273 text_content[1] = TXT2BYTE_NumberOfDives;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1274 text_content[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1275 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1276
57
e941c9e49f73 Resolve format warnings
Ideenmodellierer
parents: 55
diff changeset
1277 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
1278 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1279
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1280 translateDate(stateDeviceGetPointer()->diveCycles.date_rtc_dr, &Sdate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1281 translateDate(stateDeviceGetPointer()->depthMaximum.date_rtc_dr, &Sdate2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1282 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
1283 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content);
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_HoursOfOperation;
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_LINE4, &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",(stateDeviceGetPointer()->hoursOfOperation.value_int32)/3600);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1291 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1292
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1293 text_button[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1294 text_button[1] = TXT2BYTE_ButtonNext;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1295 text_button[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1296 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1297
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1298 case 3:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1299 text_header[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1300 text_header[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1301 text_header[2] = TXT2BYTE_Usage_Environment;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1302 text_header[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1303
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1304 text_content[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1305 text_content[1] = TXT2BYTE_AmbientTemperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1306 text_content[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1307 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1308
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1309 temperature1 = ((float)stateDeviceGetPointer()->temperatureMinimum.value_int32) / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1310 temperature2 = ((float)stateDeviceGetPointer()->temperatureMaximum.value_int32) / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1311 snprintf(text_content,80,"%0.2f\140C / %0.2f\140C",temperature1,temperature2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1312 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1313
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1314 translateDate(stateDeviceGetPointer()->temperatureMinimum.date_rtc_dr, &Sdate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1315 translateDate(stateDeviceGetPointer()->temperatureMaximum.date_rtc_dr, &Sdate2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1316 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
1317 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1318
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1319 text_content[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1320 text_content[1] = TXT2BYTE_Korrekturwerte;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1321 text_content[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1322 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1323
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1324 offsetTemperature = ((float)settingsGetPointer()->offsetTemperature_centigrad) / 10;
103
f5d2f02dc73f Generalize TEXT of pressure unit
Dmitry Romanov <kitt@bk.ru>
parents: 102
diff changeset
1325 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
1326 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1327
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1328 text_button[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1329 text_button[1] = TXT2BYTE_Exit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1330 text_button[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1331 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1332 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1333
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1334 write_topline(text_header);
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1335 tMenuEdit_newButtonText(StMSYS4_Info, text_button);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1336 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonNext,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1337 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1338
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1339
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1340 void openEdit_Reset(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1341 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1342 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1343
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1344 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1345 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1346 text[2] = TXT2BYTE_ResetMenu;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1347 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1348 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1349
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1350 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1351 text[1] = TXT2BYTE_LogbookOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1352 text[7] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1353
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1354 write_label_var( 30, 400, ME_Y_LINE1, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1355
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1356 write_field_udigit(StMSYS5_LogbookOffset,420, 800, ME_Y_LINE1, &FontT48, "####", settingsGetPointer()->logbookOffset,0,0,0);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1357
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1358 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1359 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1360
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1361 text[1] = TXT2BYTE_ResetAll;
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1362 write_field_button(StMSYS5_ResetAll, 30, 800, ME_Y_LINE2, &FontT48, text);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1363
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1364 text[1] = TXT2BYTE_ResetDeco;
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1365 write_field_button(StMSYS5_ResetDeco, 30, 800, ME_Y_LINE3, &FontT48, text);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1366
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1367 text[1] = TXT2BYTE_Reboot;
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1368 write_field_button(StMSYS5_Reboot, 30, 800, ME_Y_LINE4, &FontT48, text);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1369
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1370 text[1] = TXT2BYTE_Maintenance;
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1371 write_field_button(StMSYS5_Maintenance, 30, 800, ME_Y_LINE5, &FontT48, text);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1372
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1373 #ifndef RESETLOGBLOCK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1374 text[1] = TXT2BYTE_ResetLogbook;
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1375 write_field_button(StMSYS5_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1376 #else
528
a9c195be907e Added new option to gas configuration: "Off":
Ideenmodellierer
parents: 520
diff changeset
1377 text[0] = '\031';
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1378 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1379 text[2] = TXT2BYTE_ResetLogbook;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1380 text[3] = 0;
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1381 write_field_button(StMSYS5_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1382 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1383 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1384 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1385
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1386 setEvent(StMSYS5_LogbookOffset, (uint32_t)OnAction_LogbookOffset);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1387 setEvent(StMSYS5_ResetAll, (uint32_t)OnAction_Confirm);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1388 setEvent(StMSYS5_ResetDeco, (uint32_t)OnAction_Confirm);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1389 setEvent(StMSYS5_Reboot, (uint32_t)OnAction_Confirm);
844
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1390 setEvent(StMSYS5_Maintenance, (uint32_t)OnAction_Maintenance);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1391 #ifndef RESETLOGBLOCK
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1392 setEvent(StMSYS5_ResetLogbook, (uint32_t)OnAction_Confirm);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1393 #else
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1394 setEvent(StMSYS5_ResetLogbook, (uint32_t)OnAction_Nothing);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1395 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1396
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1397 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1398 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1399
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1400
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1401 void openEdit_ResetConfirmation(uint32_t editIdOfCaller)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1402 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1403 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1404
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1405 resetMenuEdit(CLUT_MenuPageSystem);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1406
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1407 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1408 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1409 text[2] = TXT2BYTE_AreYouSure;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1410 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1411 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1412
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1413 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1414 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1415 text[1] = TXT2BYTE_Abort;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1416
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1417 write_field_button(StMSYS5_Exit, 30, 800, ME_Y_LINE1, &FontT48, text);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1418
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1419 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1420 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1421 switch(editIdOfCaller)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1422 {
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1423 case StMSYS5_Reboot:
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1424 case StMSYS5_RebootRTE:
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1425 case StMSYS5_RebootMainCPU:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1426 text[1] = TXT2BYTE_RebootMainCPU;
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1427 write_field_button(StMSYS5_RebootMainCPU, 30, 800, ME_Y_LINE2, &FontT48, text);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1428 text[1] = TXT2BYTE_RebootRTE;
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1429 write_field_button(StMSYS5_RebootRTE, 30, 800, ME_Y_LINE3, &FontT48, text);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1430 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1431 setEvent(StMSYS5_RebootMainCPU, (uint32_t)OnAction_RebootMainCPU);
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1432 setEvent(StMSYS5_RebootRTE, (uint32_t)OnAction_RebootRTE);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1433 text[0] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1434 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1435 text[2] = TXT2BYTE_DecoDataLost;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1436 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1437 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1438 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1439
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1440 case StMSYS5_ResetDeco:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1441 text[1] = TXT2BYTE_ResetDeco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1442 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text);
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1443 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1444 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetDeco);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1445 text[0] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1446 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1447 text[2] = TXT2BYTE_DecoDataLost;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1448 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1449 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1450 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1451
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1452 case StMSYS5_ResetAll:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1453 text[1] = TXT2BYTE_ResetAll;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1454 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text);
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1455 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1456 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetAll);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1457 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1458
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1459 case StMSYS5_ResetLogbook:
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1460 text[1] = TXT2BYTE_ResetLogbook;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1461 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text);
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1462 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1463 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetLogbook);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1464 break;
844
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1465 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1466
844
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1467 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1468 }
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1469
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1470 void openEdit_Maintenance(void)
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1471 {
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1472 char text[32];
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1473 unsigned char index = 0;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1474 SSettings *pSettings = settingsGetPointer();
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1475 SSensorDataDiveO2* pDiveO2Data = NULL;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1476
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1477 resetMenuEdit(CLUT_MenuPageSystem);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1478
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1479 text[0] = '\001';
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1480 text[1] = TXT_2BYTE;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1481 text[2] = TXT2BYTE_Maintenance;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1482 text[3] = 0;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1483 write_topline(text);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1484
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1485 text[0] = TXT_2BYTE;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1486 text[1] = TXT2BYTE_SetFactoryDefaults;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1487 text[2] = 0;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1488 write_field_button(StMSYS5_SetFactoryBC, 30, 800, ME_Y_LINE1, &FontT48, text);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1489
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1490
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1491 if(stateRealGetPointer()->lifeData.battery_charge <= 0)
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1492 {
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1493 text[0] = TXT_2BYTE;
844
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1494 text[1] = TXT2BYTE_SetBatteryCharge;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1495 text[2] = 0;
844
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1496 snprintf(&text[2],10,": %u%%",pSettings->lastKnownBatteryPercentage);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1497 write_field_button(StMSYS5_SetBattCharge, 30, 800, ME_Y_LINE2, &FontT48, text);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1498 }
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1499
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1500 if((pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG) || (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_DIGITAL))
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1501 {
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1502 for (index = 0; index < 3; index++)
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1503 {
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1504 if(pSettings->ext_sensor_map[index] == SENSOR_DIGO2M)
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1505 {
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1506 pDiveO2Data = (SSensorDataDiveO2*)stateRealGetPointer()->lifeData.extIf_sensor_data[index];
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1507 if(pDiveO2Data->pressure != 0)
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1508 {
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1509 snprintf(text,32,"%c%c (%1.3lf => %1.3f)\016\016Bar",TXT_2BYTE,TXT2BYTE_AdjustAmbPressure,(float)(pDiveO2Data->pressure/1000000.0),
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1510 stateRealGetPointer()->lifeData.pressure_surface_bar);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1511
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1512 write_field_button(StMSYS5_AdjustSurfPres, 30, 800, ME_Y_LINE4, &FontT48, text);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1513 }
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1514 break;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1515 }
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1516 }
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1517 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1518
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1519 #ifdef ENABLE_ANALYSE_SAMPLES
844
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1520 text[0] = TXT_2BYTE;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1521 text[1] = TXT2BYTE_SetSampleIndex;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1522 text[2] = 0;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1523 write_field_button(StMSYS5_SetSampleIndx, 30, 800, ME_Y_LINE4, &FontT48, text);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1524 #endif
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1525
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1526 setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1527 if(stateRealGetPointer()->lifeData.battery_charge <= 0)
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1528 {
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1529 setEvent(StMSYS5_SetBattCharge, (uint32_t)OnAction_SetBatteryCharge);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1530 }
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1531 if((pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG) || (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_DIGITAL))
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1532 {
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1533 if(pDiveO2Data != NULL)
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1534 {
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1535 setEvent(StMSYS5_AdjustSurfPres, (uint32_t)OnAction_AdjustSurfacePressure);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1536 }
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1537 }
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1538 #ifdef ENABLE_ANALYSE_SAMPLES
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1539 setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx);
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1540 #endif
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1541
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1542
844
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1543 text[0] = TXT_2BYTE;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1544 text[1] = TXT2BYTE_WarnBatteryLow;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1545 text[2] = 0;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1546 snprintf(&text[2],10,": %01.2fV",stateRealGetPointer()->lifeData.battery_voltage);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1547 write_label_var( 30, 800, ME_Y_LINE5, &FontT42, text);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1548
844
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1549 snprintf(&text[0],30,"Code: %X",getLicence());
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1550 write_label_var( 30, 800, ME_Y_LINE6, &FontT42, text);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1551
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1552 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1553 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1554
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1555 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
1556 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1557 uint8_t digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1558 uint32_t newOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1559
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1560 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1561 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1562
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1563 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1564 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1565 evaluateNewString(editId, &newOffset, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1566 if(newOffset > 9000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1567 newOffset = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1568 tMenuEdit_newInput(editId, newOffset, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1569 settingsGetPointer()->logbookOffset = (uint16_t)newOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1570 return UPDATE_DIVESETTINGS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1571 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1572
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1573 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1574 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1575 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1576 if(digitContentNew > '9')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1577 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1578 return digitContentNew;
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 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1582 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1583 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1584 if(digitContentNew < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1585 digitContentNew = '9';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1586 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1587 }
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_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
1592 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1593 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1594 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1595
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1596 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
1597 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1598 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1599 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1600 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
1601 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1602 openEdit_ResetConfirmation(editId);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1603 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1604 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1605
844
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1606 uint8_t OnAction_Maintenance (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1607 {
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1608 openEdit_Maintenance();
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1609 return UNSPECIFIC_RETURN;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1610 }
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1611
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1612 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
1613 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1614 MX_SmallCPU_Reset_To_Standard();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1615 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1616 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1617
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1618 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
1619 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1620 clearDeco();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1621 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1622 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1623
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1624 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
1625 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1626 set_settings_to_Standard();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1627 check_and_correct_settings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1628
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1629 return UPDATE_AND_EXIT_TO_HOME;
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_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
1633 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1634 write_label_var( 430, 740, 350, &FontT42, "Wait");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1635 ext_flash_erase_logbook();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1636
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1637 SSettings * pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1638 pSettings->lastDiveLogId = 255;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1639 pSettings->logFlashNextSampleStartAddress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1640
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1641 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1642 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1643
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1644 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
1645 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1646 settingsGetPointer()->showDebugInfo = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1647 extern uint8_t bootToBootloader;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1648 bootToBootloader = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1649 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1650 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1651
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1652
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1653 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
1654 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1655 settingsWriteFactoryDefaults(settingsGetPointer()->ButtonResponsiveness[3], settingsGetPointer()->buttonBalance);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1656 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1657 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1658
468
aa1d71875e25 Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents: 446
diff changeset
1659 #ifdef ENABLE_ANALYSE_SAMPLES
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1660 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
1661 {
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1662 char text[32];
558
66aef216828b Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents: 528
diff changeset
1663 uint8_t openSec;
66aef216828b Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents: 528
diff changeset
1664 uint8_t retval = UNSPECIFIC_RETURN;
66aef216828b Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents: 528
diff changeset
1665 openSec = ext_flash_AnalyseSampleBuffer();
66aef216828b Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents: 528
diff changeset
1666 snprintf(&text[0],30,"OpenSec: %d",openSec);
66aef216828b Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents: 528
diff changeset
1667 write_label_var( 30, 800, ME_Y_LINE6, &FontT42, text);
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1668
558
66aef216828b Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents: 528
diff changeset
1669 if(openSec == 2)
66aef216828b Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents: 528
diff changeset
1670 {
66aef216828b Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents: 528
diff changeset
1671 retval = UPDATE_DIVESETTINGS;
66aef216828b Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents: 528
diff changeset
1672 }
66aef216828b Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents: 528
diff changeset
1673 return retval;
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1674 }
468
aa1d71875e25 Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents: 446
diff changeset
1675 #endif
424
2b31cf1ebbcc Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents: 404
diff changeset
1676
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1677 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
1678 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1679 setBatteryPercentage(settingsGetPointer()->lastKnownBatteryPercentage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1680 // setBatteryPercentage(100);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1681 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1682 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1683
844
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1684 uint8_t OnAction_AdjustSurfacePressure (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1685 {
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1686 SSensorDataDiveO2* pDiveO2Data;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1687 const SDiveState* pDiveState = stateRealGetPointer();
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1688 SSettings* pSettings = settingsGetPointer();
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1689 uint8_t index = 0;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1690 int8_t newOffset = 0;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1691
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1692 char text[32];
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1693
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1694 float orgpressure_surface;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1695
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1696 for (index = 0; index < 3; index++)
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1697 {
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1698 if(settingsGetPointer()->ext_sensor_map[index] == SENSOR_DIGO2M)
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1699 {
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1700 pDiveO2Data = (SSensorDataDiveO2*)stateRealGetPointer()->lifeData.extIf_sensor_data[index];
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1701 orgpressure_surface = pDiveState->lifeData.pressure_surface_bar - (settingsGetPointer()->offsetPressure_mbar / 1000.0);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1702 newOffset = ((pDiveO2Data->pressure/1000) - (orgpressure_surface * 1000));
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1703
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1704 if((pDiveState->lifeData.pressure_surface_bar * 1000 + newOffset) != (pDiveO2Data->pressure/1000)) /* there might be a rounding difference => compensate */
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1705 {
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1706 newOffset += (pDiveO2Data->pressure/1000) - (pDiveState->lifeData.pressure_surface_bar * 1000 + newOffset);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1707 }
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1708
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1709 pSettings->offsetPressure_mbar = newOffset;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1710 snprintf(text,32,"%c%c (%1.3lf => %1.3f)\016\016Bar",TXT_2BYTE,TXT2BYTE_AdjustAmbPressure,(float)(pDiveO2Data->pressure/1000000.0),
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1711 pDiveState->lifeData.pressure_surface_bar + pSettings->offsetPressure_mbar / 1000.0);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1712 tMenuEdit_newButtonText(StMSYS5_AdjustSurfPres,text);
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1713 break;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1714 }
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1715 }
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1716
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1717 return UNSPECIFIC_RETURN;
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1718 }
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1719
e04d7dd199fb Added option to adjust pressure to diveO2 reference:
Ideenmodellierer
parents: 805
diff changeset
1720
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1721 #ifdef SCREENTEST
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1722 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
1723 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1724 static uint8_t FrameCount = 1; // 0 is invisible frame
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1725 char text[5];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1726 GFX_DrawCfgScreen tTestScreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1727 tTestScreen.FBStartAdress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1728 tTestScreen.ImageHeight = 480;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1729 tTestScreen.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1730 tTestScreen.LayerIndex = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1731
520
970d8040c0e3 Moved custom view menu to new tab:
Ideenmodellierer
parents: 505
diff changeset
1732 set_globalState(StMSYS5_ScreenTest);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1733 tTestScreen.FBStartAdress = getFrameByNumber(FrameCount);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1734 if(tTestScreen.FBStartAdress == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1735 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1736 extern uint8_t bootToBootloader;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1737 bootToBootloader = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1738 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1739 GFX_fill_buffer(tTestScreen.FBStartAdress, 0xFF, FrameCount);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1740 snprintf(text,5,"%u",FrameCount);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1741 Gfx_write_label_var(&tTestScreen, 10,100,10,&FontT48,CLUT_Font027,text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1742 GFX_SetFramesTopBottom(tTestScreen.FBStartAdress, NULL,480);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1743 FrameCount++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1744 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1745 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1746 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1747 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
1748 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1749 write_label_var( 430, 740, 350, &FontT42, "Wait");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1750
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1751 test_log_only(20, 5);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1752 test_log_only(30, 10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1753 ext_flash_write_settings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1754 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1755 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1756 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1757