Files
T
berrux-dev 5485a90385 Lts/Services: finalize Qt6/C++17 migration cleanup
Remove deprecated Qt5 patterns remaining in Services:

- Replace remaining SIGNAL/SLOT string syntax with function pointer syntax
  (NmeaManagement/socket_handler.cpp, AudioVideoManagement/ModuleTests/mvs_tests.cpp)

- Remove Qt::UniqueConnection (deprecated in Qt6, default behavior) from
  19 files across AES, CES plugins, and cross-services (47 occurrences)

- Remove umbrella #include <QtCore> from fire_automaton.h and
  aes_test_fire_automaton.h (specific includes suffice)

25 files changed, 74 insertions(+), 81 deletions(-)
2026-09-21 06:43:28 +00:00

64 lines
1.6 KiB
C++
Executable File

/**
* CES Target Timer
* $Id$
* $HeadURL$
* $Author$
* Created by Gerlinde Rudolphus, SLTE, 2016-04-14
*/
#include "targettimer.h"
#include <QDebug>
TargetTimer::TargetTimer(int participantId,
int targetParticipantId,
int preWarningInterval,
int timeToEffectInterval)
{
m_participantId = participantId;
m_targetParticipantId = targetParticipantId;
m_preWarningInterval = preWarningInterval;
m_timeToEffectInterval = timeToEffectInterval;
timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, &TargetTimer::MyTimerSlot);
// msec
}
void TargetTimer::startTimer()
{
qDebug() << "TargetTimer::startTimer";
if (timer->isActive())
return;
if (m_timerState == NOT_ACTIVE)
{
timer->setSingleShot(true);
timer->start(m_preWarningInterval);
m_timerState = TIMER1_ACTIVE;
}
}
void TargetTimer::stopTimer()
{
qDebug() << "TargetTimer::stopTimer";
timer->stop();
}
void TargetTimer::MyTimerSlot()
{
qDebug() << "TimerSlot m_participantId=" << m_participantId;
if (m_timerState == TIMER1_ACTIVE)
{
qDebug() << "m_timerState == TIMER1_ACTIVE";
emit preWarningTimeout(m_participantId, m_targetParticipantId);
timer->setSingleShot(true);
timer->start(m_timeToEffectInterval - m_preWarningInterval);
m_timerState = TIMER2_ACTIVE;
}
else if (m_timerState == TIMER2_ACTIVE)
{
qDebug() << "m_timerState == TIMER2_ACTIVE";
emit timeToEffectTimeout(m_participantId, m_targetParticipantId);
m_timerState = BOTH_EXPIRED;
}
}