Mercurial > public > ostc4
annotate Discovery/Src/tMenuEditSystem.c @ 444:f2c4f5c90540 minor_improvments
Introduced enum for lower left corner view selection:
Enums allow changes in view configuration without danger of index inconsistencies
author | ideenmodellierer |
---|---|
date | Sat, 29 Feb 2020 22:27:29 +0100 |
parents | 8851702173e0 |
children | f1257a32f2d4 |
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 |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
44 /* Uncomment to activate a menu item in reset menu which provide sample ring analysis / repair functionality */ |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
45 #define ENABLE_ANALYSE_SAMPLES |
379 | 46 |
47 #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
|
48 /*#define HAVE_DEBUG_VIEW */ |
379 | 49 static uint8_t infoPage = 0; |
38 | 50 |
51 /* Private function prototypes -----------------------------------------------*/ | |
52 void openEdit_DateTime(void); | |
53 void openEdit_Language(void); | |
54 void openEdit_Design(void); | |
55 void openEdit_Customview(void); | |
56 void openEdit_Information(void); | |
57 void openEdit_Reset(void); | |
58 void openEdit_CustomviewDivemode(uint8_t line); | |
59 //void openEdit_ShowDebugInfo(void); | |
60 //void openEdit_Salinity(void); | |
61 | |
62 /* Announced function prototypes -----------------------------------------------*/ | |
63 uint8_t OnAction_Date (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
64 uint8_t OnAction_Time (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
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_CViewTimeout (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
83 uint8_t OnAction_CViewStandard (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
84 uint8_t OnAction_CornerTimeout (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
85 uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
86 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
|
87 uint8_t OnAction_MotionCtrl (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
38 | 88 |
89 uint8_t OnAction_Exit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
90 uint8_t OnAction_Confirm (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
91 uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
92 uint8_t OnAction_ResetDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
93 uint8_t OnAction_ResetAll (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
94 uint8_t OnAction_ResetLogbook (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
95 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
96 uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
97 uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
98 uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
99 uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
100 uint8_t OnAction_RecoverSampleIdx(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
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; |
444
f2c4f5c90540
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
435
diff
changeset
|
909 case LCC_BottleBar: |
f2c4f5c90540
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
435
diff
changeset
|
910 text[4] = TXT_AtemGasVorrat; |
f2c4f5c90540
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
435
diff
changeset
|
911 break; |
38 | 912 /* none */ |
913 case 0: | |
914 text[4] = '-'; | |
915 break; | |
916 default: | |
917 snprintf(&text[4],2,"%u",settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary); | |
918 break; | |
919 } | |
920 text[5] = 0; | |
921 write_label_var( 30, 700, ME_Y_LINE4, &FontT48, text); | |
922 | |
923 | |
924 // extra display | |
925 text[0] = TXT_2BYTE; | |
926 text[1] = TXT2BYTE_ExtraDisplay; | |
927 text[2] = ' '; | |
928 text[3] = ' '; | |
929 text[4] = TXT_2BYTE; | |
930 switch(settingsGetPointer()->extraDisplay) | |
931 { | |
932 /* BigFont */ | |
933 case EXTRADISPLAY_BIGFONT: | |
934 text[5] = TXT2BYTE_ExtraBigFont; | |
935 break; | |
936 /* DecoGame */ | |
937 case EXTRADISPLAY_DECOGAME: | |
938 text[5] = TXT2BYTE_ExtraDecoGame; | |
939 break; | |
940 /* none */ | |
941 case EXTRADISPLAY_none: | |
942 text[5] = TXT2BYTE_ExtraNone; | |
943 break; | |
944 default: | |
945 snprintf(&text[4],2,"%u",settingsGetPointer()->extraDisplay); | |
946 break; | |
947 } | |
948 text[6] = 0; | |
949 write_label_var( 30, 700, ME_Y_LINE5, &FontT48, text); | |
950 | |
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
|
951 |
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
|
952 /* 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
|
953 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
|
954 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
|
955 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
|
956 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
|
957 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
|
958 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
|
959 { |
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 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
|
961 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
|
962 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
|
963 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
|
964 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
|
965 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
|
966 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
|
967 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
|
968 break; |
373
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
969 case MOTION_DETECT_SCROLL: |
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
970 text[5] = TXT2BYTE_MoCtrlScroll; |
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
971 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
|
972 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
|
973 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
|
974 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
|
975 } |
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
|
976 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
|
977 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
|
978 |
38 | 979 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); |
980 } | |
981 | |
982 | |
983 uint8_t OnAction_CViewTimeout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
984 { | |
985 uint8_t value; | |
986 value = settingsGetPointer()->tX_customViewTimeout; | |
987 | |
988 if(value < 5) | |
989 value = 5; | |
990 else if(value < 10) | |
991 value = 10; | |
992 else if(value < 15) | |
993 value = 15; | |
994 else if(value < 20) | |
995 value = 20; | |
996 else if(value < 30) | |
997 value = 30; | |
998 else if(value < 45) | |
999 value = 45; | |
1000 else if(value < 60) | |
1001 value = 60; | |
1002 else | |
1003 value = 0; | |
1004 | |
1005 settingsGetPointer()->tX_customViewTimeout = value; | |
1006 return UPDATE_DIVESETTINGS; | |
1007 } | |
1008 | |
1009 | |
1010 uint8_t OnAction_CViewStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1011 { | |
1012 uint8_t newValue; | |
1013 switch(settingsGetPointer()->tX_customViewPrimary) | |
1014 { | |
1015 case CVIEW_sensors: | |
1016 newValue = CVIEW_sensors_mV; | |
1017 break; | |
1018 case CVIEW_sensors_mV: | |
1019 newValue = CVIEW_Compass; | |
1020 break; | |
1021 case CVIEW_Compass: | |
1022 newValue = CVIEW_Decolist; | |
1023 break; | |
1024 case CVIEW_Decolist: | |
1025 newValue = CVIEW_Tissues; | |
1026 break; | |
1027 case CVIEW_Tissues: | |
1028 newValue = CVIEW_Profile; | |
1029 break; | |
1030 case CVIEW_Profile: | |
1031 newValue = CVIEW_Gaslist; | |
1032 break; | |
1033 case CVIEW_Gaslist: | |
1034 newValue = CVIEW_EADTime; | |
1035 break; | |
1036 case CVIEW_EADTime: | |
1037 newValue = CVIEW_SummaryOfLeftCorner; | |
1038 break; | |
1039 case CVIEW_SummaryOfLeftCorner: | |
1040 newValue = CVIEW_noneOrDebug; | |
1041 break; | |
1042 case CVIEW_noneOrDebug: | |
1043 default: | |
138 | 1044 newValue = CVIEW_sensors; |
38 | 1045 break; |
1046 } | |
1047 settingsGetPointer()->tX_customViewPrimary = newValue; | |
1048 return UPDATE_DIVESETTINGS; | |
1049 } | |
1050 | |
1051 | |
1052 uint8_t OnAction_CornerTimeout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1053 { | |
1054 uint8_t value; | |
1055 value = settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout; | |
1056 | |
1057 if(value < 5) | |
1058 value = 5; | |
1059 else if(value < 10) | |
1060 value = 10; | |
1061 else if(value < 15) | |
1062 value = 15; | |
1063 else if(value < 20) | |
1064 value = 20; | |
1065 else if(value < 30) | |
1066 value = 30; | |
1067 else if(value < 45) | |
1068 value = 45; | |
1069 else if(value < 60) | |
1070 value = 60; | |
1071 else | |
1072 value = 0; | |
1073 | |
1074 settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout = value; | |
1075 return UPDATE_DIVESETTINGS; | |
1076 } | |
1077 | |
1078 | |
1079 uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1080 { | |
1081 uint8_t value; | |
1082 value = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary; | |
1083 | |
1084 value += 1; | |
1085 | |
444
f2c4f5c90540
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
435
diff
changeset
|
1086 if(value >= LLC_END) |
38 | 1087 value = 0; |
1088 | |
1089 settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary = value; | |
1090 return UPDATE_DIVESETTINGS; | |
1091 } | |
1092 | |
1093 | |
1094 uint8_t OnAction_ExtraDisplay (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1095 { | |
1096 uint8_t newValue; | |
1097 switch(settingsGetPointer()->extraDisplay) | |
1098 { | |
1099 case EXTRADISPLAY_BIGFONT: | |
1100 newValue = EXTRADISPLAY_none; | |
1101 break; | |
1102 case EXTRADISPLAY_DECOGAME: | |
1103 newValue = EXTRADISPLAY_BIGFONT; | |
1104 break; | |
1105 case EXTRADISPLAY_none: | |
1106 newValue = EXTRADISPLAY_BIGFONT; | |
1107 break; | |
1108 default: | |
1109 newValue = EXTRADISPLAY_BIGFONT; | |
1110 break; | |
1111 } | |
1112 settingsGetPointer()->extraDisplay = newValue; | |
1113 return UNSPECIFIC_RETURN; | |
1114 } | |
1115 | |
1116 | |
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
|
1117 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
|
1118 { |
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 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
|
1120 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
|
1121 { |
373
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1122 case MOTION_DETECT_OFF: |
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1123 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
|
1124 break; |
373
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1125 case MOTION_DETECT_MOVE: |
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1126 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
|
1127 break; |
373
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1128 case MOTION_DETECT_SECTOR: |
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1129 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
|
1130 break; |
373
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1131 case MOTION_DETECT_SCROLL: |
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1132 newValue = MOTION_DETECT_OFF; |
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1133 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
|
1134 default: |
373
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1135 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
|
1136 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
|
1137 } |
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 settingsGetPointer()->MotionDetection = newValue; |
373
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1139 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
|
1140 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
|
1141 } |
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 |
38 | 1143 void openEdit_Information(void) |
1144 { | |
1145 char text[70]; | |
1146 | |
1147 infoPage = 0; | |
1148 | |
1149 text[0] = '\001'; | |
1150 text[1] = TXT_Information; | |
1151 text[2] = 0; | |
1152 write_topline(text); | |
1153 | |
1154 text[0] = TXT_2BYTE; | |
1155 text[1] = TXT2BYTE_ButtonNext; | |
1156 text[2] = 0; | |
1157 | |
1158 write_field_button(StMSYS5_Info, 30, 800, ME_Y_LINE6, &FontT48, text); | |
1159 | |
1160 setEvent(StMSYS5_Info, (uint32_t)OnAction_Information); | |
1161 } | |
1162 | |
1163 | |
1164 uint8_t OnAction_Information (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1165 { | |
1166 resetEnterPressedToStateBeforeButtonAction(); | |
1167 | |
1168 infoPage++; | |
1169 if(infoPage > 3) | |
1170 return EXIT_TO_MENU; | |
1171 else | |
1172 return UNSPECIFIC_RETURN; | |
1173 } | |
1174 | |
1175 | |
1176 void refresh_InformationPage(void) | |
1177 { | |
1178 char text_header[5]; | |
1179 char text_button[5]; | |
1180 char text_content[256]; | |
1181 uint8_t date[3], year,month,day; | |
1182 | |
1183 RTC_DateTypeDef Sdate, Sdate2; | |
1184 float temperature1, temperature2, voltage, offsetTemperature; | |
1185 | |
1186 //RTC_TimeTypeDef Stime; | |
1187 | |
1188 /* | |
1189 SDeviceLine batteryChargeCycles; | |
1190 SDeviceLine batteryChargeCompleteCycles; | |
1191 SDeviceLine temperatureMinimum; | |
1192 SDeviceLine temperatureMaximum; | |
1193 SDeviceLine depthMaximum; | |
1194 SDeviceLine diveCycles; | |
1195 SDeviceLine voltageMinimum; | |
1196 */ | |
1197 | |
1198 switch(infoPage) | |
1199 { | |
1200 case 0: | |
1201 text_header[0] = '\001'; | |
1202 text_header[1] = TXT_Information; | |
1203 text_header[2] = 0; | |
1204 | |
1205 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, "Dive Computer OSTC4"); | |
1206 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, "Design heinrichs/weikamp"); | |
1207 | |
1208 Sdate.Year = firmwareDataGetPointer()->release_year; | |
1209 Sdate.Month = firmwareDataGetPointer()->release_month; | |
1210 Sdate.Date = firmwareDataGetPointer()->release_day; | |
1211 | |
1212 if(settingsGetPointer()->date_format == DDMMYY) | |
1213 { | |
1214 day = 0; | |
1215 month = 1; | |
1216 year = 2; | |
1217 } | |
1218 else | |
1219 if(settingsGetPointer()->date_format == MMDDYY) | |
1220 { | |
1221 day = 1; | |
1222 month = 0; | |
1223 year = 2; | |
1224 } | |
1225 else | |
1226 { | |
1227 day = 2; | |
1228 month = 1; | |
1229 year = 0; | |
1230 } | |
1231 date[day] = Sdate.Date; | |
1232 date[month] = Sdate.Month; | |
1233 date[year] = Sdate.Year; | |
1234 snprintf(text_content,40,"Firmware release date: %02d.%02d.%02d",date[0],date[1],date[2]); | |
1235 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
1236 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, "for more information"); | |
64 | 1237 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, "info@heinrichsweikamp.com"); |
38 | 1238 |
1239 text_button[0] = TXT_2BYTE; | |
1240 text_button[1] = TXT2BYTE_ButtonNext; | |
1241 text_button[2] = 0; | |
1242 break; | |
1243 | |
1244 case 1: | |
1245 text_header[0] = '\001'; | |
1246 text_header[1] = TXT_2BYTE; | |
1247 text_header[2] = TXT2BYTE_Usage_Battery; | |
1248 text_header[3] = 0; | |
1249 | |
1250 text_content[0] = TXT_2BYTE; | |
1251 text_content[1] = TXT2BYTE_ChargeCycles; | |
1252 text_content[2] = 0; | |
1253 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content); | |
57 | 1254 snprintf(text_content,80,"%ld (%ld)",stateDeviceGetPointer()->batteryChargeCycles.value_int32,stateDeviceGetPointer()->batteryChargeCompleteCycles.value_int32); |
38 | 1255 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); |
1256 | |
1257 translateDate(stateDeviceGetPointer()->batteryChargeCycles.date_rtc_dr, &Sdate); | |
1258 translateDate(stateDeviceGetPointer()->batteryChargeCompleteCycles.date_rtc_dr, &Sdate2); | |
1259 snprintf(text_content,80,"%u.%u.20%02u (%u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year); | |
1260 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
1261 | |
1262 text_content[0] = TXT_2BYTE; | |
1263 text_content[1] = TXT2BYTE_LowestVoltage; | |
1264 text_content[2] = 0; | |
1265 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content); | |
1266 | |
404
e729b8e7654d
Bugfix: display of time of minimum voltag:
ideenmodellierer
parents:
389
diff
changeset
|
1267 translateDate(stateDeviceGetPointer()->voltageMinimum.date_rtc_dr, &Sdate); |
38 | 1268 voltage = ((float)stateDeviceGetPointer()->voltageMinimum.value_int32) / 1000; |
1269 snprintf(text_content,80,"%0.3fV (%u.%u.20%02u)",voltage, Sdate.Date,Sdate.Month,Sdate.Year); | |
1270 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content); | |
1271 | |
1272 text_button[0] = TXT_2BYTE; | |
1273 text_button[1] = TXT2BYTE_ButtonNext; | |
1274 text_button[2] = 0; | |
1275 break; | |
1276 | |
1277 case 2: | |
1278 text_header[0] = '\001'; | |
1279 text_header[1] = TXT_2BYTE; | |
1280 text_header[2] = TXT2BYTE_Usage_Dives; | |
1281 text_header[3] = 0; | |
1282 | |
1283 text_content[0] = TXT_2BYTE; | |
1284 text_content[1] = TXT2BYTE_NumberOfDives; | |
1285 text_content[2] = 0; | |
1286 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content); | |
1287 | |
57 | 1288 snprintf(text_content,80,"%ld (%ld)",stateDeviceGetPointer()->diveCycles.value_int32,(stateDeviceGetPointer()->depthMaximum.value_int32 - 1000) / 100); |
38 | 1289 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); |
1290 | |
1291 translateDate(stateDeviceGetPointer()->diveCycles.date_rtc_dr, &Sdate); | |
1292 translateDate(stateDeviceGetPointer()->depthMaximum.date_rtc_dr, &Sdate2); | |
1293 snprintf(text_content,80,"%u.%u.20%02u (%u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year); | |
1294 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
1295 | |
1296 text_content[0] = TXT_2BYTE; | |
1297 text_content[1] = TXT2BYTE_HoursOfOperation; | |
1298 text_content[2] = 0; | |
1299 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content); | |
1300 | |
57 | 1301 snprintf(text_content,80,"%ld",(stateDeviceGetPointer()->hoursOfOperation.value_int32)/3600); |
38 | 1302 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content); |
1303 | |
1304 text_button[0] = TXT_2BYTE; | |
1305 text_button[1] = TXT2BYTE_ButtonNext; | |
1306 text_button[2] = 0; | |
1307 break; | |
1308 | |
1309 case 3: | |
1310 text_header[0] = '\001'; | |
1311 text_header[1] = TXT_2BYTE; | |
1312 text_header[2] = TXT2BYTE_Usage_Environment; | |
1313 text_header[3] = 0; | |
1314 | |
1315 text_content[0] = TXT_2BYTE; | |
1316 text_content[1] = TXT2BYTE_AmbientTemperature; | |
1317 text_content[2] = 0; | |
1318 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content); | |
1319 | |
1320 temperature1 = ((float)stateDeviceGetPointer()->temperatureMinimum.value_int32) / 100; | |
1321 temperature2 = ((float)stateDeviceGetPointer()->temperatureMaximum.value_int32) / 100; | |
1322 snprintf(text_content,80,"%0.2f\140C / %0.2f\140C",temperature1,temperature2); | |
1323 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); | |
1324 | |
1325 translateDate(stateDeviceGetPointer()->temperatureMinimum.date_rtc_dr, &Sdate); | |
1326 translateDate(stateDeviceGetPointer()->temperatureMaximum.date_rtc_dr, &Sdate2); | |
1327 snprintf(text_content,80,"(%u.%u.20%02u / %u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year); | |
1328 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
1329 | |
1330 text_content[0] = TXT_2BYTE; | |
1331 text_content[1] = TXT2BYTE_Korrekturwerte; | |
1332 text_content[2] = 0; | |
1333 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content); | |
1334 | |
1335 offsetTemperature = ((float)settingsGetPointer()->offsetTemperature_centigrad) / 10; | |
103
f5d2f02dc73f
Generalize TEXT of pressure unit
Dmitry Romanov <kitt@bk.ru>
parents:
102
diff
changeset
|
1336 snprintf(text_content,80,"%i %s / %0.2f\140C",settingsGetPointer()->offsetPressure_mbar, TEXT_PRESSURE_UNIT, offsetTemperature); |
38 | 1337 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content); |
1338 | |
1339 text_button[0] = TXT_2BYTE; | |
1340 text_button[1] = TXT2BYTE_Exit; | |
1341 text_button[2] = 0; | |
1342 break; | |
1343 } | |
1344 | |
1345 write_topline(text_header); | |
1346 tMenuEdit_newButtonText(StMSYS5_Info, text_button); | |
1347 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonNext,0); | |
1348 } | |
1349 | |
1350 | |
1351 void openEdit_Reset(void) | |
1352 { | |
1353 char text[32]; | |
1354 | |
1355 text[0] = '\001'; | |
1356 text[1] = TXT_2BYTE; | |
1357 text[2] = TXT2BYTE_ResetMenu; | |
1358 text[3] = 0; | |
1359 write_topline(text); | |
1360 | |
1361 text[0] = TXT_2BYTE; | |
1362 text[1] = TXT2BYTE_LogbookOffset; | |
1363 text[7] = 0; | |
1364 | |
1365 write_label_var( 30, 400, ME_Y_LINE1, &FontT48, text); | |
1366 | |
1367 write_field_udigit(StMSYS6_LogbookOffset,420, 800, ME_Y_LINE1, &FontT48, "####", settingsGetPointer()->logbookOffset,0,0,0); | |
1368 | |
1369 text[0] = TXT_2BYTE; | |
1370 text[2] = 0; | |
1371 | |
1372 text[1] = TXT2BYTE_ResetAll; | |
1373 write_field_button(StMSYS6_ResetAll, 30, 800, ME_Y_LINE2, &FontT48, text); | |
1374 | |
1375 text[1] = TXT2BYTE_ResetDeco; | |
1376 write_field_button(StMSYS6_ResetDeco, 30, 800, ME_Y_LINE3, &FontT48, text); | |
1377 | |
1378 text[1] = TXT2BYTE_Reboot; | |
1379 write_field_button(StMSYS6_Reboot, 30, 800, ME_Y_LINE4, &FontT48, text); | |
1380 | |
1381 text[1] = TXT2BYTE_Maintenance; | |
1382 write_field_button(StMSYS6_Maintenance, 30, 800, ME_Y_LINE5, &FontT48, text); | |
1383 | |
1384 #ifndef RESETLOGBLOCK | |
1385 text[1] = TXT2BYTE_ResetLogbook; | |
1386 write_field_button(StMSYS6_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); | |
1387 #else | |
1388 text[0] = '\021'; | |
1389 text[1] = TXT_2BYTE; | |
1390 text[2] = TXT2BYTE_ResetLogbook; | |
1391 text[3] = 0; | |
1392 write_field_button(StMSYS6_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); | |
1393 text[0] = TXT_2BYTE; | |
1394 text[2] = 0; | |
1395 #endif | |
1396 | |
1397 setEvent(StMSYS6_LogbookOffset, (uint32_t)OnAction_LogbookOffset); | |
1398 setEvent(StMSYS6_ResetAll, (uint32_t)OnAction_Confirm); | |
1399 setEvent(StMSYS6_ResetDeco, (uint32_t)OnAction_Confirm); | |
1400 setEvent(StMSYS6_Reboot, (uint32_t)OnAction_Confirm); | |
1401 setEvent(StMSYS6_Maintenance, (uint32_t)OnAction_Confirm); | |
1402 #ifndef RESETLOGBLOCK | |
1403 setEvent(StMSYS6_ResetLogbook, (uint32_t)OnAction_Confirm); | |
1404 #else | |
1405 setEvent(StMSYS6_ResetLogbook, (uint32_t)OnAction_Nothing); | |
1406 #endif | |
1407 | |
1408 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
1409 } | |
1410 | |
1411 | |
1412 void openEdit_ResetConfirmation(uint32_t editIdOfCaller) | |
1413 { | |
1414 char text[32]; | |
1415 | |
1416 resetMenuEdit(CLUT_MenuPageSystem); | |
1417 | |
1418 text[0] = '\001'; | |
1419 text[1] = TXT_2BYTE; | |
1420 text[2] = TXT2BYTE_AreYouSure; | |
1421 text[3] = 0; | |
1422 write_topline(text); | |
1423 | |
1424 text[0] = TXT_2BYTE; | |
1425 text[2] = 0; | |
1426 text[1] = TXT2BYTE_Abort; | |
1427 | |
1428 write_field_button(StMSYS6_Exit, 30, 800, ME_Y_LINE1, &FontT48, text); | |
1429 | |
1430 text[2] = 0; | |
1431 text[3] = 0; | |
1432 switch(editIdOfCaller) | |
1433 { | |
1434 case StMSYS6_Reboot: | |
1435 case StMSYS6_RebootRTE: | |
1436 case StMSYS6_RebootMainCPU: | |
1437 text[1] = TXT2BYTE_RebootMainCPU; | |
1438 write_field_button(StMSYS6_RebootMainCPU, 30, 800, ME_Y_LINE2, &FontT48, text); | |
1439 text[1] = TXT2BYTE_RebootRTE; | |
1440 write_field_button(StMSYS6_RebootRTE, 30, 800, ME_Y_LINE3, &FontT48, text); | |
1441 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); | |
1442 setEvent(StMSYS6_RebootMainCPU, (uint32_t)OnAction_RebootMainCPU); | |
1443 setEvent(StMSYS6_RebootRTE, (uint32_t)OnAction_RebootRTE); | |
1444 text[0] = '\025'; | |
1445 text[1] = TXT_2BYTE; | |
1446 text[2] = TXT2BYTE_DecoDataLost; | |
1447 text[3] = 0; | |
1448 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); | |
1449 break; | |
1450 | |
1451 case StMSYS6_ResetDeco: | |
1452 text[1] = TXT2BYTE_ResetDeco; | |
1453 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | |
1454 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); | |
1455 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetDeco); | |
1456 text[0] = '\025'; | |
1457 text[1] = TXT_2BYTE; | |
1458 text[2] = TXT2BYTE_DecoDataLost; | |
1459 text[3] = 0; | |
1460 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); | |
1461 break; | |
1462 | |
1463 case StMSYS6_ResetAll: | |
1464 text[1] = TXT2BYTE_ResetAll; | |
1465 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | |
1466 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); | |
1467 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetAll); | |
1468 break; | |
1469 | |
1470 case StMSYS6_ResetLogbook: | |
1471 text[1] = TXT2BYTE_ResetLogbook; | |
1472 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | |
1473 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); | |
1474 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetLogbook); | |
1475 break; | |
1476 | |
1477 case StMSYS6_Maintenance: | |
1478 case StMSYS6_SetBattCharge: | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1479 case StMSYS6_SetSampleIndx: |
38 | 1480 text[0] = TXT_2BYTE; |
1481 text[1] = TXT2BYTE_SetFactoryDefaults; | |
1482 text[2] = 0; | |
1483 write_field_button(StMSYS6_SetFactoryBC, 30, 800, ME_Y_LINE2, &FontT48, text); | |
1484 | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1485 #ifdef ENABLE_ANALYSE_SAMPLES |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1486 text[0] = TXT_2BYTE; |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1487 text[1] = TXT2BYTE_SetSampleIndex; |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1488 text[2] = 0; |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1489 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
|
1490 #endif |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1491 |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1492 |
38 | 1493 if(stateRealGetPointer()->lifeData.battery_charge == 0) |
1494 { | |
1495 text[0] = TXT_2BYTE; | |
1496 text[1] = TXT2BYTE_SetBatteryCharge; | |
1497 text[2] = 0; | |
1498 snprintf(&text[2],10,": %u%%",settingsGetPointer()->lastKnownBatteryPercentage); | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1499 #ifdef ENABLE_ANALYSE_SAMPLES |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1500 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
|
1501 #else |
38 | 1502 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
|
1503 #endif |
38 | 1504 |
1505 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); | |
1506 setEvent(StMSYS6_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1507 #ifdef ENABLE_ANALYSE_SAMPLES |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1508 setEvent(StMSYS6_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1509 #endif |
38 | 1510 setEvent(StMSYS6_SetBattCharge, (uint32_t)OnAction_SetBatteryCharge); |
1511 } | |
1512 else | |
1513 { | |
1514 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); | |
1515 setEvent(StMSYS6_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1516 #ifdef ENABLE_ANALYSE_SAMPLES |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1517 setEvent(StMSYS6_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1518 #endif |
38 | 1519 } |
1520 // write_field_button(StMSYS6_ScreenTest, 30, 800, ME_Y_LINE3, &FontT48, "Screen Test"); | |
1521 // setEvent(StMSYS6_ScreenTest, (uint32_t)OnAction_ScreenTest); | |
1522 | |
1523 text[0] = TXT_2BYTE; | |
1524 text[1] = TXT2BYTE_WarnBatteryLow; | |
1525 text[2] = 0; | |
1526 snprintf(&text[2],10,": %01.2fV",stateRealGetPointer()->lifeData.battery_voltage); | |
435
8851702173e0
Bugfix display battery voltage in maintainance menu:
ideenmodellierer
parents:
424
diff
changeset
|
1527 write_label_var( 30, 800, ME_Y_LINE5, &FontT42, text); |
8851702173e0
Bugfix display battery voltage in maintainance menu:
ideenmodellierer
parents:
424
diff
changeset
|
1528 |
38 | 1529 snprintf(&text[0],30,"Code: %X",getLicence()); |
1530 write_label_var( 30, 800, ME_Y_LINE6, &FontT42, text); | |
1531 break; | |
1532 | |
1533 } | |
1534 | |
1535 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
1536 } | |
1537 | |
1538 uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1539 { | |
1540 uint8_t digitContentNew; | |
1541 uint32_t newOffset; | |
1542 | |
1543 if(action == ACTION_BUTTON_ENTER) | |
1544 return digitContent; | |
1545 | |
1546 if(action == ACTION_BUTTON_ENTER_FINAL) | |
1547 { | |
1548 evaluateNewString(editId, &newOffset, 0, 0, 0); | |
1549 if(newOffset > 9000) | |
1550 newOffset = 0; | |
1551 tMenuEdit_newInput(editId, newOffset, 0, 0, 0); | |
1552 settingsGetPointer()->logbookOffset = (uint16_t)newOffset; | |
1553 return UPDATE_DIVESETTINGS; | |
1554 } | |
1555 | |
1556 if(action == ACTION_BUTTON_NEXT) | |
1557 { | |
1558 digitContentNew = digitContent + 1; | |
1559 if(digitContentNew > '9') | |
1560 digitContentNew = '0'; | |
1561 return digitContentNew; | |
1562 } | |
1563 | |
1564 if(action == ACTION_BUTTON_BACK) | |
1565 { | |
1566 digitContentNew = digitContent - 1; | |
1567 if(digitContentNew < '0') | |
1568 digitContentNew = '9'; | |
1569 return digitContentNew; | |
1570 } | |
1571 return UNSPECIFIC_RETURN; | |
1572 } | |
1573 | |
1574 uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1575 { | |
1576 return UNSPECIFIC_RETURN; | |
1577 } | |
1578 | |
1579 uint8_t OnAction_Exit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1580 { | |
1581 return EXIT_TO_MENU; | |
1582 } | |
1583 uint8_t OnAction_Confirm (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1584 { | |
1585 openEdit_ResetConfirmation(editId); | |
1586 return UNSPECIFIC_RETURN; | |
1587 } | |
1588 | |
1589 uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1590 { | |
1591 MX_SmallCPU_Reset_To_Standard(); | |
1592 return EXIT_TO_MENU; | |
1593 } | |
1594 | |
1595 uint8_t OnAction_ResetDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1596 { | |
1597 clearDeco(); | |
1598 return EXIT_TO_MENU; | |
1599 } | |
1600 | |
1601 uint8_t OnAction_ResetAll (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1602 { | |
1603 set_settings_to_Standard(); | |
1604 check_and_correct_settings(); | |
1605 | |
1606 return UPDATE_AND_EXIT_TO_HOME; | |
1607 } | |
1608 | |
1609 uint8_t OnAction_ResetLogbook (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1610 { | |
1611 write_label_var( 430, 740, 350, &FontT42, "Wait"); | |
1612 ext_flash_erase_logbook(); | |
1613 | |
1614 SSettings * pSettings = settingsGetPointer(); | |
1615 pSettings->lastDiveLogId = 255; | |
1616 pSettings->logFlashNextSampleStartAddress = 0; | |
1617 | |
1618 return EXIT_TO_MENU; | |
1619 } | |
1620 | |
1621 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1622 { | |
1623 settingsGetPointer()->showDebugInfo = 0; | |
1624 extern uint8_t bootToBootloader; | |
1625 bootToBootloader = 1; | |
1626 return UNSPECIFIC_RETURN; | |
1627 } | |
1628 | |
1629 | |
1630 uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1631 { | |
1632 settingsWriteFactoryDefaults(settingsGetPointer()->ButtonResponsiveness[3], settingsGetPointer()->buttonBalance); | |
1633 return EXIT_TO_MENU; | |
1634 } | |
1635 | |
1636 | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1637 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
|
1638 { |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1639 char text[32]; |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1640 char strResult[20]; |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1641 |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1642 |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1643 ext_flash_AnalyseSampleBuffer(strResult); |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1644 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
|
1645 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
|
1646 return UNSPECIFIC_RETURN; |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1647 } |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1648 |
38 | 1649 uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
1650 { | |
1651 setBatteryPercentage(settingsGetPointer()->lastKnownBatteryPercentage); | |
1652 // setBatteryPercentage(100); | |
1653 return EXIT_TO_MENU; | |
1654 } | |
1655 | |
1656 #ifdef SCREENTEST | |
1657 uint8_t OnAction_ScreenTest (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1658 { | |
1659 static uint8_t FrameCount = 1; // 0 is invisible frame | |
1660 char text[5]; | |
1661 GFX_DrawCfgScreen tTestScreen; | |
1662 tTestScreen.FBStartAdress = 0; | |
1663 tTestScreen.ImageHeight = 480; | |
1664 tTestScreen.ImageWidth = 800; | |
1665 tTestScreen.LayerIndex = 1; | |
1666 | |
1667 set_globalState(StMSYS6_ScreenTest); | |
1668 tTestScreen.FBStartAdress = getFrameByNumber(FrameCount); | |
1669 if(tTestScreen.FBStartAdress == 0) | |
1670 { | |
1671 extern uint8_t bootToBootloader; | |
1672 bootToBootloader = 1; | |
1673 } | |
1674 GFX_fill_buffer(tTestScreen.FBStartAdress, 0xFF, FrameCount); | |
1675 snprintf(text,5,"%u",FrameCount); | |
1676 Gfx_write_label_var(&tTestScreen, 10,100,10,&FontT48,CLUT_Font027,text); | |
1677 GFX_SetFramesTopBottom(tTestScreen.FBStartAdress, NULL,480); | |
1678 FrameCount++; | |
1679 } | |
1680 #endif | |
1681 /* | |
1682 uint8_t OnAction_TestCLog (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1683 { | |
1684 write_label_var( 430, 740, 350, &FontT42, "Wait"); | |
1685 | |
1686 test_log_only(20, 5); | |
1687 test_log_only(30, 10); | |
1688 ext_flash_write_settings(); | |
1689 return EXIT_TO_MENU; | |
1690 } | |
1691 */ | |
1692 |