@@ -24,7 +24,10 @@ use std::{
2424
2525use capnp:: message:: Builder ;
2626use log:: warn;
27- use sbp:: messages:: tracking:: { MeasurementState , TrackingChannelState } ;
27+ use sbp:: messages:: {
28+ system:: { msg_status_report:: System , MsgStatusReport } ,
29+ tracking:: { MeasurementState , TrackingChannelState } ,
30+ } ;
2831
2932use crate :: client_sender:: BoxedClientSender ;
3033use crate :: constants:: {
@@ -43,6 +46,8 @@ use crate::utils::{serialize_capnproto_builder, signal_key_color, signal_key_lab
4346pub struct TrackingSignalsTab {
4447 /// Whether a MsgTrackingState has been received. If so block Obs Msgs from being processed.
4548 pub at_least_one_track_received : bool ,
49+ /// Whether to disable processing of MsgTrackingState and MsgMeasurementState messages.
50+ pub disable_track : bool ,
4651
4752 pub check_labels : [ & ' static str ; 13 ] ,
4853 pub client_sender : BoxedClientSender ,
@@ -85,6 +90,7 @@ impl TrackingSignalsTab {
8590 pub fn new ( shared_state : SharedState , client_sender : BoxedClientSender ) -> TrackingSignalsTab {
8691 TrackingSignalsTab {
8792 at_least_one_track_received : false ,
93+ disable_track : false ,
8894 check_labels : [
8995 GPS_L1CA_STR ,
9096 GPS_L2CM_STR ,
@@ -221,6 +227,9 @@ impl TrackingSignalsTab {
221227 ///
222228 /// - `states`: All states contained within the measurementstate message.
223229 pub fn handle_msg_measurement_state ( & mut self , states : Vec < MeasurementState > ) {
230+ if self . disable_track {
231+ return ;
232+ }
224233 self . at_least_one_track_received = true ;
225234 let mut codes_that_came: Vec < ( SignalCodes , i16 ) > = Vec :: new ( ) ;
226235 let t = ( Instant :: now ( ) ) . duration_since ( self . t_init ) . as_secs_f64 ( ) ;
@@ -258,12 +267,28 @@ impl TrackingSignalsTab {
258267 self . update_plot ( ) ;
259268 self . send_data ( ) ;
260269 }
270+
271+ /// Handle MsgStatusReport message states.
272+ ///
273+ /// # Parameters:
274+ ///
275+ /// - `msg`: The full SBP message cast as an MsgStatusReport variant.
276+ pub fn handle_msg_status_report ( & mut self , msg : MsgStatusReport ) {
277+ if let Ok ( system) = msg. system ( ) {
278+ self . disable_track = system == System :: PrecisionGnssModule ;
279+ self . at_least_one_track_received = false ;
280+ }
281+ }
282+
261283 /// Handle MsgTrackingState message states.
262284 ///
263285 /// # Parameters:
264286 ///
265287 /// - `states`: All states contained within the trackingstate message.
266288 pub fn handle_msg_tracking_state ( & mut self , states : Vec < TrackingChannelState > ) {
289+ if self . disable_track {
290+ return ;
291+ }
267292 self . at_least_one_track_received = true ;
268293 let mut codes_that_came: Vec < ( SignalCodes , i16 ) > = Vec :: new ( ) ;
269294 let t = ( Instant :: now ( ) ) . duration_since ( self . t_init ) . as_secs_f64 ( ) ;
0 commit comments