Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.h
T
berrux-dev e4743d631d Reduce qt6-after tree to release validation scope
Kept: TetraIF/, Z/src, Lts/Common, Lts/Proxies/TrainingAreaBase
(tabTelegrams dependency of TetraIF) plus build scaffolding
(cmake/, include/, external/, doxygen/, tests/, translations/,
lts-cc.conf, CTestCustom.ctest, new_docker_build.sh, rti_license.dat).
Removed: out-of-scope Lts modules (Application, DDS, Plugins, Projects,
Services, Tools, Viewer, all Proxies except TrainingAreaBase),
top-level src/, specs/, Qt5 tree (qt5-before + .gitmodules entry),
migration reports and leftover scripts.
2026-10-13 17:24:34 +02:00

63 lines
1.6 KiB
C++

/**
* The Pacemaker class implements functionality to publish Service states in DDS.
* $Id$
* $HeadURL$
* $Author$
* Created by Hannes Baeuerle, SLSE, 29.02.2016
*/
#pragma once
#include <QtCore/QObject>
#include <QtCore/QThread>
#include <DDS/Core/core_dts_types.h>
#include "core_export.h"
namespace DDSConnector
{
class DdsConnector;
}
class QTimer;
namespace NGL
{
class INGLLogger;
}
namespace Core
{
class CORE_CLIENT_EXPORT Pacemaker final : public QObject
{
Q_OBJECT
public:
explicit Pacemaker(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
: Pacemaker(ddsConnector.get())
{}
explicit Pacemaker(DDSConnector::DdsConnector *ddsConnector);
~Pacemaker();
void startTimer();
public Q_SLOTS:
void setNewState(Core::RunningState newState, const QString &errorString = QString());
void addPort(unsigned short number, Core::CorePortType portType, const QString &properties = QStringLiteral(""));
// only public for special purposes, not needed to call explicitly by default
void publishState();
private:
void init(DDSConnector::DdsConnector *ddsConnector);
void setNewStateInternal(Core::RunningState newState, const QString &errorString = QString());
void addPortInternal(unsigned short number, Core::CorePortType portType, const QString &properties = QStringLiteral(""));
private:
static constexpr const int m_publishTimerDelay = 3000;
CurrentRunningState m_state;
QTimer *m_publishTimer = nullptr;
QThread *m_paceThread = nullptr;
DTS::CurrentRunningStateImpl *m_dtsCurrentRunningState;
NGL::INGLLogger &m_logger;
};
} // namespace Core