FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
timing::PrototypeTiming Class Reference

Manages timing properties such as frequency, offsets, and synchronization. More...

#include "prototype_timing.h"

Public Member Functions

 PrototypeTiming (std::string name, const SimId id=0) noexcept
 Constructor for PrototypeTiming.
 
 ~PrototypeTiming ()=default
 
 PrototypeTiming (const PrototypeTiming &)=default
 
 PrototypeTiming (PrototypeTiming &&)=default
 
PrototypeTimingoperator= (const PrototypeTiming &)=default
 
PrototypeTimingoperator= (PrototypeTiming &&)=default
 
void copyAlphas (std::vector< RealType > &alphas, std::vector< RealType > &weights) const noexcept
 Copies the alphas and weights vectors.
 
RealType getFrequency () const noexcept
 Gets the current frequency.
 
std::string getName () const
 Gets the name of the timing source.
 
SimId getId () const noexcept
 Gets the unique ID of the timing source.
 
bool getSyncOnPulse () const noexcept
 Checks if synchronization on pulse is enabled.
 
std::optional< RealTypegetPhaseOffset () const noexcept
 Gets the phase offset.
 
std::optional< RealTypegetFreqOffset () const noexcept
 Gets the frequency offset.
 
std::optional< RealTypegetRandomFreqOffsetStdev () const noexcept
 
std::optional< RealTypegetRandomPhaseOffsetStdev () const noexcept
 
void setFrequency (const RealType freq) noexcept
 Sets the frequency value.
 
void setSyncOnPulse () noexcept
 Enables synchronization on pulse.
 
void clearSyncOnPulse () noexcept
 Disables synchronization on pulse.
 
void setAlpha (RealType alpha, RealType weight) noexcept
 Sets an alpha and weight value.
 
void clearNoiseEntries () noexcept
 Clears all noise entries.
 
void setFreqOffset (RealType offset) noexcept
 Sets the frequency offset.
 
void clearFreqOffset () noexcept
 Clears the frequency offset.
 
void setPhaseOffset (RealType offset) noexcept
 Sets the phase offset.
 
void clearPhaseOffset () noexcept
 Clears the phase offset.
 
void setRandomFreqOffsetStdev (RealType stdev) noexcept
 Sets a random frequency offset standard deviation.
 
void setRandomPhaseOffsetStdev (RealType stdev) noexcept
 Sets a random phase offset standard deviation.
 
void clearRandomFreqOffsetStdev () noexcept
 Clears the random frequency offset standard deviation.
 
void clearRandomPhaseOffsetStdev () noexcept
 Clears the random phase offset standard deviation.
 
void setName (std::string name) noexcept
 Sets the name of the timing source.
 

Detailed Description

Manages timing properties such as frequency, offsets, and synchronization.

Definition at line 29 of file prototype_timing.h.

Constructor & Destructor Documentation

◆ PrototypeTiming() [1/3]

timing::PrototypeTiming::PrototypeTiming ( std::string  name,
const SimId  id = 0 
)
explicitnoexcept

Constructor for PrototypeTiming.

Parameters
nameThe name of the timing source.

Definition at line 37 of file prototype_timing.h.

37 :
38 _id(id == 0 ? SimIdGenerator::instance().generateId(ObjectType::Timing) : id), _name(std::move(name))
39 {
40 }
static SimIdGenerator & instance()
Get the singleton instance of SimIdGenerator.
Definition sim_id.h:48

◆ ~PrototypeTiming()

timing::PrototypeTiming::~PrototypeTiming ( )
default

◆ PrototypeTiming() [2/3]

timing::PrototypeTiming::PrototypeTiming ( const PrototypeTiming )
default

◆ PrototypeTiming() [3/3]

timing::PrototypeTiming::PrototypeTiming ( PrototypeTiming &&  )
default

Member Function Documentation

◆ clearFreqOffset()

void timing::PrototypeTiming::clearFreqOffset ( )
noexcept

Clears the frequency offset.

Definition at line 146 of file prototype_timing.h.

146{ _freq_offset = std::nullopt; }

Referenced by timing::from_json().

+ Here is the caller graph for this function:

