Fix FileManagement Build-Fehler (BUILD_RTI=OFF)
- flm_db.h: Stub-Header mit Folder/FileContent Klassen erstellt - flm_enums.hpp: MainFolder Enum hinzugefügt (None=0) - flm_translation.h: toInt() entfernt, trFolderName() angepasst - Plugin-Interfaces erstellt (flm, opm, exm) - Viewer-Dialogs: QString-Konvertierungen behoben - AdvancedSymbology CMakeLists.txt: Ungültige Pfade entfernt - ism_mounting_point.cpp: Redundante Definitionen entfernt Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
c21083700a
commit
e5d8bfa432
15 files changed
+815
-91
No files matched your search
+145
@@ -0,0 +1,145 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* The MountingPoint class wraps all information from InfrastructureManagement which defines a mounting point
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hannes Baeuerle, SLSE, 2017-01-16
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ismshared_export.h"
|
||||
#include "ism.hpp"
|
||||
#include <QImage>
|
||||
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace core
|
||||
{
|
||||
static inline uint qHash(const InfrastructureManagement::MountingPointType &mpt)
|
||||
{
|
||||
return ::qHash(static_cast<int32_t>(mpt));
|
||||
}
|
||||
} // namespace core
|
||||
} // namespace dds
|
||||
|
||||
namespace InfrastructureManagement
|
||||
{
|
||||
|
||||
class ISMSHARED_EXPORT MountingPoint
|
||||
{
|
||||
public:
|
||||
explicit MountingPoint();
|
||||
explicit MountingPoint(const StructureElement &data, int floorId);
|
||||
static void init();
|
||||
|
||||
const StructureElement &data() const { return m_data; }
|
||||
void updateData(const StructureElement &data, int floorId) { m_data = data; m_floor = floorId; }
|
||||
int32_t id() const { return m_data.id(); }
|
||||
int32_t associatedAssetId() const { return m_associatedAssetId; }
|
||||
bool hasAssociatedAsset() const { return m_associatedAssetId > 0; }
|
||||
bool hasAssociatedAssetDefect() const { return m_hasAssociatedAssetDefect; }
|
||||
|
||||
/*! \name aimState depends on the (loaded) plan/schedule!!! */
|
||||
//@{
|
||||
|
||||
//! \brief aimState of currently loaded schedule!!!
|
||||
//! \return aimState
|
||||
MountingPointState aimState() const { return m_aimState; }
|
||||
void setAimState(const MountingPointState &mps) { m_aimState = mps;}
|
||||
|
||||
//@}
|
||||
|
||||
bool isValid() const { return m_isValid; }
|
||||
Core::GeoPosition geoPosition() const { return m_data.geoPosition(); }
|
||||
Core::RelativePosition relPosition() const { return m_data.relPosition(); }
|
||||
MountingPointType type() const { return m_data.mountingPointTypeId(); }
|
||||
int32_t buildingId() const { return m_data.mainStructureElementId(); }
|
||||
QString name() const;
|
||||
QString fileName() const;
|
||||
QByteArray properties() const { return m_data.properties().c_str(); }
|
||||
|
||||
QImage toImage(int32_t edgeLength = 100) const;
|
||||
bool writeFile(int32_t edgeLength = 25) const;
|
||||
int floor() const { return m_floor; }
|
||||
void setFloor(int floor) { m_floor = floor; }
|
||||
|
||||
void setAssociatedAssetId(int32_t id);
|
||||
void setHasAssociatedAssetDefect(bool hasAssociatedAssetDefect);
|
||||
MountingPointState getNextMountingPointState(const MountingPointState currState);
|
||||
|
||||
private: // methods
|
||||
|
||||
private: // attributes
|
||||
StructureElement m_data;
|
||||
int32_t m_associatedAssetId;
|
||||
MountingPointState m_aimState;
|
||||
bool m_hasAssociatedAssetDefect;
|
||||
bool m_isValid;
|
||||
int m_floor;
|
||||
|
||||
public:
|
||||
|
||||
enum class MpColor
|
||||
{
|
||||
GRAY,
|
||||
BLUE,
|
||||
RED,
|
||||
GREEN,
|
||||
ORANGE
|
||||
};
|
||||
static QString mpColorToString(MpColor mpColor);
|
||||
static QString mpColorToPostfix(MpColor mpColor);
|
||||
|
||||
struct NameImagePair
|
||||
{
|
||||
NameImagePair(const QString &name = QString(),
|
||||
const QImage &img = QImage())
|
||||
: m_name(name), m_img(img)
|
||||
{}
|
||||
QString m_name; // like announcement_BLUE
|
||||
QImage m_img;
|
||||
};
|
||||
struct MpNameImageData
|
||||
{
|
||||
NameImagePair nipGray;
|
||||
NameImagePair nipBlue;
|
||||
NameImagePair nipRed;
|
||||
NameImagePair nipGreen;
|
||||
NameImagePair nipOrange;
|
||||
};
|
||||
|
||||
//
|
||||
// Some methods regarding ImageTable:
|
||||
//
|
||||
static QMap<MountingPointType_def::type, MpNameImageData> &getImageTable(); // contains images in good quality (100*100px)
|
||||
|
||||
static bool getImageAttributePlanActivity(const MountingPoint& mp,
|
||||
QImage &imgOut, QString &attribNameOut);
|
||||
static bool getImageAttributePlanDefinition(const MountingPoint& mp,
|
||||
QImage &imgOut, QString &attribNameOut);
|
||||
|
||||
static bool getImageAttribute(const MountingPoint& mp, MpColor mpColor,
|
||||
QImage &img, QString &attribName);
|
||||
|
||||
private:
|
||||
static QMap<MountingPointType_def::type, MpNameImageData> &getImageTableInternal();
|
||||
static void insertHelper(MountingPointType_def::type type,
|
||||
const QString &name,
|
||||
const QString &colorCodeGray,
|
||||
const QString &colorCodeGreen,
|
||||
const QString &colorCodeRed,
|
||||
const QString &colorCodeOrange,
|
||||
const QString &defName = QString());
|
||||
|
||||
static QImage getImage(const MountingPoint &mp);
|
||||
|
||||
static const MpNameImageData *getNameImageData(const MountingPoint&mp);
|
||||
static const NameImagePair *getNameImagePair(const MountingPoint&mp);
|
||||
|
||||
|
||||
}; // class MountingPoint
|
||||
|
||||
} // namespace InfrastructureManagement
|
||||
Reference in new issue
Block a user