64 lines
2.9 KiB
C++
Executable File
64 lines
2.9 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* ISM Handler Instrumentation Assets
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Iuliana Ojog, SLSE, 2016-11-26
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QHash>
|
|
|
|
#include "base.h"
|
|
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
namespace InfrastructureManagement
|
|
{
|
|
class ObjectInstrumentationAsset;
|
|
class MainHandler;
|
|
class HandlerInstrumentationAsset final : public Base
|
|
, protected Interface::Fts::InstrumentationAssetModifyRequestHandler
|
|
, protected Interface::Fts::InstrumentationAssetRemoveRequestHandler
|
|
, protected Interface::Fts::InstrumentationAssetSetStateRequestHandler
|
|
, protected Interface::Fts::InstrumentationAssetUnmountRequestHandler
|
|
{
|
|
public:
|
|
explicit HandlerInstrumentationAsset(MainHandler *mainHandler);
|
|
~HandlerInstrumentationAsset();
|
|
|
|
bool init();
|
|
|
|
ObjectInstrumentationAsset *createInstrumentationAssetForMse(int buildingId, int structureElementId);
|
|
bool removeInstrumentationAssetForMse(int assetId);
|
|
bool setAssetState(int assetId, InstrumentationAssetState state);
|
|
bool setAssetAvailableInExercise(int32_t assetId, const std::vector<int32_t> &exercises);
|
|
|
|
QHash<int, ObjectInstrumentationAsset *> getObjectInstrumentationAssetMap() const
|
|
{
|
|
return m_ObjectInstrumentationAssetMap;
|
|
}
|
|
ObjectInstrumentationAsset *getAssetFromBarcode(const QString &barcode) const;
|
|
ObjectInstrumentationAsset *getAssetFromId(int32_t assetId) const ;
|
|
ObjectInstrumentationAsset *getAssetFromBarcodeAndId(const QString &barcode, int32_t assetId) const;
|
|
private:
|
|
void onInstrumentationAssetModifyRequest(const rti::core::SampleIdentity &cookie,
|
|
const InstrumentationAssetModifyRequest &request) override;
|
|
Core::FunctionReplyObject instrumentationAssetCreate(const InstrumentationAssetModifyRequest &request, int *assetId = nullptr);
|
|
Core::FunctionReplyObject instrumentationAssetModify(const InstrumentationAssetModifyRequest &request);
|
|
void onInstrumentationAssetRemoveRequest(const rti::core::SampleIdentity &cookie,
|
|
const Core::RemoveElementRequest &request) override;
|
|
Core::FunctionReplyObject onInstrumentationAssetRemove(const Core::RemoveElementRequest &request);
|
|
void onInstrumentationAssetSetStateRequest(const rti::core::SampleIdentity &cookie,
|
|
const InstrumentationAssetSetStateRequest &request) override;
|
|
Core::FunctionReplyObject instrumentationAssetSetState(const InstrumentationAssetSetStateRequest &request);
|
|
void onInstrumentationAssetUnmountRequest(const rti::core::SampleIdentity &cookie,
|
|
const InstrumentationAssetUnmountRequest &request) override;
|
|
Core::FunctionReplyObject instrumentationAssetUnmount(const InstrumentationAssetUnmountRequest &request);
|
|
|
|
private:
|
|
QHash<int, ObjectInstrumentationAsset *> m_ObjectInstrumentationAssetMap;
|
|
};
|
|
}
|