- Formatted all CodeGen module files (9 files) - Formatted LtsAppDescriptor module files - Formatted LtsAppManager/AppChooser files - Applied clang-format to all DTC and enum headers across modules - Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/) Cosmetic changes only, no functional modifications. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
61 lines
1.4 KiB
C++
61 lines
1.4 KiB
C++
|
|
|
|
#pragma once
|
|
|
|
#include "svccoreclient_export.h"
|
|
|
|
#include <DDS/Core/core_dts_types.h>
|
|
#include <QtCore/QObject>
|
|
#include <QtCore/QThread>
|
|
|
|
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::PortType portType, const QString& properties = QStringLiteral(""));
|
|
|
|
void publishState();
|
|
|
|
private:
|
|
NGL::INGLLogger& m_logger;
|
|
void init(DDSConnector::DdsConnector* ddsConnector);
|
|
void setNewStateInternal(Core::RunningState newState, const QString& errorString = QString());
|
|
void addPortInternal(unsigned short number, Core::PortType portType,
|
|
const QString& properties = QStringLiteral(""));
|
|
|
|
private:
|
|
NGL::INGLLogger& m_logger;
|
|
static constexpr const int m_publishTimerDelay = 3000;
|
|
|
|
CurrentRunningState m_state;
|
|
QTimer* m_publishTimer = nullptr;
|
|
QThread* m_paceThread = nullptr;
|
|
|
|
DTS::CurrentRunningStateImpl* m_dtsCurrentRunningState;
|
|
};
|
|
} // namespace Core
|