- 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>
94 lines
2.4 KiB
C++
Executable File
94 lines
2.4 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* StreamNameMapping
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Christian Fröbel, NLSE, 2018-03-12
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "svcavmcommon_export.h"
|
|
#include <QtCore/QObject>
|
|
#include <QtCore/QString>
|
|
#include <QtCore/QRegExp>
|
|
#include <cstdint>
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
|
|
enum class DataModification;
|
|
|
|
|
|
namespace AudioVideoManagement
|
|
{
|
|
|
|
namespace Interface
|
|
{
|
|
class Dtc;
|
|
}
|
|
|
|
class StreamName;
|
|
|
|
/**
|
|
* In AVS, the names of audio and video streams need to be unique within a given exercise.
|
|
* As the stream name used internally by AVS is not necessarily what the user wants
|
|
* to see in the GUI, we define a mapping from internalName to displayName.
|
|
*
|
|
* The internalName is assigned by the AVM Service. Here, the stream name will probably
|
|
* contain the MountingPoint-Id.
|
|
* The displayName is determined by properties of the MountingPoint.
|
|
*
|
|
* For each MountingPoint the AVS service will publish the corresponding internal-
|
|
* and displayName and thus serves as the source of this mapping.
|
|
*
|
|
* @author Christian Fröbel
|
|
*/
|
|
class AVM_COMMON_EXPORT StreamNameMapping : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
struct Names
|
|
{
|
|
QString internal;
|
|
QString display;
|
|
};
|
|
|
|
/**
|
|
* Don't use directly, use create() instead.
|
|
* Only provided for UnitTests.
|
|
*/
|
|
StreamNameMapping() = default;
|
|
|
|
static StreamNameMapping *create(Interface::Dtc *dtc);
|
|
|
|
QString internalName(int32_t mountingPointId) const;
|
|
QString internalName(const QString &displayName);
|
|
|
|
QString displayName(int32_t mountingPointId) const;
|
|
|
|
/** The internalName might contain a source specifier "(S)" or "(L)" at the end. */
|
|
QString displayName(const QString &internalName) const;
|
|
|
|
std::vector<Names> allNames() const;
|
|
|
|
signals:
|
|
void changed(int32_t mountingPointId, const QString &internalName, const QString &displayName);
|
|
|
|
private slots:
|
|
void onStreamNameChanged(const StreamName &streamName, DataModification modType);
|
|
|
|
private:
|
|
void define(int32_t mountingPointId, const Names &names);
|
|
void remove(int32_t mountingPointId);
|
|
|
|
/** Used to extract the effective streamName if it contains a source specifier "(S)" or "(L)". */
|
|
const QRegExp m_extractor{QStringLiteral("(.*)(\\([SL]\\))"), Qt::CaseInsensitive};
|
|
std::map<int32_t, Names> m_mpToNames; //!< MountingPoint-Id -> internal AVS name
|
|
std::map<QString, QString> m_internalToDisplay;
|
|
};
|
|
|
|
} // namespace AudioVideoManagement
|