Apply clang-format to Lts/Common and DTC/enum headers
- 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>
This commit is contained in:
848 files changed
+89305
-100020
No files matched your search
Executable → Regular
+94
-87
@@ -1,124 +1,131 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <TopicEditorBase/topic_editor_utils.h>
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QVector>
|
||||
|
||||
#include <TopicEditorBase/topic_editor_utils.h>
|
||||
|
||||
class QWidget;
|
||||
|
||||
namespace TopicEditorBase { class ExportNotifier; }
|
||||
|
||||
namespace TopicEditorBase
|
||||
{
|
||||
class ExportNotifier;
|
||||
}
|
||||
|
||||
namespace TopicReplay
|
||||
{
|
||||
|
||||
|
||||
|
||||
class Interface
|
||||
{
|
||||
|
||||
public:
|
||||
static QJsonObject timeRange(qint64 start, qint64 end)
|
||||
{
|
||||
return { {QStringLiteral("start"), start}, {QStringLiteral("end"), end} };
|
||||
}
|
||||
|
||||
struct SituationReplayTime
|
||||
{
|
||||
int id = 0;
|
||||
|
||||
qint64 topicStart_s = -1;
|
||||
qint64 topicEnd_s = -1;
|
||||
|
||||
qint64 replayStart_ms = -1;
|
||||
qint64 replayEnd_ms = -1;
|
||||
double replaySpeedFactor = 1;
|
||||
|
||||
QJsonObject toReplayInformation() const
|
||||
public:
|
||||
static QJsonObject timeRange(qint64 start, qint64 end)
|
||||
{
|
||||
return {
|
||||
{QStringLiteral("id"), id},
|
||||
{QStringLiteral("timeInPresentation"), timeRange(topicStart_s * 1000, topicEnd_s * 1000)},
|
||||
};
|
||||
return {{QStringLiteral("start"), start}, {QStringLiteral("end"), end}};
|
||||
}
|
||||
QJsonObject toPlaybackTime(double max) const
|
||||
|
||||
struct SituationReplayTime
|
||||
{
|
||||
QJsonObject ret = timeRange(replayStart_ms, std::min(replayEnd_ms * replaySpeedFactor, max));
|
||||
ret[QStringLiteral("replaySpeedFactor")] = replaySpeedFactor;
|
||||
return ret;
|
||||
}
|
||||
QJsonObject toJson(double maxReplayEndMs) const
|
||||
int id = 0;
|
||||
|
||||
qint64 topicStart_s = -1;
|
||||
qint64 topicEnd_s = -1;
|
||||
|
||||
qint64 replayStart_ms = -1;
|
||||
qint64 replayEnd_ms = -1;
|
||||
double replaySpeedFactor = 1;
|
||||
|
||||
QJsonObject toReplayInformation() const
|
||||
{
|
||||
return {
|
||||
{QStringLiteral("id"), id},
|
||||
{QStringLiteral("timeInPresentation"), timeRange(topicStart_s * 1000, topicEnd_s * 1000)},
|
||||
};
|
||||
}
|
||||
|
||||
QJsonObject toPlaybackTime(double max) const
|
||||
{
|
||||
QJsonObject ret = timeRange(replayStart_ms, std::min(replayEnd_ms * replaySpeedFactor, max));
|
||||
ret[QStringLiteral("replaySpeedFactor")] = replaySpeedFactor;
|
||||
return ret;
|
||||
}
|
||||
|
||||
QJsonObject toJson(double maxReplayEndMs) const
|
||||
{
|
||||
return {
|
||||
{QStringLiteral("playbackTime"), toPlaybackTime(maxReplayEndMs)},
|
||||
{QStringLiteral("replayInformation"), toReplayInformation()},
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Interface() = default;
|
||||
virtual ~Interface() = default;
|
||||
|
||||
virtual QWidget* createWidget()
|
||||
{
|
||||
return {
|
||||
{QStringLiteral("playbackTime"), toPlaybackTime(maxReplayEndMs)},
|
||||
{QStringLiteral("replayInformation"), toReplayInformation()},
|
||||
};
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
Interface() = default;
|
||||
virtual ~Interface() = default;
|
||||
virtual bool playbackInit(const QJsonObject& attributes)
|
||||
{
|
||||
Q_UNUSED(attributes);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
virtual bool playbackStart(int secondsOffset)
|
||||
{
|
||||
Q_UNUSED(secondsOffset);
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual QWidget *createWidget() { return nullptr; }
|
||||
virtual bool playbackPause()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual bool playbackStop()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool playbackInit(const QJsonObject &attributes) { Q_UNUSED(attributes); return true; }
|
||||
virtual void setExportPlaybackTimes(qint64 startTimeSec, qint64 durationSec,
|
||||
const QVector<SituationReplayTime>& sitReplayTimes)
|
||||
{
|
||||
Q_UNUSED(startTimeSec);
|
||||
Q_UNUSED(durationSec);
|
||||
Q_UNUSED(sitReplayTimes);
|
||||
}
|
||||
|
||||
|
||||
virtual bool playbackStart(int secondsOffset) { Q_UNUSED(secondsOffset); return true; }
|
||||
virtual bool playbackPause() { return true; }
|
||||
virtual bool playbackStop() { return true; }
|
||||
virtual bool exportTopic(const QJsonObject& attributes, const QString& strFolderPath,
|
||||
TopicEditorBase::ExportNotifier* pExportNotifier) = 0;
|
||||
|
||||
|
||||
virtual QVector<TopicEditorBase::TopicData> additionalTrackEntries(const QJsonObject& attributes) const
|
||||
{
|
||||
Q_UNUSED(attributes);
|
||||
return {};
|
||||
}
|
||||
|
||||
virtual void setExportPlaybackTimes(
|
||||
qint64 startTimeSec, qint64 durationSec, const QVector<SituationReplayTime> &sitReplayTimes
|
||||
)
|
||||
{
|
||||
Q_UNUSED(startTimeSec);
|
||||
Q_UNUSED(durationSec);
|
||||
Q_UNUSED(sitReplayTimes);
|
||||
}
|
||||
virtual bool exportTopic(
|
||||
const QJsonObject &attributes, const QString &strFolderPath, TopicEditorBase::ExportNotifier *pExportNotifier
|
||||
) = 0;
|
||||
|
||||
|
||||
virtual QVector<TopicEditorBase::TopicData> additionalTrackEntries(const QJsonObject &attributes) const
|
||||
{
|
||||
Q_UNUSED(attributes);
|
||||
return {};
|
||||
}
|
||||
|
||||
virtual QVector<TopicEditorBase::TopicData> additionalTrackEntries(const QJsonObject &attributes, bool &keepOriginalTopic) const
|
||||
{
|
||||
keepOriginalTopic = true;
|
||||
return additionalTrackEntries(attributes);
|
||||
}
|
||||
|
||||
virtual void setBasePath(const QString &basePath) { Q_UNUSED(basePath); }
|
||||
virtual QVector<TopicEditorBase::TopicData> additionalTrackEntries(const QJsonObject& attributes,
|
||||
bool& keepOriginalTopic) const
|
||||
{
|
||||
keepOriginalTopic = true;
|
||||
return additionalTrackEntries(attributes);
|
||||
}
|
||||
|
||||
virtual void setBasePath(const QString& basePath)
|
||||
{
|
||||
Q_UNUSED(basePath);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class Factory
|
||||
{
|
||||
|
||||
public:
|
||||
virtual ~Factory() = default;
|
||||
virtual Interface *createInterface(TopicEditorBase::TopicType topicType) = 0;
|
||||
|
||||
public:
|
||||
virtual ~Factory() = default;
|
||||
virtual Interface* createInterface(TopicEditorBase::TopicType topicType) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace TopicReplay
|
||||
Reference in new issue
Block a user