comparison Discovery/Src/tInfoLog.c @ 567:1c95f811967c

-Add 12HR Time Support -Add firmware image only font extensions -Show english units when required in log's graphs -Show decompression info with Font84 if 10 characters long -Remove usage of ' symbol to denote minutes and instead use min abbreviation -Show english units when required on the simulation configuration screen -Remove usage of ' symbol to denote feet in in non-metric mode and use ft abbrevation
author izzni
date Tue, 24 Nov 2020 13:22:23 -0600
parents 1f557e5f4b5a
children 701ead8dddab
comparison
equal deleted inserted replaced
566:7761dd028386 567:1c95f811967c
254 SLogbookHeader logbookHeader; 254 SLogbookHeader logbookHeader;
255 // uint16_t divetime = logbookHeader.diveTimeMinutes; 255 // uint16_t divetime = logbookHeader.diveTimeMinutes;
256 // uint16_t maxDepth = logbookHeader.maxDepth/100; 256 // uint16_t maxDepth = logbookHeader.maxDepth/100;
257 int i = 0; 257 int i = 0;
258 uint8_t date[2], month,day; 258 uint8_t date[2], month,day;
259 char timeSuffix;
260 uint8_t hours;
259 261
260 if(INFOLOGscreen.FBStartAdress) 262 if(INFOLOGscreen.FBStartAdress)
261 releaseFrame(15,INFOLOGscreen.FBStartAdress); 263 releaseFrame(15,INFOLOGscreen.FBStartAdress);
262 INFOLOGscreen.FBStartAdress = getFrame(15); 264 INFOLOGscreen.FBStartAdress = getFrame(15);
263 265
333 textPointer += snprintf(&text[textPointer], 20,"\031%2u \020", number); 335 textPointer += snprintf(&text[textPointer], 20,"\031%2u \020", number);
334 else 336 else
335 textPointer += snprintf(&text[textPointer], 20,"\031\016\016%3u \017\020", number); 337 textPointer += snprintf(&text[textPointer], 20,"\031\016\016%3u \017\020", number);
336 */ 338 */
337 textPointer += snprintf(&text[textPointer], 20,"%02d.%02d ",date[0],date[1]); 339 textPointer += snprintf(&text[textPointer], 20,"%02d.%02d ",date[0],date[1]);
338 textPointer += snprintf(&text[textPointer], 20,"%02d:%02d ",logbookHeader.timeHour,logbookHeader.timeMinute); 340
341 if (settingsGetPointer()->amPMTime)
342 {
343 if (logbookHeader.timeHour > 11)
344 {
345 timeSuffix = 'P';
346 }
347 else
348 {
349 timeSuffix = 'A';
350 }
351
352 if (logbookHeader.timeHour % 12 == 0)
353 {
354 hours = 12;
355 }
356 else
357 {
358 hours = (logbookHeader.timeHour % 12);
359 }
360
361 textPointer += snprintf(&text[textPointer], 20,"%02d:%02d\016\016%cM\017", hours,logbookHeader.timeMinute, timeSuffix);
362 }
363 else
364 {
365 textPointer += snprintf(&text[textPointer], 20,"%02d:%02d ",logbookHeader.timeHour,logbookHeader.timeMinute);
366 }
367
339 switch(logbookHeader.decoModel) 368 switch(logbookHeader.decoModel)
340 { 369 {
341 case 1: 370 case 1:
342 textPointer += snprintf(&text[textPointer],20,"\016\016 GF \017"); 371 textPointer += snprintf(&text[textPointer],20,"\016\016 GF \017");
343 break; 372 break;
357 } 386 }
358 else 387 else
359 { 388 {
360 textPointer += snprintf(&text[textPointer], 20,"%3d.%d\016\016m\017 ", maxDepthMeter,maxDepthSubmeter); 389 textPointer += snprintf(&text[textPointer], 20,"%3d.%d\016\016m\017 ", maxDepthMeter,maxDepthSubmeter);
361 } 390 }
362 textPointer += snprintf(&text[textPointer], 20,"%3d'\n\r", divetime); 391 textPointer += snprintf(&text[textPointer], 20,"%3d\016\016min\017\n\r", divetime);
392
363 } 393 }
364 } 394 }
365 GFX_write_string(&FontT48, &INFOLOGwindow, text,1); 395 GFX_write_string(&FontT48, &INFOLOGwindow, text,1);
366 396
367 if(infolog.linesAvailableForPage > 1) 397 if(infolog.linesAvailableForPage > 1)