/** * CES Target Timer * $Id$ * $HeadURL$ * $Author$ * Created by Gerlinde Rudolphus, SLTE, 2016-04-14 */ #include "supplytimer.h" namespace CES_FUNCTIONAL_AREA { SupplyTimer::SupplyTimer(int participantId, int aesId, int timeToEffectInterval_msec) { m_participantId = participantId; m_aesId = aesId; m_timeToEffectInterval = timeToEffectInterval_msec; m_timer = new QTimer(this); connect(m_timer, &QTimer::timeout, this, &SupplyTimer::myTimerSlot); // msec } void SupplyTimer::startTimer() { if (m_timer->isActive()) return; m_timer->setSingleShot(true); m_timer->start(m_timeToEffectInterval); } void SupplyTimer::stopTimer() { m_timer->stop(); } void SupplyTimer::myTimerSlot() { emit timeToEffectTimeout(m_participantId, m_aesId); } } // namespace CES_FUNCTIONAL_AREA