Mercurial > public > ostc4
comparison Discovery/Src/t7.c @ 969:81049905d829 Evo_2_23
Zusammenf?hren
| author | heinrichsweikamp |
|---|---|
| date | Sun, 19 Jan 2025 12:02:59 +0100 |
| parents | 3d8c22c1f9e2 |
| children | e7cd7ffd1879 |
comparison
equal
deleted
inserted
replaced
| 968:b9a1710522b1 | 969:81049905d829 |
|---|---|
| 1500 | 1500 |
| 1501 void t7_show_customview_warnings(void) | 1501 void t7_show_customview_warnings(void) |
| 1502 { | 1502 { |
| 1503 char text[256]; | 1503 char text[256]; |
| 1504 uint8_t textpointer, lineFree; | 1504 uint8_t textpointer, lineFree; |
| 1505 #ifdef HAVE_DEBUG_WARNINGS | |
| 1505 uint8_t index = 0; | 1506 uint8_t index = 0; |
| 1507 #endif | |
| 1506 | 1508 |
| 1507 text[0] = '\025'; | 1509 text[0] = '\025'; |
| 1508 text[1] = '\f'; | 1510 text[1] = '\f'; |
| 1509 text[2] = '\001'; | 1511 text[2] = '\001'; |
| 1510 text[3] = TXT_Warning; | 1512 text[3] = TXT_Warning; |
| 1612 text[textpointer] = 0; | 1614 text[textpointer] = 0; |
| 1613 lineFree--; | 1615 lineFree--; |
| 1614 } | 1616 } |
| 1615 */ | 1617 */ |
| 1616 GFX_write_string(&FontT48,&t7cW,text,1); | 1618 GFX_write_string(&FontT48,&t7cW,text,1); |
| 1619 requestBuzzerActivation(1); | |
| 1617 } | 1620 } |
| 1618 | 1621 |
| 1619 | 1622 |
| 1620 void t7_set_customview_to_primary(void) | 1623 void t7_set_customview_to_primary(void) |
| 1621 { | 1624 { |
| 2804 | 2807 |
| 2805 Gfx_colorsscheme_mod(TextL2, 0); | 2808 Gfx_colorsscheme_mod(TextL2, 0); |
| 2806 GFX_write_string(&FontT105,&t7l2,TextL2,1); | 2809 GFX_write_string(&FontT105,&t7l2,TextL2,1); |
| 2807 | 2810 |
| 2808 /* ascent rate graph */ | 2811 /* ascent rate graph */ |
| 2809 | 2812 color = 0xff; |
| 2810 if((pSettings->slowExitTime != 0) && (nextstopDepthMeter == 0) && (stateUsed->lifeData.depth_meter < pSettings->last_stop_depth_meter)) | 2813 if((pSettings->slowExitTime != 0) && (nextstopDepthMeter == 0) && (stateUsed->lifeData.depth_meter < pSettings->last_stop_depth_meter)) |
| 2811 { | 2814 { |
| 2812 color = t7_drawSlowExitGraph(); | 2815 color = t7_drawSlowExitGraph(); |
| 2813 } | 2816 } |
| 2814 else if(stateUsed->lifeData.ascent_rate_meter_per_min > 1) /* a value < 1 would cause a bar in negative direction brush rectangle of 12 and step width of 6 */ | 2817 if(color == 0xff) |
| 2815 { | 2818 { |
| 2816 color = drawingColor_from_ascentspeed(stateUsed->lifeData.ascent_rate_meter_per_min); | 2819 color = drawingColor_from_ascentspeed(stateUsed->lifeData.ascent_rate_meter_per_min); |
| 2817 t7_drawAcentGraph(color); | 2820 if(stateUsed->lifeData.ascent_rate_meter_per_min > 1) /* a value < 1 would cause a bar in negative direction brush rectangle of 12 and step width of 6 */ |
| 2818 } | 2821 { |
| 2819 | 2822 |
| 2823 t7_drawAcentGraph(color); | |
| 2824 } | |
| 2825 } | |
| 2820 | 2826 |
| 2821 /* depth */ | 2827 /* depth */ |
| 2822 float depth = unit_depth_float(stateUsed->lifeData.depth_meter); | 2828 float depth = unit_depth_float(stateUsed->lifeData.depth_meter); |
| 2823 | 2829 |
| 2824 if(depth <= 0.3f) | 2830 if(depth <= 0.3f) |
| 3215 | 3221 |
| 3216 background.pointer = 0; | 3222 background.pointer = 0; |
| 3217 if(customview_warnings && warning_count_high_time) | 3223 if(customview_warnings && warning_count_high_time) |
| 3218 t7_show_customview_warnings(); | 3224 t7_show_customview_warnings(); |
| 3219 else | 3225 else |
| 3226 { | |
| 3220 t7_refresh_customview(); | 3227 t7_refresh_customview(); |
| 3228 requestBuzzerActivation(0); | |
| 3229 } | |
| 3221 | 3230 |
| 3222 /* the frame */ | 3231 /* the frame */ |
| 3223 draw_frame(1,1, CLUT_DIVE_pluginbox, CLUT_DIVE_FieldSeperatorLines); | 3232 draw_frame(1,1, CLUT_DIVE_pluginbox, CLUT_DIVE_FieldSeperatorLines); |
| 3224 } | 3233 } |
| 3225 | 3234 |
| 4030 char text[256+50]; | 4039 char text[256+50]; |
| 4031 uint8_t textpointer = 0; | 4040 uint8_t textpointer = 0; |
| 4032 point_t start, stop; | 4041 point_t start, stop; |
| 4033 uint8_t index = 0; | 4042 uint8_t index = 0; |
| 4034 uint8_t color = 0; | 4043 uint8_t color = 0; |
| 4044 SSettings* pSettings = settingsGetPointer(); | |
| 4035 | 4045 |
| 4036 t7cY0free.WindowLineSpacing = 28 + 48 + 14; | 4046 t7cY0free.WindowLineSpacing = 28 + 48 + 14; |
| 4037 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; | 4047 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; |
| 4038 t7cY0free.WindowNumberOfTextLines = 3; | 4048 t7cY0free.WindowNumberOfTextLines = 3; |
| 4039 t7cY0free.WindowY0 -= 20; | 4049 t7cY0free.WindowY0 -= 20; |
| 4050 | |
| 4051 t7cY0free.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
| 4052 t7cY0free.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
| 4053 | |
| 4054 if(pSettings->FlipDisplay) | |
| 4055 { | |
| 4056 t7cY0free.WindowY0 = t7cH.WindowY0 + 15; | |
| 4057 t7cY0free.WindowY1 = t7cY0free.WindowY0 + 250; | |
| 4058 } | |
| 4059 | |
| 4040 if(stateUsed->lifeData.gnssData.fixType < 2) | 4060 if(stateUsed->lifeData.gnssData.fixType < 2) |
| 4041 { | 4061 { |
| 4042 textpointer += snprintf(&text[textpointer],50,"\001Satellites\n\r"); | 4062 textpointer += snprintf(&text[textpointer],50,"\001Satellites\n\r"); |
| 4043 if(stateUsed->lifeData.gnssData.alive & GNSS_ALIVE_STATE_TIME) | 4063 if(stateUsed->lifeData.gnssData.alive & GNSS_ALIVE_STATE_ALIVE) |
| 4044 { | 4064 { |
| 4045 textpointer += snprintf(&text[textpointer],50,"\001\020Status\n\r"); | 4065 textpointer += snprintf(&text[textpointer],50,"\001\020Status\n\r"); |
| 4046 } | 4066 } |
| 4047 else | 4067 else |
| 4048 { | 4068 { |
| 4054 textpointer += snprintf(&text[textpointer],50,"\001Longitude\n\r"); | 4074 textpointer += snprintf(&text[textpointer],50,"\001Longitude\n\r"); |
| 4055 textpointer += snprintf(&text[textpointer],50,"\001Latitude\n\r"); | 4075 textpointer += snprintf(&text[textpointer],50,"\001Latitude\n\r"); |
| 4056 } | 4076 } |
| 4057 GFX_write_string(&FontT24, &t7cY0free, text, 1); | 4077 GFX_write_string(&FontT24, &t7cY0free, text, 1); |
| 4058 | 4078 |
| 4059 t7cY0free.WindowY0 -= 52; | 4079 if(!pSettings->FlipDisplay) |
| 4080 { | |
| 4081 t7cY0free.WindowY0 -= 52; | |
| 4082 } | |
| 4083 else | |
| 4084 { | |
| 4085 t7cY0free.WindowY1 = 370; | |
| 4086 } | |
| 4087 | |
| 4060 if(stateUsed->lifeData.gnssData.fixType < 2) | 4088 if(stateUsed->lifeData.gnssData.fixType < 2) |
| 4061 { | 4089 { |
| 4062 snprintf(text,60,"\001%d\n\r",stateUsed->lifeData.gnssData.numSat); | 4090 snprintf(text,60,"\001%d\n\r",stateUsed->lifeData.gnssData.numSat); |
| 4063 } | 4091 } |
| 4064 else | 4092 else |
| 4070 } | 4098 } |
| 4071 GFX_write_string(&FontT42, &t7cY0free, text, 1); | 4099 GFX_write_string(&FontT42, &t7cY0free, text, 1); |
| 4072 | 4100 |
| 4073 if(stateUsed->lifeData.gnssData.fixType < 2) /* draw status bars */ | 4101 if(stateUsed->lifeData.gnssData.fixType < 2) /* draw status bars */ |
| 4074 { | 4102 { |
| 4075 start.x = t7cY0free.WindowX0 + 85; | 4103 if(!pSettings->FlipDisplay) |
| 4076 stop.x = start.x; | 4104 { |
| 4077 start.y = t7cY0free.WindowY0 + 75; | 4105 start.x = t7cY0free.WindowX0 + 85; |
| 4078 stop.y = start.y + 20; | 4106 stop.x = start.x; |
| 4107 start.y = t7cY0free.WindowY0 + 75; | |
| 4108 stop.y = start.y + 20; | |
| 4109 } | |
| 4110 else | |
| 4111 { | |
| 4112 start.x = t7cY0free.WindowX0 - 50; | |
| 4113 stop.x = start.x; | |
| 4114 start.y = t7cY0free.WindowY0 - 75; | |
| 4115 stop.y = start.y - 20; | |
| 4116 } | |
| 4117 | |
| 4079 while((index < stateUsed->lifeData.gnssData.numSat) && (index < 4)) | 4118 while((index < stateUsed->lifeData.gnssData.numSat) && (index < 4)) |
| 4080 { | 4119 { |
| 4081 if(stateUsed->lifeData.gnssData.signalQual[index] > 4) color = CLUT_NiceGreen; | 4120 if(stateUsed->lifeData.gnssData.signalQual[index] > 4) color = CLUT_NiceGreen; |
| 4082 if((stateUsed->lifeData.gnssData.signalQual[index] > 2) && (stateUsed->lifeData.gnssData.signalQual[index] <= 4)) color = CLUT_WarningYellow; | 4121 if((stateUsed->lifeData.gnssData.signalQual[index] > 2) && (stateUsed->lifeData.gnssData.signalQual[index] <= 4)) color = CLUT_WarningYellow; |
| 4083 if(stateUsed->lifeData.gnssData.signalQual[index] <= 2) color = CLUT_WarningRed; | 4122 if(stateUsed->lifeData.gnssData.signalQual[index] <= 2) color = CLUT_WarningRed; |
| 4084 GFX_draw_thick_line(20, &t7screen, start, stop, color); | 4123 GFX_draw_thick_line(20, &t7screen, start, stop, color); |
| 4085 start.x += 40; | 4124 start.x += 40; |
| 4086 stop.x += 40; | 4125 stop.x += 40; |
| 4087 | 4126 |
| 4088 index++; | 4127 index++; |
| 4128 } | |
| 4129 if(stateUsed->lifeData.gnssData.alive & GNSS_ALIVE_BACKUP_POS) | |
| 4130 { | |
| 4131 snprintf(text,50,"\001%2.2f %2.2f", stateUsed->lifeData.gnssData.coord.fLat,stateUsed->lifeData.gnssData.coord.fLon); | |
| 4132 GFX_write_string(&FontT24, &t7cY0free, text, 3); | |
| 4089 } | 4133 } |
| 4090 } | 4134 } |
| 4091 | 4135 |
| 4092 | 4136 |
| 4093 } | 4137 } |
| 4696 { | 4740 { |
| 4697 t7cY0free.WindowY0 -= 52; | 4741 t7cY0free.WindowY0 -= 52; |
| 4698 } | 4742 } |
| 4699 else | 4743 else |
| 4700 { | 4744 { |
| 4701 t7cY0free.WindowY1 += 52; | 4745 t7cY0free.WindowY1 += 52; |
| 4702 } | 4746 } |
| 4703 | 4747 |
| 4704 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->chargeStatus != CHARGER_off)) | 4748 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->chargeStatus != CHARGER_off)) |
| 4705 { | 4749 { |
| 4706 snprintf(text,60, | 4750 snprintf(text,60, |
| 4869 | 4913 |
| 4870 start.y = start.y - (stateUsed->lifeData.depth_meter * (ASCENT_GRAPH_YPIXEL) / pSettings->last_stop_depth_meter); | 4914 start.y = start.y - (stateUsed->lifeData.depth_meter * (ASCENT_GRAPH_YPIXEL) / pSettings->last_stop_depth_meter); |
| 4871 stop.y = start.y; | 4915 stop.y = start.y; |
| 4872 GFX_draw_thick_line(10,&t7screen, start, stop, 9); | 4916 GFX_draw_thick_line(10,&t7screen, start, stop, 9); |
| 4873 } | 4917 } |
| 4918 else | |
| 4919 { | |
| 4920 color = 0xff; | |
| 4921 } | |
| 4874 return color; | 4922 return color; |
| 4875 } | 4923 } |
| 4876 void t7_tick(void) | 4924 void t7_tick(void) |
| 4877 { | 4925 { |
| 4878 SSettings *settings = settingsGetPointer(); | 4926 SSettings *settings = settingsGetPointer(); |
