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