@@ -24,7 +24,10 @@ use std::{
24
24
25
25
use capnp:: message:: Builder ;
26
26
use 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
+ } ;
28
31
29
32
use crate :: client_sender:: BoxedClientSender ;
30
33
use crate :: constants:: {
@@ -43,6 +46,8 @@ use crate::utils::{serialize_capnproto_builder, signal_key_color, signal_key_lab
43
46
pub struct TrackingSignalsTab {
44
47
/// Whether a MsgTrackingState has been received. If so block Obs Msgs from being processed.
45
48
pub at_least_one_track_received : bool ,
49
+ /// Whether to disable processing of MsgTrackingState and MsgMeasurementState messages.
50
+ pub disable_track : bool ,
46
51
47
52
pub check_labels : [ & ' static str ; 13 ] ,
48
53
pub client_sender : BoxedClientSender ,
@@ -85,6 +90,7 @@ impl TrackingSignalsTab {
85
90
pub fn new ( shared_state : SharedState , client_sender : BoxedClientSender ) -> TrackingSignalsTab {
86
91
TrackingSignalsTab {
87
92
at_least_one_track_received : false ,
93
+ disable_track : false ,
88
94
check_labels : [
89
95
GPS_L1CA_STR ,
90
96
GPS_L2CM_STR ,
@@ -221,6 +227,9 @@ impl TrackingSignalsTab {
221
227
///
222
228
/// - `states`: All states contained within the measurementstate message.
223
229
pub fn handle_msg_measurement_state ( & mut self , states : Vec < MeasurementState > ) {
230
+ if self . disable_track {
231
+ return ;
232
+ }
224
233
self . at_least_one_track_received = true ;
225
234
let mut codes_that_came: Vec < ( SignalCodes , i16 ) > = Vec :: new ( ) ;
226
235
let t = ( Instant :: now ( ) ) . duration_since ( self . t_init ) . as_secs_f64 ( ) ;
@@ -258,12 +267,28 @@ impl TrackingSignalsTab {
258
267
self . update_plot ( ) ;
259
268
self . send_data ( ) ;
260
269
}
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
+
261
283
/// Handle MsgTrackingState message states.
262
284
///
263
285
/// # Parameters:
264
286
///
265
287
/// - `states`: All states contained within the trackingstate message.
266
288
pub fn handle_msg_tracking_state ( & mut self , states : Vec < TrackingChannelState > ) {
289
+ if self . disable_track {
290
+ return ;
291
+ }
267
292
self . at_least_one_track_received = true ;
268
293
let mut codes_that_came: Vec < ( SignalCodes , i16 ) > = Vec :: new ( ) ;
269
294
let t = ( Instant :: now ( ) ) . duration_since ( self . t_init ) . as_secs_f64 ( ) ;
0 commit comments