Continues migration with DDS, Common

This commit is contained in:
torsten committed 2026-07-17 12:41:42 +02:00
1 parent 9b15cee841
commit fa48db111e
668 files changed
+111841 -2

No files matched your search

+87
View File
@@ -0,0 +1,87 @@
#pragma once
#include <LtsSession/ltssession_export.h>
#include <LtsWidgets/lts_dialog.h>
#include <DDS/Core/core_ftc.h>
#include <QPointer>
#include <memory>
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace LtsSession
{
class LTSSESSION_EXPORT TopicLockHandler : public QObject
{
Q_OBJECT
public:
TopicLockHandler();
~TopicLockHandler();
bool init(const std::shared_ptr<Core::Interface::Ftc> &coreFtc, int exerciseId);
bool isLocked() const { return m_locked; }
LtsWidgets::TopicInfo getTopicInfo() const { return m_topicInfo; }
public slots:
void slotTryLock(const LtsWidgets::TopicInfo &topicInfo);
bool slotUnlock();
void slotFinalize();
signals:
void signalLockDialog(const QString &lockedBy);
void signalUnlockDialog();
private:
bool lock();
bool unlock();
std::string objStateAsString() const;
std::shared_ptr<Core::Interface::Ftc> m_coreFtc;
LtsWidgets::TopicInfo m_topicInfo;
int m_lockEntityId{0};
int m_exerciseId{0};
bool m_locked{false};
bool m_askedForLock{false};
bool m_deleteAfterAnswer{false};
NGL::INGLLogger &m_logger;
};
class LTSSESSION_EXPORT TopicLockHanderData : public QObject
{
Q_OBJECT
public:
TopicLockHanderData();
~TopicLockHanderData();
void init(const std::shared_ptr<Core::Interface::Ftc> &coreFtc, int exerciseId);
void unlock();
void slotTryLock(const LtsWidgets::TopicInfo &topicInfo);
bool isLocked() const;
LtsWidgets::TopicInfo getTopicInfo() const;
const QString &getLockedBy() const { return m_lockedBy; }
Q_SIGNALS:
void lockDataChanged();
private Q_SLOTS:
void slotLock(const QString &lockedBy);
void slotUnlock();
public:
QString m_debugName;
private:
QPointer<TopicLockHandler> m_topicLockHandler;
QString m_lockedBy;
};
}