Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen
- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung - 44 Export-Header Include-Pfade korrigiert (_export.h) - 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h) - INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros - Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits) - FATAL_LOG Makro hinzugefügt - InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h) - FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h) - AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp) - SymbolAppearance Klasse vollständig definiert mit content() Methode - BuildingComponentFilter Klasse definiert mit Copy-Konstruktor - Ftc Factory: nullptr Return (abstract class) - AesFilter Klasse in aes.hpp hinzugefügt - Dtc Klasse in ppm.hpp mit participantChanged Signal - AesType Enum: alle 15 At* Werte definiert - AesEffectState_def: EsReceived hinzugefügt - DataModification Enum: eAdded/eModified/eRemoved - function_reply_object.h → core_types.h Include-Pfad (72 Dateien) - Enum-Class-Streaming Template-Operator in INGLLogger.h - ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen - ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge - QRegExp → QRegularExpression in tpm_js_parser.cpp - .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert - Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2785 files changed
+18754
-18316
No files matched your search
@@ -35,7 +35,7 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
|
||||
# generate ism_[d|f]tc.h
|
||||
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV WS HLA svcIsmCommon SHARED ${SRCS_common})
|
||||
NGL_ADD_LIBRARY2(AAR SV WS HLA svcIsmCommon SHARED ${SRCS_common})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcIsmCommon
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -68,7 +68,7 @@ SET(SRCS_client
|
||||
# generate ism_[d|f]tc_impl.[cpp|h]
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV WS HLA svcIsmClient SHARED ${SRCS_client})
|
||||
NGL_ADD_LIBRARY2(AAR SV WS HLA svcIsmClient SHARED ${SRCS_client})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcIsmClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -102,7 +102,7 @@ SET(SRCS_server
|
||||
# generate ism_[d|f]ts.h, ism_[d|f]ts_impl.[cpp|h]
|
||||
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(WS AAR SV svcIsmServer SHARED ${SRCS_server})
|
||||
NGL_ADD_LIBRARY2(WS AAR SV svcIsmServer SHARED ${SRCS_server})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcIsmServer
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
|
||||
+43
-44
@@ -34,7 +34,6 @@ using namespace InfrastructureManagement;
|
||||
// ------------------------------------------------------------------------------
|
||||
IsmImportBuildings::IsmImportBuildings(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_logger(getLogger("ImportXml"))
|
||||
{
|
||||
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
|
||||
connect(this, &IsmImportBuildings::importDone, this, &IsmImportBuildings::importNext);
|
||||
@@ -43,7 +42,7 @@ IsmImportBuildings::IsmImportBuildings(QObject *parent)
|
||||
// ------------------------------------------------------------------------------
|
||||
bool IsmImportBuildings::init(int domainId, const QUrl &tcpDiscoveryUrl)
|
||||
{
|
||||
INFO_LOG(m_logger) << "init begin";
|
||||
INFO_LOG() << "init begin";
|
||||
|
||||
// initialize DDS, always on exercise 0
|
||||
m_ddsConnector.reset(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Global, 0, 0, tcpDiscoveryUrl));
|
||||
@@ -51,13 +50,13 @@ bool IsmImportBuildings::init(int domainId, const QUrl &tcpDiscoveryUrl)
|
||||
return false;
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
DEBUG_LOG(m_logger) << "create dtc";
|
||||
DEBUG_LOG() << "create dtc";
|
||||
m_dtc = InfrastructureManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
|
||||
DEBUG_LOG(m_logger) << "create ftc";
|
||||
DEBUG_LOG() << "create ftc";
|
||||
m_ftc = InfrastructureManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
|
||||
DEBUG_LOG(m_logger) << "init dtc & ftc";
|
||||
DEBUG_LOG() << "init dtc & ftc";
|
||||
bool bRet = m_ftc->enableMainStructureElementModify() &&
|
||||
m_ftc->enableMainStructureElementRemove() &&
|
||||
m_ftc->enableMountingPointAssetRemove() &&
|
||||
@@ -69,9 +68,9 @@ bool IsmImportBuildings::init(int domainId, const QUrl &tcpDiscoveryUrl)
|
||||
m_dtc->enableMountingPointAsset() &&
|
||||
m_dtc->enableMainSchedule();
|
||||
|
||||
DEBUG_LOG(m_logger) << "init dtc, ftc end - bRet = " << bRet;
|
||||
DEBUG_LOG() << "init dtc, ftc end - bRet = " << bRet;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Domain Id = " << domainId;
|
||||
DEBUG_LOG() << "Domain Id = " << domainId;
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@@ -92,7 +91,7 @@ void IsmImportBuildings::import(const QVector<ImportData> &importData)
|
||||
QCoreApplication::quit();
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "Trying to import " << m_importData.size() << " buildings";
|
||||
DEBUG_LOG() << "Trying to import " << m_importData.size() << " buildings";
|
||||
m_curImportIdx = 0;
|
||||
import(m_importData.at(m_curImportIdx));
|
||||
}
|
||||
@@ -147,11 +146,11 @@ void IsmImportBuildings::remove(int buildingId)
|
||||
QMap<int, QVector<InfrastructureManagement::InstrumentationAsset>> assetsMapBuilding;
|
||||
m_dtc->getAllAssetsPerBuilding(predicate, assetsMapBuilding);
|
||||
|
||||
DEBUG_LOG(m_logger) << "assetsMapBuilding.size = " << assetsMapBuilding.size();
|
||||
DEBUG_LOG() << "assetsMapBuilding.size = " << assetsMapBuilding.size();
|
||||
|
||||
assetsMounted = (assetsMapBuilding[buildingId].size() > 0);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Building id = " << buildingId << " has assets mounted = " << assetsMounted;
|
||||
DEBUG_LOG() << "Building id = " << buildingId << " has assets mounted = " << assetsMounted;
|
||||
|
||||
// cfroebel 2018-11-30:
|
||||
// Currently the ISM service fails to correctly remove a building when it has mounted assets (other than BCU).
|
||||
@@ -160,7 +159,7 @@ void IsmImportBuildings::remove(int buildingId)
|
||||
if (assetsMounted)
|
||||
{
|
||||
QString msg = QStringLiteral("Not possible to remove building with id %1 because there are assets mounted!").arg(buildingId);
|
||||
ERROR_LOG(m_logger) << msg;
|
||||
ERROR_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
m_idsToBeRemoved.pop_front();
|
||||
IsmImportBuildings::removeNext();
|
||||
@@ -172,7 +171,7 @@ void IsmImportBuildings::remove(int buildingId)
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmImportBuildings::doImport()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to Import / Modify";
|
||||
INFO_LOG() << "trying to Import / Modify";
|
||||
ParseBuildingXml buildingXml(m_currentData.xmlFileName,
|
||||
m_currentData.vulFileName,
|
||||
m_currentData.egcuToRoomFileName,
|
||||
@@ -181,21 +180,21 @@ void IsmImportBuildings::doImport()
|
||||
m_currentData.angleDegree);
|
||||
if (!buildingXml.parseXml())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Can not parse building files: " << buildingXml.lastError();
|
||||
ERROR_LOG() << "Can not parse building files: " << buildingXml.lastError();
|
||||
std::cerr << "Can not parse building files name: " << m_currentData.xmlFileName
|
||||
<< " error: " << buildingXml.lastError() << std::endl;
|
||||
QCoreApplication::exit(1);
|
||||
return;
|
||||
}
|
||||
INFO_LOG(m_logger) << "Sending request";
|
||||
INFO_LOG() << "Sending request";
|
||||
|
||||
MainStructureElementModifyRequest req = buildingXml.parsedRequest();
|
||||
QByteArray propertiesBa = QByteArray::fromStdString(req.properties());
|
||||
QJsonParseError parserError;
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(propertiesBa, &parserError));
|
||||
if (parserError.error != QJsonParseError::NoError)
|
||||
WARNING_LOG(m_logger) << "Error parsing json document: " << parserError.errorString() << " '" << propertiesBa << "'";
|
||||
DEBUG_LOG(m_logger) << "json to parse: " << doc.toJson();
|
||||
WARNING_LOG() << "Error parsing json document: " << parserError.errorString() << " '" << propertiesBa << "'";
|
||||
DEBUG_LOG() << "json to parse: " << doc.toJson();
|
||||
QJsonObject obj(doc.object());
|
||||
if (m_currentData.exerciseId > 0)
|
||||
{
|
||||
@@ -221,11 +220,11 @@ void IsmImportBuildings::doImport()
|
||||
{
|
||||
m_isInRestoringMode = true;
|
||||
msg = "Building " + req.name() + " already exists. All related data is now saved.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
|
||||
msg = "Fetching IDs of MountingPints.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
QVector<qint32> mountingPointIds;
|
||||
for (const StructureElement &structureElement : oldMainStructureElement.elements())
|
||||
@@ -236,7 +235,7 @@ void IsmImportBuildings::doImport()
|
||||
}
|
||||
|
||||
msg = "Fetching MountingPointAssets.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
// get mountings of mounting points of this building
|
||||
mountings = mountingsOfStructureElements(mountingPointIds);
|
||||
@@ -245,7 +244,7 @@ void IsmImportBuildings::doImport()
|
||||
if (!mountings.isEmpty())
|
||||
{
|
||||
msg = "Removing MountingPointAssets.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
unmountAssetsOfBuliding(oldMainStructureElement.id());
|
||||
// // remove mounting point assets
|
||||
@@ -257,7 +256,7 @@ void IsmImportBuildings::doImport()
|
||||
}
|
||||
|
||||
msg = "Fetching MountingPointPlans.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
// get mounting points in plans of this building
|
||||
auto mppsBySchedule = MountingPointPlanByScheduleOfStructureElements(mountingPointIds);
|
||||
@@ -265,14 +264,14 @@ void IsmImportBuildings::doImport()
|
||||
// Don't know, why these are deleted anyways...
|
||||
for (auto it = mppsBySchedule.cbegin(); it != mppsBySchedule.cend(); ++it)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Removing MountingPointPlans.";
|
||||
INFO_LOG() << "Removing MountingPointPlans.";
|
||||
auto copy = it.value();
|
||||
for (auto &elem : copy)
|
||||
elem.mountingPointState() = MountingPointState_def::Idle;
|
||||
m_ftc->mountingPointPlanModifyRequest(MountingPointPlanModifyRequest(it.key(),copy), this);
|
||||
}
|
||||
msg = "Fetching paths of MountingPoints by name ... for later reconstruction.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
for (const StructureElement &structureElement : oldMainStructureElement.elements())
|
||||
oldNamePaths.insert(structureElement.id(), pathWithNames(structureElement, oldMainStructureElement));
|
||||
@@ -301,11 +300,11 @@ void IsmImportBuildings::doImport()
|
||||
void IsmImportBuildings::doRemove(int buildingId)
|
||||
{
|
||||
std::string msg = "Trying to Remove building with id " + QString::number(buildingId).toStdString();
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
if (!m_ftc->mainStructureElementRemoveRequest(MainStructureElementRemoveRequest(buildingId), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting remove";
|
||||
ERROR_LOG() << "Error requesting remove";
|
||||
std::cerr << "Error requesting remove" << std::endl;
|
||||
QCoreApplication::exit(1);
|
||||
return;
|
||||
@@ -403,19 +402,19 @@ StructureElement IsmImportBuildings::structureElementById(qint32 id, const MainS
|
||||
void IsmImportBuildings::createNewMainStructureElement(const MainStructureElementModifyRequest &request)
|
||||
{
|
||||
std::string msg = "Creating new MainStructureElement.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
if (!m_ftc->mainStructureElementModifyRequest(request, this))
|
||||
{
|
||||
if (m_currentData.buildingId > 0)
|
||||
ERROR_LOG(m_logger) << "Error requesting update";
|
||||
ERROR_LOG() << "Error requesting update";
|
||||
else
|
||||
ERROR_LOG(m_logger) << "Error requesting create";
|
||||
ERROR_LOG() << "Error requesting create";
|
||||
std::cerr << "Error requesting update/create" << std::endl;
|
||||
QCoreApplication::exit(1);
|
||||
return;
|
||||
}
|
||||
INFO_LOG(m_logger) << "Waiting for answer";
|
||||
INFO_LOG() << "Waiting for answer";
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
@@ -443,12 +442,12 @@ void IsmImportBuildings::restoreData(const MainStructureElement &oldMainStructur
|
||||
newMountingPointIds.append(structureElement.id());
|
||||
}
|
||||
QMap<qint32, QVector<std::string> > newNamePaths;
|
||||
INFO_LOG(m_logger) << "Restoring mounting point data.";
|
||||
INFO_LOG() << "Restoring mounting point data.";
|
||||
for (const StructureElement &structureElement : newMainStructureElement.elements())
|
||||
newNamePaths.insert(structureElement.id(), pathWithNames(structureElement, oldMainStructureElement));
|
||||
|
||||
if (oldNamePaths.size() != newNamePaths.size())
|
||||
INFO_LOG(m_logger) << "old name path size: " + QString::number(oldNamePaths.size()).toStdString() + " , new name path size: " + QString::number(newNamePaths.size()).toStdString();;
|
||||
INFO_LOG() << "old name path size: " + QString::number(oldNamePaths.size()).toStdString() + " , new name path size: " + QString::number(newNamePaths.size()).toStdString();;
|
||||
|
||||
QMap<qint32, qint32> oldStructureElementIdToNewStructureElementId;
|
||||
for (auto it = oldNamePaths.constBegin(); it != oldNamePaths.constEnd(); ++it)
|
||||
@@ -485,7 +484,7 @@ void IsmImportBuildings::restoreData(const MainStructureElement &oldMainStructur
|
||||
if (!mountings.isEmpty())
|
||||
{
|
||||
msg = "Restoring MountingPointAssets.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
// restore mountings
|
||||
for (const MountingPointAsset &mountingPointAsset : mountings)
|
||||
@@ -509,7 +508,7 @@ void IsmImportBuildings::restoreData(const MainStructureElement &oldMainStructur
|
||||
return;
|
||||
|
||||
msg = "Restoring MountingPointPlans.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
// restore mounting point plans
|
||||
MountingPointPlanModifyRequest createRequest;
|
||||
@@ -547,7 +546,7 @@ void IsmImportBuildings::unmountAssetsOfBuliding(qint32 buildingId)
|
||||
{
|
||||
msg = "Waiting for socket to open";
|
||||
std::cerr << msg << std::endl;
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
QThread::sleep(1);
|
||||
}
|
||||
|
||||
@@ -564,7 +563,7 @@ void IsmImportBuildings::unmountAssetsOfBuliding(qint32 buildingId)
|
||||
{
|
||||
std::string msg = "Got reply: " + message.toStdString();
|
||||
std::cerr << msg << std::endl;
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
hasAnswer = true;
|
||||
});
|
||||
|
||||
@@ -574,7 +573,7 @@ void IsmImportBuildings::unmountAssetsOfBuliding(qint32 buildingId)
|
||||
{
|
||||
msg = "Waiting for socket to answer";
|
||||
std::cerr << msg << std::endl;
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
QThread::sleep(1);
|
||||
}
|
||||
|
||||
@@ -598,13 +597,13 @@ void IsmImportBuildings::onMainStructureElementRemoveReply(const Core::FunctionR
|
||||
if (replyObject.error())
|
||||
{
|
||||
QString msg = QStringLiteral("Failed to remove building with id %1: %2").arg(buildingId).arg(QString::fromStdString(replyObject()));
|
||||
ERROR_LOG(m_logger) << msg;
|
||||
ERROR_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
QString msg = QStringLiteral("Removed building with id %1").arg(buildingId);
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
}
|
||||
|
||||
@@ -619,7 +618,7 @@ void IsmImportBuildings::onMountingPointPlanModifyReply(const Core::FunctionRepl
|
||||
{
|
||||
if (reply.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << reply.error();
|
||||
ERROR_LOG() << reply.error();
|
||||
std::cerr << reply.error() << std::endl;
|
||||
}
|
||||
}
|
||||
@@ -627,10 +626,10 @@ void IsmImportBuildings::onMountingPointPlanModifyReply(const Core::FunctionRepl
|
||||
// ------------------------------------------------------------------
|
||||
void IsmImportBuildings::onMountingPointAssetRemoveReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "REMOVE REPLY";
|
||||
ERROR_LOG() << "REMOVE REPLY";
|
||||
if (reply.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << reply.error();
|
||||
ERROR_LOG() << reply.error();
|
||||
std::cerr << reply.error() << std::endl;
|
||||
}
|
||||
}
|
||||
@@ -640,7 +639,7 @@ void IsmImportBuildings::onMountingPointAssetModifyReply(const Core::FunctionRep
|
||||
{
|
||||
if (reply.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << reply.error();
|
||||
ERROR_LOG() << reply.error();
|
||||
std::cerr << reply.error() << std::endl;
|
||||
}
|
||||
}
|
||||
@@ -650,7 +649,7 @@ void IsmImportBuildings::onStructureElementModifyReply(const Core::FunctionReply
|
||||
{
|
||||
if (reply.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << reply.error();
|
||||
ERROR_LOG() << reply.error();
|
||||
std::cerr << reply.error() << std::endl;
|
||||
}
|
||||
}
|
||||
@@ -660,7 +659,7 @@ bool IsmImportBuildings::handleReply(const Core::FunctionReplyObject &replyObjec
|
||||
{
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Got Reply error: " << replyObject.translated();
|
||||
ERROR_LOG() << "Got Reply error: " << replyObject.translated();
|
||||
std::cerr << "Error importing building" << std::endl;
|
||||
QCoreApplication::exit(1);
|
||||
return false;
|
||||
|
||||
+95
-96
@@ -51,7 +51,6 @@ IsmTests::IsmTests(QObject *parent)
|
||||
, m_structureElementId(0)
|
||||
, m_indexNo(0)
|
||||
, m_bTestsSuccessful(true)
|
||||
, m_logger(getLogger("Test"))
|
||||
{
|
||||
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
|
||||
}
|
||||
@@ -64,7 +63,7 @@ IsmTests::~IsmTests()
|
||||
// ------------------------------------------------------------------------------
|
||||
bool IsmTests::init(int domainId, int testId, int assetId, int mainStructureElementId, int structureElementId, int indexNo)
|
||||
{
|
||||
INFO_LOG(m_logger) << "init begin";
|
||||
INFO_LOG() << "init begin";
|
||||
|
||||
m_testId = testId;
|
||||
m_assetId = assetId;
|
||||
@@ -82,30 +81,30 @@ bool IsmTests::init(int domainId, int testId, int assetId, int mainStructureElem
|
||||
m_dbHandler = std::make_shared<DbHandler>();
|
||||
if(!m_dbHandler->init(0, Settings::settings()))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation dbHandler failed.";
|
||||
ERROR_LOG() << "Initialisation dbHandler failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "Initialisation dbHandler succesful.";
|
||||
DEBUG_LOG() << "Initialisation dbHandler succesful.";
|
||||
m_db = m_dbHandler->db();
|
||||
|
||||
TRACE_LOG(m_logger) << "create dtc";
|
||||
TRACE_LOG() << "create dtc";
|
||||
m_dtc = InfrastructureManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
TRACE_LOG(m_logger) << "init dtc";
|
||||
TRACE_LOG() << "init dtc";
|
||||
bool bRet = m_dtc->enableAll();
|
||||
TRACE_LOG(m_logger) << "init dtc end - bRet = " << bRet;
|
||||
TRACE_LOG() << "init dtc end - bRet = " << bRet;
|
||||
|
||||
TRACE_LOG(m_logger) << "create ftc";
|
||||
TRACE_LOG() << "create ftc";
|
||||
m_ftc = InfrastructureManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
TRACE_LOG(m_logger) << "init ftc";
|
||||
TRACE_LOG() << "init ftc";
|
||||
bRet &= m_ftc->enableAll();
|
||||
TRACE_LOG(m_logger) << "init ftc end - bRet = " << bRet;
|
||||
TRACE_LOG() << "init ftc end - bRet = " << bRet;
|
||||
|
||||
DEBUG_LOG(m_logger) << "########### Domain Id = " << domainId;
|
||||
DEBUG_LOG(m_logger) << "########### Test Id = " << testId;
|
||||
DEBUG_LOG(m_logger) << "########### Asset Id = " << assetId;
|
||||
DEBUG_LOG(m_logger) << "########### Main Structure Element Id = " << mainStructureElementId;
|
||||
DEBUG_LOG(m_logger) << "########### Structure Element Id = " << structureElementId;
|
||||
DEBUG_LOG(m_logger) << "########### Index No = " << indexNo;
|
||||
DEBUG_LOG() << "########### Domain Id = " << domainId;
|
||||
DEBUG_LOG() << "########### Test Id = " << testId;
|
||||
DEBUG_LOG() << "########### Asset Id = " << assetId;
|
||||
DEBUG_LOG() << "########### Main Structure Element Id = " << mainStructureElementId;
|
||||
DEBUG_LOG() << "########### Structure Element Id = " << structureElementId;
|
||||
DEBUG_LOG() << "########### Index No = " << indexNo;
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@@ -113,7 +112,7 @@ bool IsmTests::init(int domainId, int testId, int assetId, int mainStructureElem
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::startTest()
|
||||
{
|
||||
INFO_LOG(m_logger) << "********* startTest **************";
|
||||
INFO_LOG() << "********* startTest **************";
|
||||
// main structure elements
|
||||
switch (m_testId)
|
||||
{
|
||||
@@ -180,7 +179,7 @@ void IsmTests::startTest()
|
||||
failExit();
|
||||
break;
|
||||
}
|
||||
INFO_LOG(m_logger) << "********* endTest **************";
|
||||
INFO_LOG() << "********* endTest **************";
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
|
||||
@@ -198,7 +197,7 @@ static void addElementToRequest(MainStructureElementModifyRequest &request,
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryCreateMainStructureElement()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send MainStructureElementCreateRequest";
|
||||
INFO_LOG() << "trying to send MainStructureElementCreateRequest";
|
||||
|
||||
MainStructureElementModifyRequest data;
|
||||
|
||||
@@ -444,7 +443,7 @@ void IsmTests::tryCreateMainStructureElement()
|
||||
|
||||
// if (!m_ftc->mainStructureElementModifyRequest(data, this))
|
||||
// {
|
||||
// ERROR_LOG(m_logger) << "Error requesting create data (building)";
|
||||
// ERROR_LOG() << "Error requesting create data (building)";
|
||||
// failExit();
|
||||
// }
|
||||
|
||||
@@ -454,18 +453,18 @@ void IsmTests::tryCreateMainStructureElement()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryModifyMainStructureElement()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send MainStructureElementModifyRequest ";
|
||||
INFO_LOG() << "trying to send MainStructureElementModifyRequest ";
|
||||
m_dtc->waitForHistoricalDataMainStructureElement();
|
||||
InfrastructureManagement::MainStructureElement mse = m_dtc->mainStructureElement(m_mainStructureElementId);
|
||||
InfrastructureManagement::MainStructureElementModifyRequest data;
|
||||
|
||||
if (mse.id() == 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Modify MainStructureElement with id = " << mse.id();
|
||||
DEBUG_LOG() << "Modify MainStructureElement with id = " << mse.id();
|
||||
|
||||
// creating ModifyRequest
|
||||
data.id(mse.id());
|
||||
@@ -485,7 +484,7 @@ void IsmTests::tryModifyMainStructureElement()
|
||||
m_replyFinished = false;
|
||||
if (!m_ftc->mainStructureElementModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -501,7 +500,7 @@ void IsmTests::tryModifyMainStructureElement()
|
||||
for (size_t i = 0; i < mse.elements().size(); ++i)
|
||||
{
|
||||
se = mse.elements().at(i);
|
||||
DEBUG_LOG(m_logger) << "Updating barcode for element (" << i << ") with old barcode = " << se.barcode();
|
||||
DEBUG_LOG() << "Updating barcode for element (" << i << ") with old barcode = " << se.barcode();
|
||||
|
||||
se.barcode("BARCODE");
|
||||
seData.elements().push_back(se);
|
||||
@@ -509,7 +508,7 @@ void IsmTests::tryModifyMainStructureElement()
|
||||
|
||||
if (!m_ftc->structureElementModifyRequest(seData, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -519,20 +518,20 @@ void IsmTests::tryModifyMainStructureElement()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryRemoveMainStructureElement()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send MainStructureElementRemoveRequest for mse id = " << m_mainStructureElementId;
|
||||
INFO_LOG() << "trying to send MainStructureElementRemoveRequest for mse id = " << m_mainStructureElementId;
|
||||
|
||||
m_dtc->waitForHistoricalDataMainStructureElement();
|
||||
InfrastructureManagement::MainStructureElement mse = m_dtc->mainStructureElement(m_mainStructureElementId);
|
||||
|
||||
if (mse.id() == 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Cannot find main structure element with id = " << m_mainStructureElementId;
|
||||
ERROR_LOG() << "Cannot find main structure element with id = " << m_mainStructureElementId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
if (!m_ftc->mainStructureElementRemoveRequest(MainStructureElementRemoveRequest(m_mainStructureElementId), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting delete data";
|
||||
ERROR_LOG() << "Error requesting delete data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -542,7 +541,7 @@ void IsmTests::tryRemoveMainStructureElement()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryCreateBridge()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send MainStructureElementCreateRequest";
|
||||
INFO_LOG() << "trying to send MainStructureElementCreateRequest";
|
||||
|
||||
MainStructureElementModifyRequest data;
|
||||
|
||||
@@ -575,7 +574,7 @@ void IsmTests::tryCreateBridge()
|
||||
|
||||
if (!m_ftc->mainStructureElementModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data (bridge)";
|
||||
ERROR_LOG() << "Error requesting create data (bridge)";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -586,18 +585,18 @@ void IsmTests::tryCreateBridge()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryChangeBridgeStatus()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send MainStructureElementModifyBridgeStatusRequest ";
|
||||
INFO_LOG() << "trying to send MainStructureElementModifyBridgeStatusRequest ";
|
||||
m_dtc->waitForHistoricalDataMainStructureElement();
|
||||
InfrastructureManagement::MainStructureElement mse = m_dtc->mainStructureElement(m_mainStructureElementId);
|
||||
InfrastructureManagement::MainStructureElementModifyBridgeStatusRequest data;
|
||||
|
||||
if (mse.id() == 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Modify MainStructureElement with id = " << mse.id();
|
||||
DEBUG_LOG() << "Modify MainStructureElement with id = " << mse.id();
|
||||
|
||||
// creating ModifyRequest
|
||||
data.id(mse.id());
|
||||
@@ -609,7 +608,7 @@ void IsmTests::tryChangeBridgeStatus()
|
||||
m_replyFinished = false;
|
||||
if (!m_ftc->mainStructureElementModifyBridgeStatusRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify bridge status";
|
||||
ERROR_LOG() << "Error requesting modify bridge status";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -623,7 +622,7 @@ void IsmTests::tryChangeBridgeStatus()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryCreateAsset()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send AssetCreateRequest";
|
||||
INFO_LOG() << "trying to send AssetCreateRequest";
|
||||
|
||||
InstrumentationAssetModifyRequest data;
|
||||
|
||||
@@ -634,7 +633,7 @@ void IsmTests::tryCreateAsset()
|
||||
|
||||
if (!m_ftc->instrumentationAssetModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -647,7 +646,7 @@ void IsmTests::tryCreateAsset()
|
||||
|
||||
if (!m_ftc->instrumentationAssetModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -660,7 +659,7 @@ void IsmTests::tryCreateAsset()
|
||||
|
||||
if (!m_ftc->instrumentationAssetModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -673,7 +672,7 @@ void IsmTests::tryCreateAsset()
|
||||
|
||||
if (!m_ftc->instrumentationAssetModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -684,21 +683,21 @@ void IsmTests::tryCreateAsset()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryModifyAsset()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send asset modify request ";
|
||||
INFO_LOG() << "trying to send asset modify request ";
|
||||
|
||||
DEBUG_LOG(m_logger) << "m_assetId = " << m_assetId;
|
||||
DEBUG_LOG() << "m_assetId = " << m_assetId;
|
||||
|
||||
m_dtc->waitForHistoricalDataInstrumentationAsset();
|
||||
const InfrastructureManagement::InstrumentationAsset &ast = m_dtc->instrumentationAsset(m_assetId);
|
||||
// const InfrastructureManagement::InstrumentationAsset &ast1 = m_dtc->instrumentationAssets()[m_assetId];
|
||||
InfrastructureManagement::InstrumentationAssetModifyRequest data;
|
||||
|
||||
DEBUG_LOG(m_logger) << "ast.id() = " << ast.id();
|
||||
// DEBUG_LOG(m_logger) << "ast1.id() = " << ast1.id();
|
||||
DEBUG_LOG() << "ast.id() = " << ast.id();
|
||||
// DEBUG_LOG() << "ast1.id() = " << ast1.id();
|
||||
|
||||
if (ast.id() == 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Cannot find Asset Id = " << m_assetId;
|
||||
ERROR_LOG() << "Cannot find Asset Id = " << m_assetId;
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
@@ -715,7 +714,7 @@ void IsmTests::tryModifyAsset()
|
||||
|
||||
if (!m_ftc->instrumentationAssetModifyRequest(InstrumentationAssetModifyRequest(data), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -726,20 +725,20 @@ void IsmTests::tryModifyAsset()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryRemoveAsset()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send AssetRemoveRequest for id = " << m_assetId;
|
||||
INFO_LOG() << "trying to send AssetRemoveRequest for id = " << m_assetId;
|
||||
|
||||
m_dtc->waitForHistoricalDataInstrumentationAsset();
|
||||
const InfrastructureManagement::InstrumentationAsset &ast = m_dtc->instrumentationAsset(m_assetId);
|
||||
|
||||
if (ast.id() == 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Cannot find Asset Id = " << m_assetId;
|
||||
ERROR_LOG() << "Cannot find Asset Id = " << m_assetId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
if (!m_ftc->instrumentationAssetRemoveRequest(InstrumentationAssetRemoveRequest(m_assetId), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting delete data";
|
||||
ERROR_LOG() << "Error requesting delete data";
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -748,21 +747,21 @@ void IsmTests::tryRemoveAsset()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryUnmountAsset()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send asset state modify request ";
|
||||
INFO_LOG() << "trying to send asset state modify request ";
|
||||
|
||||
DEBUG_LOG(m_logger) << "m_assetId = " << m_assetId;
|
||||
DEBUG_LOG() << "m_assetId = " << m_assetId;
|
||||
|
||||
m_dtc->waitForHistoricalDataInstrumentationAsset();
|
||||
const InfrastructureManagement::InstrumentationAsset &ast = m_dtc->instrumentationAsset(m_assetId);
|
||||
// const InfrastructureManagement::InstrumentationAsset &ast1 = m_dtc->instrumentationAssets()[m_assetId];
|
||||
InfrastructureManagement::InstrumentationAssetSetStateRequest data;
|
||||
|
||||
DEBUG_LOG(m_logger) << "ast.id() = " << ast.id();
|
||||
// DEBUG_LOG(m_logger) << "ast1.id() = " << ast1.id();
|
||||
DEBUG_LOG() << "ast.id() = " << ast.id();
|
||||
// DEBUG_LOG() << "ast1.id() = " << ast1.id();
|
||||
|
||||
if (ast.id() == 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Cannot find Asset Id = " << m_assetId;
|
||||
ERROR_LOG() << "Cannot find Asset Id = " << m_assetId;
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
@@ -772,7 +771,7 @@ void IsmTests::tryUnmountAsset()
|
||||
|
||||
if (!m_ftc->instrumentationAssetSetStateRequest(InstrumentationAssetSetStateRequest(data), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting set asset state";
|
||||
ERROR_LOG() << "Error requesting set asset state";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -784,7 +783,7 @@ void IsmTests::tryUnmountAsset()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryCreateMountingPointAsset()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send AssetCreateRequest";
|
||||
INFO_LOG() << "trying to send AssetCreateRequest";
|
||||
|
||||
MountingPointAssetModifyRequest data;
|
||||
|
||||
@@ -794,7 +793,7 @@ void IsmTests::tryCreateMountingPointAsset()
|
||||
|
||||
if (!m_ftc->mountingPointAssetModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -804,20 +803,20 @@ void IsmTests::tryCreateMountingPointAsset()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryRemoveMountingPointAsset()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send MountingPointAssetRemoveRequest ";
|
||||
INFO_LOG() << "trying to send MountingPointAssetRemoveRequest ";
|
||||
|
||||
m_dtc->waitForHistoricalDataMountingPointAsset();
|
||||
if (!m_dtc->getMountingPointAssetId(m_structureElementId, m_assetId, m_mountingPointAssetId))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Cannot find requested mounting point asset";
|
||||
ERROR_LOG() << "Cannot find requested mounting point asset";
|
||||
failExit();
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "MountingPointAsset Id = " << m_mountingPointAssetId;
|
||||
DEBUG_LOG() << "MountingPointAsset Id = " << m_mountingPointAssetId;
|
||||
|
||||
if (!m_ftc->mountingPointAssetRemoveRequest(MountingPointAssetRemoveRequest(m_mountingPointAssetId), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting delete data";
|
||||
ERROR_LOG() << "Error requesting delete data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -828,7 +827,7 @@ void IsmTests::tryRemoveMountingPointAsset()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryCreateMainSchedule()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send MainScheduleCreateRequest";
|
||||
INFO_LOG() << "trying to send MainScheduleCreateRequest";
|
||||
|
||||
MainScheduleModifyRequest data0, data1, data2;
|
||||
|
||||
@@ -843,7 +842,7 @@ void IsmTests::tryCreateMainSchedule()
|
||||
|
||||
if (!m_ftc->mainScheduleModifyRequest(data1, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -860,7 +859,7 @@ void IsmTests::tryCreateMainSchedule()
|
||||
|
||||
if (!m_ftc->mainScheduleModifyRequest(data2, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -876,7 +875,7 @@ void IsmTests::tryCreateMainSchedule()
|
||||
|
||||
if (!m_ftc->mainScheduleModifyRequest(data0, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -886,16 +885,16 @@ void IsmTests::tryCreateMainSchedule()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryModifyMainSchedule()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send mounting point schedule modify request ";
|
||||
INFO_LOG() << "trying to send mounting point schedule modify request ";
|
||||
|
||||
m_dtc->waitForHistoricalDataMainSchedule();
|
||||
// using m_assetId as main schedule id
|
||||
InfrastructureManagement::MainSchedule ast = m_dtc->mainSchedule(m_assetId);
|
||||
InfrastructureManagement::MainScheduleModifyRequest data;
|
||||
|
||||
DEBUG_LOG(m_logger) << "m_assetId = " << m_assetId;
|
||||
DEBUG_LOG() << "m_assetId = " << m_assetId;
|
||||
|
||||
DEBUG_LOG(m_logger) << "ast.id() = " << ast.id();
|
||||
DEBUG_LOG() << "ast.id() = " << ast.id();
|
||||
|
||||
// creating ModifyRequest
|
||||
if (ast.id() > 0)
|
||||
@@ -914,13 +913,13 @@ void IsmTests::tryModifyMainSchedule()
|
||||
|
||||
if (!m_ftc->mainScheduleModifyRequest(MainScheduleModifyRequest(data), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Cannot find main schedule id = " << m_assetId;
|
||||
ERROR_LOG() << "Cannot find main schedule id = " << m_assetId;
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -929,16 +928,16 @@ void IsmTests::tryModifyMainSchedule()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryChangeStatusSchedule()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send mounting point schedule modify request ";
|
||||
INFO_LOG() << "trying to send mounting point schedule modify request ";
|
||||
|
||||
m_dtc->waitForHistoricalDataMainSchedule();
|
||||
// using m_assetId as main schedule id
|
||||
InfrastructureManagement::MainSchedule ast = m_dtc->mainSchedule(m_assetId);
|
||||
InfrastructureManagement::MainScheduleModifyRequest data;
|
||||
|
||||
DEBUG_LOG(m_logger) << "m_assetId = " << m_assetId;
|
||||
DEBUG_LOG() << "m_assetId = " << m_assetId;
|
||||
|
||||
DEBUG_LOG(m_logger) << "ast.id() = " << ast.id();
|
||||
DEBUG_LOG() << "ast.id() = " << ast.id();
|
||||
|
||||
// creating ModifyRequest
|
||||
if (ast.id() > 0)
|
||||
@@ -975,13 +974,13 @@ void IsmTests::tryChangeStatusSchedule()
|
||||
|
||||
if (!m_ftc->mainScheduleModifyRequest(MainScheduleModifyRequest(data), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Cannot find main schedule id = " << m_assetId;
|
||||
ERROR_LOG() << "Cannot find main schedule id = " << m_assetId;
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -990,20 +989,20 @@ void IsmTests::tryChangeStatusSchedule()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryRemoveMainSchedule()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send MainScheduleRemoveRequest for id = " << m_assetId;
|
||||
INFO_LOG() << "trying to send MainScheduleRemoveRequest for id = " << m_assetId;
|
||||
|
||||
m_dtc->waitForHistoricalDataMainSchedule();
|
||||
InfrastructureManagement::MainSchedule ast = m_dtc->mainSchedule(m_assetId);
|
||||
|
||||
if (ast.id() == 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Cannot find main schedule id = " << m_assetId;
|
||||
ERROR_LOG() << "Cannot find main schedule id = " << m_assetId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
if (!m_ftc->mainScheduleRemoveRequest(MainScheduleRemoveRequest(m_assetId), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting delete data";
|
||||
ERROR_LOG() << "Error requesting delete data";
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -1012,20 +1011,20 @@ void IsmTests::tryRemoveMainSchedule()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryCopySchedule()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to copy schedule";
|
||||
INFO_LOG() << "trying to copy schedule";
|
||||
|
||||
m_dtc->waitForHistoricalDataMainSchedule();
|
||||
// using m_assetId as main schedule id
|
||||
InfrastructureManagement::MainSchedule ms = m_dtc->mainSchedule(m_assetId);
|
||||
|
||||
DEBUG_LOG(m_logger) << "scheduleId = " << m_assetId;
|
||||
DEBUG_LOG(m_logger) << "ms.id() = " << ms.id();
|
||||
DEBUG_LOG() << "scheduleId = " << m_assetId;
|
||||
DEBUG_LOG() << "ms.id() = " << ms.id();
|
||||
|
||||
int newId = m_db->copySchedule(ms.id());
|
||||
|
||||
if (newId <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error copy schedule, code = " << newId;
|
||||
ERROR_LOG() << "Error copy schedule, code = " << newId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -1035,26 +1034,26 @@ void IsmTests::tryCopySchedule()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::checkSchedule()
|
||||
{
|
||||
ERROR_LOG(m_logger) << "check instrumentation plan";
|
||||
ERROR_LOG() << "check instrumentation plan";
|
||||
|
||||
m_dtc->waitForHistoricalDataMainSchedule();
|
||||
|
||||
// using m_assetId as main schedule id
|
||||
InfrastructureManagement::MainSchedule ms = m_dtc->mainSchedule(m_assetId);
|
||||
|
||||
DEBUG_LOG(m_logger) << "scheduleId = " << m_assetId;
|
||||
DEBUG_LOG(m_logger) << "ms.id() = " << ms.id();
|
||||
DEBUG_LOG() << "scheduleId = " << m_assetId;
|
||||
DEBUG_LOG() << "ms.id() = " << ms.id();
|
||||
|
||||
QList<MountingPointPlan> diff;
|
||||
bool ok = m_dtc->getScheduleDifferences(m_assetId, diff);
|
||||
|
||||
if (ok)
|
||||
ERROR_LOG(m_logger) << "Instrumentation plan complete!";
|
||||
ERROR_LOG() << "Instrumentation plan complete!";
|
||||
else
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Instrumentation plan not complete !!!";
|
||||
ERROR_LOG() << "Instrumentation plan not complete !!!";
|
||||
for (const MountingPointPlan &mpp : std::as_const(diff))
|
||||
ERROR_LOG(m_logger) << "Diff - # mpp.structureElementId() = " << mpp.structureElementId();
|
||||
ERROR_LOG() << "Diff - # mpp.structureElementId() = " << mpp.structureElementId();
|
||||
}
|
||||
|
||||
QTest::qWait(1000);
|
||||
@@ -1065,7 +1064,7 @@ void IsmTests::checkSchedule()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::tryCreateMountingPointPlan()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send MountingPointPlanCreateRequest";
|
||||
INFO_LOG() << "trying to send MountingPointPlanCreateRequest";
|
||||
|
||||
MountingPointPlanModifyRequest data;
|
||||
|
||||
@@ -1075,7 +1074,7 @@ void IsmTests::tryCreateMountingPointPlan()
|
||||
|
||||
if (!m_ftc->mountingPointPlanModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -1087,7 +1086,7 @@ void IsmTests::tryCreateMountingPointPlan()
|
||||
|
||||
if (!m_ftc->mountingPointPlanModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -1099,7 +1098,7 @@ void IsmTests::tryCreateMountingPointPlan()
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::onError(const QString &reason)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Got Reply error: " << reason;
|
||||
ERROR_LOG() << "Got Reply error: " << reason;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -1111,7 +1110,7 @@ void IsmTests::onCreateReply(const Core::FunctionReplyObject &replyObject)
|
||||
onError(replyObject.translated());
|
||||
return;
|
||||
}
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id()
|
||||
INFO_LOG() << "Got createReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
@@ -1125,7 +1124,7 @@ void IsmTests::onModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
onError(replyObject.translated());
|
||||
return;
|
||||
}
|
||||
INFO_LOG(m_logger) << "Got modifyRequest with id " << replyObject.id()
|
||||
INFO_LOG() << "Got modifyRequest with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
@@ -1138,7 +1137,7 @@ void IsmTests::onRemoveReply(const Core::FunctionReplyObject &replyObject)
|
||||
onError(replyObject.translated());
|
||||
return;
|
||||
}
|
||||
INFO_LOG(m_logger) << "Got removeReply with id " << replyObject.id()
|
||||
INFO_LOG() << "Got removeReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
@@ -1146,7 +1145,7 @@ void IsmTests::onRemoveReply(const Core::FunctionReplyObject &replyObject)
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmTests::failExit()
|
||||
{
|
||||
ERROR_LOG(m_logger) << "FAIL EXIT !";
|
||||
ERROR_LOG() << "FAIL EXIT !";
|
||||
m_bTestsSuccessful = false;
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
|
||||
+9
-10
@@ -25,7 +25,6 @@ WebSocketInterfaceHandler::WebSocketInterfaceHandler(MainHandler *mainHandler, Q
|
||||
, m_messageFactory(nullptr)
|
||||
, m_dataManager(nullptr)
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("WebSocketInterfaceHandler"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -38,34 +37,34 @@ bool WebSocketInterfaceHandler::init()
|
||||
{
|
||||
cleanup();
|
||||
|
||||
DEBUG_LOG(m_logger) << "... ok";
|
||||
DEBUG_LOG() << "... ok";
|
||||
|
||||
DEBUG_LOG(m_logger) << "Initialising DataManager";
|
||||
DEBUG_LOG() << "Initialising DataManager";
|
||||
m_dataManager = new DataManager(m_mainHandler);
|
||||
if (!m_dataManager->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Failed to initialise DataManager";
|
||||
ERROR_LOG() << "Failed to initialise DataManager";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "... ok";
|
||||
DEBUG_LOG() << "... ok";
|
||||
|
||||
m_messageFactory = new Messages::ClientMessageFactory(m_dataManager);
|
||||
m_webSocketServer = new LtsWebSocket::LtsWebSocketServer(m_messageFactory, this);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Setting Message Delay to " << Settings::messageDelay();
|
||||
DEBUG_LOG() << "Setting Message Delay to " << Settings::messageDelay();
|
||||
|
||||
m_webSocketServer->setMessageDelay(Settings::messageDelay());
|
||||
|
||||
DEBUG_LOG(m_logger) << "Initialising LtsWebSocketServer";
|
||||
DEBUG_LOG() << "Initialising LtsWebSocketServer";
|
||||
if (!m_webSocketServer->init(QStringLiteral("ISM"),
|
||||
NGL::Connections::port(NGL::Connections::eConnection::ISM_WEBSOCKET)))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Failed to initialise LtsWebSocketServer";
|
||||
ERROR_LOG() << "Failed to initialise LtsWebSocketServer";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "... ok";
|
||||
DEBUG_LOG() << "... ok";
|
||||
|
||||
DEBUG_LOG(m_logger) << "Connection signals and slots";
|
||||
DEBUG_LOG() << "Connection signals and slots";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,5 @@ protected:
|
||||
|
||||
protected:
|
||||
MainHandler *m_mainHandler;
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
}
|
||||
+5
-6
@@ -16,16 +16,15 @@ namespace InfrastructureManagement
|
||||
|
||||
DdsHandler::DdsHandler(int domainId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Any))
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
bool DdsHandler::init(const QStringList &qosFileList)
|
||||
{
|
||||
if (!m_ddsConnector->init(qosFileList))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
|
||||
ERROR_LOG() << "Error initializing dds connections - aborting";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -44,15 +43,15 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
try
|
||||
{
|
||||
bRet = m_ddsFts->enableAll();
|
||||
INFO_LOG(m_logger) << "Fts initialised";
|
||||
INFO_LOG() << "Fts initialised";
|
||||
// erst FTS funktioniert komischer Weise nicht (seit MainStructureElementModifyRequest
|
||||
// von MainStructureElement abgeleitet ist ... rti/dds - Bug?
|
||||
bRet &= m_ddsDts->enableAll();
|
||||
INFO_LOG(m_logger) << "Dts initialised";
|
||||
INFO_LOG() << "Dts initialised";
|
||||
}
|
||||
catch (const dds::core::Exception &e)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Exception: " << e.what();
|
||||
ERROR_LOG() << "Exception: " << e.what();
|
||||
m_pacemaker->setNewState(Core::RunningState::StoppedError);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -56,8 +56,6 @@ private:
|
||||
|
||||
std::shared_ptr<InfrastructureManagement::Interface::Dts> m_ddsDts;
|
||||
std::shared_ptr<InfrastructureManagement::Interface::Fts> m_ddsFts;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* @file ism.hpp
|
||||
* @brief DDS-Stub-Header für InfrastructureManagement
|
||||
*
|
||||
* Dieser Header ersetzt die von RTI DDS Generator erzeugten Typen.
|
||||
*/
|
||||
|
||||
#ifndef ISM_HPP
|
||||
#define ISM_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <QString>
|
||||
#include "ism_enums.hpp"
|
||||
|
||||
namespace InfrastructureManagement {
|
||||
|
||||
// Core namespace mit GeoPosition und RelativePosition
|
||||
namespace Core {
|
||||
|
||||
class GeoPosition {
|
||||
public:
|
||||
GeoPosition() : latitude_(0.0), longitude_(0.0), altitude_(0.0) {}
|
||||
double latitude() const { return latitude_; }
|
||||
double longitude() const { return longitude_; }
|
||||
double altitude() const { return altitude_; }
|
||||
void latitude(double v) { latitude_ = v; }
|
||||
void longitude(double v) { longitude_ = v; }
|
||||
void altitude(double v) { altitude_ = v; }
|
||||
private:
|
||||
double latitude_;
|
||||
double longitude_;
|
||||
double altitude_;
|
||||
};
|
||||
|
||||
class RelativePosition {
|
||||
public:
|
||||
RelativePosition() : x_(0.0), y_(0.0), z_(0.0) {}
|
||||
double x() const { return x_; }
|
||||
double y() const { return y_; }
|
||||
double z() const { return z_; }
|
||||
void x(double v) { x_ = v; }
|
||||
void y(double v) { y_ = v; }
|
||||
void z(double v) { z_ = v; }
|
||||
private:
|
||||
double x_;
|
||||
double y_;
|
||||
double z_;
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
||||
// StructureElement Stub-Klasse
|
||||
class StructureElement {
|
||||
public:
|
||||
StructureElement() : id_(0), mainStructureElementId_(0), mountingPointTypeId_(MountingPointType::Undefined) {}
|
||||
|
||||
int32_t id() const { return id_; }
|
||||
void id(int32_t v) { id_ = v; }
|
||||
|
||||
int32_t mainStructureElementId() const { return mainStructureElementId_; }
|
||||
void mainStructureElementId(int32_t v) { mainStructureElementId_ = v; }
|
||||
|
||||
MountingPointType mountingPointTypeId() const { return mountingPointTypeId_; }
|
||||
void mountingPointTypeId(MountingPointType v) { mountingPointTypeId_ = v; }
|
||||
|
||||
Core::GeoPosition geoPosition() const { return geoPosition_; }
|
||||
void geoPosition(const Core::GeoPosition& v) { geoPosition_ = v; }
|
||||
|
||||
Core::RelativePosition relPosition() const { return relPosition_; }
|
||||
void relPosition(const Core::RelativePosition& v) { relPosition_ = v; }
|
||||
|
||||
std::string properties() const { return properties_; }
|
||||
void properties(const std::string& v) { properties_ = v; }
|
||||
|
||||
std::string name() const { return name_; }
|
||||
void name(const std::string& v) { name_ = v; }
|
||||
|
||||
std::string displayName() const { return displayName_; }
|
||||
void displayName(const std::string& v) { displayName_ = v; }
|
||||
|
||||
private:
|
||||
int32_t id_;
|
||||
int32_t mainStructureElementId_;
|
||||
MountingPointType mountingPointTypeId_;
|
||||
Core::GeoPosition geoPosition_;
|
||||
Core::RelativePosition relPosition_;
|
||||
std::string properties_;
|
||||
std::string name_;
|
||||
std::string displayName_;
|
||||
};
|
||||
|
||||
} // namespace InfrastructureManagement
|
||||
|
||||
#endif // ISM_HPP
|
||||
@@ -0,0 +1,114 @@
|
||||
/**
|
||||
* @file ism_enums.hpp
|
||||
* @brief DDS-Stub-Header für InfrastructureManagement Enums
|
||||
*/
|
||||
|
||||
#ifndef ISM_ENUMS_HPP
|
||||
#define ISM_ENUMS_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <QString>
|
||||
#include <QDebug>
|
||||
|
||||
namespace InfrastructureManagement {
|
||||
|
||||
// MountingPointType als enum class mit allen Werten
|
||||
enum class MountingPointType : int32_t {
|
||||
Undefined = 0,
|
||||
Generic = 1,
|
||||
Sensor = 2,
|
||||
Actuator = 3,
|
||||
BuildingSensorModule = 4,
|
||||
OutdoorCamera = 5,
|
||||
IndoorCamera = 6,
|
||||
OutdoorIPS = 7,
|
||||
IndoorIPS = 8,
|
||||
MeteoDataUnit = 9,
|
||||
AnnouncementUnit = 10,
|
||||
BuildingNetworkSwitch = 11,
|
||||
EffectGenerationControlUnit = 12,
|
||||
Unknown = 13
|
||||
};
|
||||
|
||||
// MountingPointState als enum class mit allen Werten
|
||||
enum class MountingPointState : int32_t {
|
||||
Undefined = 0,
|
||||
Equipped = 1,
|
||||
Empty = 2,
|
||||
Idle = 3
|
||||
};
|
||||
|
||||
// AimState als enum class
|
||||
enum class AimState : int32_t {
|
||||
Undefined = 0,
|
||||
Active = 1,
|
||||
Inactive = 2
|
||||
};
|
||||
|
||||
// DDS type wrapper für MountingPointType
|
||||
struct MountingPointType_def {
|
||||
using type = MountingPointType;
|
||||
|
||||
// Enum values als static members für Kompatibilität
|
||||
static constexpr MountingPointType Undefined = MountingPointType::Undefined;
|
||||
static constexpr MountingPointType Generic = MountingPointType::Generic;
|
||||
static constexpr MountingPointType Sensor = MountingPointType::Sensor;
|
||||
static constexpr MountingPointType Actuator = MountingPointType::Actuator;
|
||||
static constexpr MountingPointType BuildingSensorModule = MountingPointType::BuildingSensorModule;
|
||||
static constexpr MountingPointType OutdoorCamera = MountingPointType::OutdoorCamera;
|
||||
static constexpr MountingPointType IndoorCamera = MountingPointType::IndoorCamera;
|
||||
static constexpr MountingPointType OutdoorIPS = MountingPointType::OutdoorIPS;
|
||||
static constexpr MountingPointType IndoorIPS = MountingPointType::IndoorIPS;
|
||||
static constexpr MountingPointType MeteoDataUnit = MountingPointType::MeteoDataUnit;
|
||||
static constexpr MountingPointType AnnouncementUnit = MountingPointType::AnnouncementUnit;
|
||||
static constexpr MountingPointType BuildingNetworkSwitch = MountingPointType::BuildingNetworkSwitch;
|
||||
static constexpr MountingPointType EffectGenerationControlUnit = MountingPointType::EffectGenerationControlUnit;
|
||||
static constexpr MountingPointType Unknown = MountingPointType::Unknown;
|
||||
};
|
||||
|
||||
// DDS type wrapper für MountingPointState
|
||||
struct MountingPointState_def {
|
||||
using type = MountingPointState;
|
||||
|
||||
static constexpr MountingPointState Undefined = MountingPointState::Undefined;
|
||||
static constexpr MountingPointState Equipped = MountingPointState::Equipped;
|
||||
static constexpr MountingPointState Empty = MountingPointState::Empty;
|
||||
static constexpr MountingPointState Idle = MountingPointState::Idle;
|
||||
};
|
||||
|
||||
// DDS type wrapper für AimState
|
||||
struct AimState_def {
|
||||
using type = AimState;
|
||||
|
||||
static constexpr AimState Undefined = AimState::Undefined;
|
||||
static constexpr AimState Active = AimState::Active;
|
||||
static constexpr AimState Inactive = AimState::Inactive;
|
||||
};
|
||||
|
||||
} // namespace InfrastructureManagement
|
||||
|
||||
// QDebug operator<< für MountingPointType
|
||||
inline QDebug operator<<(QDebug debug, InfrastructureManagement::MountingPointType type) {
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.nospace() << "MountingPointType(" << static_cast<int32_t>(type) << ")";
|
||||
return debug;
|
||||
}
|
||||
|
||||
// QDebug operator<< für MountingPointState
|
||||
inline QDebug operator<<(QDebug debug, InfrastructureManagement::MountingPointState state) {
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.nospace() << "MountingPointState(" << static_cast<int32_t>(state) << ")";
|
||||
return debug;
|
||||
}
|
||||
|
||||
// qHash für MountingPointType (für QMap/QHash)
|
||||
namespace dds {
|
||||
namespace core {
|
||||
static inline uint qHash(const InfrastructureManagement::MountingPointType &mpt)
|
||||
{
|
||||
return ::qHash(static_cast<int32_t>(mpt));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // ISM_ENUMS_HPP
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
namespace InfrastructureManagement {
|
||||
struct FtcData {
|
||||
std::string name;
|
||||
uint32_t id;
|
||||
};
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include "ism_export.h"
|
||||
#include "svcismcommon_export.h"
|
||||
|
||||
namespace InfrastructureManagement
|
||||
{
|
||||
|
||||
+11
-11
@@ -48,14 +48,14 @@ MainHandler::~MainHandler()
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
bool MainHandler::init(int domainId)
|
||||
{
|
||||
INFO_LOG(m_logger) << "--- Start InfrastructureManagement MainHandler.";
|
||||
INFO_LOG() << "--- Start InfrastructureManagement MainHandler.";
|
||||
|
||||
// initialize DDS
|
||||
// for InfrastructureManagement => exerciseId = partitionId
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId);
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation DdsHandler failed.";
|
||||
ERROR_LOG() << "Initialisation DdsHandler failed.";
|
||||
if (m_ddsHandler->pacemaker())
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
@@ -66,7 +66,7 @@ bool MainHandler::init(int domainId)
|
||||
m_dbHandler = std::make_shared<DbHandler>();
|
||||
if (!m_dbHandler->init(0, Settings::settings()))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation DbHandler failed.";
|
||||
ERROR_LOG() << "Initialisation DbHandler failed.";
|
||||
pm->setNewState(Core::RunningState::StoppedError);
|
||||
return false;
|
||||
}
|
||||
@@ -79,7 +79,7 @@ bool MainHandler::init(int domainId)
|
||||
m_handlerMainStructureElement = std::make_shared<HandlerMainStructureElement>(this);
|
||||
if (!m_handlerMainStructureElement->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerMainStructureElement failed.";
|
||||
ERROR_LOG() << "Initialisation HandlerMainStructureElement failed.";
|
||||
pm->setNewState(Core::RunningState::StoppedError);
|
||||
return false;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ bool MainHandler::init(int domainId)
|
||||
m_handlerInstrumentationAsset = std::make_shared<HandlerInstrumentationAsset>(this);
|
||||
if (!m_handlerInstrumentationAsset->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerInstrumentationAsset failed.";
|
||||
ERROR_LOG() << "Initialisation HandlerInstrumentationAsset failed.";
|
||||
pm->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ bool MainHandler::init(int domainId)
|
||||
m_handlerMountingPointAsset = std::make_shared<HandlerMountingPointAsset>(this);
|
||||
if (!m_handlerMountingPointAsset->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerMountingPointAsset failed.";
|
||||
ERROR_LOG() << "Initialisation HandlerMountingPointAsset failed.";
|
||||
pm->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ bool MainHandler::init(int domainId)
|
||||
m_handlerEffectArea = std::make_shared<HandlerEffectArea>(this);
|
||||
if (!m_handlerEffectArea->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerEffectArea failed.";
|
||||
ERROR_LOG() << "Initialisation HandlerEffectArea failed.";
|
||||
pm->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
@@ -117,7 +117,7 @@ bool MainHandler::init(int domainId)
|
||||
m_handlerSpecialArea = std::make_shared<HandlerSpecialArea>(this);
|
||||
if (!m_handlerSpecialArea->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerSpecialArea failed.";
|
||||
ERROR_LOG() << "Initialisation HandlerSpecialArea failed.";
|
||||
pm->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
@@ -126,7 +126,7 @@ bool MainHandler::init(int domainId)
|
||||
m_handlerMainSchedule = std::make_shared<HandlerMainSchedule>(this);
|
||||
if (!m_handlerMainSchedule->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerMainSchedule failed.";
|
||||
ERROR_LOG() << "Initialisation HandlerMainSchedule failed.";
|
||||
pm->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
@@ -141,12 +141,12 @@ bool MainHandler::init(int domainId)
|
||||
m_handlerWebSocketInterface = std::make_shared<WebSocketInterfaceHandler>(this);
|
||||
if (!m_handlerWebSocketInterface->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation WebSocketInterface failed.";
|
||||
ERROR_LOG() << "Initialisation WebSocketInterface failed.";
|
||||
pm->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << "ISM MainHandler initialized.";
|
||||
INFO_LOG() << "ISM MainHandler initialized.";
|
||||
pm->setNewState(Core::RunningState::Running);
|
||||
pm->addPort(m_handlerWebSocketInterface->webSocketPort(), Core::PortType::WebSocketServer);
|
||||
|
||||
|
||||
@@ -84,8 +84,6 @@ private: // attributes
|
||||
std::shared_ptr<HandlerSpecialArea> m_handlerSpecialArea;
|
||||
std::shared_ptr<WebSocketInterface::WebSocketInterfaceHandler> m_handlerWebSocketInterface;
|
||||
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_exmDtc;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
QPointF rotatePoint(const double xIn, const double yIn, double angleDegree);
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "base.h"
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <DDS/Core/core_types.h>
|
||||
|
||||
#include <InfrastructureManagement/ism_db.h>
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "base.h"
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <DDS/Core/core_types.h>
|
||||
|
||||
#include <InfrastructureManagement/ism_db.h>
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "base.h"
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <DDS/Core/core_types.h>
|
||||
|
||||
#include <InfrastructureManagement/ism_db.h>
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
#include <QMap>
|
||||
#include <QJsonArray>
|
||||
#include "base.h"
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <DDS/Core/core_types.h>
|
||||
|
||||
#include <InfrastructureManagement/ism_db.h>
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "base.h"
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <DDS/Core/core_types.h>
|
||||
|
||||
#include <InfrastructureManagement/ism_db.h>
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "base.h"
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <DDS/Core/core_types.h>
|
||||
|
||||
#include <InfrastructureManagement/ism_db.h>
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "base.h"
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <DDS/Core/core_types.h>
|
||||
|
||||
#include <InfrastructureManagement/ism_db.h>
|
||||
#include <InfrastructureManagement/object_main_structure_element.h>
|
||||
|
||||
+43
-44
@@ -59,14 +59,13 @@ ParseBuildingXml::ParseBuildingXml(const QString &xmlFilename,
|
||||
, m_soundAreaFilename(soundAreaFilename)
|
||||
, m_geoPosition(geoPosition)
|
||||
, m_rotationAngleDegree(rotationAngleDegree)
|
||||
, m_logger(getLogger("ParseBuildingXml"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "m_soundAreaFilename=" << m_soundAreaFilename;
|
||||
DEBUG_LOG() << "m_soundAreaFilename=" << m_soundAreaFilename;
|
||||
}
|
||||
|
||||
QJsonObject ParseBuildingXml::egcusToJson() const
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "egcusToJson";
|
||||
DEBUG_LOG() << "egcusToJson";
|
||||
if (m_egcus.isEmpty())
|
||||
return QJsonObject();
|
||||
|
||||
@@ -91,7 +90,7 @@ QJsonObject ParseBuildingXml::egcusToJson() const
|
||||
|
||||
QJsonObject ParseBuildingXml::soundAreaToJson() const
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "soundAreaToJson";
|
||||
DEBUG_LOG() << "soundAreaToJson";
|
||||
QJsonObject soundArea;
|
||||
QJsonObject json;
|
||||
QJsonObject jsonEgcu;
|
||||
@@ -118,7 +117,7 @@ QJsonObject ParseBuildingXml::soundAreaToJson() const
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
bool ParseBuildingXml::parseXml()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "parseXml";
|
||||
DEBUG_LOG() << "parseXml";
|
||||
m_request = MainStructureElementModifyRequest();
|
||||
m_request.properties("{}");
|
||||
m_lastError.clear();
|
||||
@@ -142,7 +141,7 @@ bool ParseBuildingXml::parseXml()
|
||||
// catch (const std::exception &ex)
|
||||
// {
|
||||
// m_lastError = QString::fromUtf8(ex.what());
|
||||
// WARNING_LOG(m_logger) << "Error importing building: " << ex.what();
|
||||
// WARNING_LOG() << "Error importing building: " << ex.what();
|
||||
// m_request = MainStructureElementModifyRequest();
|
||||
// return false;
|
||||
// }
|
||||
@@ -152,17 +151,17 @@ bool ParseBuildingXml::parseXml()
|
||||
parseXmlEgcus();
|
||||
QJsonObject egcus = egcusToJson();
|
||||
properties[QStringLiteral("egcusToRooms")] = egcus[QStringLiteral("egcusToRooms")];
|
||||
DEBUG_LOG(m_logger) << "parseXml vor isEmpty";
|
||||
DEBUG_LOG() << "parseXml vor isEmpty";
|
||||
if (!m_soundAreaFilename.isEmpty())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "parseXml vor parseXmlSoundArea";
|
||||
DEBUG_LOG() << "parseXml vor parseXmlSoundArea";
|
||||
parseXmlSoundArea();
|
||||
properties[QStringLiteral("soundArea")] = soundAreaToJson();
|
||||
}
|
||||
|
||||
m_request.properties(QJsonDocument(properties).toJson(QJsonDocument::Compact).toStdString());
|
||||
|
||||
DEBUG_LOG(m_logger) << "Finished import for file " << m_xmlFilename;
|
||||
DEBUG_LOG() << "Finished import for file " << m_xmlFilename;
|
||||
return bRet;
|
||||
}
|
||||
|
||||
@@ -171,24 +170,24 @@ ParseBuildingXml::Egcu ParseBuildingXml::parseEgcu(const QDomElement &domEgcu)
|
||||
{
|
||||
ParseBuildingXml::Egcu ret;
|
||||
|
||||
INFO_LOG(m_logger) << "parseEgcu Egcu: = " << domEgcu.tagName();
|
||||
INFO_LOG() << "parseEgcu Egcu: = " << domEgcu.tagName();
|
||||
QDomElement mountpoint = domEgcu.firstChildElement(QStringLiteral("Mountpoint"));
|
||||
INFO_LOG(m_logger) << "Mountpoint=" << mountpoint.tagName();
|
||||
INFO_LOG() << "Mountpoint=" << mountpoint.tagName();
|
||||
QDomElement mountpointSubId = mountpoint.firstChildElement(QStringLiteral("SubId"));
|
||||
INFO_LOG(m_logger) << "Mountpoint=" << mountpointSubId.tagName()
|
||||
INFO_LOG() << "Mountpoint=" << mountpointSubId.tagName()
|
||||
<< " SubId = " << mountpointSubId.attribute(QStringLiteral("SubId"))
|
||||
<< " text= " << mountpointSubId.text();
|
||||
ret.mountpointEgcu = mountpointSubId.text().toInt();
|
||||
|
||||
QDomElement rooms = domEgcu.firstChildElement(QStringLiteral("Rooms"));
|
||||
INFO_LOG(m_logger) << "Rooms=" << rooms.tagName()
|
||||
INFO_LOG() << "Rooms=" << rooms.tagName()
|
||||
<< " SubId = " << rooms.attribute(QStringLiteral("SubId"))
|
||||
<< " text = " << rooms.text();
|
||||
|
||||
QDomElement room = rooms.firstChildElement(QStringLiteral("SubId"));
|
||||
for (; !room.isNull(); room = room.nextSiblingElement(room.tagName()))
|
||||
{
|
||||
INFO_LOG(m_logger) << "Room=" << room.tagName()
|
||||
INFO_LOG() << "Room=" << room.tagName()
|
||||
<< " SubId = " << room.attribute(QStringLiteral("SubId"))
|
||||
<< " text = " << room.text();
|
||||
ret.rooms.append(room.text().toInt());
|
||||
@@ -204,27 +203,27 @@ bool ParseBuildingXml::parseXmlEgcus()
|
||||
try
|
||||
{
|
||||
//parseXmlInternal();
|
||||
INFO_LOG(m_logger) << "parseXmlEgcus " << m_egcuToRoomFilename;
|
||||
INFO_LOG() << "parseXmlEgcus " << m_egcuToRoomFilename;
|
||||
if (!m_egcuToRoomFilename.isEmpty())
|
||||
{
|
||||
INFO_LOG(m_logger) << "openXml";
|
||||
INFO_LOG() << "openXml";
|
||||
QDomDocument doc = openXml(m_egcuToRoomFilename);
|
||||
if (!doc.isNull())
|
||||
{
|
||||
// Evaluate xml file and modify properties in m_request
|
||||
QDomElement root = doc.documentElement();
|
||||
INFO_LOG(m_logger) << "root.tagName()=" << root.tagName();
|
||||
INFO_LOG() << "root.tagName()=" << root.tagName();
|
||||
if (root.tagName() != QStringLiteral("EgcusToRooms"))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "The file is not EgcusToRooms";
|
||||
WARNING_LOG() << "The file is not EgcusToRooms";
|
||||
return false;
|
||||
}
|
||||
QDomElement domEgcu = root.firstChildElement(QStringLiteral("Egcu"));
|
||||
if (domEgcu.isNull())
|
||||
INFO_LOG(m_logger) << "Keine EGCU's";
|
||||
INFO_LOG() << "Keine EGCU's";
|
||||
for (; !domEgcu.isNull(); domEgcu = domEgcu.nextSiblingElement(domEgcu.tagName()))
|
||||
{
|
||||
INFO_LOG(m_logger) << "parseEgcus=" << domEgcu.tagName()
|
||||
INFO_LOG() << "parseEgcus=" << domEgcu.tagName()
|
||||
<< " text=" << domEgcu.text()
|
||||
<< " Name=" << domEgcu.attribute(QStringLiteral("Name"));
|
||||
const Egcu egcu = parseEgcu(domEgcu);
|
||||
@@ -237,7 +236,7 @@ bool ParseBuildingXml::parseXmlEgcus()
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
m_lastError = QString::fromUtf8(ex.what());
|
||||
WARNING_LOG(m_logger) << "Error importing building: wrong XML-File EgcuToRooms: " << ex.what();
|
||||
WARNING_LOG() << "Error importing building: wrong XML-File EgcuToRooms: " << ex.what();
|
||||
bRet = false;
|
||||
}
|
||||
|
||||
@@ -254,34 +253,34 @@ bool ParseBuildingXml::parseXmlSoundArea()
|
||||
try
|
||||
{
|
||||
//parseXmlInternal();
|
||||
INFO_LOG(m_logger) << "parseXmlSoundArea " << m_soundAreaFilename;
|
||||
INFO_LOG() << "parseXmlSoundArea " << m_soundAreaFilename;
|
||||
if (!m_soundAreaFilename.isEmpty())
|
||||
{
|
||||
INFO_LOG(m_logger) << "openXml";
|
||||
INFO_LOG() << "openXml";
|
||||
QDomDocument doc = openXml(m_soundAreaFilename);
|
||||
if (!doc.isNull())
|
||||
{
|
||||
// Evaluate xml file and modify properties in m_request
|
||||
QDomElement root = doc.documentElement();
|
||||
INFO_LOG(m_logger) << "root.tagName()=" << root.tagName();
|
||||
INFO_LOG() << "root.tagName()=" << root.tagName();
|
||||
if (root.tagName() != QStringLiteral("SoundArea"))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "The file is not SoundArea";
|
||||
WARNING_LOG() << "The file is not SoundArea";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << "parseSoundArea SoundArea: = " << root.tagName();
|
||||
INFO_LOG() << "parseSoundArea SoundArea: = " << root.tagName();
|
||||
|
||||
// Id
|
||||
m_soundArea.id = root.firstChildElement(QStringLiteral("Id")).text().toInt();
|
||||
INFO_LOG(m_logger) << "Id=" << m_soundArea.id;
|
||||
INFO_LOG() << "Id=" << m_soundArea.id;
|
||||
|
||||
// Geometry
|
||||
QDomElement geometry = root.firstChildElement(QStringLiteral("Geometry"));
|
||||
QDomElement point = geometry.firstChildElement(QStringLiteral("Point"));
|
||||
for (; !point.isNull(); point = point.nextSiblingElement(point.tagName()))
|
||||
{
|
||||
INFO_LOG(m_logger) << "Point=" << point.tagName()
|
||||
INFO_LOG() << "Point=" << point.tagName()
|
||||
<< " lat = " << point.firstChildElement(QStringLiteral("lat")).text().toDouble()
|
||||
<< " lon = " << point.firstChildElement(QStringLiteral("lon")).text().toDouble();
|
||||
geoPosition.lat(point.firstChildElement(QStringLiteral("lat")).text().toDouble());
|
||||
@@ -291,7 +290,7 @@ bool ParseBuildingXml::parseXmlSoundArea()
|
||||
|
||||
// MainEgcuMountpoint
|
||||
m_soundArea.mainEgcuMountpoint = root.firstChildElement(QStringLiteral("MainEgcuMountpoint")).text().toInt();
|
||||
DEBUG_LOG(m_logger) << "MainEgcuMountpoint Id=" << m_soundArea.mainEgcuMountpoint;
|
||||
DEBUG_LOG() << "MainEgcuMountpoint Id=" << m_soundArea.mainEgcuMountpoint;
|
||||
|
||||
// MountpointsEgcu
|
||||
QDomElement egcuMountpoints = root.firstChildElement(QStringLiteral("EgcuMountpoints"));
|
||||
@@ -299,7 +298,7 @@ bool ParseBuildingXml::parseXmlSoundArea()
|
||||
for (; !id.isNull(); id = id.nextSiblingElement(id.tagName()))
|
||||
{
|
||||
int mountpointEgcu = id.text().toInt();
|
||||
DEBUG_LOG(m_logger) << "mountpointEgcu=" << mountpointEgcu;
|
||||
DEBUG_LOG() << "mountpointEgcu=" << mountpointEgcu;
|
||||
m_soundArea.egcuMountpoints.push_back(mountpointEgcu);
|
||||
}
|
||||
}
|
||||
@@ -309,7 +308,7 @@ bool ParseBuildingXml::parseXmlSoundArea()
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
m_lastError = QString::fromUtf8(ex.what());
|
||||
WARNING_LOG(m_logger) << "Error importing building: wrong XML-File EgcuToRooms: " << ex.what();
|
||||
WARNING_LOG() << "Error importing building: wrong XML-File EgcuToRooms: " << ex.what();
|
||||
bRet = false;
|
||||
}
|
||||
|
||||
@@ -368,16 +367,16 @@ QVector<ParseBuildingXml::BuildingMetaInfo> ParseBuildingXml::parseMetaXml(const
|
||||
info.filename = streifElem.attribute(QLatin1String("Name"));
|
||||
if (info.filename.isEmpty())
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Empty filename (building)!";
|
||||
WARNING_LOG() << "Empty filename (building)!";
|
||||
continue;
|
||||
}
|
||||
|
||||
info.rotationAngleDegree = orientationElem.attribute(QLatin1String("Angle")).toDouble(); // correct rotation?
|
||||
INFO_LOG(m_logger) << "Found Building angle: " << info.rotationAngleDegree;
|
||||
INFO_LOG() << "Found Building angle: " << info.rotationAngleDegree;
|
||||
|
||||
info.geoPosition = positionFromElement<Core::GeoPosition>(posElem);
|
||||
|
||||
INFO_LOG(m_logger) << "Found Building position: (" << info.geoPosition.lon() << ", ("
|
||||
INFO_LOG() << "Found Building position: (" << info.geoPosition.lon() << ", ("
|
||||
<< info.geoPosition.lat() << ", ("
|
||||
<< info.geoPosition.z() << ")";
|
||||
|
||||
@@ -398,14 +397,14 @@ void ParseBuildingXml::parseXmlInternal()
|
||||
const QDomElement headerElem = getChildElement(rootElem, QStringLiteral("Header"));
|
||||
const QDomElement baseGroupElem = getChildElement(headerElem, QStringLiteral("Group"));
|
||||
|
||||
DEBUG_LOG(m_logger) << "Start import for file " << m_xmlFilename;
|
||||
DEBUG_LOG() << "Start import for file " << m_xmlFilename;
|
||||
|
||||
m_request.angle(m_rotationAngleDegree);
|
||||
m_request.geoPosition(m_geoPosition);
|
||||
m_request.modelId(getInteger(getChildElement(baseGroupElem, QStringLiteral("ModelId")), QStringLiteral("Id")));
|
||||
m_request.name(getChildElement(baseGroupElem, QStringLiteral("Name")).text().toStdString());
|
||||
m_request.description(m_request.name());
|
||||
INFO_LOG(m_logger) << "Importing building with name: " << m_request.name();
|
||||
INFO_LOG() << "Importing building with name: " << m_request.name();
|
||||
|
||||
InfrastructureManagement::StructureElement seBuilding;
|
||||
seBuilding.name(m_request.name());
|
||||
@@ -484,15 +483,15 @@ void ParseBuildingXml::importExternalReferences(const QDomElement &parent,
|
||||
// we don't care about BCU Mounting positions inside xml file - we create our own
|
||||
if (se.mountingPointTypeId() == MountingPointType::BuildingControlUnit)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Ignoring xml-internal BuildingControl mounting point - not needed";
|
||||
INFO_LOG() << "Ignoring xml-internal BuildingControl mounting point - not needed";
|
||||
continue;
|
||||
}
|
||||
if (se.mountingPointTypeId() == MountingPointType::Unknown)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Ignoring unknown mounting point type with subId " << se.mountingPointId();
|
||||
INFO_LOG() << "Ignoring unknown mounting point type with subId " << se.mountingPointId();
|
||||
continue;
|
||||
}
|
||||
INFO_LOG(m_logger) << "importExternalReferences: " << se.displayName() << ", parentIdx = " << parentIdx;
|
||||
INFO_LOG() << "importExternalReferences: " << se.displayName() << ", parentIdx = " << parentIdx;
|
||||
addElementToRequest(se, parentIdx);
|
||||
}
|
||||
}
|
||||
@@ -508,7 +507,7 @@ void ParseBuildingXml::importFloors(const QDomElement &parent,
|
||||
if (!nameElement.text().startsWith(QLatin1String("floor_"), Qt::CaseInsensitive))
|
||||
continue;
|
||||
|
||||
INFO_LOG(m_logger) << "importFloors: " << nameElement.text() << ", parentIdx = " << parentIdx;
|
||||
INFO_LOG() << "importFloors: " << nameElement.text() << ", parentIdx = " << parentIdx;
|
||||
|
||||
StructureElement se;
|
||||
se.name(nameElement.text().simplified().toStdString());
|
||||
@@ -519,12 +518,12 @@ void ParseBuildingXml::importFloors(const QDomElement &parent,
|
||||
|
||||
// read base height from xml comment
|
||||
const QDomElement commentElement = getChildElement(floorElem, QStringLiteral("Comment"), false);
|
||||
DEBUG_LOG(m_logger) << "Comment = " << commentElement.text();
|
||||
DEBUG_LOG() << "Comment = " << commentElement.text();
|
||||
const QStringList comm = commentElement.text().split(QLatin1Char('='));
|
||||
double baseHeight = 0.00;
|
||||
if (comm.at(0) == QStringLiteral("base_height"))
|
||||
baseHeight = comm.at(1).toDouble();
|
||||
DEBUG_LOG(m_logger) << "base_height = " << baseHeight;
|
||||
DEBUG_LOG() << "base_height = " << baseHeight;
|
||||
se.relPosition().offsetZ(baseHeight);
|
||||
|
||||
addElementToRequest(se, parentIdx);
|
||||
@@ -553,7 +552,7 @@ void ParseBuildingXml::importRooms(const QDomElement &parent,
|
||||
// displayed room names are too long
|
||||
roomName.replace(QStringLiteral("SW_room"), QStringLiteral("R"));
|
||||
|
||||
INFO_LOG(m_logger) << "importRooms: " << roomName << ", parentIdx = " << parentIdx;
|
||||
INFO_LOG() << "importRooms: " << roomName << ", parentIdx = " << parentIdx;
|
||||
|
||||
se.displayName(roomName.toStdString());
|
||||
se.mountingPointId(subId);
|
||||
@@ -568,7 +567,7 @@ void ParseBuildingXml::importRooms(const QDomElement &parent,
|
||||
addElementToRequest(se, parentIdx);
|
||||
const int curIdx = m_request.elements().size() - 1;
|
||||
importExternalReferences(subRoomElem, curIdx);
|
||||
DEBUG_LOG(m_logger) << "Room=" << se.name()
|
||||
DEBUG_LOG() << "Room=" << se.name()
|
||||
<< " Id=" << se.id()
|
||||
<< " mountingPointId=" << se.mountingPointId();
|
||||
}
|
||||
|
||||
+1
-3
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "ism_export.h"
|
||||
#include "svcismclient_export.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QVector>
|
||||
@@ -90,8 +90,6 @@ private:
|
||||
QString m_lastError;
|
||||
QVector<Egcu> m_egcus;
|
||||
SoundArea m_soundArea;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
|
||||
} // namespace InfraStructureManagement
|
||||
+4
-4
@@ -27,7 +27,7 @@ void ScheduleStatusBase::onEntry(QEvent *event)
|
||||
{
|
||||
QState::onEntry(event);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Schedule " << scheduleId() << ": onEntry Base: write ScheduleStatus: " << m_scheduleStatus;
|
||||
DEBUG_LOG() << "Schedule " << scheduleId() << ": onEntry Base: write ScheduleStatus: " << m_scheduleStatus;
|
||||
// write ScheduleStatus to db
|
||||
m_schedule->setScheduleStatus(m_scheduleStatus);
|
||||
}
|
||||
@@ -44,7 +44,7 @@ Creation::Creation(ObjectMainSchedule *objSchedule)
|
||||
|
||||
void Creation::onEntry(QEvent *event)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Schedule " << scheduleId() << ": onEntry Creation ";
|
||||
DEBUG_LOG() << "Schedule " << scheduleId() << ": onEntry Creation ";
|
||||
ScheduleStatusBase::onEntry(event);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ Activation::Activation(ObjectMainSchedule *objSchedule)
|
||||
|
||||
void Activation::onEntry(QEvent *event)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Schedule " << scheduleId() << ": onEntry Activation: write ScheduleStatus:Activated";
|
||||
DEBUG_LOG() << "Schedule " << scheduleId() << ": onEntry Activation: write ScheduleStatus:Activated";
|
||||
ScheduleStatusBase::onEntry(event);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ Expiration::Expiration(ObjectMainSchedule *objSchedule)
|
||||
|
||||
void Expiration::onEntry(QEvent *event)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Schedule " << scheduleId() << ": onEntry Expiration ";
|
||||
DEBUG_LOG() << "Schedule " << scheduleId() << ": onEntry Expiration ";
|
||||
ScheduleStatusBase::onEntry(event);
|
||||
}
|
||||
|
||||
|
||||
-2
@@ -29,8 +29,6 @@ namespace InfrastructureManagement
|
||||
|
||||
protected:
|
||||
ObjectMainSchedule *m_schedule;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
private:
|
||||
const InfrastructureManagement::ScheduleStatus m_scheduleStatus;
|
||||
};
|
||||
|
||||
+4
-5
@@ -19,7 +19,6 @@ namespace InfrastructureManagement
|
||||
: QObject(parent)
|
||||
, m_ScheduleStatus(ScheduleStatus::Unknown)
|
||||
, m_schedule(objSchedule)
|
||||
, m_logger(getLogger("ScheduleStatusManager"))
|
||||
{
|
||||
m_stateSignals[ScheduleStatus::Unknown] = [&]() { emit stateUnknown(); };
|
||||
m_stateSignals[ScheduleStatus::Created] = [&]() { emit stateCreated(); };
|
||||
@@ -31,11 +30,11 @@ namespace InfrastructureManagement
|
||||
|
||||
bool ScheduleStatusManager::triggerSwitchState(InfrastructureManagement::ScheduleStatus state)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Schedule " << scheduleId() << ": Trying to switch to state " << toString(state);
|
||||
INFO_LOG() << "Schedule " << scheduleId() << ": Trying to switch to state " << toString(state);
|
||||
std::function<void()> f = m_stateSignals.value(state);
|
||||
if (f)
|
||||
{
|
||||
//DEBUG_LOG(m_logger) << "function: emit signal";
|
||||
//DEBUG_LOG() << "function: emit signal";
|
||||
emit f();
|
||||
}
|
||||
return (f != nullptr);
|
||||
@@ -79,13 +78,13 @@ namespace InfrastructureManagement
|
||||
|
||||
void ScheduleStatusManager::setStateInternal(InfrastructureManagement::ScheduleStatus state)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Schedule " << scheduleId() << ": In setStateInternal: new state " << toString(state);
|
||||
INFO_LOG() << "Schedule " << scheduleId() << ": In setStateInternal: new state " << toString(state);
|
||||
if(m_ScheduleStatus == state)
|
||||
return;
|
||||
|
||||
m_ScheduleStatus = state;
|
||||
|
||||
INFO_LOG(m_logger) << "Schedule " << scheduleId() << ": Changed schedule state to " << toString(state);
|
||||
INFO_LOG() << "Schedule " << scheduleId() << ": Changed schedule state to " << toString(state);
|
||||
}
|
||||
|
||||
int ScheduleStatusManager::scheduleId() const
|
||||
|
||||
-1
@@ -52,7 +52,6 @@ namespace InfrastructureManagement
|
||||
|
||||
InfrastructureManagement::ScheduleStatus m_ScheduleStatus;
|
||||
ObjectMainSchedule *m_schedule;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} // namespace InfrastructureManagement
|
||||
+7
-8
@@ -23,7 +23,6 @@ ScheduleStatusMachine::ScheduleStatusMachine(ObjectMainSchedule* objSchedule, QO
|
||||
, m_stateManager(new ScheduleStatusManager(objSchedule, this))
|
||||
, m_stateMachine(new QStateMachine(this))
|
||||
, m_schedule(objSchedule)
|
||||
, m_logger(getLogger("ScheduleStatusMachine"))
|
||||
{
|
||||
qRegisterMetaType<InfrastructureManagement::ScheduleStatus>("InfrastructureManagement::ScheduleStatus");
|
||||
|
||||
@@ -77,12 +76,12 @@ ScheduleStatusMachine::ScheduleStatusMachine(ObjectMainSchedule* objSchedule, QO
|
||||
//States zur StateMachine hinzufügen
|
||||
for (ScheduleStatusBase *state : std::as_const(m_ScheduleStatuses))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Schedule " << scheduleId() << ": state: " << state->scheduleStatus();
|
||||
DEBUG_LOG() << "Schedule " << scheduleId() << ": state: " << state->scheduleStatus();
|
||||
m_stateMachine->addState(state);
|
||||
connect(state, &ScheduleStatusBase::entered, this, &ScheduleStatusMachine::onEnteredState);
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Schedule " << scheduleId() << ": Constructor ScheduleStatusMachine: size m_ScheduleStatuses = " << m_ScheduleStatuses.size();
|
||||
DEBUG_LOG() << "Schedule " << scheduleId() << ": Constructor ScheduleStatusMachine: size m_ScheduleStatuses = " << m_ScheduleStatuses.size();
|
||||
}
|
||||
|
||||
ScheduleStatusMachine::~ScheduleStatusMachine()
|
||||
@@ -97,11 +96,11 @@ bool ScheduleStatusMachine::init()
|
||||
if (m_stateMachine->isRunning())
|
||||
return false;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Schedule " << scheduleId() << ": Init ScheduleStatusMachine ";
|
||||
DEBUG_LOG() << "Schedule " << scheduleId() << ": Init ScheduleStatusMachine ";
|
||||
// initialise current ScheduleStatus
|
||||
ScheduleStatusBase *currentScheduleStatus = getStateFromId(m_schedule->scheduleStatus());
|
||||
|
||||
DEBUG_LOG(m_logger) << "Schedule " << scheduleId() << ": State = "
|
||||
DEBUG_LOG() << "Schedule " << scheduleId() << ": State = "
|
||||
<< ScheduleStatusManager::toString(m_schedule->scheduleStatus());
|
||||
|
||||
m_stateMachine->setInitialState(currentScheduleStatus);
|
||||
@@ -109,7 +108,7 @@ bool ScheduleStatusMachine::init()
|
||||
|
||||
m_stateManager->setInitial(m_schedule->scheduleStatus());
|
||||
|
||||
DEBUG_LOG(m_logger) << "Schedule " << scheduleId() << ": ==> Done Init ScheduleStatusMachine ";
|
||||
DEBUG_LOG() << "Schedule " << scheduleId() << ": ==> Done Init ScheduleStatusMachine ";
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -126,13 +125,13 @@ bool ScheduleStatusMachine::switchToState(ScheduleStatus newScheduleStatus)
|
||||
|
||||
void ScheduleStatusMachine::onEnteredState()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Schedule " << scheduleId() << ": ScheduleStatusMachine - onEnteredState";
|
||||
DEBUG_LOG() << "Schedule " << scheduleId() << ": ScheduleStatusMachine - onEnteredState";
|
||||
|
||||
ScheduleStatusBase *s = qobject_cast<ScheduleStatusBase*>(sender());
|
||||
if (!s)
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Schedule " << scheduleId() << ": ScheduleStatusBase : " << s->scheduleStatus();
|
||||
DEBUG_LOG() << "Schedule " << scheduleId() << ": ScheduleStatusBase : " << s->scheduleStatus();
|
||||
|
||||
m_stateManager->setCurrent(s->scheduleStatus());
|
||||
|
||||
|
||||
-2
@@ -53,8 +53,6 @@ namespace InfrastructureManagement
|
||||
QMap<InfrastructureManagement::ScheduleStatus, ScheduleStatusBase*> m_ScheduleStatuses;
|
||||
|
||||
ObjectMainSchedule *m_schedule;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} // namespace InfrastructureManagement
|
||||
Reference in new issue
Block a user