◆ clearNoiseEntries()

void timing::PrototypeTiming::clearNoiseEntries ( )
noexcept

Clears all noise entries.

Definition at line 33 of file prototype_timing.cpp.

34 {
35 _alphas.clear();
36 _weights.clear();
37 }

Referenced by timing::from_json().

+ Here is the caller graph for this function:

◆ clearPhaseOffset()

void timing::PrototypeTiming::clearPhaseOffset ( )
noexcept

Clears the phase offset.

Definition at line 158 of file prototype_timing.h.

158{ _phase_offset = std::nullopt; }

Referenced by timing::from_json().

+ Here is the caller graph for this function:

◆ clearRandomFreqOffsetStdev()

void timing::PrototypeTiming::clearRandomFreqOffsetStdev ( )
noexcept

Clears the random frequency offset standard deviation.

Definition at line 177 of file prototype_timing.h.

177{ _random_freq_stdev = std::nullopt; }

Referenced by timing::from_json().

+ Here is the caller graph for this function:

◆ clearRandomPhaseOffsetStdev()

void timing::PrototypeTiming::clearRandomPhaseOffsetStdev ( )
noexcept

Clears the random phase offset standard deviation.

Definition at line 182 of file prototype_timing.h.

182{ _random_phase_stdev = std::nullopt; }

Referenced by timing::from_json().

+ Here is the caller graph for this function:

◆ clearSyncOnPulse()

void timing::PrototypeTiming::clearSyncOnPulse ( )
noexcept

Disables synchronization on pulse.

Definition at line 121 of file prototype_timing.h.

121{ _sync_on_pulse = false; }

Referenced by timing::from_json().

+ Here is the caller graph for this function:

◆ copyAlphas()

void timing::PrototypeTiming::copyAlphas ( std::vector< RealType > &  alphas,
std::vector< RealType > &  weights 
) const
noexcept

Copies the alphas and weights vectors.

Parameters
alphasReference to the vector where alpha values will be copied.
weightsReference to the vector where weight values will be copied.

Definition at line 27 of file prototype_timing.cpp.

28 {
29 alphas = _alphas;
30 weights = _weights;
31 }

Referenced by timing::to_json().

+ Here is the caller graph for this function:

◆ getFreqOffset()

std::optional< RealType > timing::PrototypeTiming::getFreqOffset ( ) const
noexcept

Gets the frequency offset.

Returns
The frequency offset value.

Definition at line 100 of file prototype_timing.h.

100{ return _freq_offset; }

Referenced by timing::to_json().

+ Here is the caller graph for this function:

◆ getFrequency()

RealType timing::PrototypeTiming::getFrequency ( ) const
noexcept

Gets the current frequency.

Returns
The current frequency value.

Definition at line 65 of file prototype_timing.h.

65{ return _frequency; }

Referenced by timing::to_json().

+ Here is the caller graph for this function:

◆ getId()

SimId timing::PrototypeTiming::getId ( ) const
noexcept

Gets the unique ID of the timing source.

Returns
The timing source SimId.

Definition at line 79 of file prototype_timing.h.

79{ return _id; }

Referenced by serial::xml_parser_utils::parseReceiver(), serial::xml_parser_utils::parseTransmitter(), core::World::replace(), and timing::to_json().

+ Here is the caller graph for this function:

◆ getName()

std::string timing::PrototypeTiming::getName ( ) const

Gets the name of the timing source.

Returns
The name of the timing source.

Definition at line 72 of file prototype_timing.h.

72{ return _name; }

Referenced by serial::xml_parser_utils::parseReceiver(), serial::xml_parser_utils::parseTransmitter(), core::World::replace(), and timing::to_json().

+ Here is the caller graph for this function:

◆ getPhaseOffset()

std::optional< RealType > timing::PrototypeTiming::getPhaseOffset ( ) const
noexcept

Gets the phase offset.

Returns
The phase offset value.

Definition at line 93 of file prototype_timing.h.

93{ return _phase_offset; }

Referenced by timing::to_json().

+ Here is the caller graph for this function:

◆ getRandomFreqOffsetStdev()

std::optional< RealType > timing::PrototypeTiming::getRandomFreqOffsetStdev ( ) const
noexcept

