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