Syntalos::FreqCounterSynchronizer

Syntalos::FreqCounterSynchronizer

Syntalos::FreqCounterSynchronizer

Synchronizer for a monotonic counter, given a frequency. More…

#include <timesync.h>

Public Functions

Name
FreqCounterSynchronizer(std::shared_ptr< SyncTimer > masterTimer, const QString & modName, double frequencyHz, const QString & id =nullptr)
~FreqCounterSynchronizer()
voidsetNotifyCallbacks(const SyncDetailsChangeNotifyFn & detailsChangeNotifyFn, const OffsetChangeNotifyFn & offsetChangeNotifyFn)
Set callback functions to notify about state changes.
voidsetCalibrationBlocksCount(int count)
voidsetStrategies(const TimeSyncStrategies & strategies)
voidsetTolerance(const std::chrono::microseconds & tolerance)
voidsetTimeSyncBasename(const QString & fname, const QUuid & collectionId)
voidsetLastValidMasterTimestamp(microseconds_t masterTimestamp)
Set the last known valid master timestamp.
microseconds_tlastMasterAssumedAcqTS() const
boolisCalibrated() const
intindexOffset() const
boolstart()
voidstop()
voidprocessTimestamps(const microseconds_t & blocksRecvTimestamp, int blockIndex, int blockCount, VectorXul & idxTimestamps)

Detailed Description

class Syntalos::FreqCounterSynchronizer;

Synchronizer for a monotonic counter, given a frequency.

This synchronizer helps synchronizing the counting of a monotonic counter (e.g. adding an increasing index number to signals/frames/etc. from a starting point) to the master clock if we know a sampling frequency for the counter.

Depending on the permitted strategies, the counter may never move forward or backward, but gaps may always occur unless the sole active sync strategy is to write a TSync file.

Public Functions Documentation

function FreqCounterSynchronizer

explicit FreqCounterSynchronizer(
    std::shared_ptr< SyncTimer > masterTimer,
    const QString & modName,
    double frequencyHz,
    const QString & id =nullptr
)

function ~FreqCounterSynchronizer

~FreqCounterSynchronizer()

function setNotifyCallbacks

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

Set callback functions to notify about state changes.

function setCalibrationBlocksCount

void setCalibrationBlocksCount(
    int count
)

function setStrategies

void setStrategies(
    const TimeSyncStrategies & strategies
)

function setTolerance

void setTolerance(
    const std::chrono::microseconds & tolerance
)

function setTimeSyncBasename

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

function setLastValidMasterTimestamp

void setLastValidMasterTimestamp(
    microseconds_t masterTimestamp
)

Set the last known valid master timestamp.

This is a hack in case the timestamp-generating module generates timestamps that it may not write to disk.

function lastMasterAssumedAcqTS

microseconds_t lastMasterAssumedAcqTS() const

function isCalibrated

bool isCalibrated() const

function indexOffset

int indexOffset() const

function start

bool start()

function stop

void stop()

function processTimestamps

void processTimestamps(
    const microseconds_t & blocksRecvTimestamp,
    int blockIndex,
    int blockCount,
    VectorXul & idxTimestamps
)

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