diff --git a/src/tracking_state.jl b/src/tracking_state.jl index 7b33d63..0115f65 100644 --- a/src/tracking_state.jl +++ b/src/tracking_state.jl @@ -87,6 +87,33 @@ struct TrackingState{ code::COR end +function TrackingState( + track_state::TrackingState; + post_corr_filter, +) + TrackingState( + track_state.prn, + track_state.system, + post_corr_filter, + track_state.init_carrier_doppler, + track_state.init_code_doppler, + track_state.carrier_doppler, + track_state.code_doppler, + track_state.carrier_phase, + track_state.code_phase, + track_state.correlator, + track_state.carrier_loop_filter, + track_state.code_loop_filter, + track_state.sc_bit_detector, + track_state.integrated_samples, + track_state.prompt_accumulator, + track_state.cn0_estimator, + track_state.downconverted_signal, + track_state.carrier, + track_state.code + ) +end + """ $(SIGNATURES) diff --git a/test/cuda/tracking_state.jl b/test/cuda/tracking_state.jl index 417d9b7..28519a3 100644 --- a/test/cuda/tracking_state.jl +++ b/test/cuda/tracking_state.jl @@ -55,4 +55,6 @@ state = TrackingState(1, gpsl1, carrier_doppler, code_phase, num_samples = num_samples, num_ants = NumAnts(2)) @test @inferred(Tracking.get_correlator(state)) == EarlyPromptLateCorrelator(NumAnts(2)) + changed_state = @inferred(TrackingState(state, post_corr_filter = Tracking.DefaultPostCorrFilter())) + @test get_post_corr_filter(changed_state) == Tracking.DefaultPostCorrFilter() end diff --git a/test/tracking_state.jl b/test/tracking_state.jl index 8a3c78a..a933250 100644 --- a/test/tracking_state.jl +++ b/test/tracking_state.jl @@ -67,4 +67,7 @@ @test @inferred(Tracking.get_code_loop_filter(state)) == SecondOrderBilinearLF() @test @inferred(Tracking.get_prompt_accumulator(state)) == 0.0 @test @inferred(Tracking.get_integrated_samples(state)) == 0 + + changed_state = @inferred(TrackingState(state, post_corr_filter = Tracking.DefaultPostCorrFilter())) + @test get_post_corr_filter(changed_state) == Tracking.DefaultPostCorrFilter() end