11use egui:: { Align , CornerRadius , Frame , Id , Image , ImageButton , Layout , Sense , ViewportCommand } ;
22
33use crate :: telemetry:: {
4- short_shifting_analyzer:: SHORT_SHIFT_ANNOTATION ,
4+ short_shifting_analyzer:: SHORT_SHIFT_ANNOTATION , slip_analyzer :: SLIP_ANNOTATION ,
55 trailbrake_steering_analyzer:: TRAILBRAKE_EXCESSIVE_STEERING_ANNOTATION , TelemetryAnnotation ,
66} ;
77
@@ -88,6 +88,7 @@ impl LiveTelemetryApp {
8888 let mut shift_image = egui:: include_image!( "../../assets/shift-grey.png" ) ;
8989 let mut wheelspin_image = egui:: include_image!( "../../assets/wheelspin-green.png" ) ;
9090 let mut trailbrake_steering_image = egui:: include_image!( "../../assets/steering-grey.png" ) ;
91+ let mut slip_image = egui:: include_image!( "../../assets/slip-grey.png" ) ;
9192 if let Some ( back) = self . telemetry_points . back ( ) {
9293 // brake ABS alert
9394 if back. brake > 0.4 && !back. abs_active {
@@ -127,6 +128,11 @@ impl LiveTelemetryApp {
127128 {
128129 trailbrake_steering_image = egui:: include_image!( "../../assets/steering-red.png" ) ;
129130 }
131+
132+ // slip alert
133+ if let Some ( TelemetryAnnotation :: Bool ( true ) ) = back. annotations . get ( SLIP_ANNOTATION ) {
134+ slip_image = egui:: include_image!( "../../assets/slip-red.png" ) ;
135+ }
130136 }
131137 let button_align = match self . app_config . alerts_layout {
132138 AlertsLayout :: Vertical => Align :: Center ,
@@ -151,5 +157,10 @@ impl LiveTelemetryApp {
151157 ui. label ( "Trailbraking" ) ;
152158 ui. add ( Image :: new ( trailbrake_steering_image) ) ;
153159 } ) ;
160+ ui. separator ( ) ;
161+ ui. with_layout ( Layout :: top_down ( button_align) , |ui| {
162+ ui. label ( "Slip" ) ;
163+ ui. add ( Image :: new ( slip_image) ) ;
164+ } ) ;
154165 }
155166}
0 commit comments