comparison Discovery/Src/t7.c @ 675:3c4a3d78ff2b Betatest

Bugfix: Missing flip screen support for charge view The new charge view was not displayed correct in case the option "Flip screen" was selected. Drawing parameter have not been adapted to show the view correctly.
author Ideenmodellierer
date Wed, 30 Mar 2022 18:07:21 +0200
parents c00a80f26641
children 5575f21382d5
comparison
equal deleted inserted replaced
674:8ebf7a27c189 675:3c4a3d78ff2b
3942 uint16_t hoursto100 = 0; 3942 uint16_t hoursto100 = 0;
3943 char indicator = '~'; 3943 char indicator = '~';
3944 3944
3945 point_t start, stop; 3945 point_t start, stop;
3946 3946
3947 SWindowGimpStyle wintemp;
3948 SSettings* pSettings;
3949 pSettings = settingsGetPointer();
3950
3947 t7cY0free.WindowLineSpacing = 28 + 48 + 14; 3951 t7cY0free.WindowLineSpacing = 28 + 48 + 14;
3948 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; 3952 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing;
3949 t7cY0free.WindowNumberOfTextLines = 3; 3953 t7cY0free.WindowNumberOfTextLines = 3;
3954
3955
3956 if(pSettings->FlipDisplay)
3957 {
3958 t7cY0free.WindowY0 = t7cH.WindowY0 + 15;
3959 t7cY0free.WindowY1 = t7cY0free.WindowY0 + 250;
3960 }
3950 3961
3951 localCharge = stateUsed->lifeData.battery_charge; 3962 localCharge = stateUsed->lifeData.battery_charge;
3952 if(localCharge < 0.0) 3963 if(localCharge < 0.0)
3953 { 3964 {
3954 localCharge *= -1.0; 3965 localCharge *= -1.0;
3985 if(hoursto100 < 1) 3996 if(hoursto100 < 1)
3986 { 3997 {
3987 indicator = '<'; 3998 indicator = '<';
3988 hoursto100 = 1; 3999 hoursto100 = 1;
3989 } 4000 }
3990 t7cY0free.WindowY0 -= 52; 4001
4002 if(!pSettings->FlipDisplay)
4003 {
4004 t7cY0free.WindowY0 -= 52;
4005 }
4006 else
4007 {
4008 t7cY0free.WindowY1 += 52;
4009 }
3991 4010
3992 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->chargeStatus != CHARGER_off)) 4011 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->chargeStatus != CHARGER_off))
3993 { 4012 {
3994 snprintf(text,60, 4013 snprintf(text,60,
3995 "\001%0.2f\n\r" 4014 "\001%0.2f\n\r"
4004 "\001---\n\r" 4023 "\001---\n\r"
4005 "\001---\n\r"); 4024 "\001---\n\r");
4006 } 4025 }
4007 GFX_write_string(&FontT42, &t7cY0free, text, 1); 4026 GFX_write_string(&FontT42, &t7cY0free, text, 1);
4008 4027
4009 SWindowGimpStyle wintemp;
4010 SSettings* pSettings;
4011 pSettings = settingsGetPointer();
4012
4013
4014
4015 wintemp.left = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + 50; 4028 wintemp.left = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + 50;
4016 wintemp.right = wintemp.left + CUSTOMBOX_SPACE_INSIDE - 100; 4029 wintemp.right = wintemp.left + CUSTOMBOX_SPACE_INSIDE - 100;
4017 4030
4018 4031
4019 if(!pSettings->FlipDisplay) 4032 if(!pSettings->FlipDisplay)
4021 wintemp.top = 480 - t7l1.WindowY0 + 115; 4034 wintemp.top = 480 - t7l1.WindowY0 + 115;
4022 wintemp.bottom = wintemp.top + 100; 4035 wintemp.bottom = wintemp.top + 100;
4023 } 4036 }
4024 else 4037 else
4025 { 4038 {
4026 wintemp.top = t7l1.WindowY1; 4039 wintemp.top = t7l1.WindowY1 + 102;
4027 wintemp.bottom = wintemp.top + 200; 4040 wintemp.bottom = wintemp.top + 100;
4028 } 4041 }
4029 4042
4030 start.x = wintemp.left-5; 4043 start.x = wintemp.left-5;
4031 //start.y = wintemp.top + 100;
4032 start.y = 90; 4044 start.y = 90;
4033 4045
4034 stop.x = wintemp.right + 5 - start.x; 4046 stop.x = wintemp.right + 5 - start.x;
4035 //stop.y = wintemp.bottom - start.y;
4036 stop.y = 100; 4047 stop.y = 100;
4037 GFX_draw_box(&t7screen, start, stop,1, CLUT_Font020); 4048 GFX_draw_box(&t7screen, start, stop,1, CLUT_Font020);
4038 4049
4039 if(stateUsed->chargeStatus != CHARGER_off) 4050 if(stateUsed->chargeStatus != CHARGER_off)
4040 { 4051 {