- 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>
90 lines
2.0 KiB
C++
90 lines
2.0 KiB
C++
|
|
|
|
#pragma once
|
|
|
|
#include "ltsscripttimeline_export.h"
|
|
|
|
#include <QtGui/QColor>
|
|
#include <QtGui/QIcon>
|
|
#include <QtGui/QPainter>
|
|
#include <QtGui/QPen>
|
|
#include <QtCore/QRect>
|
|
|
|
namespace LtsScriptTimeline
|
|
{
|
|
class TrackEntry;
|
|
|
|
enum class TrackEntryType {
|
|
INVALID,
|
|
SituationMap,
|
|
SituationReplay,
|
|
Image,
|
|
Text,
|
|
Pdf,
|
|
Xml,
|
|
TacticalPlan,
|
|
MSOffice,
|
|
OpenOffice,
|
|
Audio,
|
|
Video,
|
|
Building,
|
|
SituationMapFilter,
|
|
Snapshot,
|
|
Evaluation,
|
|
Report,
|
|
Situation
|
|
};
|
|
LTSSCRIPTTIMELINE_EXPORT QString translateTrackEntryType(const TrackEntryType& tet);
|
|
LTSSCRIPTTIMELINE_EXPORT QString trackEntryTypeName(const TrackEntryType& tet);
|
|
LTSSCRIPTTIMELINE_EXPORT QIcon appToIcon(const TrackEntryType type);
|
|
|
|
inline std::ostream& operator<<(std::ostream& stream, const TrackEntryType tet)
|
|
{
|
|
return stream << trackEntryTypeName(tet).toStdString();
|
|
}
|
|
|
|
class LTSSCRIPTTIMELINE_EXPORT TrackEntryPainter
|
|
{
|
|
public:
|
|
explicit TrackEntryPainter(const QColor& bgColor = QColor(0, 0, 0),
|
|
const QString& trackEntryType = QStringLiteral("INVALID"))
|
|
: m_bgColor(bgColor), m_trackEntryType(trackEntryType)
|
|
{
|
|
}
|
|
|
|
void paintEvent(QPainter& painter, const QRect& rect)
|
|
{
|
|
painter.setPen(QPen(Qt::black));
|
|
painter.drawText(rect.adjusted(3, 0, 5000, 0), m_trackEntryType);
|
|
}
|
|
|
|
QColor bgColor() const
|
|
{
|
|
return m_bgColor;
|
|
}
|
|
|
|
void setBgColor(const QColor& bgColor)
|
|
{
|
|
m_bgColor = bgColor;
|
|
}
|
|
|
|
const QString& trackEntryType() const
|
|
{
|
|
return m_trackEntryType;
|
|
}
|
|
|
|
void setTrackEntryType(const QString& trackEntryType)
|
|
{
|
|
m_trackEntryType = trackEntryType;
|
|
}
|
|
|
|
protected:
|
|
QColor m_bgColor;
|
|
QString m_trackEntryType;
|
|
};
|
|
|
|
void drawTrackEntry(TrackEntry* te, QPainter& painter, const QRect& trackRect, bool isSelected, bool isEnabled = true);
|
|
TrackEntryPainter* getTrackEntryPainter(const TrackEntryType& type);
|
|
|
|
} // namespace LtsScriptTimeline
|