comparison Discovery/Src/tInfoSensor.c @ 826:a370741a743b Evo_2_23

Bugfix Line order of info screen with flip screen active: In the previous version the order of the line in flipping mode (top to bottom) was 6,5,4,3,2,1 instead of 1,2,3,4,5,6. This effected the compass calibration as well as the sensor info view. The problem was solved by adapting the Y calculation. In addition the size of the SensorInfo screen was corrected to avoid clipping issues in flipped mode.
author Ideenmodellierer
date Wed, 11 Oct 2023 17:49:19 +0200
parents 19ab6f3ed52a
children ffb1036c27c2
comparison
equal deleted inserted replaced
824:2a9a47547b05 826:a370741a743b
155 text[2] = ' '; 155 text[2] = ' ';
156 text[3] = TXT_Information; 156 text[3] = TXT_Information;
157 text[4] = ' '; 157 text[4] = ' ';
158 text[5] = '1' + activeSensorId; 158 text[5] = '1' + activeSensorId;
159 text[6] = 0; 159 text[6] = 0;
160 tInfo_write_content_simple( 30, 340, ME_Y_LINE_BASE, &FontT48, text, CLUT_MenuPageHardware); 160 tInfo_write_content_simple( 30, 770, ME_Y_LINE_BASE, &FontT48, text, CLUT_MenuPageHardware);
161 161
162 pDiveO2Data = (SSensorDataDiveO2*)&stateRealGetPointer()->lifeData.extIf_sensor_data[activeSensorId]; 162 pDiveO2Data = (SSensorDataDiveO2*)&stateRealGetPointer()->lifeData.extIf_sensor_data[activeSensorId];
163 163
164 strIndex = snprintf(text,32,"ID: "); 164 strIndex = snprintf(text,32,"ID: ");
165 if(pDiveO2Data->sensorId != 0) 165 if(pDiveO2Data->sensorId != 0)
166 { 166 {
167 uint64ToString(pDiveO2Data->sensorId,&text[strIndex]); 167 uint64ToString(pDiveO2Data->sensorId,&text[strIndex]);
168 } 168 }
169 tInfo_write_content_simple( 30, 340, ME_Y_LINE1, &FontT48, text, CLUT_Font020); 169 tInfo_write_content_simple( 30, 770, ME_Y_LINE1, &FontT48, text, CLUT_Font020);
170 snprintf(text,32,"%c: %02.1f",TXT_Temperature , (float)pDiveO2Data->temperature / 1000.0); 170 snprintf(text,32,"%c: %02.1f",TXT_Temperature , (float)pDiveO2Data->temperature / 1000.0);
171 tInfo_write_content_simple( 30, 340, ME_Y_LINE2, &FontT48, text, CLUT_Font020); 171 tInfo_write_content_simple( 30, 770, ME_Y_LINE2, &FontT48, text, CLUT_Font020);
172 172
173 #ifdef ENABLE_EXTERNAL_PRESSURE 173 #ifdef ENABLE_EXTERNAL_PRESSURE
174 pressure = (float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[2]); 174 pressure = (float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[2]);
175 #else 175 #else
176 pressure = (float)pDiveO2Data->pressure / 1000.0; 176 pressure = (float)pDiveO2Data->pressure / 1000.0;
177 #endif 177 #endif
178 snprintf(text,32,"Druck: %02.1f (%02.1f)", (float)pDiveO2Data->pressure / 1000.0, pressure *1000.0); 178 snprintf(text,32,"Druck: %02.1f (%02.1f)", (float)pDiveO2Data->pressure / 1000.0, pressure *1000.0);
179 179
180 tInfo_write_content_simple( 30, 340, ME_Y_LINE3, &FontT48, text, CLUT_Font020); 180 tInfo_write_content_simple( 30, 770, ME_Y_LINE3, &FontT48, text, CLUT_Font020);
181 snprintf(text,32,"Feuchtigkeit: %02.1f", (float)pDiveO2Data->humidity / 1000.0); 181 snprintf(text,32,"Feuchtigkeit: %02.1f", (float)pDiveO2Data->humidity / 1000.0);
182 tInfo_write_content_simple( 30, 340, ME_Y_LINE4, &FontT48, text, CLUT_Font020); 182 tInfo_write_content_simple( 30, 770, ME_Y_LINE4, &FontT48, text, CLUT_Font020);
183 snprintf(text,32,"Status: 0x%lx", pDiveO2Data->status); 183 snprintf(text,32,"Status: 0x%lx", pDiveO2Data->status);
184 tInfo_write_content_simple( 30, 340, ME_Y_LINE5, &FontT48, text, CLUT_Font020); 184 tInfo_write_content_simple( 30, 770, ME_Y_LINE5, &FontT48, text, CLUT_Font020);
185 #ifdef ENABLE_EXTERNAL_PRESSURE 185 #ifdef ENABLE_EXTERNAL_PRESSURE
186 snprintf(text,32,"Norm ppO2: %02.3f (%02.1f)", (float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[0] / (pressure / 1000.0)),(float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[0])); 186 snprintf(text,32,"Norm ppO2: %02.3f (%02.1f)", (float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[0] / (pressure / 1000.0)),(float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[0]));
187 tInfo_write_content_simple( 30, 340, ME_Y_LINE6, &FontT48, text, CLUT_Font020); 187 tInfo_write_content_simple( 30, 770, ME_Y_LINE6, &FontT48, text, CLUT_Font020);
188 #endif 188 #endif
189 189
190 if(sensorActive) 190 if(sensorActive)
191 { 191 {
192 *textPointer++ = '\005'; 192 *textPointer++ = '\005';
203 *textPointer++ = TXT2BYTE_O2IFDigital; 203 *textPointer++ = TXT2BYTE_O2IFDigital;
204 *textPointer++ = '1' + activeSensorId; 204 *textPointer++ = '1' + activeSensorId;
205 205
206 snprintf(textPointer, 20,": %01.2f, %01.1f mV", pStateReal->lifeData.ppO2Sensor_bar[activeSensorId], pStateReal->lifeData.sensorVoltage_mV[activeSensorId]); 206 snprintf(textPointer, 20,": %01.2f, %01.1f mV", pStateReal->lifeData.ppO2Sensor_bar[activeSensorId], pStateReal->lifeData.sensorVoltage_mV[activeSensorId]);
207 207
208 tInfo_write_content_simple( 30, 340, ME_Y_LINE6, &FontT48, text, CLUT_Font020); 208 tInfo_write_content_simple( 30, 770, ME_Y_LINE6, &FontT48, text, CLUT_Font020);
209 209
210 tInfo_write_buttonTextline_simple(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,0); 210 tInfo_write_buttonTextline_simple(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,0);
211 } 211 }
212 212
213 void sendActionToInfoSensor(uint8_t sendAction) 213 void sendActionToInfoSensor(uint8_t sendAction)