SatCat5
satcat5::ptp::TrackingSimple Class Reference

Detailed Description

Simple all-in-one implementation of TrackingController.

Streamlined variant of ptp::TrackingController, with a built-in filter chain that is adequate for most PTP applications.

See also
ptp_tracking.h TrackingController

Definition at line 184 of file ptp_tracking.h.

#include <ptp_tracking.h>

Inheritance diagram for satcat5::ptp::TrackingSimple:
[legend]
Collaboration diagram for satcat5::ptp::TrackingSimple:
[legend]

Public Member Functions

 TrackingSimple (satcat5::ptp::TrackingClock *clk, satcat5::ptp::Source *source)
 Constructor links to a specific TrackingClock target.
 
void ptp_ready (const satcat5::ptp::Measurement &data) override
 Event handler for ptp::Callback. More...
 
void add_clock (satcat5::ptp::TrackingClock *clock)
 Add to the list of attached clocks. More...
 
void remove_clock (satcat5::ptp::TrackingClock *clock)
 Remove an item from the list of attached clocks.
 
void add_filter (satcat5::ptp::Filter *filter)
 Add to the chain of processing filters. More...
 
void remove_filter (satcat5::ptp::Filter *filter)
 Remove a filter from the chain, leaving others as-is. More...
 
void reset (bool linear=false)
 Reset tracking filter(s) and begin free-wheeling. More...
 
void reacquire ()
 Indicate to the controller than an external event has happened that should trigger a re-acquisition without fully resetting the system, such as a short disruption of an external reference.
 
void update (const satcat5::ptp::Time &delta)
 Update filter state with a new measurement from the PTP client. More...
 
bool is_locked () const
 Check if the controller is currently locked. More...
 

Protected Types

enum class  LockState { RESET , ACQUIRE , TRACK , LINEAR }
 

Protected Member Functions

s64 coarse (const satcat5::ptp::Time &delta)
 
void filter (u32 elapsed_usec, s64 delta_subns)
 
satcat5::ptp::Time clock_adjust (const satcat5::ptp::Time &amount)
 
void clock_rate (s64 offset)
 
void pps_event (satcat5::ptp::Time &ts, satcat5::ptp::Time &delta) override
 

Protected Attributes

satcat5::ptp::AmplitudeReject m_ampl
 
satcat5::ptp::ControllerPII m_ctrl
 
satcat5::util::List< satcat5::ptp::TrackingClockm_clocks
 
satcat5::util::List< satcat5::ptp::Filterm_filters
 
satcat5::util::TimeVal m_tref
 
s64 m_freq_accum
 
u32 m_lock_alarm
 
u32 m_lock_usec
 
satcat5::ptp::TrackingController::LockState m_lock_state
 
satcat5::ptp::Source *const m_source
 

Private Attributes

satcat5::ptp::Callbackm_next
 

Member Function Documentation

◆ add_clock()

void satcat5::ptp::TrackingController::add_clock ( satcat5::ptp::TrackingClock clock)
inlineinherited

Add to the list of attached clocks.

All will receive the same frequency adjustments and will be frequency-locked, but only the primary clock (constructor or first add_clock) will be phase-locked.

Definition at line 107 of file ptp_tracking.h.

◆ add_filter()

void satcat5::ptp::TrackingController::add_filter ( satcat5::ptp::Filter filter)
inlineinherited

Add to the chain of processing filters.

See also
ptp_filters.h A chain of filters condition raw measurements at the input, deriving the final control signal for the TrackingClock. Filters are added and applied in the same sequence, with each new filter added to the end of the pre-existing chain.

Definition at line 118 of file ptp_tracking.h.

◆ is_locked()

bool satcat5::ptp::TrackingController::is_locked ( ) const
inlineinherited

Check if the controller is currently locked.

Note that in linear mode, no lock detection exists and this always returns true.

Definition at line 146 of file ptp_tracking.h.

◆ ptp_ready()

void TrackingController::ptp_ready ( const satcat5::ptp::Measurement data)
overridevirtualinherited

Event handler for ptp::Callback.

This calculates offsetFromMaster and calls "update".

Implements satcat5::ptp::Callback.

Definition at line 48 of file ptp_tracking.cc.

◆ remove_filter()

void satcat5::ptp::TrackingController::remove_filter ( satcat5::ptp::Filter filter)
inlineinherited

Remove a filter from the chain, leaving others as-is.

e.g., Starting from A->B->C, removing B results in A->C.

Definition at line 123 of file ptp_tracking.h.

◆ reset()

void TrackingController::reset ( bool  linear = false)
inherited

Reset tracking filter(s) and begin free-wheeling.

Parameters
linearDisables nonlinear coarse acquisition.

Definition at line 53 of file ptp_tracking.cc.

◆ update()

void TrackingController::update ( const satcat5::ptp::Time delta)
inherited

Update filter state with a new measurement from the PTP client.

Specify the measured clock offset (delta = remote - local). (Call this directly or use the ptp::Callback event handler.)

Definition at line 73 of file ptp_tracking.cc.


The documentation for this class was generated from the following files: