/** * @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 { return QString::fromStdString(m_data.name()); } QString MountingPoint::fileName() const { 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) const { Q_UNUSED(currState); return MountingPointState(); } const StructureElement &MountingPoint::data() const { return m_data; } void MountingPoint::updateData(const StructureElement &data, int floorId) { m_data = data; m_floor = floorId; } int32_t MountingPoint::associatedAssetId() const { return m_associatedAssetId; } bool MountingPoint::hasAssociatedAsset() const { return m_associatedAssetId >= 0; } bool MountingPoint::hasAssociatedAssetDefect() const { return m_hasAssociatedAssetDefect; } MountingPointState MountingPoint::aimState() const { return m_aimState; } void MountingPoint::setAimState(const MountingPointState &mps) { m_aimState = mps; } bool MountingPoint::isValid() const { return m_isValid; } Core::RelativePosition MountingPoint::relPosition() const { return m_data.relPosition(); } int32_t MountingPoint::buildingId() const { return m_data.mainStructureElementId(); } int MountingPoint::floor() const { return m_floor; } void MountingPoint::setFloor(int floor) { m_floor = floor; } QByteArray MountingPoint::properties() const { return QByteArray::fromStdString(m_data.properties()); } QString MountingPoint::type() const { return QString::number(static_cast(m_data.mountingPointTypeId())); } } // namespace InfrastructureManagement