Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* ISM Object Main Structure Element
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Iuliana Ojog, SLSE, 2016-11-26
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QMap>
|
||||
#include <QJsonArray>
|
||||
#include "base.h"
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
|
||||
#include <InfrastructureManagement/ism_db.h>
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
namespace InfrastructureManagement
|
||||
{
|
||||
class MainHandler;
|
||||
class ObjectStructureElement;
|
||||
class ObjectMainStructureElement : public Base
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ObjectMainStructureElement(MainHandler *mainHandler);
|
||||
ObjectMainStructureElement(const Database::IsmMainStructureElement &dbData,
|
||||
MainHandler *mainHandler);
|
||||
~ObjectMainStructureElement();
|
||||
|
||||
Core::FunctionReplyObject createObject(const MainStructureElementModifyRequest &request);
|
||||
Core::FunctionReplyObject updateObject(const MainStructureElementModifyRequest &request);
|
||||
Core::FunctionReplyObject removeObject();
|
||||
|
||||
ObjectStructureElement *createStructureElementObject(const Database::IsmStructureElement &dbData);
|
||||
|
||||
qint32 getId() const { return m_data.id(); }
|
||||
qint32 getStructureElementId() const { return m_data.structureElementId(); }
|
||||
const ObjectStructureElement *getMainStructureElementMountingPoint() const;
|
||||
QString getDescription() const { return QString::fromStdString(m_data.description()); }
|
||||
QString getName() const { return QString::fromStdString(m_data.name()); }
|
||||
std::vector<InfrastructureManagement::StructureElement> getElements() const { return m_data.elements(); }
|
||||
QMap<int, ObjectStructureElement *> getStructureElements() const { return m_objectStructureElements; }
|
||||
const MainStructureElement &getData() const { return m_data; }
|
||||
const MainFootprint &getFootprint() const { return m_footprint; }
|
||||
void setFootprintData(const std::vector<FootprintElement> &elements);
|
||||
QJsonArray getAvailableInExerciseJsonArray() const;
|
||||
int getBridgeStatus() const;
|
||||
std::vector<int32_t> getAvailableInExercise() const;
|
||||
bool isValid() const;
|
||||
Core::FunctionReplyObject updatePosition(const Core::GeoPosition &position);
|
||||
void noticeNewProperties(bool remove = false);
|
||||
Core::FunctionReplyObject setBridgeStatus(const BridgeStatus &st);
|
||||
std::vector<StructureElement> deleteEGCUOverrides(const MainStructureElement &data, int oldExerciseId, int newExerciseId, QSet<int> &modifiedStructureElements);
|
||||
bool isTopLevel(StructureElementType structureElementTypeId);
|
||||
|
||||
// convert methods
|
||||
static Database::IsmMainStructureElement toDbData(const MainStructureElement &ddsData); // dds -> db
|
||||
|
||||
void onPublishData();
|
||||
|
||||
private: // methods
|
||||
Core::FunctionReplyObject createStructureElements(MainStructureElement &mse,
|
||||
QVector<ObjectStructureElement *> &objSeVec);
|
||||
Core::FunctionReplyObject updatePaths(MainStructureElement &mse,
|
||||
const QVector<ObjectStructureElement *> &objSeVec,
|
||||
const std::vector<int> &childParentMapping);
|
||||
static bool isStructureElementDeletable(const StructureElement &se);
|
||||
|
||||
private: // attributes
|
||||
MainStructureElement m_data;
|
||||
MainFootprint m_footprint;
|
||||
bool m_footprintNeedsUpdate = true;
|
||||
QMap<int, ObjectStructureElement *> m_objectStructureElements; // must be sorted
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user