#include <ElecClock.h>
Public Member Functions | |
ElecClock (double time=0, double frame_period=kTIME_MAX, double frequency=1e9) | |
Default constructor. More... | |
~ElecClock () | |
Default destructor. More... | |
void | SetTime (double time) |
void | SetTime (int sample, int frame) |
void | SetTime (unsigned int sample, unsigned int frame) |
void | SetTime (int ticks) |
void | SetTime (unsigned int ticks) |
double | Time () const |
Time (stored) in nano-second. More... | |
double | Time (int sample, int frame) const |
Given sample & frame number in this clock, returns double precision time [ns]. More... | |
double | Time (double time) const |
Given time [ns] w.r.t. electronics clock counting, return discretized time in double precision. More... | |
double | Time (int ticks) const |
Given time in ticks w.r.t. electronics clock counting, return discretized time in double precision. More... | |
double | Frequency () const |
Frequency in MHz. More... | |
double | FramePeriod () const |
A single frame period in micro-second. More... | |
int | Ticks () const |
of TicksMore... | |
int | Ticks (double time) const |
Given time [ns] w.r.t. electronics clock T0, return # of ticks. More... | |
int | Ticks (int sample, int frame) const |
Given sample & frame returns # ticks. More... | |
int | Sample () const |
Sample number. More... | |
int | Sample (double time) const |
Given time [ns] w.r.t. electronics clock T0, return sample number. More... | |
int | Sample (int tick) const |
Given ticks w.r.t. electronics clock T0, return sample number. More... | |
int | Frame () const |
Frame number. More... | |
int | Frame (double time) const |
Given time [ns] w.r.t. electronics clock T0, return frame number. More... | |
int | Frame (int tick) const |
Given ticks w.r.t. electronics clock T0, return frame number. More... | |
unsigned int | FrameTicks () const |
Number ticks in a frame. More... | |
double | TickPeriod () const |
A single tick period in nano-second, frequency is in MHz. More... | |
ElecClock | operator+ (const ElecClock &rhs) |
ElecClock | operator- (const ElecClock &rhs) |
bool | operator< (const ElecClock &rhs) const |
bool | operator> (const ElecClock &rhs) const |
bool | operator<= (const ElecClock &rhs) const |
bool | operator>= (const ElecClock &rhs) const |
Protected Attributes | |
double | fTime |
Time in nano-second. More... | |
double | fFramePeriod |
Frame period in micro-second. More... | |
double | fFrequency |
Clock speed in MHz. More... | |
Electronics clock class which holds double precision time in nanosecond, frequency in Hz, and frame period in seconds.
Definition at line 28 of file ElecClock.h.
|
inline |
Default constructor.
Definition at line 33 of file ElecClock.h.
|
inline |
|
inline |
|
inline |
Given time [ns] w.r.t. electronics clock T0, return frame number.
Definition at line 116 of file ElecClock.h.
|
inline |
Given ticks w.r.t. electronics clock T0, return frame number.
Definition at line 119 of file ElecClock.h.
|
inline |
A single frame period in micro-second.
Definition at line 92 of file ElecClock.h.
|
inline |
Number ticks in a frame.
Definition at line 122 of file ElecClock.h.
|
inline |
Definition at line 148 of file ElecClock.h.
Definition at line 151 of file ElecClock.h.
Definition at line 154 of file ElecClock.h.
Definition at line 156 of file ElecClock.h.
Definition at line 155 of file ElecClock.h.
Definition at line 157 of file ElecClock.h.
|
inline |
|
inline |
Given time [ns] w.r.t. electronics clock T0, return sample number.
Definition at line 107 of file ElecClock.h.
|
inline |
Given ticks w.r.t. electronics clock T0, return sample number.
Definition at line 110 of file ElecClock.h.
|
inline |
Definition at line 58 of file ElecClock.h.
|
inline |
Definition at line 60 of file ElecClock.h.
|
inline |
Definition at line 64 of file ElecClock.h.
|
inline |
Definition at line 68 of file ElecClock.h.
|
inline |
Definition at line 71 of file ElecClock.h.
|
inline |
A single tick period in nano-second, frequency is in MHz.
Definition at line 125 of file ElecClock.h.
|
inline |
|
inline |
Given time [ns] w.r.t. electronics clock T0, return # of ticks.
Definition at line 98 of file ElecClock.h.
|
inline |
Given sample & frame returns # ticks.
Definition at line 101 of file ElecClock.h.
|
inline |
|
inline |
Given sample & frame number in this clock, returns double precision time [ns].
Definition at line 80 of file ElecClock.h.
|
inline |
Given time [ns] w.r.t. electronics clock counting, return discretized time in double precision.
Definition at line 83 of file ElecClock.h.
|
inline |
Given time in ticks w.r.t. electronics clock counting, return discretized time in double precision.
Definition at line 86 of file ElecClock.h.
|
protected |
Frame period in micro-second.
Definition at line 51 of file ElecClock.h.
|
protected |
Clock speed in MHz.
Definition at line 52 of file ElecClock.h.
|
protected |
Time in nano-second.
Definition at line 44 of file ElecClock.h.