comparison Discovery/Src/t7.c @ 382:14fd5f35cb50 MotionDetection

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