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