Definition at line 102 of file prototype_timing.h.

102{ return _random_freq_stdev; }

Referenced by timing::to_json().

+ Here is the caller graph for this function:

◆ getRandomPhaseOffsetStdev()

std::optional< RealType > timing::PrototypeTiming::getRandomPhaseOffsetStdev ( ) const
noexcept

Definition at line 104 of file prototype_timing.h.

104{ return _random_phase_stdev; }

Referenced by timing::to_json().

+ Here is the caller graph for this function:

◆ getSyncOnPulse()

bool timing::PrototypeTiming::getSyncOnPulse ( ) const
noexcept

Checks if synchronization on pulse is enabled.

Returns
True if synchronization on pulse is enabled, false otherwise.

Definition at line 86 of file prototype_timing.h.

86{ return _sync_on_pulse; }

Referenced by timing::to_json().

+ Here is the caller graph for this function:

◆ operator=() [1/2]

PrototypeTiming & timing::PrototypeTiming::operator= ( const PrototypeTiming )
default

◆ operator=() [2/2]

PrototypeTiming & timing::PrototypeTiming::operator= ( PrototypeTiming &&  )
default

◆ setAlpha()

void timing::PrototypeTiming::setAlpha ( RealType  alpha,
RealType  weight 
)
noexcept

Sets an alpha and weight value.

Parameters
alphaThe alpha value to be added.
weightThe weight value to be added.

Definition at line 21 of file prototype_timing.cpp.

22 {
23 _alphas.emplace_back(alpha);
24 _weights.emplace_back(weight);
25 }

Referenced by timing::from_json().

+ Here is the caller graph for this function:

◆ setFreqOffset()

void timing::PrototypeTiming::setFreqOffset ( RealType  offset)
noexcept

Sets the frequency offset.

Parameters
offsetThe frequency offset to be set.

Definition at line 141 of file prototype_timing.h.

141{ _freq_offset = offset; }

Referenced by timing::from_json().

+ Here is the caller graph for this function:

◆ setFrequency()

void timing::PrototypeTiming::setFrequency ( const RealType  freq)
noexcept

Sets the frequency value.

Parameters
freqThe frequency value to be set.

Definition at line 111 of file prototype_timing.h.

111{ _frequency = freq; }

Referenced by timing::from_json().

+ Here is the caller graph for this function:

◆ setName()

void timing::PrototypeTiming::setName ( std::string  name)
noexcept

Sets the name of the timing source.

Parameters
nameThe new name.

Definition at line 189 of file prototype_timing.h.

189{ _name = std::move(name); }

◆ setPhaseOffset()

void timing::PrototypeTiming::setPhaseOffset ( RealType  offset)
noexcept

Sets the phase offset.

Parameters
offsetThe phase offset to be set.

Definition at line 153 of file prototype_timing.h.

153{ _phase_offset = offset; }

Referenced by timing::from_json().

+ Here is the caller graph for this function:

◆ setRandomFreqOffsetStdev()

void timing::PrototypeTiming::setRandomFreqOffsetStdev ( RealType  stdev)
noexcept

Sets a random frequency offset standard deviation.

Parameters
stdevThe standard deviation for generating the random frequency offset.

Definition at line 165 of file prototype_timing.h.

165{ _random_freq_stdev = stdev; }

Referenced by timing::from_json().

+ Here is the caller graph for this function:

◆ setRandomPhaseOffsetStdev()

void timing::PrototypeTiming::setRandomPhaseOffsetStdev ( RealType  stdev)
noexcept

Sets a random phase offset standard deviation.

Parameters
stdevThe standard deviation for generating the random phase offset.

Definition at line 172 of file prototype_timing.h.

172{ _random_phase_stdev = stdev; }

Referenced by timing::from_json().

+ Here is the caller graph for this function:

◆ setSyncOnPulse()

void timing::PrototypeTiming::setSyncOnPulse ( )
noexcept

Enables synchronization on pulse.

Definition at line 116 of file prototype_timing.h.

116{ _sync_on_pulse = true; }

Referenced by timing::from_json().

+ Here is the caller graph for this function:

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