Mercurial > public > ostc4
comparison Discovery/Src/t7.c @ 351:ba53ab77f059
Merge
author | heinrichsweikamp |
---|---|
date | Sun, 06 Oct 2019 14:12:41 +0200 |
parents | 84f5c18b74ea |
children | 14fd5f35cb50 |
comparison
equal
deleted
inserted
replaced
341:591c03a1e68d | 351:ba53ab77f059 |
---|---|
1142 else | 1142 else |
1143 t7_refresh_customview(); | 1143 t7_refresh_customview(); |
1144 draw_frame(0,0, CLUT_pluginboxSurface, CLUT_Font020); | 1144 draw_frame(0,0, CLUT_pluginboxSurface, CLUT_Font020); |
1145 } | 1145 } |
1146 | 1146 |
1147 void t7_refresh_surface_debugmode_wireless_info(void) | |
1148 { | |
1149 char text[400]; | |
1150 uint8_t colorDataLost = 0; | |
1151 int txtPointer = 0; | |
1152 uint8_t numberOfBytes = 0; | |
1153 | |
1154 GFX_DrawCfgWindow textWindow = | |
1155 { | |
1156 .Image = &t7screen, | |
1157 .WindowNumberOfTextLines = 5, | |
1158 .WindowLineSpacing = 70, | |
1159 .WindowTab = 220, | |
1160 .WindowX0 = 10, | |
1161 .WindowX1 = 790, | |
1162 .WindowY0 = 10, | |
1163 .WindowY1 = 380 | |
1164 }; | |
1165 | |
1166 Gfx_write_label_var(&t7screen, 10,600, 10,&FontT42,CLUT_DiveMainLabel,"Wireless Data"); | |
1167 | |
1168 if(stateUsed->data_old__lost_connection_to_slave) | |
1169 { | |
1170 Gfx_write_label_var(&t7screen, 600,800,10,&FontT42,CLUT_Font020,"CPU2?"); | |
1171 colorDataLost = 1; | |
1172 } | |
1173 | |
1174 txtPointer = 0; | |
1175 for(int i=0;i<4;i++) | |
1176 { | |
1177 if((!stateUsed->lifeData.wireless_data[i].ageInMilliSeconds) || colorDataLost) | |
1178 text[txtPointer++] = '\021'; | |
1179 | |
1180 numberOfBytes = stateUsed->lifeData.wireless_data[i].numberOfBytes; | |
1181 if((numberOfBytes > 0) && (numberOfBytes <= 10)) | |
1182 { | |
1183 txtPointer += snprintf(&text[txtPointer],20,"%02u s %02u\t" | |
1184 ,(stateUsed->lifeData.wireless_data[i].ageInMilliSeconds)/1000 | |
1185 ,stateUsed->lifeData.wireless_data[i].status | |
1186 ); | |
1187 if(numberOfBytes > 8) ///< lifeData.wireless_data[i].data[j] has only size of 8 | |
1188 numberOfBytes = 8; | |
1189 for(int j=0;j<numberOfBytes;j++) | |
1190 { | |
1191 txtPointer += snprintf(&text[txtPointer],4," %02X" | |
1192 ,stateUsed->lifeData.wireless_data[i].data[j] | |
1193 ); | |
1194 } | |
1195 } | |
1196 text[txtPointer++] = '\n'; | |
1197 text[txtPointer++] = '\r'; | |
1198 text[txtPointer++] = '\020'; | |
1199 text[txtPointer] = 0; | |
1200 } | |
1201 GFX_write_string(&FontT48,&textWindow,text,1); | |
1202 | |
1203 } | |
1204 | |
1205 | |
1206 void t7_refresh_surface_debugmode(void) | 1147 void t7_refresh_surface_debugmode(void) |
1207 { | 1148 { |
1208 if(selection_customview%2 == 1) | |
1209 { | |
1210 t7_refresh_surface_debugmode_wireless_info(); | |
1211 return; | |
1212 } | |
1213 | |
1214 // could be warning, now just to set RTE variables | 1149 // could be warning, now just to set RTE variables |
1215 DataEX_check_RTE_version__needs_update(); | 1150 DataEX_check_RTE_version__needs_update(); |
1216 | 1151 |
1217 | 1152 |
1218 char TextL1[4*TEXTSIZE]; | 1153 char TextL1[4*TEXTSIZE]; |
1310 | 1245 |
1311 // snprintf(TextL1,TEXTSIZE,"# %u",stateUsed->lifeData.ambient_light_level); | 1246 // snprintf(TextL1,TEXTSIZE,"# %u",stateUsed->lifeData.ambient_light_level); |
1312 // Gfx_write_label_var(&t7screen, 601,800,310,&FontT42,CLUT_DiveMainLabel,"Light"); | 1247 // Gfx_write_label_var(&t7screen, 601,800,310,&FontT42,CLUT_DiveMainLabel,"Light"); |
1313 // Gfx_write_label_var(&t7screen, 601,800,355,&FontT48,CLUT_Font020,TextL1); | 1248 // Gfx_write_label_var(&t7screen, 601,800,355,&FontT48,CLUT_Font020,TextL1); |
1314 | 1249 |
1250 /* show surface pressure state */ | |
1251 if(stateUsed->lifeData.bool_temp1 ) | |
1252 { | |
1253 snprintf(TextL1,TEXTSIZE,"stable"); | |
1254 } | |
1255 else | |
1256 { | |
1257 snprintf(TextL1,TEXTSIZE,"unstable"); | |
1258 } | |
1259 Gfx_write_label_var(&t7screen, 500,800,400,&FontT48,CLUT_Font020,TextL1); | |
1315 | 1260 |
1316 | 1261 |
1317 if(Sdate.Year < 15) | 1262 if(Sdate.Year < 15) |
1318 { | 1263 { |
1319 if(warning_count_high_time) | 1264 if(warning_count_high_time) |