21 m_counterCycle(counterCycle),
22 m_timeCycle(timeCycle)
40 this->m_counterCycle = counterCycle;
48 this->m_timeCycle = timeCycle;
68 this->m_timeAtNegativeInfinity =
true;
76 this->m_counter = counter;
85 this->m_timeAtNegativeInfinity =
false;
103 if (this->m_counterCycle == 0 && this->m_timeCycle == 0) {
108 bool shouldTrigger =
false;
109 if (this->m_counterCycle > 0) {
110 shouldTrigger = shouldTrigger || this->shouldCounterTrigger();
112 if (this->m_timeCycle > 0) {
113 shouldTrigger = shouldTrigger || this->shouldTimeTrigger(time);
117 if (this->m_counterCycle > 0) {
118 this->updateCounter(shouldTrigger);
120 if (this->m_timeCycle > 0) {
121 this->updateTime(shouldTrigger, time);
124 return shouldTrigger;
135 shouldCounterTrigger()
140 bool shouldTrigger = (this->m_counter == 0);
142 return shouldTrigger;
153 bool shouldTrigger = (time >= nextTrigger) || this->m_timeAtNegativeInfinity;
155 return shouldTrigger;
159 updateCounter(
bool triggered)
169 if (++this->m_counter >= this->m_counterCycle) {
176 updateTime(
bool triggered,
Fw::Time time)
184 this->m_timeAtNegativeInfinity =
false;
static Time add(const Time &a, const Time &b)
static Time zero(TimeBase timeBase=TB_NONE)
void setTime(Fw::Time time)
void setTimeCycle(U32 timeCycle)
void setCounterCycle(U32 counterCycle)