Mercurial > public > ostc4
comparison Discovery/Src/t7.c @ 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 | 5a9bc2e6112d |
children |
comparison
equal
deleted
inserted
replaced
933:43055e069bd1 | 934:406d498786e7 |
---|---|
4033 | 4033 |
4034 void t7_showPosition(void) | 4034 void t7_showPosition(void) |
4035 { | 4035 { |
4036 char text[256+50]; | 4036 char text[256+50]; |
4037 uint8_t textpointer = 0; | 4037 uint8_t textpointer = 0; |
4038 point_t start, stop; | |
4039 uint8_t index = 0; | |
4040 uint8_t color = 0; | |
4038 | 4041 |
4039 t7cY0free.WindowLineSpacing = 28 + 48 + 14; | 4042 t7cY0free.WindowLineSpacing = 28 + 48 + 14; |
4040 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; | 4043 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; |
4041 t7cY0free.WindowNumberOfTextLines = 3; | 4044 t7cY0free.WindowNumberOfTextLines = 3; |
4042 | 4045 t7cY0free.WindowY0 -= 20; |
4043 textpointer += snprintf(&text[textpointer],50,"\001Satellites\n\r"); | 4046 if(stateUsed->lifeData.gnssData.fixType < 2) |
4044 textpointer += snprintf(&text[textpointer],50,"\001Longitude\n\r"); | 4047 { |
4045 textpointer += snprintf(&text[textpointer],50,"\001Latitude\n\r"); | 4048 textpointer += snprintf(&text[textpointer],50,"\001Satellites\n\r"); |
4049 textpointer += snprintf(&text[textpointer],50,"\001Status\n\r"); | |
4050 } | |
4051 else | |
4052 { | |
4053 textpointer += snprintf(&text[textpointer],50,"\001Longitude\n\r"); | |
4054 textpointer += snprintf(&text[textpointer],50,"\001Latitude\n\r"); | |
4055 } | |
4046 GFX_write_string(&FontT24, &t7cY0free, text, 1); | 4056 GFX_write_string(&FontT24, &t7cY0free, text, 1); |
4047 | 4057 |
4048 t7cY0free.WindowY0 -= 52; | 4058 t7cY0free.WindowY0 -= 52; |
4049 snprintf(text,60, | 4059 if(stateUsed->lifeData.gnssData.fixType < 2) |
4050 "\001%d - %d %d %d %d %d\n\r" | 4060 { |
4051 "\001%0.5f\n\r" | 4061 snprintf(text,60,"\001%d\n\r",stateUsed->lifeData.gnssData.numSat); |
4052 "\001%0.5f\n\r" | 4062 } |
4053 ,stateUsed->lifeData.gnssData.numSat, stateUsed->lifeData.gnssData.fixType | 4063 else |
4054 ,stateUsed->lifeData.gnssData.signalQual[0],stateUsed->lifeData.gnssData.signalQual[1],stateUsed->lifeData.gnssData.signalQual[2],stateUsed->lifeData.gnssData.signalQual[3] | 4064 { |
4055 ,stateUsed->lifeData.gnssData.fLat | 4065 snprintf(text,60, |
4056 ,stateUsed->lifeData.gnssData.fLon ); | 4066 "\001%0.5f\n\r" |
4057 | 4067 "\001%0.5f\n\r" |
4068 ,stateUsed->lifeData.gnssData.fLat ,stateUsed->lifeData.gnssData.fLon); | |
4069 } | |
4058 GFX_write_string(&FontT42, &t7cY0free, text, 1); | 4070 GFX_write_string(&FontT42, &t7cY0free, text, 1); |
4071 | |
4072 if(stateUsed->lifeData.gnssData.fixType < 2) /* draw status bars */ | |
4073 { | |
4074 start.x = t7cY0free.WindowX0 + 85; | |
4075 stop.x = start.x; | |
4076 start.y = t7cY0free.WindowY0 + 75; | |
4077 stop.y = start.y + 20; | |
4078 while((index < stateUsed->lifeData.gnssData.numSat) && (index < 4)) | |
4079 { | |
4080 if(stateUsed->lifeData.gnssData.signalQual[index] > 4) color = CLUT_NiceGreen; | |
4081 if((stateUsed->lifeData.gnssData.signalQual[index] > 2) && (stateUsed->lifeData.gnssData.signalQual[index] <= 4)) color = CLUT_WarningYellow; | |
4082 if(stateUsed->lifeData.gnssData.signalQual[index] <= 2) color = CLUT_WarningRed; | |
4083 GFX_draw_thick_line(20, &t7screen, start, stop, color); | |
4084 start.x += 40; | |
4085 stop.x += 40; | |
4086 | |
4087 index++; | |
4088 } | |
4089 } | |
4090 | |
4091 | |
4059 } | 4092 } |
4060 void t7_SummaryOfLeftCorner(void) | 4093 void t7_SummaryOfLeftCorner(void) |
4061 { | 4094 { |
4062 char text[256+60]; | 4095 char text[256+60]; |
4063 uint8_t textpointer = 0; | 4096 uint8_t textpointer = 0; |