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