- 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>
132 lines
4.8 KiB
C++
132 lines
4.8 KiB
C++
#pragma once
|
|
|
|
#include "ltsscripttimeline_export.h"
|
|
#include "track_entry_painters.h"
|
|
|
|
#include <QtCore/QJsonObject>
|
|
#include <QtCore/QObject>
|
|
|
|
namespace LtsScriptTimeline
|
|
{
|
|
|
|
class LTSSCRIPTTIMELINE_EXPORT TrackEntry : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit TrackEntry(const TrackEntryType& tet = TrackEntryType::INVALID)
|
|
: QObject(), m_topicId(-1), m_startTime(-1), m_length(-1), m_type(tet), isSet(false), index(-1), x(-1), y(-1),
|
|
h(-1), w(-1)
|
|
{
|
|
}
|
|
|
|
explicit TrackEntry(int topicId, int startTime, int length, LtsScriptTimeline::TrackEntryType type,
|
|
const QJsonObject& detailData, const QString& channelName, const QString& description)
|
|
: QObject(), m_topicId(topicId), m_startTime(startTime), m_length(length), m_type(type), isSet(false),
|
|
index(-1), x(-1), y(-1), h(-1), w(-1), m_detailData(detailData), m_channelName(channelName)
|
|
|
|
,
|
|
m_description(description)
|
|
{
|
|
}
|
|
|
|
explicit TrackEntry(const TrackEntry& te)
|
|
: QObject(), m_topicId(te.m_topicId), m_startTime(te.m_startTime), m_length(te.m_length), m_type(te.m_type),
|
|
isSet(te.isSet), index(te.index), x(te.x), y(te.y), h(te.h), w(te.w), m_detailData(te.m_detailData),
|
|
m_channelName(te.m_channelName), m_description(te.m_description),
|
|
m_filterParentChannel(te.m_filterParentChannel)
|
|
{
|
|
}
|
|
|
|
explicit TrackEntry(TrackEntry* te)
|
|
: QObject(), m_topicId(te->m_topicId), m_startTime(te->m_startTime), m_length(te->m_length), m_type(te->m_type),
|
|
isSet(te->isSet), index(te->index), x(te->x), y(te->y), h(te->h), w(te->w), m_detailData(te->m_detailData),
|
|
m_channelName(te->m_channelName), m_description(te->m_description),
|
|
m_filterParentChannel(te->m_filterParentChannel)
|
|
{
|
|
}
|
|
|
|
TrackEntry(const TrackEntryType& tet, int length)
|
|
: QObject(), m_topicId(-1), m_startTime(-1), m_length(length), m_type(tet), isSet(false), index(-1), x(-1),
|
|
y(-1), h(-1), w(-1)
|
|
{
|
|
}
|
|
|
|
~TrackEntry() {}
|
|
|
|
TrackEntry& operator=(const TrackEntry& other)
|
|
{
|
|
this->m_topicId = other.m_topicId;
|
|
this->m_startTime = other.m_startTime;
|
|
this->m_length = other.m_length;
|
|
this->m_type = other.m_type;
|
|
this->isSet = other.isSet;
|
|
this->index = other.index;
|
|
this->x = other.x;
|
|
this->y = other.y;
|
|
this->h = other.h;
|
|
this->w = other.w;
|
|
this->m_detailData = other.m_detailData;
|
|
this->m_channelName = other.m_channelName;
|
|
this->m_filterParentChannel = other.m_filterParentChannel;
|
|
this->m_description = other.m_description;
|
|
|
|
return *this;
|
|
}
|
|
|
|
int m_topicId;
|
|
int m_startTime;
|
|
int m_length;
|
|
TrackEntryType m_type;
|
|
bool isSet;
|
|
int index;
|
|
|
|
double x;
|
|
double y;
|
|
double h;
|
|
double w;
|
|
|
|
QJsonObject m_detailData;
|
|
QString m_channelName;
|
|
QString m_description;
|
|
QString m_filterParentChannel;
|
|
|
|
QJsonObject toJson() const
|
|
{
|
|
return QJsonObject({{QStringLiteral("topicId"), m_topicId},
|
|
{QStringLiteral("startTime"), m_startTime},
|
|
{QStringLiteral("length"), m_length},
|
|
{QStringLiteral("type"), static_cast<int>(m_type)},
|
|
{QStringLiteral("isSet"), isSet},
|
|
{QStringLiteral("index"), index},
|
|
{QStringLiteral("x"), x},
|
|
{QStringLiteral("y"), y},
|
|
{QStringLiteral("w"), w},
|
|
{QStringLiteral("h"), h},
|
|
{QStringLiteral("detailData"), m_detailData},
|
|
{QStringLiteral("channelName"), m_channelName},
|
|
{QStringLiteral("description"), m_description},
|
|
{QStringLiteral("filterParentChannel"), m_filterParentChannel}});
|
|
}
|
|
|
|
void fromJson(const QJsonObject& obj)
|
|
{
|
|
m_topicId = obj[QStringLiteral("topicId")].toInt();
|
|
m_startTime = obj[QStringLiteral("startTime")].toInt(-1);
|
|
m_length = obj[QStringLiteral("length")].toInt(-1);
|
|
m_type = static_cast<TrackEntryType>(obj[QStringLiteral("type")].toInt());
|
|
isSet = obj[QStringLiteral("isSet")].toBool();
|
|
index = obj[QStringLiteral("index")].toInt();
|
|
x = obj[QStringLiteral("x")].toDouble();
|
|
y = obj[QStringLiteral("y")].toDouble();
|
|
w = obj[QStringLiteral("w")].toDouble();
|
|
h = obj[QStringLiteral("h")].toDouble();
|
|
m_detailData = obj[QStringLiteral("detailData")].toObject();
|
|
m_channelName = obj[QStringLiteral("channelName")].toString();
|
|
m_description = obj[QStringLiteral("description")].toString();
|
|
m_filterParentChannel = obj[QStringLiteral("filterParentChannel")].toString();
|
|
}
|
|
};
|
|
|
|
} // namespace LtsScriptTimeline
|