comparison Discovery/Src/t3.c @ 413:65c7b009136f Improment_NVM

Bugfix Flipdisplay Gauge and Apnoe mode: Changes needed to provide the same look and feel like in standard mode were not applied. Added missinng functions.
author ideenmodellierer
date Tue, 14 Jan 2020 21:10:37 +0100
parents 39c147e47c1c
children 9623f166b0c0
comparison
equal deleted inserted replaced
412:b3ab85121e4d 413:65c7b009136f
257 if(stateUsed->lifeData.ascent_rate_meter_per_min > -200) 257 if(stateUsed->lifeData.ascent_rate_meter_per_min > -200)
258 depthChangeRate = (uint8_t)(0 - stateUsed->lifeData.ascent_rate_meter_per_min); 258 depthChangeRate = (uint8_t)(0 - stateUsed->lifeData.ascent_rate_meter_per_min);
259 else 259 else
260 depthChangeRate = 200; 260 depthChangeRate = 200;
261 } 261 }
262 start.y = tXl1->WindowY0 - 1; 262
263 if(!pSettings->FlipDisplay)
264 {
265 start.y = tXl1->WindowY0 - 1;
266 }
267 else
268 {
269 start.y = tXl1->WindowY1 + 1;
270 }
263 startZeroLine.y = start.y; 271 startZeroLine.y = start.y;
264 for(int i = 0; i<5;i++) 272 for(int i = 0; i<5;i++)
265 { 273 {
266 start.y += 40; 274 start.y += 40;
267 stop.y = start.y; 275 stop.y = start.y;
268 start.x = tXl1->WindowX1 - 1; 276 if(!pSettings->FlipDisplay)
277 {
278 start.x = tXl1->WindowX1 - 1;
279 }
280 else
281 {
282 start.x = tXr1->WindowX1 - 1;
283 }
269 stop.x = start.x - 17; 284 stop.x = start.x - 17;
270 285
271 if(depthChangeRate <= 6) 286 if(depthChangeRate <= 6)
272 { 287 {
273 if(i == 2) 288 if(i == 2)
288 } 303 }
289 // new thick bar design Sept. 2015 304 // new thick bar design Sept. 2015
290 if((stateUsed->lifeData.ascent_rate_meter_per_min > 4) || (stateUsed->lifeData.ascent_rate_meter_per_min < -4)) 305 if((stateUsed->lifeData.ascent_rate_meter_per_min > 4) || (stateUsed->lifeData.ascent_rate_meter_per_min < -4))
291 { 306 {
292 start.y = startZeroLine.y; 307 start.y = startZeroLine.y;
293
294 if(depthChangeAscent) 308 if(depthChangeAscent)
295 { 309 {
296 color = CLUT_EverythingOkayGreen; 310 color = CLUT_EverythingOkayGreen;
297 start.y += 7; // starte etwas weiter oben 311 start.y += 7; // starte etwas weiter oben
298 stop.y = start.y + (uint16_t)(depthChangeRate * 4) - 9; // - x; // wegen der Liniendicke 312 stop.y = start.y + (uint16_t)(depthChangeRate * 4) - 9; // - x; // wegen der Liniendicke
305 start.y -= 7; 319 start.y -= 7;
306 stop.y = start.y - (uint16_t)(depthChangeRate * 4) + 9; 320 stop.y = start.y - (uint16_t)(depthChangeRate * 4) + 9;
307 if(stop.y <= tXl1->WindowY0) 321 if(stop.y <= tXl1->WindowY0)
308 stop.y = tXl1->WindowY0 + 1; 322 stop.y = tXl1->WindowY0 + 1;
309 } 323 }
310 stop.x = start.x = tXl1->WindowX1 - 8; 324 if(!pSettings->FlipDisplay)
325 {
326 start.x = tXl1->WindowX1 - 3 - 5;
327 }
328 else
329 {
330 start.x = tXr1->WindowX1 - 3 - 5;
331 }
332
333 stop.x = start.x;
311 GFX_draw_thick_line(12,tXscreen, start, stop, color); 334 GFX_draw_thick_line(12,tXscreen, start, stop, color);
312 } 335 }
313 } 336 }
314 else 337 else
315 { 338 {
499 char text[512]; 522 char text[512];
500 uint16_t textpointer = 0; 523 uint16_t textpointer = 0;
501 524
502 // CVIEW_T3_Temperature 525 // CVIEW_T3_Temperature
503 float temperature; 526 float temperature;
527 SSettings* pSettings;
528 pSettings = settingsGetPointer();
504 529
505 SDivetime TotalDivetime = {0,0,0,0}; 530 SDivetime TotalDivetime = {0,0,0,0};
506 SDivetime LastDivetime = {0,0,0,0}; 531 SDivetime LastDivetime = {0,0,0,0};
507 532
508 uint16_t tempWinX0; 533 uint16_t tempWinX0;
534 uint16_t tempWinX1;
509 uint16_t tempWinY0; 535 uint16_t tempWinY0;
536 uint16_t tempWinY1;
510 537
511 tempWinX0 = tXc1->WindowX0; 538 tempWinX0 = tXc1->WindowX0;
539 tempWinX1 = tXc1->WindowX1;
512 tempWinY0 = tXc1->WindowY0; 540 tempWinY0 = tXc1->WindowY0;
541 tempWinY1 = tXc1->WindowY1;
513 542
514 tXc1->WindowX0 = 440; // rechte Seite 543 tXc1->WindowX0 = 440; // rechte Seite
515 544
516 switch(tX_selection_customview) 545 switch(tX_selection_customview)
517 { 546 {
540 569
541 LastDivetime.Total = stateUsed->lifeData.apnea_last_dive_time_seconds; 570 LastDivetime.Total = stateUsed->lifeData.apnea_last_dive_time_seconds;
542 LastDivetime.Minutes = LastDivetime.Total / 60; 571 LastDivetime.Minutes = LastDivetime.Total / 60;
543 LastDivetime.Seconds = LastDivetime.Total - ( LastDivetime.Minutes * 60 ); 572 LastDivetime.Seconds = LastDivetime.Total - ( LastDivetime.Minutes * 60 );
544 573
545 tXc1->WindowY0 = 100; // obere Zeile 574 // tXc1->WindowY0 = 100; // obere Zeile
575 if(!pSettings->FlipDisplay)
576 {
577 tXc1->WindowY0 = 100;
578 }
579 else
580 {
581 tXc1->WindowY1 -= 100; /* jump to upper of two lines */
582 }
546 583
547 snprintf(text,TEXTSIZE,"\020\016%u:%02u",LastDivetime.Minutes, LastDivetime.Seconds); 584 snprintf(text,TEXTSIZE,"\020\016%u:%02u",LastDivetime.Minutes, LastDivetime.Seconds);
548 t3_basics_colorscheme_mod(text); 585 t3_basics_colorscheme_mod(text);
549 GFX_write_string(&FontT105,tXc1,text,0); 586 GFX_write_string(&FontT105,tXc1,text,0);
550 587
588 if(pSettings->FlipDisplay)
589 {
590 tXc1->WindowX0 = 0;
591
592 }
551 snprintf(text,TEXTSIZE,"\032\002%c%c",TXT_2BYTE, TXT2BYTE_ApneaLast); 593 snprintf(text,TEXTSIZE,"\032\002%c%c",TXT_2BYTE, TXT2BYTE_ApneaLast);
552 GFX_write_string(&FontT42,tXc1,text,0); 594 GFX_write_string(&FontT42,tXc1,text,0);
553 595
554 tXc1->WindowY0 = tempWinY0; // wieder unten 596 if(!pSettings->FlipDisplay)
597 {
598 tXc1->WindowY0 = tempWinY0;
599 }
600 else
601 {
602 tXc1->WindowX1 = tempWinX1;
603 tXc1->WindowY1 = tempWinY1; /* jump to upper of two lines */
604 }
555 605
556 snprintf(text,TEXTSIZE,"\020\016%u:%02u",TotalDivetime.Minutes, TotalDivetime.Seconds); 606 snprintf(text,TEXTSIZE,"\020\016%u:%02u",TotalDivetime.Minutes, TotalDivetime.Seconds);
557 t3_basics_colorscheme_mod(text); 607 t3_basics_colorscheme_mod(text);
558 GFX_write_string(&FontT105,tXc1,text,0); 608 GFX_write_string(&FontT105,tXc1,text,0);
559 609
560 snprintf(text,TEXTSIZE,"\032\002%c%c",TXT_2BYTE, TXT2BYTE_ApneaTotal); 610 snprintf(text,TEXTSIZE,"\032\002%c%c",TXT_2BYTE, TXT2BYTE_ApneaTotal);
611 if(pSettings->FlipDisplay)
612 {
613 tXc1->WindowX0 = 0;
614
615 }
561 GFX_write_string(&FontT42,tXc1,text,0); 616 GFX_write_string(&FontT42,tXc1,text,0);
562 break; 617 break;
563 } 618 }
564 619
565 tXc1->WindowX0 = tempWinX0; 620 tXc1->WindowX0 = tempWinX0;
621 tXc1->WindowX1 = tempWinX1;
566 tXc1->WindowY0 = tempWinY0; 622 tXc1->WindowY0 = tempWinY0;
567 623
568 } 624 }
569 625
570 626
607 uint16_t tempWinX0; 663 uint16_t tempWinX0;
608 uint16_t tempWinX1; 664 uint16_t tempWinX1;
609 uint16_t tempWinY0; 665 uint16_t tempWinY0;
610 uint16_t tempWinY1; 666 uint16_t tempWinY1;
611 uint16_t tempWinC2X0; 667 uint16_t tempWinC2X0;
668 uint16_t tempWinC2Y0;
669 uint16_t tempWinC2X1;
670 uint16_t tempWinC2Y1;
612 uint16_t tempWinC2Tab; 671 uint16_t tempWinC2Tab;
613 672
614 tempWinX0 = tXc1->WindowX0; 673 tempWinX0 = tXc1->WindowX0;
615 tempWinY0 = tXc1->WindowY0; 674 tempWinY0 = tXc1->WindowY0;
675
616 tempWinC2X0 = tXc2->WindowX0; 676 tempWinC2X0 = tXc2->WindowX0;
677 tempWinC2Y0 = tXc2->WindowY0;
678 tempWinC2X1 = tXc2->WindowX1;
679 tempWinC2Y1 = tXc2->WindowY1;
617 tempWinC2Tab = tXc2->WindowTab; 680 tempWinC2Tab = tXc2->WindowTab;
618 681
619 switch(tX_selection_customview) 682 switch(tX_selection_customview)
620 { 683 {
621 case CVIEW_T3_ApnoeSurfaceInfo: 684 case CVIEW_T3_ApnoeSurfaceInfo:
622 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth); 685 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth);
623 GFX_write_string(&FontT42,tXc1,text,0); 686
624 687 if(!pSettings->FlipDisplay)
625 tXc1->WindowY0 = 100; // obere Zeile 688 {
689 GFX_write_string(&FontT42,tXc1,text,0);
690 tXc1->WindowY0 = 100;
691 }
692 else
693 {
694 GFX_write_string(&FontT42,tXc2,text,0);
695 tXc2->WindowY1 -= 100; /* jump to upper of two lines */
696 }
626 697
627 snprintf(text,TEXTSIZE,"\020\016%01.1f",unit_depth_float(stateUsed->lifeData.apnea_last_max_depth_meter)); 698 snprintf(text,TEXTSIZE,"\020\016%01.1f",unit_depth_float(stateUsed->lifeData.apnea_last_max_depth_meter));
628 t3_basics_colorscheme_mod(text); 699 t3_basics_colorscheme_mod(text);
629 GFX_write_string(&FontT105,tXc1,text,0); 700
630 701 if(!pSettings->FlipDisplay)
631 tXc1->WindowY0 = tempWinY0; // wieder unten 702 {
703 GFX_write_string(&FontT105,tXc1,text,0);
704 tXc1->WindowY0 = tempWinY0;
705 }
706 else
707 {
708 GFX_write_string(&FontT105,tXc2,text,0);
709 tXc2->WindowY1 = tempWinC2Y1; /* jump to upper of two lines */
710 }
711
632 712
633 snprintf(text,TEXTSIZE,"\020\016%01.1f",unit_depth_float(stateUsed->lifeData.apnea_total_max_depth_meter)); 713 snprintf(text,TEXTSIZE,"\020\016%01.1f",unit_depth_float(stateUsed->lifeData.apnea_total_max_depth_meter));
634 t3_basics_colorscheme_mod(text); 714 t3_basics_colorscheme_mod(text);
635 GFX_write_string(&FontT105,tXc1,text,0); 715 if(!pSettings->FlipDisplay)
716 {
717 GFX_write_string(&FontT105,tXc1,text,0);
718 }
719 else
720 {
721 GFX_write_string(&FontT105,tXc2,text,0);
722 }
636 break; 723 break;
637 724
638 case CVIEW_T3_StopWatch: 725 case CVIEW_T3_StopWatch:
639 726
640 tempWinX0 = tXc1->WindowX0; 727 tempWinX0 = tXc1->WindowX0;
693 GFX_write_string(&FontT42,tXc1,text,0); 780 GFX_write_string(&FontT42,tXc1,text,0);
694 781
695 textpointer = 0; 782 textpointer = 0;
696 tempWinC2X0 = tXc2->WindowX0; 783 tempWinC2X0 = tXc2->WindowX0;
697 tempWinC2Tab = tXc2->WindowTab; 784 tempWinC2Tab = tXc2->WindowTab;
698
699 tXc2->WindowX0 = 0; 785 tXc2->WindowX0 = 0;
700 tXc2->WindowTab = 800/2; 786 tXc2->WindowTab = 800/2;
787
788 if(pSettings->FlipDisplay)
789 {
790 tXc2->WindowY1 = 0;
791 }
701 792
702 pGasLine = settingsGetPointer()->gas; 793 pGasLine = settingsGetPointer()->gas;
703 if(actualLeftMaxDepth(stateUsed)) 794 if(actualLeftMaxDepth(stateUsed))
704 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_deco) / 100; 795 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_deco) / 100;
705 else 796 else
837 } 928 }
838 break; 929 break;
839 930
840 case CVIEW_T3_MaxDepth: 931 case CVIEW_T3_MaxDepth:
841 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth); 932 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth);
842 GFX_write_string(&FontT42,tXc1,text,0); 933 if(pSettings->FlipDisplay)
934 {
935 if(mode == DIVEMODE_Apnea)
936 {
937 GFX_write_string(&FontT42,tXc2,text,0);
938 }
939 else
940 {
941 GFX_write_string(&FontT42,tXc1,text,0);
942 }
943 }
944 else
945 {
946 GFX_write_string(&FontT42,tXc1,text,0);
947 }
843 snprintf(text,TEXTSIZE,"\020\003\016%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter)); 948 snprintf(text,TEXTSIZE,"\020\003\016%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter));
844 t3_basics_colorscheme_mod(text); 949 t3_basics_colorscheme_mod(text);
845 GFX_write_string(&FontT105,tXc1,text,1); 950 if(pSettings->FlipDisplay)
951 {
952 if(mode == DIVEMODE_Apnea)
953 {
954 GFX_write_string(&FontT105,tXc2,text,0);
955 }
956 else
957 {
958 GFX_write_string(&FontT105,tXc1,text,0);
959 }
960 }
961 else
962 {
963 GFX_write_string(&FontT105,tXc1,text,1);
964 }
846 break; 965 break;
847 966
848 case CVIEW_T3_TTS: 967 case CVIEW_T3_TTS:
849 snprintf(text,TEXTSIZE,"\032\f%c",TXT_TTS); 968 snprintf(text,TEXTSIZE,"\032\f%c",TXT_TTS);
850 GFX_write_string(&FontT42,tXc1,text,0); 969 GFX_write_string(&FontT42,tXc1,text,0);
879 GFX_write_string(&FontT48,tXc1,text,1); 998 GFX_write_string(&FontT48,tXc1,text,1);
880 break; 999 break;
881 } 1000 }
882 tXc1->WindowX0 = tempWinX0; 1001 tXc1->WindowX0 = tempWinX0;
883 tXc1->WindowY0 = tempWinY0; 1002 tXc1->WindowY0 = tempWinY0;
1003
884 tXc2->WindowX0 = tempWinC2X0; 1004 tXc2->WindowX0 = tempWinC2X0;
1005 tXc2->WindowY0 = tempWinC2Y0;
1006 tXc2->WindowX1 = tempWinC2X1;
1007 tXc2->WindowY1 = tempWinC2Y1;
885 tXc2->WindowTab = tempWinC2Tab; 1008 tXc2->WindowTab = tempWinC2Tab;
886 } 1009 }
887 1010
888 1011
889 uint8_t t3_test_customview_warnings(void) 1012 uint8_t t3_test_customview_warnings(void)