@@ -3,11 +3,6 @@ use std::{
33 time:: { Duration , Instant } ,
44} ;
55
6- use capnp:: message:: Builder ;
7- use log:: warn;
8- use ordered_float:: OrderedFloat ;
9- use sbp:: messages:: tracking:: { MeasurementState , TrackingChannelState } ;
10-
116use crate :: client_sender:: BoxedClientSender ;
127use crate :: constants:: {
138 CHART_XMIN_OFFSET_NO_TRACKING , CHART_XMIN_OFFSET_TRACKING , GLO_FCN_OFFSET , GLO_SLOT_SAT_MAX ,
@@ -20,6 +15,13 @@ use crate::piksi_tools_constants::{
2015use crate :: shared_state:: SharedState ;
2116use crate :: types:: { Cn0Age , Cn0Dict , Deque , ObservationMsg , SignalCodes } ;
2217use crate :: utils:: { serialize_capnproto_builder, signal_key_color, signal_key_label} ;
18+ use capnp:: message:: Builder ;
19+ use log:: warn;
20+ use ordered_float:: OrderedFloat ;
21+ use sbp:: messages:: {
22+ system:: { msg_status_report:: System , MsgStatusReport } ,
23+ tracking:: { MeasurementState , TrackingChannelState } ,
24+ } ;
2325
2426/// TrackingSignalsTab struct.
2527///
@@ -46,6 +48,8 @@ use crate::utils::{serialize_capnproto_builder, signal_key_color, signal_key_lab
4648#[ derive( Debug ) ]
4749pub struct TrackingSignalsTab {
4850 pub at_least_one_track_received : bool ,
51+ /// Whether to disable processing of MsgTrackingState and MsgMeasurementState messages.
52+ pub disable_track : bool ,
4953 pub check_labels : [ & ' static str ; 13 ] ,
5054 pub client_sender : BoxedClientSender ,
5155 pub cn0_age : Cn0Age ,
@@ -72,6 +76,7 @@ impl TrackingSignalsTab {
7276 pub fn new ( shared_state : SharedState , client_sender : BoxedClientSender ) -> TrackingSignalsTab {
7377 TrackingSignalsTab {
7478 at_least_one_track_received : false ,
79+ disable_track : false ,
7580 check_labels : [
7681 GPS_L1CA_STR ,
7782 GPS_L2CM_STR ,
@@ -208,6 +213,9 @@ impl TrackingSignalsTab {
208213 ///
209214 /// - `states`: All states contained within the measurementstate message.
210215 pub fn handle_msg_measurement_state ( & mut self , states : Vec < MeasurementState > ) {
216+ if self . disable_track {
217+ return ;
218+ }
211219 self . at_least_one_track_received = true ;
212220 let mut codes_that_came: Vec < ( SignalCodes , i16 ) > = Vec :: new ( ) ;
213221 let t = ( Instant :: now ( ) ) . duration_since ( self . t_init ) . as_secs_f64 ( ) ;
@@ -245,12 +253,28 @@ impl TrackingSignalsTab {
245253 self . update_plot ( ) ;
246254 self . send_data ( ) ;
247255 }
256+
257+ /// Handle MsgStatusReport message states.
258+ ///
259+ /// # Parameters:
260+ ///
261+ /// - `msg`: The full SBP message cast as an MsgStatusReport variant.
262+ pub fn handle_msg_status_report ( & mut self , msg : MsgStatusReport ) {
263+ if let Ok ( system) = msg. system ( ) {
264+ self . disable_track = system == System :: PrecisionGnssModule ;
265+ self . at_least_one_track_received = false ;
266+ }
267+ }
268+
248269 /// Handle MsgTrackingState message states.
249270 ///
250271 /// # Parameters:
251272 ///
252273 /// - `states`: All states contained within the trackingstate message.
253274 pub fn handle_msg_tracking_state ( & mut self , states : Vec < TrackingChannelState > ) {
275+ if self . disable_track {
276+ return ;
277+ }
254278 self . at_least_one_track_received = true ;
255279 let mut codes_that_came: Vec < ( SignalCodes , i16 ) > = Vec :: new ( ) ;
256280 let t = ( Instant :: now ( ) ) . duration_since ( self . t_init ) . as_secs_f64 ( ) ;
0 commit comments