95 lines
2.6 KiB
C++
95 lines
2.6 KiB
C++
#pragma once
|
|
|
|
// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert
|
|
// Für die Migration erstellen wir minimale Forward-Declarations
|
|
|
|
#include <cstdint>
|
|
#include <functional>
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
#include <QObject>
|
|
|
|
#include "LtsUtils/LtsUtilsCore/data_modification_enum.h"
|
|
#include "ProjectDataManagement/pdm_types.h"
|
|
|
|
namespace AlarmManagement
|
|
{
|
|
|
|
// Position-Struct (wird normalerweise von DDS generiert)
|
|
struct Position
|
|
{
|
|
double longitude = 0.0;
|
|
double latitude = 0.0;
|
|
|
|
double lon() const { return longitude; }
|
|
double lat() const { return latitude; }
|
|
};
|
|
|
|
// Notification-Struct (wird normalerweise von DDS generiert)
|
|
struct Notification
|
|
{
|
|
int32_t id = 0;
|
|
int64_t time() const { return timestamp; }
|
|
int64_t timestamp = 0;
|
|
int32_t type = 0;
|
|
int32_t priority = 0;
|
|
int32_t status = 0;
|
|
std::string description;
|
|
|
|
// Zusätzliche Member für AlarmHistoryModel
|
|
int32_t operatorId() const { return m_operatorId; }
|
|
int32_t equipmentNumber() const { return m_equipmentNumber; }
|
|
std::optional<int32_t> participantId() const { return m_participantId; }
|
|
std::optional<int32_t> aesId() const { return m_aesId; }
|
|
ProjectDataManagement::EventType eventType() const { return m_eventType; }
|
|
Position position() const { return m_position; }
|
|
const std::string& properties() const { return m_properties; }
|
|
|
|
int32_t m_operatorId = 0;
|
|
int32_t m_equipmentNumber = 0;
|
|
std::optional<int32_t> m_participantId;
|
|
std::optional<int32_t> m_aesId;
|
|
ProjectDataManagement::EventType m_eventType = ProjectDataManagement::EventType::Unknown;
|
|
Position m_position;
|
|
std::string m_properties;
|
|
};
|
|
|
|
namespace Interface
|
|
{
|
|
|
|
// Dtc interface class with signals for Qt6 migration STUB
|
|
class Dtc : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit Dtc(QObject* parent = nullptr) : QObject(parent) {}
|
|
~Dtc() override = default;
|
|
|
|
// Callback registration instead of enableNotification()
|
|
void notifications(std::function<void(const Notification&)> callback)
|
|
{
|
|
m_notificationCallback = callback;
|
|
}
|
|
|
|
// Trigger notification changed (for STUB testing)
|
|
void triggerNotificationChanged(const Notification& notification, DataModification modType)
|
|
{
|
|
emit notificationChanged(notification, modType);
|
|
if (m_notificationCallback)
|
|
{
|
|
m_notificationCallback(notification);
|
|
}
|
|
}
|
|
|
|
signals:
|
|
void notificationChanged(const Notification& notification, DataModification modType);
|
|
|
|
private:
|
|
std::function<void(const Notification&)> m_notificationCallback;
|
|
};
|
|
|
|
class Ftc;
|
|
} // namespace Interface
|
|
} // namespace AlarmManagement
|