Syntalos::SecondaryClockSynchronizer

Syntalos::SecondaryClockSynchronizer

Syntalos::SecondaryClockSynchronizer

Synchronizer for an external steady monotonic clock. More…

#include <timesync.h>

Public Functions

Name
SecondaryClockSynchronizer(std::shared_ptr< SyncTimer > masterTimer, const QString & modName, const QString & id =QString())
~SecondaryClockSynchronizer()
voidsetNotifyCallbacks(const SyncDetailsChangeNotifyFn & detailsChangeNotifyFn, const OffsetChangeNotifyFn & offsetChangeNotifyFn)
Set callback functions to notify about state changes.
microseconds_tclockCorrectionOffset() const
An adjustment offset to pring the secondary clock back to speed.
voidsetCalibrationPointsCount(int timepointCount)
Set the amount of points needed to determine the average offset explicitly.
voidsetExpectedClockFrequencyHz(double frequency)
Automatically determine tolerance and needed calibration point count based on expected DAQ frequency.
voidsetStrategies(const TimeSyncStrategies & strategies)
voidsetTolerance(const microseconds_t & tolerance)
voidsetTimeSyncBasename(const QString & fname, const QUuid & collectionId)
boolisCalibrated() const
microseconds_texpectedOffsetToMaster() const
boolstart()
voidstop()
voidprocessTimestamp(microseconds_t & masterTimestamp, const microseconds_t & secondaryAcqTimestamp)

Detailed Description

class Syntalos::SecondaryClockSynchronizer;

Synchronizer for an external steady monotonic clock.

This synchronizer helps synchronizing a timestamp from an external source with Syntalos’ master clock.

Public Functions Documentation

function SecondaryClockSynchronizer

explicit SecondaryClockSynchronizer(
    std::shared_ptr< SyncTimer > masterTimer,
    const QString & modName,
    const QString & id =QString()
)

function ~SecondaryClockSynchronizer

~SecondaryClockSynchronizer()

function setNotifyCallbacks

void setNotifyCallbacks(
    const SyncDetailsChangeNotifyFn & detailsChangeNotifyFn,
    const OffsetChangeNotifyFn & offsetChangeNotifyFn
)

Set callback functions to notify about state changes.

function clockCorrectionOffset

microseconds_t clockCorrectionOffset() const

An adjustment offset to pring the secondary clock back to speed.

negative values indicate the secondary clock running too slow, positive values mean it is running too fast compared to the master clock.

function setCalibrationPointsCount

void setCalibrationPointsCount(
    int timepointCount
)

Set the amount of points needed to determine the average offset explicitly.

function setExpectedClockFrequencyHz

void setExpectedClockFrequencyHz(
    double frequency
)

Automatically determine tolerance and needed calibration point count based on expected DAQ frequency.

function setStrategies

void setStrategies(
    const TimeSyncStrategies & strategies
)

function setTolerance

void setTolerance(
    const microseconds_t & tolerance
)

function setTimeSyncBasename

void setTimeSyncBasename(
    const QString & fname,
    const QUuid & collectionId
)

function isCalibrated

bool isCalibrated() const

function expectedOffsetToMaster

microseconds_t expectedOffsetToMaster() const

function start

bool start()

function stop

void stop()

function processTimestamp

void processTimestamp(
    microseconds_t & masterTimestamp,
    const microseconds_t & secondaryAcqTimestamp
)

Updated on 2024-11-06 at 17:10:29 +0000