Mercurial > public > ostc4
annotate Discovery/Src/tMenuEditSystem.c @ 662:1b995079c045 Betatest
PSCR Mode
| author | heinrichs weikamp |
|---|---|
| date | Tue, 14 Dec 2021 15:36:10 +0100 |
| parents | 87bee7cc77b3 |
| children | 16833cd3a2f5 |
| 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() | |
| 662 | 37 #include "tComm.h" |
| 38 | 38 #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
|
39 #include "tMenu.h" |
| 38 | 40 #include "tMenuEdit.h" |
|
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
41 #include "tMenuSystem.h" |
| 520 | 42 #include "tMenuEditCustom.h" |
|
389
ebc2b571a0b9
Fix case for case sensitive OS
Jan Mulder <jan@jlmulder.nl>
parents:
384
diff
changeset
|
43 #include "motion.h" |
|
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
44 #include "t7.h" |
|
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
45 |
|
493
b560e474e319
Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents:
468
diff
changeset
|
46 |
|
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
47 /*#define HAVE_DEBUG_VIEW */ |
| 379 | 48 static uint8_t infoPage = 0; |
| 38 | 49 |
| 50 /* Private function prototypes -----------------------------------------------*/ | |
| 51 void openEdit_DateTime(void); | |
| 52 void openEdit_Language(void); | |
| 53 void openEdit_Design(void); | |
| 54 void openEdit_Information(void); | |
| 55 void openEdit_Reset(void); | |
| 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); | |
| 567 | 62 uint8_t OnAction_12HR (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 38 | 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_Exit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 81 uint8_t OnAction_Confirm (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 82 uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 83 uint8_t OnAction_ResetDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 84 uint8_t OnAction_ResetAll (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 85 uint8_t OnAction_ResetLogbook (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 86 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 87 uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 88 uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 89 uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 662 | 90 uint8_t OnAction_ResetBluetooth(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 38 | 91 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
|
92 #ifdef ENABLE_ANALYSE_SAMPLES |
|
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
93 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
|
94 #endif |
| 38 | 95 #ifdef SCREENTEST |
| 96 uint8_t OnAction_ScreenTest (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 97 #endif | |
| 98 uint8_t OnAction_Information (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 99 /* | |
| 100 uint8_t OnAction_Salinity (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 101 uint8_t OnAction_TestCLog (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 102 */ | |
| 103 | |
| 104 /* Exported functions --------------------------------------------------------*/ | |
| 105 | |
| 106 void openEdit_System(uint8_t line) | |
| 107 { | |
| 108 set_globalState_Menu_Line(line); | |
| 109 resetMenuEdit(CLUT_MenuPageSystem); | |
| 110 | |
| 111 if(actual_menu_content == MENU_SURFACE) | |
| 112 { | |
| 113 switch(line) | |
| 114 { | |
| 115 case 1: | |
| 116 default: | |
| 117 openEdit_DateTime(); | |
| 118 break; | |
| 119 case 2: | |
| 120 openEdit_Language(); | |
| 121 break; | |
| 122 case 3: | |
| 123 openEdit_Design(); | |
| 124 break; | |
| 125 case 4: | |
| 520 | 126 openEdit_Information(); |
| 38 | 127 break; |
| 128 case 5: | |
| 129 openEdit_Reset(); | |
| 130 break; | |
| 131 /* | |
| 132 case 3: | |
| 133 openEdit_DecoFutureTTS(); | |
| 134 break; | |
| 135 case 4: | |
| 136 openEdit_DecoLastStop(); | |
| 137 break; | |
| 138 */ | |
| 139 } | |
| 140 } | |
| 141 else | |
| 142 { | |
| 520 | 143 openEdit_CustomviewDivemodeMenu(line); |
| 38 | 144 } |
| 145 | |
| 146 } | |
| 147 | |
| 148 /* Private functions ---------------------------------------------------------*/ | |
| 149 | |
| 150 | |
| 151 void openEdit_DateTime(void) | |
| 152 { | |
| 153 RTC_DateTypeDef Sdate; | |
| 154 RTC_TimeTypeDef Stime; | |
| 155 uint8_t day,month,year,hour,minute, dateFormat, ddmmyy, mmddyy, yymmdd; | |
| 156 char text[32]; | |
| 157 SSettings *pSettings; | |
| 158 const SDiveState * pStateReal = stateRealGetPointer(); | |
| 159 | |
| 160 pSettings = settingsGetPointer(); | |
| 161 translateDate(pStateReal->lifeData.dateBinaryFormat, &Sdate); | |
| 162 translateTime(pStateReal->lifeData.timeBinaryFormat, &Stime); | |
| 163 year = Sdate.Year; | |
| 164 month = Sdate.Month; | |
| 165 day = Sdate.Date; | |
| 166 hour = Stime.Hours; | |
| 167 minute= Stime.Minutes; | |
| 168 | |
| 169 if(year < 16) | |
| 170 year = 16; | |
| 171 | |
| 172 if(month < 1) | |
| 173 month = 1; | |
| 174 | |
| 175 if(day < 1) | |
| 176 day = 1; | |
| 177 | |
| 178 // daylightsaving = Stime.DayLightSaving; | |
| 179 dateFormat = pSettings->date_format; | |
| 180 ddmmyy = 0; | |
| 181 mmddyy = 0; | |
| 182 yymmdd = 0; | |
| 183 | |
| 184 if(dateFormat == DDMMYY) | |
| 185 ddmmyy = 1; | |
| 186 else | |
| 187 if(dateFormat == MMDDYY) | |
| 188 mmddyy = 1; | |
| 189 else | |
| 190 yymmdd = 1; | |
| 191 | |
| 192 text[0] = '\001'; | |
| 193 text[1] = TXT_DateAndTime; | |
| 194 text[2] = 0; | |
| 195 | |
| 196 write_topline(text); | |
| 197 | |
| 198 write_label_fix( 20, 340, ME_Y_LINE1, &FontT42, TXT_TimeConfig); | |
| 567 | 199 write_label_fix( 20, 340, ME_Y_LINE2, &FontT42, TXT_Format); |
| 200 write_label_fix( 20, 340, ME_Y_LINE3, &FontT42, TXT_DateConfig); | |
| 201 write_label_var( 600, 800, ME_Y_LINE4, &FontT48, "\016\016DDMMYY\017"); | |
| 202 write_label_fix( 20, 790, ME_Y_LINE5, &FontT42, TXT_Format); | |
| 38 | 203 // write_label_fix( 350 ,580, 250, &FontT42, TXT_Daylightsaving); |
| 204 | |
| 205 write_field_2digit(StMSYS1_Time, 320, 780, ME_Y_LINE1, &FontT48, "##:##", (uint32_t)hour, (uint32_t)minute, 0, 0); | |
| 567 | 206 write_field_on_off(StMSYS1_12HR, 320, 790, ME_Y_LINE2, &FontT48, "12 HR", pSettings->amPMTime); |
| 207 write_field_2digit(StMSYS1_Date, 320, 780, ME_Y_LINE3, &FontT48, "##-##-20##", (uint32_t)day, (uint32_t)month, (uint32_t)year, 0); | |
| 208 write_field_on_off(StMSYS1_DDMMYY, 320, 790, ME_Y_LINE4, &FontT48, "DDMMYY", ddmmyy); | |
| 209 write_field_on_off(StMSYS1_MMDDYY, 320, 790, ME_Y_LINE5, &FontT48, "MMDDYY", mmddyy); | |
| 210 write_field_on_off(StMSYS1_YYMMDD, 320, 790, ME_Y_LINE6, &FontT48, "YYMMDD", yymmdd); | |
| 38 | 211 // write_field_on_off(StMSYS1_DST, 350, 580, 310, &FontT48, "Active", daylightsaving); |
| 212 | |
| 213 setEvent(StMSYS1_Date, (uint32_t)OnAction_Date); | |
| 214 setEvent(StMSYS1_Time, (uint32_t)OnAction_Time); | |
| 567 | 215 setEvent(StMSYS1_12HR, (uint32_t)OnAction_12HR); |
| 38 | 216 setEvent(StMSYS1_DDMMYY, (uint32_t)OnAction_DDMMYY); |
| 217 setEvent(StMSYS1_MMDDYY, (uint32_t)OnAction_MMDDYY); | |
| 218 setEvent(StMSYS1_YYMMDD, (uint32_t)OnAction_YYMMDD); | |
| 219 // setEvent(StMSYS1_DST, (uint32_t)OnAction_DST); | |
| 220 | |
| 221 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
| 222 } | |
| 223 | |
| 224 | |
| 225 uint8_t OnAction_Date(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 226 { | |
| 227 uint8_t digitContentNew; | |
| 228 uint32_t newDay, newMonth, newYear; | |
| 229 RTC_DateTypeDef sdatestructure; | |
| 230 | |
| 231 | |
| 232 if(action == ACTION_BUTTON_ENTER) | |
| 233 { | |
| 234 return digitContent; | |
| 235 } | |
| 236 if(action == ACTION_BUTTON_ENTER_FINAL) | |
| 237 { | |
| 238 evaluateNewString(editId, &newDay, &newMonth, &newYear, 0); | |
| 239 if(newDay == 0) | |
| 240 newDay = 1; | |
| 241 if(newDay > 31) | |
| 242 newDay = 31; | |
| 243 if(newMonth == 0) | |
| 244 newMonth = 1; | |
| 245 if(newMonth > 12) | |
| 246 newMonth = 12; | |
| 247 if((newMonth == 2) && (newDay > 29)) | |
| 248 newDay = 29; | |
| 249 if((newDay > 30) && ((newMonth == 4) ||(newMonth == 6) ||(newMonth == 9) ||(newMonth == 11))) | |
| 250 newDay = 30; | |
| 251 if(newYear < 17) | |
| 252 newYear = 17; | |
| 253 if(newYear > 99) | |
| 254 newYear = 99; | |
| 255 | |
| 256 sdatestructure.Date = newDay; | |
| 257 sdatestructure.Month = newMonth; | |
| 258 sdatestructure.Year = newYear; | |
| 259 setWeekday(&sdatestructure); | |
| 260 | |
| 261 setDate(sdatestructure); | |
| 262 | |
| 263 tMenuEdit_newInput(editId, newDay, newMonth, newYear, 0); | |
| 264 return UNSPECIFIC_RETURN; | |
| 265 } | |
| 266 if(action == ACTION_BUTTON_NEXT) | |
| 267 { | |
| 268 digitContentNew = digitContent + 1; | |
| 269 if((blockNumber == 0) && (digitContentNew > '0' + 31)) | |
| 270 digitContentNew = '1'; | |
| 271 if((blockNumber == 1) && (digitContentNew > '0' + 12)) | |
| 272 digitContentNew = '1'; | |
| 273 // year range 2017-2018 | |
|
55
a7683f9765da
Italian activated (needs some fine tuning), special characters (?,?,?,?,? and others) currently not working...
heinrichsweikamp
parents:
38
diff
changeset
|
274 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
|
275 digitContentNew = '0' + 18; |
| 38 | 276 return digitContentNew; |
| 277 } | |
| 278 if(action == ACTION_BUTTON_BACK) | |
| 279 { | |
| 280 digitContentNew = digitContent - 1; | |
| 281 if((blockNumber == 0) && (digitContentNew < '1')) | |
| 282 digitContentNew = '0' + 31; | |
| 283 if((blockNumber == 1) && (digitContentNew < '1')) | |
| 284 digitContentNew = '0' + 12; | |
| 285 // year range 2016-2018 | |
| 286 if((blockNumber == 2) && (digitContentNew < '0' + 17)) | |
| 287 digitContentNew = '0' + 18; | |
| 288 return digitContentNew; | |
| 289 } | |
| 290 /* | |
| 291 if(action == ACTION_BUTTON_NEXT) | |
| 292 { | |
| 293 digitContentNew = digitContent + 1; | |
| 294 if((blockNumber == 2) && (digitNumber == 0) && (digitContentNew > '2')) | |
| 295 digitContentNew = '1'; | |
| 296 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew > '3')) | |
| 297 digitContentNew = '0'; | |
| 298 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew > '1')) | |
| 299 digitContentNew = '0'; | |
| 300 if(digitContentNew > '9') | |
| 301 digitContentNew = '0'; | |
| 302 return digitContentNew; | |
| 303 } | |
| 304 if(action == ACTION_BUTTON_BACK) | |
| 305 { | |
| 306 digitContentNew = digitContent - 1; | |
| 307 if((blockNumber == 2) && (digitNumber == 0) && (digitContentNew < '1')) | |
| 308 digitContentNew = '2'; | |
| 309 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew < '0')) | |
| 310 digitContentNew = '3'; | |
| 311 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew < '0')) | |
| 312 digitContentNew = '1'; | |
| 313 if(digitContentNew < '0') | |
| 314 digitContentNew = '9'; | |
| 315 return digitContentNew; | |
| 316 } | |
| 317 */ | |
| 318 return UNSPECIFIC_RETURN; | |
| 319 } | |
| 320 | |
| 321 | |
| 322 uint8_t OnAction_Time(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 323 { | |
| 324 uint8_t digitContentNew; | |
| 325 uint32_t newHour, newMinute; | |
| 326 RTC_TimeTypeDef stimestructure; | |
| 327 | |
| 328 if(action == ACTION_BUTTON_ENTER) | |
| 329 { | |
| 330 return digitContent; | |
| 331 } | |
| 332 if(action == ACTION_BUTTON_ENTER_FINAL) | |
| 333 { | |
| 334 evaluateNewString(editId, &newHour, &newMinute, 0, 0); | |
| 335 if(newHour > 23) | |
| 336 newHour = 23; | |
| 337 if(newMinute > 59) | |
| 338 newMinute = 59; | |
| 339 | |
| 340 stimestructure.Hours = newHour; | |
| 341 stimestructure.Minutes = newMinute; | |
| 342 stimestructure.Seconds = 0; | |
| 343 | |
| 344 setTime(stimestructure); | |
| 345 | |
| 346 tMenuEdit_newInput(editId, newHour, newMinute, 0, 0); | |
| 347 return UNSPECIFIC_RETURN; | |
| 348 } | |
| 349 if(action == ACTION_BUTTON_NEXT) | |
| 350 { | |
| 351 digitContentNew = digitContent + 1; | |
| 352 if((blockNumber == 0) && (digitContentNew > '0' + 23)) | |
| 353 digitContentNew = '0'; | |
| 354 if((blockNumber == 1) && (digitContentNew > '0' + 59)) | |
| 355 digitContentNew = '0'; | |
| 356 return digitContentNew; | |
| 357 } | |
| 358 if(action == ACTION_BUTTON_BACK) | |
| 359 { | |
| 360 digitContentNew = digitContent - 1; | |
| 361 if((blockNumber == 0) && (digitContentNew < '0')) | |
| 362 digitContentNew = '0' + 23; | |
| 363 if((blockNumber == 1) && (digitContentNew < '0')) | |
| 364 digitContentNew = '0' + 59; | |
| 365 return digitContentNew; | |
| 366 } | |
| 367 /* | |
| 368 if(action == ACTION_BUTTON_NEXT) | |
| 369 { | |
| 370 digitContentNew = digitContent + 1; | |
| 371 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew > '2')) | |
| 372 digitContentNew = '0'; | |
| 373 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew > '5')) | |
| 374 digitContentNew = '0'; | |
| 375 if(digitContentNew > '9') | |
| 376 digitContentNew = '0'; | |
| 377 return digitContentNew; | |
| 378 } | |
| 379 if(action == ACTION_BUTTON_BACK) | |
| 380 { | |
| 381 digitContentNew = digitContent - 1; | |
| 382 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew < '0')) | |
| 383 digitContentNew = '2'; | |
| 384 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew < '0')) | |
| 385 digitContentNew = '5'; | |
| 386 if(digitContentNew < '0') | |
| 387 digitContentNew = '9'; | |
| 388 return digitContentNew; | |
| 389 } | |
| 390 */ | |
| 391 return UNSPECIFIC_RETURN; | |
| 392 } | |
| 393 | |
| 567 | 394 uint8_t OnAction_12HR(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
| 395 { | |
| 396 SSettings *pSettings; | |
| 397 | |
| 398 pSettings = settingsGetPointer(); | |
| 399 pSettings->amPMTime = !(pSettings->amPMTime); | |
| 400 | |
| 401 tMenuEdit_set_on_off(editId, pSettings->amPMTime); | |
| 402 | |
| 403 return UNSPECIFIC_RETURN; | |
| 404 } | |
| 38 | 405 |
| 406 uint8_t OnAction_DDMMYY(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 407 { | |
| 408 SSettings *pSettings; | |
| 409 | |
| 410 pSettings = settingsGetPointer(); | |
| 411 pSettings->date_format = DDMMYY; | |
| 412 | |
| 413 tMenuEdit_set_on_off(editId, 1); | |
| 414 tMenuEdit_set_on_off(StMSYS1_MMDDYY, 0); | |
| 415 tMenuEdit_set_on_off(StMSYS1_YYMMDD, 0); | |
| 416 | |
| 417 return UNSPECIFIC_RETURN; | |
| 418 } | |
| 419 | |
| 420 | |
| 421 uint8_t OnAction_MMDDYY(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 422 { | |
| 423 SSettings *pSettings; | |
| 424 | |
| 425 pSettings = settingsGetPointer(); | |
| 426 pSettings->date_format = MMDDYY; | |
| 427 | |
| 428 tMenuEdit_set_on_off(editId, 1); | |
| 429 tMenuEdit_set_on_off(StMSYS1_DDMMYY, 0); | |
| 430 tMenuEdit_set_on_off(StMSYS1_YYMMDD, 0); | |
| 431 | |
| 432 return UNSPECIFIC_RETURN; | |
| 433 } | |
| 434 | |
| 435 | |
| 436 uint8_t OnAction_YYMMDD(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 = YYMMDD; | |
| 442 | |
| 443 tMenuEdit_set_on_off(editId, 1); | |
| 444 tMenuEdit_set_on_off(StMSYS1_MMDDYY, 0); | |
| 445 tMenuEdit_set_on_off(StMSYS1_DDMMYY, 0); | |
| 446 | |
| 447 return UNSPECIFIC_RETURN; | |
| 448 } | |
| 449 | |
| 450 | |
| 451 uint8_t OnAction_DST(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 452 { | |
| 453 RTC_TimeTypeDef stimestructure; | |
| 454 uint8_t newDST; | |
| 455 | |
| 456 get_RTC_DateTime(0, &stimestructure); | |
| 457 newDST = stimestructure.DayLightSaving; | |
| 458 if(newDST) | |
| 459 newDST = 0; | |
| 460 else | |
| 461 newDST = 1; | |
| 462 stimestructure.DayLightSaving = newDST; | |
| 463 set_RTC_DateTime(0, &stimestructure); | |
| 464 | |
| 465 tMenuEdit_set_on_off(editId, newDST); | |
| 466 | |
| 467 return UNSPECIFIC_RETURN; | |
| 468 } | |
| 469 | |
| 470 | |
| 471 void openEdit_Language(void) | |
| 472 { | |
| 473 char text[32]; | |
| 474 uint8_t actualLanguage, active; | |
| 475 SSettings *pSettings; | |
| 476 | |
| 477 pSettings = settingsGetPointer(); | |
| 478 actualLanguage = pSettings->selected_language; | |
| 479 | |
| 480 text[0] = '\001'; | |
| 481 text[1] = TXT_Language; | |
| 482 text[2] = 0; | |
| 483 write_topline(text); | |
| 484 | |
| 485 text[0] = TXT_LanguageName; | |
| 486 text[1] = 0; | |
| 487 | |
| 488 pSettings->selected_language = LANGUAGE_English; | |
| 489 if( actualLanguage == pSettings->selected_language) | |
| 490 active = 1; | |
| 491 else | |
| 492 active = 0; | |
| 493 write_field_on_off(StMSYS2_English, 30, 500, ME_Y_LINE1, &FontT48, text, active); | |
| 494 | |
| 495 pSettings->selected_language = LANGUAGE_German; | |
| 496 if( actualLanguage == pSettings->selected_language) | |
| 497 active = 1; | |
| 498 else | |
| 499 active = 0; | |
| 500 write_field_on_off(StMSYS2_German, 30, 800, ME_Y_LINE2, &FontT48, text, active); | |
| 501 | |
| 502 pSettings->selected_language = LANGUAGE_French; | |
| 503 if( actualLanguage == pSettings->selected_language) | |
| 504 active = 1; | |
| 505 else | |
| 506 active = 0; | |
| 507 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
|
508 |
| 38 | 509 |
| 510 pSettings->selected_language = LANGUAGE_Italian; | |
| 511 if( actualLanguage == pSettings->selected_language) | |
| 512 active = 1; | |
| 513 else | |
| 514 active = 0; | |
| 515 write_field_on_off(StMSYS2_Italian, 30, 800, ME_Y_LINE4, &FontT48, text, active); | |
| 516 | |
|
102
4276d56eb37c
hPa instead of mbar, enabled Spanish language
heinrichsweikamp
parents:
64
diff
changeset
|
517 |
| 38 | 518 pSettings->selected_language = LANGUAGE_Espanol; |
| 519 if( actualLanguage == pSettings->selected_language) | |
| 520 active = 1; | |
| 521 else | |
| 522 active = 0; | |
| 523 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
|
524 |
| 38 | 525 pSettings->selected_language = actualLanguage; |
| 526 | |
| 527 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
| 528 | |
| 529 setEvent(StMSYS2_English, (uint32_t)OnAction_English); | |
| 530 setEvent(StMSYS2_German, (uint32_t)OnAction_German); | |
| 531 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
|
532 setEvent(StMSYS2_Italian, (uint32_t)OnAction_Italian); |
|
102
4276d56eb37c
hPa instead of mbar, enabled Spanish language
heinrichsweikamp
parents:
64
diff
changeset
|
533 setEvent(StMSYS2_Espanol, (uint32_t)OnAction_Espanol); |
| 38 | 534 } |
| 535 | |
| 536 | |
| 537 uint8_t OnAction_English (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 538 { | |
| 539 SSettings *pSettings = settingsGetPointer(); | |
| 540 pSettings->selected_language = LANGUAGE_English; | |
| 541 return EXIT_TO_MENU_WITH_LOGO; | |
| 542 } | |
| 543 | |
| 544 | |
| 545 uint8_t OnAction_German (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 546 { | |
| 547 SSettings *pSettings = settingsGetPointer(); | |
| 548 pSettings->selected_language = LANGUAGE_German; | |
| 549 return EXIT_TO_MENU_WITH_LOGO; | |
| 550 } | |
| 551 | |
| 552 | |
| 553 uint8_t OnAction_French (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 554 { | |
| 555 SSettings *pSettings = settingsGetPointer(); | |
| 556 pSettings->selected_language = LANGUAGE_French; | |
| 557 return EXIT_TO_MENU_WITH_LOGO; | |
| 558 } | |
| 559 | |
| 560 | |
| 561 uint8_t OnAction_Italian (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 562 { | |
| 563 SSettings *pSettings = settingsGetPointer(); | |
| 564 pSettings->selected_language = LANGUAGE_Italian; | |
| 565 return EXIT_TO_MENU_WITH_LOGO; | |
| 566 } | |
| 567 | |
| 568 | |
| 569 uint8_t OnAction_Espanol (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 570 { | |
| 571 SSettings *pSettings = settingsGetPointer(); | |
| 572 pSettings->selected_language = LANGUAGE_Espanol; | |
| 573 return EXIT_TO_MENU_WITH_LOGO; | |
| 574 } | |
| 575 | |
| 576 | |
| 577 void openEdit_Design(void) | |
| 578 { | |
| 579 refresh_Design(); | |
| 580 | |
| 581 write_field_button(StMSYS3_Units, 400, 700, ME_Y_LINE1, &FontT48, ""); | |
| 582 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
|
583 #ifdef HAVE_DEBUG_VIEW |
|
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
584 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
|
585 #endif |
| 38 | 586 setEvent(StMSYS3_Units, (uint32_t)OnAction_Units); |
| 587 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
|
588 #ifdef HAVE_DEBUG_VIEW |
|
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
589 setEvent(StMSYS3_Debug, (uint32_t)OnAction_DebugInfo); |
|
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
590 #endif |
| 38 | 591 } |
| 592 | |
| 593 | |
| 594 void refresh_Design(void) | |
| 595 { | |
| 596 char text[32]; | |
| 597 | |
| 598 // header | |
| 599 text[0] = '\001'; | |
| 600 text[1] = TXT_2BYTE; | |
| 601 text[2] = TXT2BYTE_Layout; | |
| 602 text[3] = 0; | |
| 603 write_topline(text); | |
| 604 | |
| 605 // units | |
| 606 text[0] = TXT_2BYTE; | |
| 607 text[1] = TXT2BYTE_Units; | |
| 608 text[2] = 0; | |
| 609 write_label_var( 30, 200, ME_Y_LINE1, &FontT48, text); | |
| 610 | |
| 611 if(settingsGetPointer()->nonMetricalSystem) | |
| 612 { | |
| 613 text[1] = TXT2BYTE_Units_feet; | |
| 614 } | |
| 615 else | |
| 616 { | |
| 617 text[1] = TXT2BYTE_Units_metric; | |
| 618 } | |
| 619 write_label_var( 400, 700, ME_Y_LINE1, &FontT48, text); | |
| 620 | |
| 621 // colorscheme | |
| 622 text[0] = TXT_2BYTE; | |
| 623 text[1] = TXT2BYTE_Farbschema; | |
| 624 text[2] = 0; | |
|
118
ee7f2cd9b9b4
Enlarge text limits to get string displayed completly
Ideenmodellierer
parents:
103
diff
changeset
|
625 write_label_var( 30, 300, ME_Y_LINE2, &FontT48, text); |
| 38 | 626 |
| 627 text[0] = '0' + settingsGetPointer()->tX_colorscheme; | |
| 628 text[1] = 0; | |
| 629 write_label_var( 400, 700, ME_Y_LINE2, &FontT48, text); | |
| 630 | |
|
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
631 #ifdef HAVE_DEBUG_VIEW |
| 38 | 632 // specials |
| 633 text[0] = TXT_2BYTE; | |
| 634 text[1] = TXT2BYTE_ShowDebug; | |
| 635 text[2] = 0; | |
| 636 write_label_var( 30, 700, ME_Y_LINE3, &FontT48, text); | |
| 637 | |
| 638 if(settingsGetPointer()->showDebugInfo) | |
| 639 text[0] = '\005'; | |
| 640 else | |
| 641 text[0] = '\006'; | |
| 642 text[1] = 0; | |
| 643 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
|
644 #endif |
| 38 | 645 |
| 646 // design | |
| 647 text[0] = TXT_Depth; | |
| 648 text[1] = 0; | |
| 649 write_content( 30, 700, ME_Y_LINE4, &FontT24, text, CLUT_Font031); | |
| 650 write_content( 30, 700, ME_Y_LINE4 + 30 + 70, &FontT48, "___________", CLUT_DIVE_FieldSeperatorLines); | |
| 651 write_content(280, 700, ME_Y_LINE4 + 30 + 70 - 3, &FontT48, "|", CLUT_DIVE_pluginbox); | |
| 652 write_content(290, 700, ME_Y_LINE4 + 30 + 70 - 37, &FontT48, "_______________", CLUT_DIVE_pluginbox); | |
| 653 write_content( 30, 700, ME_Y_LINE4 + 30, &FontT144, "24.7", CLUT_Font027); | |
| 654 | |
| 655 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
| 656 } | |
| 657 | |
| 658 | |
| 659 uint8_t OnAction_Units(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 660 { | |
| 661 settingsGetPointer()->nonMetricalSystem = !(settingsGetPointer()->nonMetricalSystem); | |
| 662 return EXIT_TO_MENU_WITH_LOGO;//UPDATE_DIVESETTINGS; | |
| 663 } | |
| 664 | |
| 665 | |
| 666 uint8_t OnAction_Colorscheme(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 667 { | |
| 668 uint8_t newColorscheme; | |
| 669 | |
| 670 newColorscheme = settingsGetPointer()->tX_colorscheme + 1; | |
| 671 | |
| 672 if(newColorscheme > 3) | |
| 673 newColorscheme = 0; | |
| 674 | |
| 675 settingsGetPointer()->tX_colorscheme = newColorscheme; | |
| 676 GFX_use_colorscheme(newColorscheme); | |
| 677 tHome_init_compass(); | |
| 678 return UNSPECIFIC_RETURN; | |
| 679 } | |
| 680 | |
| 681 | |
| 682 uint8_t OnAction_DebugInfo(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 683 { | |
| 684 settingsGetPointer()->showDebugInfo = !(settingsGetPointer()->showDebugInfo); | |
| 685 return UPDATE_DIVESETTINGS; | |
| 686 } | |
| 687 | |
| 688 | |
| 689 | |
| 690 | |
| 691 /* | |
| 692 uint8_t OnAction_Design_t7ft (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 693 { | |
| 694 SSettings *pSettings = settingsGetPointer(); | |
| 695 if((pSettings->design == 7) && pSettings->nonMetricalSystem) | |
| 696 return EXIT_TO_MENU; | |
| 697 pSettings->design = 7; | |
| 698 pSettings->nonMetricalSystem = 1; | |
| 699 tMenuEdit_set_on_off(StMSYS3_t7, 0); | |
| 700 tMenuEdit_set_on_off(StMSYS3_t7ft, 1); | |
| 701 tMenuEdit_set_on_off(StMSYS3_t3, 0); | |
| 702 return UPDATE_DIVESETTINGS; | |
| 703 } | |
| 704 | |
| 705 | |
| 706 uint8_t OnAction_Design_t7 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 707 { | |
| 708 SSettings *pSettings = settingsGetPointer(); | |
| 709 if((pSettings->design == 7) && (pSettings->nonMetricalSystem == 0)) | |
| 710 return EXIT_TO_MENU; | |
| 711 pSettings->design = 7; | |
| 712 pSettings->nonMetricalSystem = 0; | |
| 713 tMenuEdit_set_on_off(StMSYS3_t7, 1); | |
| 714 tMenuEdit_set_on_off(StMSYS3_t7ft, 0); | |
| 715 tMenuEdit_set_on_off(StMSYS3_t3, 0); | |
| 716 return UPDATE_DIVESETTINGS; | |
| 717 } | |
| 718 | |
| 719 | |
| 720 uint8_t OnAction_Design_t3 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 721 { | |
| 722 SSettings *pSettings = settingsGetPointer(); | |
| 723 if(pSettings->design == 3) | |
| 724 return EXIT_TO_MENU; | |
| 725 pSettings->design = 3; | |
| 726 pSettings->nonMetricalSystem = 0; | |
| 727 tMenuEdit_set_on_off(StMSYS3_t7, 0); | |
| 728 tMenuEdit_set_on_off(StMSYS3_t7ft,0); | |
| 729 tMenuEdit_set_on_off(StMSYS3_t3, 1); | |
| 730 return UPDATE_DIVESETTINGS; | |
| 731 } | |
| 732 */ | |
| 733 | |
| 734 | |
|
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
|
735 |
| 38 | 736 void openEdit_Information(void) |
| 737 { | |
| 738 char text[70]; | |
| 739 | |
| 740 infoPage = 0; | |
| 741 | |
| 742 text[0] = '\001'; | |
| 743 text[1] = TXT_Information; | |
| 744 text[2] = 0; | |
| 745 write_topline(text); | |
| 746 | |
| 747 text[0] = TXT_2BYTE; | |
| 748 text[1] = TXT2BYTE_ButtonNext; | |
| 749 text[2] = 0; | |
| 750 | |
| 520 | 751 write_field_button(StMSYS4_Info, 30, 800, ME_Y_LINE6, &FontT48, text); |
| 38 | 752 |
| 520 | 753 setEvent(StMSYS4_Info, (uint32_t)OnAction_Information); |
| 38 | 754 } |
| 755 | |
| 756 | |
| 757 uint8_t OnAction_Information (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 758 { | |
| 759 resetEnterPressedToStateBeforeButtonAction(); | |
| 760 | |
| 761 infoPage++; | |
| 762 if(infoPage > 3) | |
| 763 return EXIT_TO_MENU; | |
| 764 else | |
| 765 return UNSPECIFIC_RETURN; | |
| 766 } | |
| 767 | |
| 768 | |
| 769 void refresh_InformationPage(void) | |
| 770 { | |
| 771 char text_header[5]; | |
| 772 char text_button[5]; | |
| 773 char text_content[256]; | |
| 774 uint8_t date[3], year,month,day; | |
| 775 | |
| 776 RTC_DateTypeDef Sdate, Sdate2; | |
| 777 float temperature1, temperature2, voltage, offsetTemperature; | |
| 778 | |
| 779 //RTC_TimeTypeDef Stime; | |
| 780 | |
| 781 /* | |
| 782 SDeviceLine batteryChargeCycles; | |
| 783 SDeviceLine batteryChargeCompleteCycles; | |
| 784 SDeviceLine temperatureMinimum; | |
| 785 SDeviceLine temperatureMaximum; | |
| 786 SDeviceLine depthMaximum; | |
| 787 SDeviceLine diveCycles; | |
| 788 SDeviceLine voltageMinimum; | |
| 789 */ | |
| 790 | |
| 791 switch(infoPage) | |
| 792 { | |
| 793 case 0: | |
| 794 text_header[0] = '\001'; | |
| 795 text_header[1] = TXT_Information; | |
| 796 text_header[2] = 0; | |
| 797 | |
| 798 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, "Dive Computer OSTC4"); | |
| 799 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, "Design heinrichs/weikamp"); | |
| 800 | |
| 801 Sdate.Year = firmwareDataGetPointer()->release_year; | |
| 802 Sdate.Month = firmwareDataGetPointer()->release_month; | |
| 803 Sdate.Date = firmwareDataGetPointer()->release_day; | |
| 804 | |
| 805 if(settingsGetPointer()->date_format == DDMMYY) | |
| 806 { | |
| 807 day = 0; | |
| 808 month = 1; | |
| 809 year = 2; | |
| 810 } | |
| 811 else | |
| 812 if(settingsGetPointer()->date_format == MMDDYY) | |
| 813 { | |
| 814 day = 1; | |
| 815 month = 0; | |
| 816 year = 2; | |
| 817 } | |
| 818 else | |
| 819 { | |
| 820 day = 2; | |
| 821 month = 1; | |
| 822 year = 0; | |
| 823 } | |
| 824 date[day] = Sdate.Date; | |
| 825 date[month] = Sdate.Month; | |
| 826 date[year] = Sdate.Year; | |
| 827 snprintf(text_content,40,"Firmware release date: %02d.%02d.%02d",date[0],date[1],date[2]); | |
| 828 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
| 829 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, "for more information"); | |
| 64 | 830 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, "info@heinrichsweikamp.com"); |
| 38 | 831 |
| 832 text_button[0] = TXT_2BYTE; | |
| 833 text_button[1] = TXT2BYTE_ButtonNext; | |
| 834 text_button[2] = 0; | |
| 835 break; | |
| 836 | |
| 837 case 1: | |
| 838 text_header[0] = '\001'; | |
| 839 text_header[1] = TXT_2BYTE; | |
| 840 text_header[2] = TXT2BYTE_Usage_Battery; | |
| 841 text_header[3] = 0; | |
| 842 | |
| 843 text_content[0] = TXT_2BYTE; | |
| 844 text_content[1] = TXT2BYTE_ChargeCycles; | |
| 845 text_content[2] = 0; | |
| 846 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content); | |
|
646
0fc1b47d2482
Remove battery charge counter from information menu:
Ideenmodellierer
parents:
567
diff
changeset
|
847 /* snprintf(text_content,80,"%ld (%ld)",stateDeviceGetPointer()->batteryChargeCycles.value_int32,stateDeviceGetPointer()->batteryChargeCompleteCycles.value_int32); |
|
0fc1b47d2482
Remove battery charge counter from information menu:
Ideenmodellierer
parents:
567
diff
changeset
|
848 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); */ |
| 38 | 849 |
| 850 translateDate(stateDeviceGetPointer()->batteryChargeCycles.date_rtc_dr, &Sdate); | |
| 851 translateDate(stateDeviceGetPointer()->batteryChargeCompleteCycles.date_rtc_dr, &Sdate2); | |
| 852 snprintf(text_content,80,"%u.%u.20%02u (%u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year); | |
|
646
0fc1b47d2482
Remove battery charge counter from information menu:
Ideenmodellierer
parents:
567
diff
changeset
|
853 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); |
| 38 | 854 |
| 855 text_content[0] = TXT_2BYTE; | |
| 856 text_content[1] = TXT2BYTE_LowestVoltage; | |
| 857 text_content[2] = 0; | |
| 858 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content); | |
| 859 | |
|
404
e729b8e7654d
Bugfix: display of time of minimum voltag:
ideenmodellierer
parents:
389
diff
changeset
|
860 translateDate(stateDeviceGetPointer()->voltageMinimum.date_rtc_dr, &Sdate); |
| 38 | 861 voltage = ((float)stateDeviceGetPointer()->voltageMinimum.value_int32) / 1000; |
| 862 snprintf(text_content,80,"%0.3fV (%u.%u.20%02u)",voltage, Sdate.Date,Sdate.Month,Sdate.Year); | |
| 863 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content); | |
| 864 | |
| 865 text_button[0] = TXT_2BYTE; | |
| 866 text_button[1] = TXT2BYTE_ButtonNext; | |
| 867 text_button[2] = 0; | |
| 868 break; | |
| 869 | |
| 870 case 2: | |
| 871 text_header[0] = '\001'; | |
| 872 text_header[1] = TXT_2BYTE; | |
| 873 text_header[2] = TXT2BYTE_Usage_Dives; | |
| 874 text_header[3] = 0; | |
| 875 | |
| 876 text_content[0] = TXT_2BYTE; | |
| 877 text_content[1] = TXT2BYTE_NumberOfDives; | |
| 878 text_content[2] = 0; | |
| 879 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content); | |
| 880 | |
| 57 | 881 snprintf(text_content,80,"%ld (%ld)",stateDeviceGetPointer()->diveCycles.value_int32,(stateDeviceGetPointer()->depthMaximum.value_int32 - 1000) / 100); |
| 38 | 882 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); |
| 883 | |
| 884 translateDate(stateDeviceGetPointer()->diveCycles.date_rtc_dr, &Sdate); | |
| 885 translateDate(stateDeviceGetPointer()->depthMaximum.date_rtc_dr, &Sdate2); | |
| 886 snprintf(text_content,80,"%u.%u.20%02u (%u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year); | |
| 887 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
| 888 | |
| 889 text_content[0] = TXT_2BYTE; | |
| 890 text_content[1] = TXT2BYTE_HoursOfOperation; | |
| 891 text_content[2] = 0; | |
| 892 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content); | |
| 893 | |
| 57 | 894 snprintf(text_content,80,"%ld",(stateDeviceGetPointer()->hoursOfOperation.value_int32)/3600); |
| 38 | 895 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content); |
| 896 | |
| 897 text_button[0] = TXT_2BYTE; | |
| 898 text_button[1] = TXT2BYTE_ButtonNext; | |
| 899 text_button[2] = 0; | |
| 900 break; | |
| 901 | |
| 902 case 3: | |
| 903 text_header[0] = '\001'; | |
| 904 text_header[1] = TXT_2BYTE; | |
| 905 text_header[2] = TXT2BYTE_Usage_Environment; | |
| 906 text_header[3] = 0; | |
| 907 | |
| 908 text_content[0] = TXT_2BYTE; | |
| 909 text_content[1] = TXT2BYTE_AmbientTemperature; | |
| 910 text_content[2] = 0; | |
| 911 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content); | |
| 912 | |
| 913 temperature1 = ((float)stateDeviceGetPointer()->temperatureMinimum.value_int32) / 100; | |
| 914 temperature2 = ((float)stateDeviceGetPointer()->temperatureMaximum.value_int32) / 100; | |
| 915 snprintf(text_content,80,"%0.2f\140C / %0.2f\140C",temperature1,temperature2); | |
| 916 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); | |
| 917 | |
| 918 translateDate(stateDeviceGetPointer()->temperatureMinimum.date_rtc_dr, &Sdate); | |
| 919 translateDate(stateDeviceGetPointer()->temperatureMaximum.date_rtc_dr, &Sdate2); | |
| 920 snprintf(text_content,80,"(%u.%u.20%02u / %u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year); | |
| 921 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
| 922 | |
| 923 text_content[0] = TXT_2BYTE; | |
| 924 text_content[1] = TXT2BYTE_Korrekturwerte; | |
| 925 text_content[2] = 0; | |
| 926 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content); | |
| 927 | |
| 928 offsetTemperature = ((float)settingsGetPointer()->offsetTemperature_centigrad) / 10; | |
|
103
f5d2f02dc73f
Generalize TEXT of pressure unit
Dmitry Romanov <kitt@bk.ru>
parents:
102
diff
changeset
|
929 snprintf(text_content,80,"%i %s / %0.2f\140C",settingsGetPointer()->offsetPressure_mbar, TEXT_PRESSURE_UNIT, offsetTemperature); |
| 38 | 930 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content); |
| 931 | |
| 932 text_button[0] = TXT_2BYTE; | |
| 933 text_button[1] = TXT2BYTE_Exit; | |
| 934 text_button[2] = 0; | |
| 935 break; | |
| 936 } | |
| 937 | |
| 938 write_topline(text_header); | |
| 520 | 939 tMenuEdit_newButtonText(StMSYS4_Info, text_button); |
| 38 | 940 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonNext,0); |
| 941 } | |
| 942 | |
| 943 | |
| 944 void openEdit_Reset(void) | |
| 945 { | |
| 946 char text[32]; | |
| 947 | |
| 948 text[0] = '\001'; | |
| 949 text[1] = TXT_2BYTE; | |
| 950 text[2] = TXT2BYTE_ResetMenu; | |
| 951 text[3] = 0; | |
| 952 write_topline(text); | |
| 953 | |
| 954 text[0] = TXT_2BYTE; | |
| 955 text[1] = TXT2BYTE_LogbookOffset; | |
| 956 text[7] = 0; | |
| 957 | |
| 958 write_label_var( 30, 400, ME_Y_LINE1, &FontT48, text); | |
| 959 | |
| 520 | 960 write_field_udigit(StMSYS5_LogbookOffset,420, 800, ME_Y_LINE1, &FontT48, "####", settingsGetPointer()->logbookOffset,0,0,0); |
| 38 | 961 |
| 962 text[0] = TXT_2BYTE; | |
| 963 text[2] = 0; | |
| 964 | |
| 965 text[1] = TXT2BYTE_ResetAll; | |
| 520 | 966 write_field_button(StMSYS5_ResetAll, 30, 800, ME_Y_LINE2, &FontT48, text); |
| 38 | 967 |
| 968 text[1] = TXT2BYTE_ResetDeco; | |
| 520 | 969 write_field_button(StMSYS5_ResetDeco, 30, 800, ME_Y_LINE3, &FontT48, text); |
| 38 | 970 |
| 971 text[1] = TXT2BYTE_Reboot; | |
| 520 | 972 write_field_button(StMSYS5_Reboot, 30, 800, ME_Y_LINE4, &FontT48, text); |
| 38 | 973 |
| 974 text[1] = TXT2BYTE_Maintenance; | |
| 520 | 975 write_field_button(StMSYS5_Maintenance, 30, 800, ME_Y_LINE5, &FontT48, text); |
| 38 | 976 |
| 977 #ifndef RESETLOGBLOCK | |
| 978 text[1] = TXT2BYTE_ResetLogbook; | |
| 520 | 979 write_field_button(StMSYS5_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); |
| 38 | 980 #else |
|
528
a9c195be907e
Added new option to gas configuration: "Off":
Ideenmodellierer
parents:
520
diff
changeset
|
981 text[0] = '\031'; |
| 38 | 982 text[1] = TXT_2BYTE; |
| 983 text[2] = TXT2BYTE_ResetLogbook; | |
| 984 text[3] = 0; | |
| 520 | 985 write_field_button(StMSYS5_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); |
| 38 | 986 text[0] = TXT_2BYTE; |
| 987 text[2] = 0; | |
| 988 #endif | |
| 989 | |
| 520 | 990 setEvent(StMSYS5_LogbookOffset, (uint32_t)OnAction_LogbookOffset); |
| 991 setEvent(StMSYS5_ResetAll, (uint32_t)OnAction_Confirm); | |
| 992 setEvent(StMSYS5_ResetDeco, (uint32_t)OnAction_Confirm); | |
| 993 setEvent(StMSYS5_Reboot, (uint32_t)OnAction_Confirm); | |
| 994 setEvent(StMSYS5_Maintenance, (uint32_t)OnAction_Confirm); | |
| 38 | 995 #ifndef RESETLOGBLOCK |
| 520 | 996 setEvent(StMSYS5_ResetLogbook, (uint32_t)OnAction_Confirm); |
| 38 | 997 #else |
| 520 | 998 setEvent(StMSYS5_ResetLogbook, (uint32_t)OnAction_Nothing); |
| 38 | 999 #endif |
| 1000 | |
| 1001 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
| 1002 } | |
| 1003 | |
| 1004 | |
| 1005 void openEdit_ResetConfirmation(uint32_t editIdOfCaller) | |
| 1006 { | |
| 1007 char text[32]; | |
| 1008 | |
| 1009 resetMenuEdit(CLUT_MenuPageSystem); | |
| 1010 | |
| 1011 text[0] = '\001'; | |
| 1012 text[1] = TXT_2BYTE; | |
| 1013 text[2] = TXT2BYTE_AreYouSure; | |
| 1014 text[3] = 0; | |
| 1015 write_topline(text); | |
| 1016 | |
| 1017 text[0] = TXT_2BYTE; | |
| 1018 text[2] = 0; | |
| 1019 text[1] = TXT2BYTE_Abort; | |
| 1020 | |
| 520 | 1021 write_field_button(StMSYS5_Exit, 30, 800, ME_Y_LINE1, &FontT48, text); |
| 38 | 1022 |
| 1023 text[2] = 0; | |
| 1024 text[3] = 0; | |
| 1025 switch(editIdOfCaller) | |
| 1026 { | |
| 520 | 1027 case StMSYS5_Reboot: |
| 1028 case StMSYS5_RebootRTE: | |
| 1029 case StMSYS5_RebootMainCPU: | |
| 38 | 1030 text[1] = TXT2BYTE_RebootMainCPU; |
| 520 | 1031 write_field_button(StMSYS5_RebootMainCPU, 30, 800, ME_Y_LINE2, &FontT48, text); |
| 38 | 1032 text[1] = TXT2BYTE_RebootRTE; |
| 520 | 1033 write_field_button(StMSYS5_RebootRTE, 30, 800, ME_Y_LINE3, &FontT48, text); |
| 1034 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); | |
| 1035 setEvent(StMSYS5_RebootMainCPU, (uint32_t)OnAction_RebootMainCPU); | |
| 1036 setEvent(StMSYS5_RebootRTE, (uint32_t)OnAction_RebootRTE); | |
| 38 | 1037 text[0] = '\025'; |
| 1038 text[1] = TXT_2BYTE; | |
| 1039 text[2] = TXT2BYTE_DecoDataLost; | |
| 1040 text[3] = 0; | |
| 1041 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); | |
| 1042 break; | |
| 1043 | |
| 520 | 1044 case StMSYS5_ResetDeco: |
| 38 | 1045 text[1] = TXT2BYTE_ResetDeco; |
| 1046 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | |
| 520 | 1047 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); |
| 38 | 1048 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetDeco); |
| 1049 text[0] = '\025'; | |
| 1050 text[1] = TXT_2BYTE; | |
| 1051 text[2] = TXT2BYTE_DecoDataLost; | |
| 1052 text[3] = 0; | |
| 1053 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); | |
| 1054 break; | |
| 1055 | |
| 520 | 1056 case StMSYS5_ResetAll: |
| 38 | 1057 text[1] = TXT2BYTE_ResetAll; |
| 1058 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | |
| 520 | 1059 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); |
| 38 | 1060 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetAll); |
| 1061 break; | |
| 1062 | |
| 520 | 1063 case StMSYS5_ResetLogbook: |
| 38 | 1064 text[1] = TXT2BYTE_ResetLogbook; |
| 1065 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | |
| 520 | 1066 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); |
| 38 | 1067 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetLogbook); |
| 1068 break; | |
| 1069 | |
| 520 | 1070 case StMSYS5_Maintenance: |
| 1071 case StMSYS5_SetBattCharge: | |
| 1072 case StMSYS5_SetSampleIndx: | |
| 38 | 1073 text[0] = TXT_2BYTE; |
| 1074 text[1] = TXT2BYTE_SetFactoryDefaults; | |
| 1075 text[2] = 0; | |
| 520 | 1076 write_field_button(StMSYS5_SetFactoryBC, 30, 800, ME_Y_LINE2, &FontT48, text); |
| 38 | 1077 |
| 662 | 1078 text[0] = TXT_2BYTE; |
| 1079 text[1] = TXT2BYTE_ResetBluetooth; | |
| 1080 text[2] = 0; | |
| 1081 write_field_button(StMSYS5_ResetBluetooth, 30, 800, ME_Y_LINE3, &FontT48, text); | |
| 1082 | |
|
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1083 #ifdef ENABLE_ANALYSE_SAMPLES |
|
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1084 text[0] = TXT_2BYTE; |
|
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1085 text[1] = TXT2BYTE_SetSampleIndex; |
|
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1086 text[2] = 0; |
| 662 | 1087 write_field_button(StMSYS5_SetSampleIndx, 30, 800, ME_Y_LINE4, &FontT48, text); |
|
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1088 #endif |
|
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1089 |
|
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1090 |
| 38 | 1091 if(stateRealGetPointer()->lifeData.battery_charge == 0) |
| 1092 { | |
| 1093 text[0] = TXT_2BYTE; | |
| 1094 text[1] = TXT2BYTE_SetBatteryCharge; | |
| 1095 text[2] = 0; | |
| 1096 snprintf(&text[2],10,": %u%%",settingsGetPointer()->lastKnownBatteryPercentage); | |
|
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1097 #ifdef ENABLE_ANALYSE_SAMPLES |
| 520 | 1098 write_field_button(StMSYS5_SetBattCharge, 30, 800, ME_Y_LINE4, &FontT48, text); |
|
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1099 #else |
| 520 | 1100 write_field_button(StMSYS5_SetBattCharge, 30, 800, ME_Y_LINE3, &FontT48, text); |
|
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1101 #endif |
| 38 | 1102 |
| 520 | 1103 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); |
| 1104 setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); | |
| 662 | 1105 setEvent(StMSYS5_ResetBluetooth, (uint32_t)OnAction_ResetBluetooth); |
|
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1106 #ifdef ENABLE_ANALYSE_SAMPLES |
| 520 | 1107 setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); |
|
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1108 #endif |
| 520 | 1109 setEvent(StMSYS5_SetBattCharge, (uint32_t)OnAction_SetBatteryCharge); |
| 38 | 1110 } |
| 1111 else | |
| 1112 { | |
| 520 | 1113 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); |
| 1114 setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); | |
| 662 | 1115 setEvent(StMSYS5_ResetBluetooth, (uint32_t)OnAction_ResetBluetooth); |
|
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1116 #ifdef ENABLE_ANALYSE_SAMPLES |
| 520 | 1117 setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); |
|
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1118 #endif |
| 38 | 1119 } |
| 520 | 1120 // write_field_button(StMSYS5_ScreenTest, 30, 800, ME_Y_LINE3, &FontT48, "Screen Test"); |
| 1121 // setEvent(StMSYS5_ScreenTest, (uint32_t)OnAction_ScreenTest); | |
| 38 | 1122 |
| 1123 text[0] = TXT_2BYTE; | |
| 1124 text[1] = TXT2BYTE_WarnBatteryLow; | |
| 1125 text[2] = 0; | |
| 1126 snprintf(&text[2],10,": %01.2fV",stateRealGetPointer()->lifeData.battery_voltage); | |
|
435
8851702173e0
Bugfix display battery voltage in maintainance menu:
ideenmodellierer
parents:
424
diff
changeset
|
1127 write_label_var( 30, 800, ME_Y_LINE5, &FontT42, text); |
|
8851702173e0
Bugfix display battery voltage in maintainance menu:
ideenmodellierer
parents:
424
diff
changeset
|
1128 |
| 38 | 1129 snprintf(&text[0],30,"Code: %X",getLicence()); |
| 1130 write_label_var( 30, 800, ME_Y_LINE6, &FontT42, text); | |
| 1131 break; | |
| 1132 | |
| 1133 } | |
| 1134 | |
| 1135 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
| 1136 } | |
| 1137 | |
| 1138 uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 1139 { | |
| 1140 uint8_t digitContentNew; | |
| 1141 uint32_t newOffset; | |
| 1142 | |
| 1143 if(action == ACTION_BUTTON_ENTER) | |
| 1144 return digitContent; | |
| 1145 | |
| 1146 if(action == ACTION_BUTTON_ENTER_FINAL) | |
| 1147 { | |
| 1148 evaluateNewString(editId, &newOffset, 0, 0, 0); | |
| 1149 if(newOffset > 9000) | |
| 1150 newOffset = 0; | |
| 1151 tMenuEdit_newInput(editId, newOffset, 0, 0, 0); | |
| 1152 settingsGetPointer()->logbookOffset = (uint16_t)newOffset; | |
| 1153 return UPDATE_DIVESETTINGS; | |
| 1154 } | |
| 1155 | |
| 1156 if(action == ACTION_BUTTON_NEXT) | |
| 1157 { | |
| 1158 digitContentNew = digitContent + 1; | |
| 1159 if(digitContentNew > '9') | |
| 1160 digitContentNew = '0'; | |
| 1161 return digitContentNew; | |
| 1162 } | |
| 1163 | |
| 1164 if(action == ACTION_BUTTON_BACK) | |
| 1165 { | |
| 1166 digitContentNew = digitContent - 1; | |
| 1167 if(digitContentNew < '0') | |
| 1168 digitContentNew = '9'; | |
| 1169 return digitContentNew; | |
| 1170 } | |
| 1171 return UNSPECIFIC_RETURN; | |
| 1172 } | |
| 1173 | |
| 1174 uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 1175 { | |
| 1176 return UNSPECIFIC_RETURN; | |
| 1177 } | |
| 1178 | |
| 1179 uint8_t OnAction_Exit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 1180 { | |
| 1181 return EXIT_TO_MENU; | |
| 1182 } | |
| 1183 uint8_t OnAction_Confirm (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 1184 { | |
| 1185 openEdit_ResetConfirmation(editId); | |
| 1186 return UNSPECIFIC_RETURN; | |
| 1187 } | |
| 1188 | |
| 1189 uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 1190 { | |
| 1191 MX_SmallCPU_Reset_To_Standard(); | |
| 1192 return EXIT_TO_MENU; | |
| 1193 } | |
| 1194 | |
| 1195 uint8_t OnAction_ResetDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 1196 { | |
| 1197 clearDeco(); | |
| 1198 return EXIT_TO_MENU; | |
| 1199 } | |
| 1200 | |
| 1201 uint8_t OnAction_ResetAll (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 1202 { | |
| 1203 set_settings_to_Standard(); | |
| 1204 check_and_correct_settings(); | |
| 1205 | |
| 1206 return UPDATE_AND_EXIT_TO_HOME; | |
| 1207 } | |
| 1208 | |
| 1209 uint8_t OnAction_ResetLogbook (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 1210 { | |
| 1211 write_label_var( 430, 740, 350, &FontT42, "Wait"); | |
| 1212 ext_flash_erase_logbook(); | |
| 1213 | |
| 1214 SSettings * pSettings = settingsGetPointer(); | |
| 1215 pSettings->lastDiveLogId = 255; | |
| 1216 pSettings->logFlashNextSampleStartAddress = 0; | |
| 1217 | |
| 1218 return EXIT_TO_MENU; | |
| 1219 } | |
| 1220 | |
| 1221 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 1222 { | |
| 1223 settingsGetPointer()->showDebugInfo = 0; | |
| 1224 extern uint8_t bootToBootloader; | |
| 1225 bootToBootloader = 1; | |
| 1226 return UNSPECIFIC_RETURN; | |
| 1227 } | |
| 1228 | |
| 1229 | |
| 1230 uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 1231 { | |
| 1232 settingsWriteFactoryDefaults(settingsGetPointer()->ButtonResponsiveness[3], settingsGetPointer()->buttonBalance); | |
| 1233 return EXIT_TO_MENU; | |
| 1234 } | |
| 1235 | |
| 662 | 1236 uint8_t OnAction_ResetBluetooth(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
| 1237 { | |
| 1238 tComm_Set_Bluetooth_Name(1); | |
| 1239 | |
| 1240 return EXIT_TO_MENU; | |
| 1241 } | |
| 1242 | |
|
468
aa1d71875e25
Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents:
446
diff
changeset
|
1243 #ifdef ENABLE_ANALYSE_SAMPLES |
|
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1244 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
|
1245 { |
|
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1246 char text[32]; |
|
558
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1247 uint8_t openSec; |
|
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1248 uint8_t retval = UNSPECIFIC_RETURN; |
|
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1249 openSec = ext_flash_AnalyseSampleBuffer(); |
|
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1250 snprintf(&text[0],30,"OpenSec: %d",openSec); |
|
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1251 write_label_var( 30, 800, ME_Y_LINE6, &FontT42, text); |
|
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1252 |
|
558
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1253 if(openSec == 2) |
|
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1254 { |
|
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1255 retval = UPDATE_DIVESETTINGS; |
|
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1256 } |
|
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1257 return retval; |
|
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1258 } |
|
468
aa1d71875e25
Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents:
446
diff
changeset
|
1259 #endif |
|
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1260 |
| 38 | 1261 uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
| 1262 { | |
| 1263 setBatteryPercentage(settingsGetPointer()->lastKnownBatteryPercentage); | |
| 1264 // setBatteryPercentage(100); | |
| 1265 return EXIT_TO_MENU; | |
| 1266 } | |
| 1267 | |
| 1268 #ifdef SCREENTEST | |
| 1269 uint8_t OnAction_ScreenTest (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 1270 { | |
| 1271 static uint8_t FrameCount = 1; // 0 is invisible frame | |
| 1272 char text[5]; | |
| 1273 GFX_DrawCfgScreen tTestScreen; | |
| 1274 tTestScreen.FBStartAdress = 0; | |
| 1275 tTestScreen.ImageHeight = 480; | |
| 1276 tTestScreen.ImageWidth = 800; | |
| 1277 tTestScreen.LayerIndex = 1; | |
| 1278 | |
| 520 | 1279 set_globalState(StMSYS5_ScreenTest); |
| 38 | 1280 tTestScreen.FBStartAdress = getFrameByNumber(FrameCount); |
| 1281 if(tTestScreen.FBStartAdress == 0) | |
| 1282 { | |
| 1283 extern uint8_t bootToBootloader; | |
| 1284 bootToBootloader = 1; | |
| 1285 } | |
| 1286 GFX_fill_buffer(tTestScreen.FBStartAdress, 0xFF, FrameCount); | |
| 1287 snprintf(text,5,"%u",FrameCount); | |
| 1288 Gfx_write_label_var(&tTestScreen, 10,100,10,&FontT48,CLUT_Font027,text); | |
| 1289 GFX_SetFramesTopBottom(tTestScreen.FBStartAdress, NULL,480); | |
| 1290 FrameCount++; | |
| 1291 } | |
| 1292 #endif | |
| 1293 /* | |
| 1294 uint8_t OnAction_TestCLog (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 1295 { | |
| 1296 write_label_var( 430, 740, 350, &FontT42, "Wait"); | |
| 1297 | |
| 1298 test_log_only(20, 5); | |
| 1299 test_log_only(30, 10); | |
| 1300 ext_flash_write_settings(); | |
| 1301 return EXIT_TO_MENU; | |
| 1302 } | |
| 1303 */ | |
| 1304 |
