comparison Discovery/Src/show_logbook.c @ 484:eea282e733e8 FixLayout_Header_LogView

Small corrections layout Divelog page 1: Reading the code the information on the right side of the page should be aligned to the right border. That was not done because of e.g. a to small field of view for a certain string. Introduced a define to have all information aligned to the same position
author ideenmodellierer
date Tue, 26 May 2020 21:12:46 +0200
parents 4bd01f48c285
children 1c95f811967c
comparison
equal deleted inserted replaced
483:90d1f793dcf2 484:eea282e733e8
37 37
38 #include <stdint.h> 38 #include <stdint.h>
39 #include <stdio.h> 39 #include <stdio.h>
40 #include <stdlib.h> // for abs() 40 #include <stdlib.h> // for abs()
41 41
42 #define LOG_BORDER_OFFSET (50u) /* text offset from left / right display to text start/end */
43
42 /* Private variables ---------------------------------------------------------*/ 44 /* Private variables ---------------------------------------------------------*/
43 45
44 static GFX_DrawCfgScreen tLOGscreen; 46 static GFX_DrawCfgScreen tLOGscreen;
45 static GFX_DrawCfgScreen tLOGbackground; 47 static GFX_DrawCfgScreen tLOGbackground;
46 48
413 */ 415 */
414 static void show_logbook_logbook_show_log_page1(GFX_DrawCfgScreen *hgfx,uint8_t StepBackwards) 416 static void show_logbook_logbook_show_log_page1(GFX_DrawCfgScreen *hgfx,uint8_t StepBackwards)
415 { 417 {
416 SWindowGimpStyle wintemp; 418 SWindowGimpStyle wintemp;
417 SWindowGimpStyle winsmal; 419 SWindowGimpStyle winsmal;
418 wintemp.left = 50; 420 wintemp.left = LOG_BORDER_OFFSET;
419 wintemp.right = 799 - wintemp.left; 421 wintemp.right = 799 - wintemp.left;
420 wintemp.top = 50; 422 wintemp.top = LOG_BORDER_OFFSET;
421 wintemp.bottom = 479 - 40; 423 wintemp.bottom = 479 - 40;
422 424
423 SLogbookHeader logbookHeader; 425 SLogbookHeader logbookHeader;
424 logbook_getHeader(StepBackwards ,&logbookHeader); 426 logbook_getHeader(StepBackwards ,&logbookHeader);
425 427
463 } 465 }
464 466
465 //Print time 467 //Print time
466 uint8_t hour = logbookHeader.timeHour; 468 uint8_t hour = logbookHeader.timeHour;
467 uint8_t minute = logbookHeader.timeMinute; 469 uint8_t minute = logbookHeader.timeMinute;
468 snprintf(text,20,"%02i:%02i",hour,minute); 470 snprintf(text,20,"\002%02i:%02i",hour,minute);
469 Gfx_write_label_var(hgfx, 600, 749,10, &FontT42,CLUT_GasSensor1,text); 471 Gfx_write_label_var(hgfx, 600, wintemp.right,10, &FontT42,CLUT_GasSensor1,text);
470 472
471 //Print Dive Mode (OC/CCR/...) 473 //Print Dive Mode (OC/CCR/...)
472 switch(logbookHeader.diveMode) 474 switch(logbookHeader.diveMode)
473 { 475 {
474 case DIVEMODE_OC: 476 case DIVEMODE_OC:
491 { 493 {
492 switch(logbookHeader.decoModel) 494 switch(logbookHeader.decoModel)
493 { 495 {
494 case GF_MODE: 496 case GF_MODE:
495 snprintf(text,20,"\002GF%u/%u",logbookHeader.gfLow_or_Vpm_conservatism,logbookHeader.gfHigh); 497 snprintf(text,20,"\002GF%u/%u",logbookHeader.gfLow_or_Vpm_conservatism,logbookHeader.gfHigh);
496 break; 498 break;
497 case VPM_MODE: 499 case VPM_MODE:
498 snprintf(text,20,"\002VPM +%u",logbookHeader.gfLow_or_Vpm_conservatism); 500 snprintf(text,20,"\002VPM +%u",logbookHeader.gfLow_or_Vpm_conservatism);
499 break; 501 break;
502 default:
503 snprintf(text,20," "); /* no information to be displayed */
504 break;
500 } 505 }
501 Gfx_write_label_var(hgfx, 600, 729,60, &FontT42,CLUT_GasSensor1,text); 506 Gfx_write_label_var(hgfx, 500, wintemp.right,60, &FontT42,CLUT_GasSensor1,text);
502 } 507 }
503 508
504 //Write Dive Time 509 //Write Dive Time
505 int minutes = logbookHeader.diveTimeMinutes; 510 int minutes = logbookHeader.diveTimeMinutes;
506 int seconds = logbookHeader.diveTimeSeconds; 511 int seconds = logbookHeader.diveTimeSeconds;
641 bottlePressureEnd = tankdata[loop]; 646 bottlePressureEnd = tankdata[loop];
642 } 647 }
643 } 648 }
644 if(bottlePressureStart != 0) 649 if(bottlePressureStart != 0)
645 { 650 {
646 snprintf(text,40,"%i | %i\016\016 Bar\017",bottlePressureStart,bottlePressureEnd); 651 snprintf(text,40,"\002%i | %i\016\016 Bar\017",bottlePressureStart,bottlePressureEnd);
647 Gfx_write_label_var(hgfx,600,800,440, &FontT42,CLUT_GasSensor1,text); 652 Gfx_write_label_var(hgfx,450,wintemp.right,440, &FontT42,CLUT_GasSensor1,text);
648 } 653 }
649 #endif 654 #endif
650 //--- print coordinate system & depth graph with gaschanges --- 655 //--- print coordinate system & depth graph with gaschanges ---
651 wintemp.left = 330; 656 wintemp.left = 330;
652 wintemp.top = 160; 657 wintemp.top = 160;