changeset 934:406d498786e7 Evo_2_23

Position visualization: Splitted view into two steps. In the first step only the number of available satellietes and 4 states are shown. If a fix (valid position) is available then the display shows the coordinates. This avoids misunderstandings because if there was once a position information then it will be provided even no valid fix is available.
author Ideenmodellierer
date Sun, 08 Dec 2024 21:56:48 +0100
parents 43055e069bd1
children f2494a708f52
files Discovery/Src/t7.c
diffstat 1 files changed, 46 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/t7.c	Sun Dec 08 17:38:16 2024 +0100
+++ b/Discovery/Src/t7.c	Sun Dec 08 21:56:48 2024 +0100
@@ -4035,27 +4035,60 @@
 {
     char text[256+50];
     uint8_t textpointer = 0;
+    point_t start, stop;
+    uint8_t index = 0;
+    uint8_t color = 0;
 
     t7cY0free.WindowLineSpacing = 28 + 48 + 14;
     t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing;
     t7cY0free.WindowNumberOfTextLines = 3;
-
-    textpointer += snprintf(&text[textpointer],50,"\001Satellites\n\r");
-    textpointer += snprintf(&text[textpointer],50,"\001Longitude\n\r");
-    textpointer += snprintf(&text[textpointer],50,"\001Latitude\n\r");
+    t7cY0free.WindowY0 -= 20;
+    if(stateUsed->lifeData.gnssData.fixType < 2)
+    {
+    	textpointer += snprintf(&text[textpointer],50,"\001Satellites\n\r");
+    	textpointer += snprintf(&text[textpointer],50,"\001Status\n\r");
+    }
+    else
+    {
+		textpointer += snprintf(&text[textpointer],50,"\001Longitude\n\r");
+		textpointer += snprintf(&text[textpointer],50,"\001Latitude\n\r");
+    }
     GFX_write_string(&FontT24, &t7cY0free, text, 1);
 
     t7cY0free.WindowY0 -= 52;
-    snprintf(text,60,
-    	"\001%d - %d %d %d %d %d\n\r"
-        "\001%0.5f\n\r"
-        "\001%0.5f\n\r"
-    	,stateUsed->lifeData.gnssData.numSat, stateUsed->lifeData.gnssData.fixType
-    	,stateUsed->lifeData.gnssData.signalQual[0],stateUsed->lifeData.gnssData.signalQual[1],stateUsed->lifeData.gnssData.signalQual[2],stateUsed->lifeData.gnssData.signalQual[3]
-        ,stateUsed->lifeData.gnssData.fLat
-		,stateUsed->lifeData.gnssData.fLon );
-
+    if(stateUsed->lifeData.gnssData.fixType < 2)
+    {
+		snprintf(text,60,"\001%d\n\r",stateUsed->lifeData.gnssData.numSat);
+    }
+    else
+    {
+    	snprintf(text,60,
+    			"\001%0.5f\n\r"
+    			"\001%0.5f\n\r"
+    			,stateUsed->lifeData.gnssData.fLat ,stateUsed->lifeData.gnssData.fLon);
+    }
     GFX_write_string(&FontT42, &t7cY0free, text, 1);
+
+    if(stateUsed->lifeData.gnssData.fixType < 2)	/* draw status bars */
+    {
+    	start.x = t7cY0free.WindowX0 + 85;
+    	stop.x = start.x;
+    	start.y = t7cY0free.WindowY0 + 75;
+    	stop.y = start.y + 20;
+    	while((index < stateUsed->lifeData.gnssData.numSat) && (index < 4))
+    	{
+    		if(stateUsed->lifeData.gnssData.signalQual[index] > 4) color = CLUT_NiceGreen;
+    		if((stateUsed->lifeData.gnssData.signalQual[index] > 2) && (stateUsed->lifeData.gnssData.signalQual[index] <= 4)) color = CLUT_WarningYellow;
+    		if(stateUsed->lifeData.gnssData.signalQual[index] <= 2) color = CLUT_WarningRed;
+    		GFX_draw_thick_line(20, &t7screen, start, stop, color);
+    		start.x += 40;
+    		stop.x += 40;
+
+    		index++;
+    	}
+    }
+
+
 }
 void t7_SummaryOfLeftCorner(void)
 {