Files
T
torstenandCopilot 7a6be7474e Qt6 migration: Fix BUILD_RTI=OFF build errors in TrainingAreaBase
- training_area_telegrams.cpp: Fixed QJsonObject initializer syntax (Qt6 requires {{}} not ({}))
- training_area_telegrams.cpp: Fixed fromJson() methods to access m_* members directly
- training_area_telegrams.cpp: Fixed brace mismatches in multiple toJson() methods
- training_area_telegrams.h: Changed Header struct to public members for consistency
- tx_mixin.cpp: Fixed getEquipmentNumber() template for direct member access
- lts_coordinate.cpp: Added missing #include <iomanip>
- MIGRATION_STATUS.md: Added migration progress tracking document

C++17 constraint enforced due to RTI Connext DDS 7.7.0 incompatibility with C++20+

Build status: BUILD_RTI=OFF successful (0 errors, warnings only)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-23 20:49:23 +02:00

65 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 <QtCore/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, SIGNAL(timeout()),
this, SLOT(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;
}
}