comparison Discovery/Src/t7.c @ 1006:75f958ca5d0e GasConsumption

Minor modification activ gas indicator: On the main screen the active gas is visualized by a number and a box around it.The box as well as the number started at coordinate 0 resultiong of a very close drawing of box and number. To improve this a small gap is added between box and number and the box itself was enlarged. With the OSTC5 a problem with the pixel sync was solfed which caused the first column to not be drawn.
author Ideenmodellierer
date Sat, 03 May 2025 17:52:05 +0200
parents 5a690195b6b7
children 23c405d5a766
comparison
equal deleted inserted replaced
1005:85f7e19c6688 1006:75f958ca5d0e
1063 GFX_write_string(&FontT48,&t7surfaceL,text,6); 1063 GFX_write_string(&FontT48,&t7surfaceL,text,6);
1064 } 1064 }
1065 else 1065 else
1066 { 1066 {
1067 textIdx = 0; 1067 textIdx = 0;
1068
1068 if(isLoopMode(stateUsed->diveSettings.diveMode)) 1069 if(isLoopMode(stateUsed->diveSettings.diveMode))
1069 gasOffset = NUM_OFFSET_DILUENT; 1070 gasOffset = NUM_OFFSET_DILUENT;
1070 else 1071 else
1071 gasOffset = 0; 1072 gasOffset = 0;
1072 1073
1093 text[textIdx++] = '\177'; 1094 text[textIdx++] = '\177';
1094 text[textIdx++] = '\177'; 1095 text[textIdx++] = '\177';
1095 text[textIdx++] = 10; 1096 text[textIdx++] = 10;
1096 } 1097 }
1097 text[textIdx++] = 0; 1098 text[textIdx++] = 0;
1099 if(!pSettings->FlipDisplay)
1100 {
1101 t7surfaceL.WindowX0 +=5;
1102 }
1103 else
1104 {
1105 t7surfaceL.WindowX1 -=2;
1106 }
1098 GFX_write_string(&FontT48,&t7surfaceL,text,6); 1107 GFX_write_string(&FontT48,&t7surfaceL,text,6);
1099 1108 if(!pSettings->FlipDisplay)
1100 1109 {
1110 t7surfaceL.WindowX0 -=5;
1111 }
1112 else
1113 {
1114 t7surfaceL.WindowX1 +=2;
1115 }
1101 oxygen_percentage = 100; 1116 oxygen_percentage = 100;
1102 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage; 1117 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage;
1103 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage; 1118 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage;
1104 1119
1105 tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&text[0]); 1120 tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&text[0]);
1119 if(actualGasID > gasOffset) // security 1134 if(actualGasID > gasOffset) // security
1120 { 1135 {
1121 if(!pSettings->FlipDisplay) 1136 if(!pSettings->FlipDisplay)
1122 { 1137 {
1123 start.y = t7surfaceL.WindowY0 + (3 * t7surfaceL.WindowLineSpacing); 1138 start.y = t7surfaceL.WindowY0 + (3 * t7surfaceL.WindowLineSpacing);
1124 start.x = t7surfaceL.WindowX0 + ((stateUsed->lifeData.actualGas.GasIdInSettings - gasOffset - 1) * 35); 1139 start.x = t7surfaceL.WindowX0 + ((stateUsed->lifeData.actualGas.GasIdInSettings - gasOffset - 1) * 35) + 2;
1125 } 1140 }
1126 else 1141 else
1127 { 1142 {
1128 start.y = t7surfaceR.WindowY0 + (3 * t7surfaceR.WindowLineSpacing); 1143 start.y = t7surfaceR.WindowY0 + (3 * t7surfaceR.WindowLineSpacing);
1129 start.x = t7surfaceR.WindowX0 + ((stateUsed->lifeData.actualGas.GasIdInSettings - gasOffset - 1) * 35); 1144 start.x = t7surfaceR.WindowX0 + ((stateUsed->lifeData.actualGas.GasIdInSettings - gasOffset - 1) * 35);
1130 } 1145 }
1131 1146
1132 stop.x = start.x + 25; 1147 stop.x = start.x + 29;
1133 stop.y = start.y + 52; 1148 stop.y = start.y + 52;
1134 GFX_draw_box2(&t7screen, start, stop, CLUT_Font020, 1); 1149 GFX_draw_box2(&t7screen, start, stop, CLUT_Font020, 1);
1135 } 1150 }
1136 } 1151 }
1137 1152