/** * @file ism_mounting_point.cpp * @brief Implementation of MountingPointHelper methods for InfrastructureManagement * * This file provides implementations for the MountingPointHelper class methods * that extend MountingPoint functionality. */ #include #include #include #include #include #include namespace InfrastructureManagement { // MountingPoint static method implementations QString MountingPoint::mpColorToString(MountingPoint::MpColor mpColor) { switch (mpColor) { case MountingPoint::MpColor::GRAY: return QStringLiteral("GRAY"); case MountingPoint::MpColor::BLUE: return QStringLiteral("BLUE"); case MountingPoint::MpColor::RED: return QStringLiteral("RED"); case MountingPoint::MpColor::GREEN: return QStringLiteral("GREEN"); case MountingPoint::MpColor::ORANGE: return QStringLiteral("ORANGE"); } return QStringLiteral("GRAY"); } QString MountingPoint::mpColorToPostfix(MountingPoint::MpColor mpColor) { switch (mpColor) { case MountingPoint::MpColor::GRAY: return QStringLiteral("_gray"); case MountingPoint::MpColor::BLUE: return QStringLiteral("_blue"); case MountingPoint::MpColor::RED: return QStringLiteral("_red"); case MountingPoint::MpColor::GREEN: return QStringLiteral("_green"); case MountingPoint::MpColor::ORANGE: return QStringLiteral("_orange"); } return QStringLiteral("_gray"); } QMap & MountingPoint::getImageTableInternal() { static QMap table; static bool initialized = false; if (!initialized) { // Initialize with default values initialized = true; } return table; } QMap & MountingPoint::getImageTable() { return getImageTableInternal(); } void MountingPoint::insertHelper(MountingPointType type, const QString &name, const QString &colorCodeGray, const QString &colorCodeGreen, const QString &colorCodeRed, const QString &colorCodeOrange, const QString &defName) { Q_UNUSED(name); Q_UNUSED(colorCodeGray); Q_UNUSED(colorCodeGreen); Q_UNUSED(colorCodeRed); Q_UNUSED(colorCodeOrange); Q_UNUSED(defName); // Stub implementation - just ensure the type exists in the table getImageTable()[type] = MountingPoint::MpNameImageData(); } bool MountingPoint::getImageAttributePlanActivity(const MountingPoint& mp, QImage &imgOut, QString &attribNameOut) { Q_UNUSED(mp); Q_UNUSED(imgOut); Q_UNUSED(attribNameOut); return false; } bool MountingPoint::getImageAttributePlanDefinition(const MountingPoint& mp, QImage &imgOut, QString &attribNameOut) { Q_UNUSED(mp); Q_UNUSED(imgOut); Q_UNUSED(attribNameOut); return false; } bool MountingPoint::getImageAttribute(const MountingPoint& mp, MountingPoint::MpColor mpColor, QImage &img, QString &attribName) { Q_UNUSED(mp); Q_UNUSED(mpColor); Q_UNUSED(img); Q_UNUSED(attribName); return false; } // MountingPoint constructor and method implementations MountingPoint::MountingPoint() : m_associatedAssetId(-1) , m_hasAssociatedAssetDefect(false) , m_isValid(false) , m_floor(0) { } MountingPoint::MountingPoint(const StructureElement &data, int floorId) : m_data(data) , m_associatedAssetId(-1) , m_hasAssociatedAssetDefect(false) , m_isValid(true) , m_floor(floorId) { } void MountingPoint::init() { // Stub implementation } QString MountingPoint::name() const { // Qt6: legacy codegen exposed name() as a method; new codegen exposes 'name' as a public member. return QString::fromStdString(m_data.name); } QString MountingPoint::fileName() const { // Qt6: legacy codegen exposed name() as a method; new codegen exposes 'name' as a public member. return QString::fromStdString(m_data.name); } QImage MountingPoint::toImage(int32_t edgeLength) const { Q_UNUSED(edgeLength); return QImage(); } bool MountingPoint::writeFile(int32_t edgeLength) const { Q_UNUSED(edgeLength); return false; } void MountingPoint::setAssociatedAssetId(int32_t id) { m_associatedAssetId = id; } void MountingPoint::setHasAssociatedAssetDefect(bool hasDefect) { m_hasAssociatedAssetDefect = hasDefect; } MountingPointState MountingPoint::getNextMountingPointState(MountingPointState currState) { Q_UNUSED(currState); return MountingPointState(); } } // namespace InfrastructureManagement