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
@@ -32,7 +32,7 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
|
||||
# generate opm_[d|f]tc.h
|
||||
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV WS svcOpmCommon SHARED ${SRCS_common})
|
||||
NGL_ADD_LIBRARY2(AAR SV WS svcOpmCommon SHARED ${SRCS_common})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcOpmCommon
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -63,7 +63,7 @@ SET(SRCS_client
|
||||
# generate opm_ftc_impl.[cpp|h]
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV WS svcOpmClient SHARED ${SRCS_client})
|
||||
NGL_ADD_LIBRARY2(AAR SV WS svcOpmClient SHARED ${SRCS_client})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcOpmClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -91,7 +91,7 @@ SET(SRCS_server
|
||||
# generate opm_[d|f]ts.h, opm_[d|f]ts_impl.[cpp|h]
|
||||
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV svcOpmServer SHARED ${SRCS_server})
|
||||
NGL_ADD_LIBRARY2(AAR SV svcOpmServer SHARED ${SRCS_server})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcOpmServer
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
|
||||
+51
-52
@@ -30,7 +30,6 @@ OpmTests::OpmTests(QObject *parent)
|
||||
, m_createdId(0)
|
||||
, m_eTestStep(eUnknown)
|
||||
, m_bTestsSuccessful(true)
|
||||
, m_logger(getLogger("OpmTests"))
|
||||
{
|
||||
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
|
||||
} // end of ctor()
|
||||
@@ -43,7 +42,7 @@ OpmTests::~OpmTests()
|
||||
//-----------------------------------------------------------------------------
|
||||
bool OpmTests::init(int domainId, int exerciseId, int testId, int operatorId, int createdId)
|
||||
{
|
||||
INFO_LOG(m_logger) << "OpmTests::init() "
|
||||
INFO_LOG() << "OpmTests::init() "
|
||||
<< " domainId:" << domainId
|
||||
<< " exerciseId:" << exerciseId
|
||||
<< " testId: " << testId
|
||||
@@ -62,18 +61,18 @@ bool OpmTests::init(int domainId, int exerciseId, int testId, int operatorId, in
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
// Access to FTC
|
||||
DEBUG_LOG(m_logger) << "create ftc";
|
||||
DEBUG_LOG() << "create ftc";
|
||||
m_ftc = OperatorManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
DEBUG_LOG(m_logger) << "init ftc";
|
||||
DEBUG_LOG() << "init ftc";
|
||||
bool bRet = m_ftc->enableAll();
|
||||
DEBUG_LOG(m_logger) << "init end - bRet = " << bRet;
|
||||
DEBUG_LOG() << "init end - bRet = " << bRet;
|
||||
|
||||
// Access to DTC
|
||||
DEBUG_LOG(m_logger) << "create dtc";
|
||||
DEBUG_LOG() << "create dtc";
|
||||
m_dtc = OperatorManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
DEBUG_LOG(m_logger) << "init dtc";
|
||||
DEBUG_LOG() << "init dtc";
|
||||
bRet = m_dtc->enableAll();
|
||||
DEBUG_LOG(m_logger) << "init end - bRet = " << bRet;
|
||||
DEBUG_LOG() << "init end - bRet = " << bRet;
|
||||
|
||||
connect(m_dtc.get(), &Interface::Dtc::userChanged,
|
||||
this, &OpmTests::onReceiveOperatorChanged);
|
||||
@@ -87,7 +86,7 @@ bool OpmTests::init(int domainId, int exerciseId, int testId, int operatorId, in
|
||||
//-----------------------------------------------------------------------------
|
||||
void OpmTests::startTest()
|
||||
{
|
||||
INFO_LOG(m_logger) << "startTest() exerciseId:" << m_exerciseId
|
||||
INFO_LOG() << "startTest() exerciseId:" << m_exerciseId
|
||||
<< " testId:" << m_testId
|
||||
<< " operatorId:" << m_operatorId
|
||||
;
|
||||
@@ -122,10 +121,10 @@ void OpmTests::tryCreate()
|
||||
OperatorCreateModifyRequest data;
|
||||
getOperatorCreateRequestData( data);
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send OperatorCreateRequest";
|
||||
INFO_LOG() << "trying to send OperatorCreateRequest";
|
||||
if (!m_ftc->operatorCreateModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -138,10 +137,10 @@ void OpmTests::tryModify()
|
||||
OperatorCreateModifyRequest data;
|
||||
getOperatorModifyRequestData(data);
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send OperatorCreateModifyRequest";
|
||||
INFO_LOG() << "trying to send OperatorCreateModifyRequest";
|
||||
if (!m_ftc->operatorCreateModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -155,10 +154,10 @@ void OpmTests::tryRemove()
|
||||
|
||||
data.id(m_operatorId);
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send remove request";
|
||||
INFO_LOG() << "trying to send remove request";
|
||||
if (!m_ftc->operatorRemoveRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data";
|
||||
ERROR_LOG() << "Error requesting remove data";
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -191,7 +190,7 @@ void OpmTests::tryLogin()
|
||||
<< ", force:" << data.force();
|
||||
if (!m_ftc->operatorLoginRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error login operator id " << m_operatorId << " on workstation 1";
|
||||
ERROR_LOG() << "Error login operator id " << m_operatorId << " on workstation 1";
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -214,10 +213,10 @@ void OpmTests::tryLoginForce()
|
||||
data.workstationId(4);
|
||||
data.force(true);
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send OperatorLoginRequest";
|
||||
INFO_LOG() << "trying to send OperatorLoginRequest";
|
||||
if (!m_ftc->operatorLoginRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error login operator id " << m_operatorId << " on workstation 1";
|
||||
ERROR_LOG() << "Error login operator id " << m_operatorId << " on workstation 1";
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -231,10 +230,10 @@ void OpmTests::tryLogout()
|
||||
|
||||
data.id(m_operatorId);
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send OperatorLogoutRequest";
|
||||
INFO_LOG() << "trying to send OperatorLogoutRequest";
|
||||
if (!m_ftc->operatorLogoutRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error logout operator id " << m_operatorId;
|
||||
ERROR_LOG() << "Error logout operator id " << m_operatorId;
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -247,18 +246,18 @@ void OpmTests::tryGetOperatorsByOperatorRight()
|
||||
int operatorRight = OperatorRights::CContaminationsEdit;
|
||||
|
||||
m_dtc->waitForHistoricalDataUser();
|
||||
INFO_LOG(m_logger) << "trying to send get operators by operatorRight";
|
||||
INFO_LOG() << "trying to send get operators by operatorRight";
|
||||
QVector<int> operators = m_dtc->getOperatorsByOperatorRight(operatorRight);
|
||||
if (operators.empty())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error no operators for operatorRight: " << operatorRight;
|
||||
ERROR_LOG() << "Error no operators for operatorRight: " << operatorRight;
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int operatorId : operators)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Operator " << operatorId << " found.";
|
||||
INFO_LOG() << "Operator " << operatorId << " found.";
|
||||
}
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -267,22 +266,22 @@ void OpmTests::tryGetOperatorsByOperatorRight()
|
||||
void OpmTests::tryGetAllOperators()
|
||||
{
|
||||
m_eTestStep = eGetAllOperators;
|
||||
DEBUG_LOG(m_logger) << "trying to get all operators";
|
||||
DEBUG_LOG() << "trying to get all operators";
|
||||
|
||||
m_dtc->waitForHistoricalDataUser();
|
||||
const QMap<qint32, OperatorManagement::User> opMap = m_dtc->users();
|
||||
if(opMap.isEmpty())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting all operator data";
|
||||
ERROR_LOG() << "Error requesting all operator data";
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "Amout of existing operators = " << opMap.size();
|
||||
INFO_LOG() << "Amout of existing operators = " << opMap.size();
|
||||
m_operatorId = opMap.firstKey();
|
||||
for(auto it = opMap.begin(); it != opMap.end(); ++it)
|
||||
{
|
||||
INFO_LOG(m_logger) << "opm(" << it.key() << ") :"
|
||||
INFO_LOG() << "opm(" << it.key() << ") :"
|
||||
<< " name:" << it.value().name()
|
||||
// << " password:" << it.value().password()
|
||||
// << " effectiveACLs:" << it.value().effectiveAcls()
|
||||
@@ -295,7 +294,7 @@ void OpmTests::tryGetAllOperators()
|
||||
//-----------------------------------------------------------------------------
|
||||
void OpmTests::tryGetOperator()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "trying to get operator with id:" << m_operatorId;
|
||||
DEBUG_LOG() << "trying to get operator with id:" << m_operatorId;
|
||||
|
||||
if(m_testId > 1)
|
||||
{
|
||||
@@ -304,7 +303,7 @@ void OpmTests::tryGetOperator()
|
||||
|
||||
if(m_operatorId <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "invalid operatorId - test aborted.";
|
||||
ERROR_LOG() << "invalid operatorId - test aborted.";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -313,12 +312,12 @@ void OpmTests::tryGetOperator()
|
||||
|
||||
if(op.id() <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error receiving data for operatorId " << m_operatorId << " returnVal:" << op.id();
|
||||
ERROR_LOG() << "Error receiving data for operatorId " << m_operatorId << " returnVal:" << op.id();
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "opm(" << op.id() << ") :"
|
||||
INFO_LOG() << "opm(" << op.id() << ") :"
|
||||
<< " name: " << op.name()
|
||||
// << " password: " << data.password()
|
||||
// << " effectiveACLs:" << it.value().effectiveAcls()
|
||||
@@ -331,7 +330,7 @@ void OpmTests::tryGetOperator()
|
||||
{
|
||||
if(! onCompareCreatedData(op))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Compare created data failed!";
|
||||
ERROR_LOG() << "Compare created data failed!";
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
@@ -344,7 +343,7 @@ void OpmTests::tryGetOperator()
|
||||
{
|
||||
if(! onCompareModifiedData(op))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Compare modified data failed!";
|
||||
ERROR_LOG() << "Compare modified data failed!";
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
@@ -364,20 +363,20 @@ void OpmTests::tryGetOperator()
|
||||
//-----------------------------------------------------------------------------
|
||||
void OpmTests::onOperatorCreateModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Got create/modifyReply with id " << replyObject.id()
|
||||
INFO_LOG() << "Got create/modifyReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
m_operatorId = replyObject.id();
|
||||
|
||||
if(replyObject.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create/modify data";
|
||||
ERROR_LOG() << "Error requesting create/modify data";
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Requesting create/modify data ok. Got id:" << replyObject.id() << " ... ok.";
|
||||
DEBUG_LOG() << "Requesting create/modify data ok. Got id:" << replyObject.id() << " ... ok.";
|
||||
}
|
||||
|
||||
if(m_testId == 0)
|
||||
@@ -395,23 +394,23 @@ void OpmTests::onOperatorCreateModifyReply(const Core::FunctionReplyObject &repl
|
||||
//-----------------------------------------------------------------------------
|
||||
void OpmTests::onOperatorRemoveReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Got removeReply with id " << replyObject.id()
|
||||
INFO_LOG() << "Got removeReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
if(replyObject.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for id:" << replyObject.id();
|
||||
ERROR_LOG() << "Error requesting remove data for id:" << replyObject.id();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Requesting remove data for id:" << replyObject.id() << " ... ok.";
|
||||
DEBUG_LOG() << "Requesting remove data for id:" << replyObject.id() << " ... ok.";
|
||||
}
|
||||
|
||||
if(m_testId == 0)
|
||||
{
|
||||
INFO_LOG(m_logger) << "***** FTC/DTC test successfully finished. (used id:" << replyObject.id() << ") *****";
|
||||
INFO_LOG() << "***** FTC/DTC test successfully finished. (used id:" << replyObject.id() << ") *****";
|
||||
// ansonsten verheriger Ausstieg mit Errorlog.
|
||||
}
|
||||
|
||||
@@ -422,12 +421,12 @@ void OpmTests::onOperatorRemoveReply(const Core::FunctionReplyObject &replyObjec
|
||||
//-----------------------------------------------------------------------------
|
||||
void OpmTests::onOperatorLoginReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Got loginReply with id " << replyObject.id()
|
||||
DEBUG_LOG() << "Got loginReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
if(replyObject.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting login for id:" << replyObject.id();
|
||||
ERROR_LOG() << "Error requesting login for id:" << replyObject.id();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
@@ -438,12 +437,12 @@ void OpmTests::onOperatorLoginReply(const Core::FunctionReplyObject &replyObject
|
||||
//-----------------------------------------------------------------------------
|
||||
void OpmTests::onOperatorLogoutReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Got logoutReply with id " << replyObject.id()
|
||||
INFO_LOG() << "Got logoutReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
if(replyObject.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting logout for id:" << replyObject.id();
|
||||
ERROR_LOG() << "Error requesting logout for id:" << replyObject.id();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
@@ -457,8 +456,8 @@ void OpmTests::onReceiveOperatorChanged(const User &data, DataModification modTy
|
||||
// Check signal/slot connection
|
||||
if (m_operatorId == data.id())
|
||||
{
|
||||
TRACE_LOG(m_logger) << "Check signal/slot connection for DTC. Data for id = " << data.id() << " received";
|
||||
TRACE_LOG(m_logger) << "ModificationType: = " << (int)modType << " received";
|
||||
TRACE_LOG() << "Check signal/slot connection for DTC. Data for id = " << data.id() << " received";
|
||||
TRACE_LOG() << "ModificationType: = " << (int)modType << " received";
|
||||
}
|
||||
} // end of onReceiveOperatorData()
|
||||
|
||||
@@ -468,8 +467,8 @@ void OpmTests::onReceiveGroupChanged(const Group &data, DataModification modType
|
||||
// Check signal/slot connection
|
||||
// if (m_operatorId == data.id())
|
||||
// {
|
||||
TRACE_LOG(m_logger) << "Check signal/slot connection for DTC. Data for id = " << data.id() << " received";
|
||||
TRACE_LOG(m_logger) << "ModificationType: = " << (int)modType << " received";
|
||||
TRACE_LOG() << "Check signal/slot connection for DTC. Data for id = " << data.id() << " received";
|
||||
TRACE_LOG() << "ModificationType: = " << (int)modType << " received";
|
||||
// }
|
||||
} // end of onReceiveOperatorData()
|
||||
|
||||
@@ -514,7 +513,7 @@ void OpmTests::getOperatorModifyRequestData(OperatorCreateModifyRequest &data) c
|
||||
//-----------------------------------------------------------------------------
|
||||
bool OpmTests::onCompareCreatedData(User &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG() << "start onCompareCreatedData() for id :" << data.id();
|
||||
|
||||
OperatorCreateModifyRequest createData;
|
||||
|
||||
@@ -529,7 +528,7 @@ bool OpmTests::onCompareCreatedData(User &data)
|
||||
if (data.description() != createData.description())
|
||||
return false;
|
||||
|
||||
DEBUG_LOG(m_logger) << "successfull finished onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG() << "successfull finished onCompareCreatedData() for id :" << data.id();
|
||||
|
||||
return true;
|
||||
} // end of onCompareCreatedData()
|
||||
@@ -537,7 +536,7 @@ bool OpmTests::onCompareCreatedData(User &data)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool OpmTests::onCompareModifiedData(User &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "start onCompareModifiedData() for id :" << data.id();
|
||||
DEBUG_LOG() << "start onCompareModifiedData() for id :" << data.id();
|
||||
|
||||
OperatorCreateModifyRequest modifyData;
|
||||
|
||||
@@ -552,7 +551,7 @@ bool OpmTests::onCompareModifiedData(User &data)
|
||||
if (data.description() != modifyData.description())
|
||||
return false;
|
||||
|
||||
DEBUG_LOG(m_logger) << "successfully finished onCompareModifiedData() for id :" << data.id();
|
||||
DEBUG_LOG() << "successfully finished onCompareModifiedData() for id :" << data.id();
|
||||
|
||||
return true;
|
||||
} // end of onCompareModifiedData()
|
||||
|
||||
@@ -105,9 +105,6 @@ private:
|
||||
} m_eTestStep;
|
||||
|
||||
bool m_bTestsSuccessful;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
|
||||
} // namespace OperatorManagement
|
||||
-1
@@ -47,7 +47,6 @@ LtsWebSocket::AbstractClientMessage *ClientMessageFactory::createMessage(LtsWebS
|
||||
ClientMessage::ClientMessage(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data)
|
||||
: LtsWebSocket::AbstractClientMessage(client, type, typeId, uuid, data)
|
||||
, m_dataManager(dataManager)
|
||||
, m_logger(getLogger("ClientMessage"))
|
||||
{}
|
||||
// ####### ClientMessage end #######
|
||||
|
||||
|
||||
+6
-7
@@ -24,7 +24,6 @@ WebSocketInterfaceHandler::WebSocketInterfaceHandler(MainHandler *mainHandler, Q
|
||||
, m_messageFactory(nullptr)
|
||||
, m_dataManager(nullptr)
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("WebSocketInterfaceHandler"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -37,7 +36,7 @@ bool WebSocketInterfaceHandler::init()
|
||||
{
|
||||
cleanup();
|
||||
|
||||
DEBUG_LOG(m_logger) << "... ok";
|
||||
DEBUG_LOG() << "... ok";
|
||||
|
||||
m_dataManager = new DataManager(m_mainHandler);
|
||||
|
||||
@@ -45,16 +44,16 @@ bool WebSocketInterfaceHandler::init()
|
||||
|
||||
m_webSocketServer = new LtsWebSocket::LtsWebSocketServer(m_messageFactory, this);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Initialising LtsWebSocketServer";
|
||||
DEBUG_LOG() << "Initialising LtsWebSocketServer";
|
||||
if (!m_webSocketServer->init(QStringLiteral("ASM"), Settings::getWebSocketServerPortRange(1)))
|
||||
{
|
||||
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(m_logger) << "... ok";
|
||||
DEBUG_LOG() << "Connection signals and slots";
|
||||
DEBUG_LOG() << "... ok";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -15,16 +15,15 @@ namespace OperatorManagement
|
||||
|
||||
DdsHandler::DdsHandler(int domainId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Any, 0))
|
||||
, 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;
|
||||
}
|
||||
|
||||
@@ -47,10 +46,10 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
!m_ddsDts->enableActiveApp() ||
|
||||
!m_dtcAsm->enableAsset())
|
||||
bRet = false;
|
||||
INFO_LOG(m_logger) << "Dts initialised: " << bRet;;
|
||||
INFO_LOG() << "Dts initialised: " << bRet;;
|
||||
|
||||
bRet &= m_ddsFts->enableAll();
|
||||
INFO_LOG(m_logger) << "Fts initialised" << bRet;
|
||||
INFO_LOG() << "Fts initialised" << bRet;
|
||||
|
||||
return bRet;
|
||||
}
|
||||
|
||||
@@ -48,8 +48,6 @@ private:
|
||||
std::shared_ptr<OperatorManagement::Interface::Dts> m_ddsDts;
|
||||
std::shared_ptr<OperatorManagement::Interface::Fts> m_ddsFts;
|
||||
std::shared_ptr<AssetManagement::Interface::Dtc> m_dtcAsm;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
+3
-4
@@ -15,7 +15,6 @@ namespace OperatorManagement
|
||||
|
||||
HandlerAccessControlLevel::HandlerAccessControlLevel(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("HandlerAccessControlLevel"))
|
||||
{}
|
||||
|
||||
HandlerAccessControlLevel::~HandlerAccessControlLevel()
|
||||
@@ -34,7 +33,7 @@ bool HandlerAccessControlLevel::init()
|
||||
if(ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
ERROR_LOG() << ret();
|
||||
bRet = false;
|
||||
return;
|
||||
}
|
||||
@@ -43,11 +42,11 @@ bool HandlerAccessControlLevel::init()
|
||||
|
||||
if (!m_mainHandler->db()->select(cb) || !bRet)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "m_exeObjMap.size() = " << m_accesscontrollevelObjMap.size();
|
||||
DEBUG_LOG() << "m_exeObjMap.size() = " << m_accesscontrollevelObjMap.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
-2
@@ -27,7 +27,5 @@ public:
|
||||
private:
|
||||
QMap<int, ObjectAccessControlLevel*> m_accesscontrollevelObjMap;
|
||||
MainHandler *m_mainHandler;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
+8
-9
@@ -21,7 +21,6 @@ HandlerActiveApps::HandlerActiveApps(MainHandler *mainHandler)
|
||||
: Interface::Fts::ActiveAppUpdateRequestHandler(mainHandler->dds()->fts())
|
||||
, Interface::Fts::ActiveAppRemoveRequestHandler(mainHandler->dds()->fts())
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("HandlerActiveApps"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -44,7 +43,7 @@ bool HandlerActiveApps::init()
|
||||
|
||||
void HandlerActiveApps::cleanupOperator(int operatorId)
|
||||
{
|
||||
INFO_LOG(m_logger) << "cleanupOperator operatorId: " << operatorId
|
||||
INFO_LOG() << "cleanupOperator operatorId: " << operatorId
|
||||
<< ", m_activeApps.size = " << m_activeApps.size();
|
||||
|
||||
// Operator has logged in or out or WS is not alive anymore:
|
||||
@@ -56,7 +55,7 @@ void HandlerActiveApps::cleanupOperator(int operatorId)
|
||||
const ActiveApp &item = it.value();
|
||||
if (item.operatorId() == operatorId)
|
||||
{
|
||||
INFO_LOG(m_logger) << "cleanupOperator operatorId: " << operatorId << " ActiveApp=" << item;
|
||||
INFO_LOG() << "cleanupOperator operatorId: " << operatorId << " ActiveApp=" << item;
|
||||
dtsPtr->removeActiveAppByKey(item.id());
|
||||
it = m_activeApps.erase(it);
|
||||
}
|
||||
@@ -93,11 +92,11 @@ void HandlerActiveApps::removeZombieEntry(const ActiveApp &request)
|
||||
void HandlerActiveApps::onActiveAppUpdateRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ActiveApp &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onActiveAppUpdateRequest: " << request;
|
||||
DEBUG_LOG() << "onActiveAppUpdateRequest: " << request;
|
||||
auto ret = activeAppUpdateRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
DEBUG_LOG(m_logger) << "onActiveAppUpdateRequest - returned id: " << ret.id();
|
||||
WARNING_LOG() << ret();
|
||||
DEBUG_LOG() << "onActiveAppUpdateRequest - returned id: " << ret.id();
|
||||
fts()->activeAppUpdateReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -136,7 +135,7 @@ Core::FunctionReplyObject HandlerActiveApps::activeAppUpdateRequest(const Active
|
||||
// copy data
|
||||
it.value() = request;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "onActiveAppUpdateRequest - publish new data: " << it.value();
|
||||
DEBUG_LOG() << "onActiveAppUpdateRequest - publish new data: " << it.value();
|
||||
dts()->publish(it.value());
|
||||
return Core::FunctionReplyObject(it.value().id());
|
||||
}
|
||||
@@ -144,10 +143,10 @@ Core::FunctionReplyObject HandlerActiveApps::activeAppUpdateRequest(const Active
|
||||
void HandlerActiveApps::onActiveAppRemoveRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Core::RemoveElementRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onActiveAppRemoveRequest: " << request;
|
||||
DEBUG_LOG() << "onActiveAppRemoveRequest: " << request;
|
||||
auto ret = activeAppRemoveRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
WARNING_LOG() << ret();
|
||||
fts()->activeAppRemoveReply(cookie, ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,5 @@ private:
|
||||
private:
|
||||
QHash<int /*id*/, ActiveApp> m_activeApps;
|
||||
MainHandler *m_mainHandler;
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
}
|
||||
@@ -21,7 +21,6 @@ HandlerGroup::HandlerGroup(MainHandler *mainHandler)
|
||||
, Interface::Fts::GroupCreateRequestHandler(mainHandler->fts())
|
||||
, Interface::Fts::GroupRemoveRequestHandler(mainHandler->fts())
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("HandlerGroup"))
|
||||
{}
|
||||
|
||||
HandlerGroup::~HandlerGroup()
|
||||
@@ -54,7 +53,7 @@ bool HandlerGroup::init()
|
||||
};
|
||||
if (!m_mainHandler->db()->select(cbGroupGroup))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -65,7 +64,7 @@ bool HandlerGroup::init()
|
||||
};
|
||||
if (!m_mainHandler->db()->select(cbAclAllow))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -76,7 +75,7 @@ bool HandlerGroup::init()
|
||||
};
|
||||
if (!m_mainHandler->db()->select(cbAclDeny))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -93,7 +92,7 @@ bool HandlerGroup::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
ERROR_LOG() << ret();
|
||||
bRet = false;
|
||||
return;
|
||||
}
|
||||
@@ -101,19 +100,19 @@ bool HandlerGroup::init()
|
||||
};
|
||||
if (!m_mainHandler->db()->select(cbGroup) || !bRet)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "m_exeObjMap.size() = " << m_groupObjMap.size();
|
||||
INFO_LOG(m_logger) << "Handler Group initialized";
|
||||
DEBUG_LOG() << "m_exeObjMap.size() = " << m_groupObjMap.size();
|
||||
INFO_LOG() << "Handler Group initialized";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandlerGroup::updateRolePresetId(const int operatorId, const int rolePresetId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "updateRolePresetId "
|
||||
DEBUG_LOG() << "updateRolePresetId "
|
||||
<< " operatorId=" << operatorId
|
||||
<< " rolePresetId=" << rolePresetId;
|
||||
m_mainHandler->getHandlerOperator()->operatorModifyRolePresetId( operatorId, rolePresetId);
|
||||
@@ -140,12 +139,12 @@ Core::FunctionReplyObject HandlerGroup::changeMembership(const OperatorManagemen
|
||||
void HandlerGroup::onGroupChangeMembershipsRequest(const rti::core::SampleIdentity &cookie,
|
||||
const GroupChangeMembersRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onGroupChangeMembershipsRequest " << request;
|
||||
DEBUG_LOG() << "onGroupChangeMembershipsRequest " << request;
|
||||
Core::FunctionReplyObject ret = changeMembership(request);
|
||||
if (request.operatorId().is_set() && request.rolePresetId().is_set())
|
||||
updateRolePresetId(request.operatorId().get(), request.rolePresetId().get());
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
WARNING_LOG() << ret();
|
||||
m_mainHandler->fts()->groupChangeMembershipsReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -177,10 +176,10 @@ Core::FunctionReplyObject HandlerGroup::create(const GroupCreateRequest &request
|
||||
void HandlerGroup::onGroupCreateRequest(const rti::core::SampleIdentity &cookie,
|
||||
const GroupCreateRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onGroupCreateRequest" << request;
|
||||
DEBUG_LOG() << "onGroupCreateRequest" << request;
|
||||
Core::FunctionReplyObject ret = create(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
WARNING_LOG() << ret();
|
||||
m_mainHandler->fts()->groupCreateReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -208,7 +207,7 @@ Core::FunctionReplyObject HandlerGroup::changeName(const OperatorManagement::Gro
|
||||
void HandlerGroup::onGroupChangeNameRequest(const rti::core::SampleIdentity &cookie,
|
||||
const GroupChangeNameRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onGroupChangeNameRequest" << request;
|
||||
DEBUG_LOG() << "onGroupChangeNameRequest" << request;
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectGroup *ifs = m_groupObjMap.value(request.id());
|
||||
@@ -260,10 +259,10 @@ Core::FunctionReplyObject HandlerGroup::remove(const Core::RemoveElementRequest
|
||||
void HandlerGroup::onGroupRemoveRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Core::RemoveElementRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onGroupRemoveRequest" << request;
|
||||
DEBUG_LOG() << "onGroupRemoveRequest" << request;
|
||||
Core::FunctionReplyObject ret = remove(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
WARNING_LOG() << ret();
|
||||
m_mainHandler->fts()->groupRemoveReply(cookie, ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,5 @@ private:
|
||||
QMultiMap<int, int> m_aclAllowMap;
|
||||
QMultiMap<int, int> m_aclDenyMap;
|
||||
MainHandler *m_mainHandler;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
+20
-21
@@ -11,7 +11,7 @@
|
||||
#include "handler_operator.h"
|
||||
#include <DDS/FTS/generic_fts_impl.h>
|
||||
#include <DDS/DTS/generic_dts_impl.h>
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <DDS/Core/core_types.h>
|
||||
|
||||
#include <QMutableHashIterator>
|
||||
|
||||
@@ -22,7 +22,6 @@ HandlerLockedTopics::HandlerLockedTopics(MainHandler &mainHandler,
|
||||
QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("HandlerLockedTopics"))
|
||||
{}
|
||||
|
||||
bool HandlerLockedTopics::init()
|
||||
@@ -54,7 +53,7 @@ bool HandlerLockedTopics::init()
|
||||
|
||||
auto cbDatabase = [this](const Database::OpmLockedTopics & data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Locked topic from db: " << data.exerciseId.toInt() << ", " << data.workstationId
|
||||
DEBUG_LOG() << "Locked topic from db: " << data.exerciseId.toInt() << ", " << data.workstationId
|
||||
<< ", " << data.operatorId << data.entityTypeName;
|
||||
m_lockedTopics.insert(Core::key(data.entityId, data.exerciseId.isNull() ? 0 : data.exerciseId.toInt(), data.entityTypeName), data);
|
||||
};
|
||||
@@ -90,7 +89,7 @@ void HandlerLockedTopics::operatorLoggedInOut(int operatorId, int workstationId)
|
||||
{
|
||||
// check if there are stale locks (e.g. by crashing client) - then remove all of them - if there are any
|
||||
|
||||
DEBUG_LOG(m_logger) << "operatorLoggedInOut: " << workstationId << ", " << operatorId;
|
||||
DEBUG_LOG() << "operatorLoggedInOut: " << workstationId << ", " << operatorId;
|
||||
|
||||
// Ueberall wurden - ohne erase wohlgemerkt - mutable Iteratoren verwendet. Nur hier - wo erase verwendet wurde - nicht! :')
|
||||
QMutableHashIterator<Core::key, Database::OpmLockedTopics> it(m_lockedTopics);
|
||||
@@ -99,7 +98,7 @@ void HandlerLockedTopics::operatorLoggedInOut(int operatorId, int workstationId)
|
||||
{
|
||||
const auto lockedTopic = it.next().value();
|
||||
|
||||
DEBUG_LOG(m_logger) << "check if unlock: id=" << lockedTopic.id
|
||||
DEBUG_LOG() << "check if unlock: id=" << lockedTopic.id
|
||||
<< ", exId=" << lockedTopic.exerciseId.toInt()
|
||||
<< ", wsId=" << lockedTopic.workstationId
|
||||
<< ", opId=" << lockedTopic.operatorId;
|
||||
@@ -108,7 +107,7 @@ void HandlerLockedTopics::operatorLoggedInOut(int operatorId, int workstationId)
|
||||
continue;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Unlocking topic: id=" << lockedTopic.id
|
||||
DEBUG_LOG() << "Unlocking topic: id=" << lockedTopic.id
|
||||
<< ", exId=" << lockedTopic.exerciseId.toInt()
|
||||
<< ", wsId=" << lockedTopic.workstationId
|
||||
<< ", opId=" << lockedTopic.operatorId;
|
||||
@@ -127,11 +126,11 @@ void HandlerLockedTopics::onTryLockEntityRequest(const rti::core::SampleIdentity
|
||||
auto ret = tryLock(request);
|
||||
if (!ret.errorString().empty())
|
||||
{
|
||||
WARNING_LOG(m_logger) << Core::FunctionReplyObject(ret.FunctionReply::id(), ret.errorString(), ret.errorParams()).translated() << " - " << request;
|
||||
WARNING_LOG() << Core::FunctionReplyObject(ret.FunctionReply::id(), ret.errorString(), ret.errorParams()).translated() << " - " << request;
|
||||
}
|
||||
else if (ret.alreadyLocked())
|
||||
{
|
||||
WARNING_LOG(m_logger) << "onTryLockEntityRequest failed because the topic was already locked by ws " << ret.alreadyLocked().get().workstationName() << " and op " << ret.alreadyLocked().get().operatorName() << " - " << request;
|
||||
WARNING_LOG() << "onTryLockEntityRequest failed because the topic was already locked by ws " << ret.alreadyLocked().get().workstationName() << " and op " << ret.alreadyLocked().get().operatorName() << " - " << request;
|
||||
}
|
||||
m_ftsTryLockEntity->sendReply(cookie, ret);
|
||||
|
||||
@@ -156,7 +155,7 @@ Core::TryLockEntityReply lockSuccessReply(const Database::OpmLockedTopics &dbStr
|
||||
|
||||
Core::TryLockEntityReply HandlerLockedTopics::tryLock(const Core::TryLockEntityRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "tryLock : " << request;
|
||||
DEBUG_LOG() << "tryLock : " << request;
|
||||
|
||||
const auto topicId = request.entityId();
|
||||
|
||||
@@ -192,7 +191,7 @@ Core::TryLockEntityReply HandlerLockedTopics::tryLock(const Core::TryLockEntityR
|
||||
|
||||
//Core::TryLockEntityReply HandlerLockedTopics::tryLockModify(const Core::TryLockEntityRequest &request)
|
||||
//{
|
||||
// DEBUG_LOG(m_logger) << "tryLockModify: " << request;
|
||||
// DEBUG_LOG() << "tryLockModify: " << request;
|
||||
|
||||
// const auto lockEntityId = request.id();
|
||||
|
||||
@@ -261,7 +260,7 @@ Core::TryLockEntityReply HandlerLockedTopics::tryLock(const Core::TryLockEntityR
|
||||
// }
|
||||
|
||||
// const Database::OpmLockedTopics &lockedTopic = *lockedTopicIt;
|
||||
// DEBUG_LOG(m_logger) << LOGFUNCTION << ": locked topic id " << lockedTopic.id;
|
||||
// DEBUG_LOG() << Q_FUNC_INFO << ": locked topic id " << lockedTopic.id;
|
||||
// // ... and then reinserting the updated lock entity (as the id has now changed) - while the key (op, ws, exc, topic id) stays the same!
|
||||
// m_lockedTopics[requestedKey] = dbStruct;
|
||||
// }
|
||||
@@ -271,7 +270,7 @@ Core::TryLockEntityReply HandlerLockedTopics::tryLock(const Core::TryLockEntityR
|
||||
|
||||
//bool HandlerLockedTopics::removeReleaseOutdatedLock(const int lockEntityId)
|
||||
//{
|
||||
// DEBUG_LOG(m_logger) << "removeReleaseOutdatedLock: lockEntityId = " << lockEntityId;
|
||||
// DEBUG_LOG() << "removeReleaseOutdatedLock: lockEntityId = " << lockEntityId;
|
||||
|
||||
// auto lockedTopicIt = std::find_if(m_lockedTopics.constBegin(), m_lockedTopics.constEnd(),
|
||||
// [&lockEntityId](const Database::OpmLockedTopics &lockedTopic)
|
||||
@@ -281,13 +280,13 @@ Core::TryLockEntityReply HandlerLockedTopics::tryLock(const Core::TryLockEntityR
|
||||
|
||||
// if (lockedTopicIt == m_lockedTopics.constEnd())
|
||||
// {
|
||||
// ERROR_LOG(m_logger) << LOGFUNCTION << ": Failed to release outdated lock as lock entity id ("<<lockedTopicIt<<") was not found!";
|
||||
// ERROR_LOG() << Q_FUNC_INFO << ": Failed to release outdated lock as lock entity id ("<<lockedTopicIt<<") was not found!";
|
||||
// Q_ASSERT(false);
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// const Database::OpmLockedTopics &lockedTopic = *lockedTopicIt;
|
||||
// DEBUG_LOG(m_logger) << LOGFUNCTION << ": found lock entity " << lockEntityId;
|
||||
// DEBUG_LOG() << Q_FUNC_INFO << ": found lock entity " << lockEntityId;
|
||||
|
||||
// unlockInDb(lockedTopic);
|
||||
// removeLockedEntity(lockEntityId);
|
||||
@@ -306,7 +305,7 @@ void HandlerLockedTopics::onTryUnlockEntityRequest(const rti::core::SampleIdenti
|
||||
auto ret = tryUnlock(request);
|
||||
if (!ret.errorString().empty())
|
||||
{
|
||||
WARNING_LOG(m_logger) << Core::FunctionReplyObject(ret.FunctionReply::id(), ret.errorString(), ret.errorParams()).translated() << " - " << request;
|
||||
WARNING_LOG() << Core::FunctionReplyObject(ret.FunctionReply::id(), ret.errorString(), ret.errorParams()).translated() << " - " << request;
|
||||
}
|
||||
m_ftsTryUnlockEntity->sendReply(cookie, ret);
|
||||
|
||||
@@ -316,7 +315,7 @@ void HandlerLockedTopics::onTryUnlockEntityRequest(const rti::core::SampleIdenti
|
||||
|
||||
Core::FunctionReply HandlerLockedTopics::tryUnlock(const Core::TryUnlockEntityRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "tryUnlock: " << request;
|
||||
DEBUG_LOG() << "tryUnlock: " << request;
|
||||
|
||||
const auto lockEntityId = request.id();
|
||||
|
||||
@@ -367,7 +366,7 @@ bool HandlerLockedTopics::publishLockedEntity(const Core::LockedEntity &entity)
|
||||
m_dtsLockedEntity->write(entity);
|
||||
return true;
|
||||
}
|
||||
ERROR_LOG(m_logger) << "Publishing LockedEntity " << entity.id() << " failed: DTS not available!";
|
||||
ERROR_LOG() << "Publishing LockedEntity " << entity.id() << " failed: DTS not available!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -380,7 +379,7 @@ bool HandlerLockedTopics::removeLockedEntity(int64_t id)
|
||||
m_dtsLockedEntity->remove(entity);
|
||||
return true;
|
||||
}
|
||||
ERROR_LOG(m_logger) << "Removing LockedEntity " << entity.id() << " failed: DTS not available!";
|
||||
ERROR_LOG() << "Removing LockedEntity " << entity.id() << " failed: DTS not available!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -405,14 +404,14 @@ void HandlerLockedTopics::dumpLockedTopics(int line)
|
||||
{
|
||||
QHashIterator<Core::key, Database::OpmLockedTopics> it (m_lockedTopics);
|
||||
|
||||
INFO_LOG(m_logger) << " dump m_lockedTopics, START size= " << m_lockedTopics.size()
|
||||
INFO_LOG() << " dump m_lockedTopics, START size= " << m_lockedTopics.size()
|
||||
<< " (callerline=" << line << ")";
|
||||
while (it.hasNext())
|
||||
{
|
||||
it.next();
|
||||
const Core::key &keyRef = it.key();
|
||||
const Database::OpmLockedTopics &valRef = it.value();
|
||||
INFO_LOG(m_logger) << " entityTypeName=" << keyRef.entityTypeName << "'"
|
||||
INFO_LOG() << " entityTypeName=" << keyRef.entityTypeName << "'"
|
||||
<< ", entityId=" << keyRef.entityId
|
||||
<< ", exerciseId=" << keyRef.exerciseId
|
||||
<< " - eTN=" << valRef.entityTypeName
|
||||
@@ -420,7 +419,7 @@ void HandlerLockedTopics::dumpLockedTopics(int line)
|
||||
<< ", exId=" << valRef.exerciseId.toInt()
|
||||
<< ", opId=" << valRef.operatorId;
|
||||
}
|
||||
INFO_LOG(m_logger) << " dump m_lockedTopics, END size= " << m_lockedTopics.size();
|
||||
INFO_LOG() << " dump m_lockedTopics, END size= " << m_lockedTopics.size();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
+28
-29
@@ -32,7 +32,6 @@ HandlerOperator::HandlerOperator(MainHandler *mainHandler)
|
||||
, Interface::Fts::OperatorUpdateVisiblePartiesByExerciseRequestHandler(mainHandler->fts())
|
||||
, m_aliveCheckTimer(new QTimer(this))
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("HandlerOperator"))
|
||||
{
|
||||
connect(m_aliveCheckTimer, &QTimer::timeout, this, &HandlerOperator::onCheckAliveTimeout);
|
||||
m_aliveCheckTimer->setInterval(10000);
|
||||
@@ -54,7 +53,7 @@ bool HandlerOperator::init()
|
||||
// read all Operators from database
|
||||
if (!m_mainHandler->db()->select(dataVec))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -62,17 +61,17 @@ bool HandlerOperator::init()
|
||||
// read all Operators from database
|
||||
if (!m_mainHandler->db()->select(partyExerciseVec))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
return true;
|
||||
}
|
||||
QMap<int, QVector<Database::OpmOperatorExercise> > opMap;
|
||||
for (const auto &elem : partyExerciseVec)
|
||||
{
|
||||
INFO_LOG(m_logger) << "---------- elem.operatorId:" << elem.operatorId
|
||||
INFO_LOG() << "---------- elem.operatorId:" << elem.operatorId
|
||||
<< ", elem size " << elem.visibleParties().size();
|
||||
opMap[elem.operatorId] << elem;
|
||||
}
|
||||
INFO_LOG(m_logger) << "------- opMap size" << opMap.size();
|
||||
INFO_LOG() << "------- opMap size" << opMap.size();
|
||||
|
||||
OperatorManagement::OperatorWorkstationAlive alive;
|
||||
alive.lastAlive(QDateTime::currentMSecsSinceEpoch());
|
||||
@@ -83,7 +82,7 @@ bool HandlerOperator::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
ERROR_LOG() << ret();
|
||||
return false;
|
||||
}
|
||||
if (m_logger.isDebugEnabled())
|
||||
@@ -93,7 +92,7 @@ bool HandlerOperator::init()
|
||||
stringList.reserve(acls.size());
|
||||
for (int acl : acls)
|
||||
stringList << QString::number(acl);
|
||||
DEBUG_LOG(m_logger) << "Effective ACLs for Operator " << op.name << "(id: " << op.id << "): "
|
||||
DEBUG_LOG() << "Effective ACLs for Operator " << op.name << "(id: " << op.id << "): "
|
||||
<< stringList.join(QLatin1String(", "));
|
||||
}
|
||||
ifs->updateExercises(getExercisesForOperator(exMappingVec, op.id), true);
|
||||
@@ -111,7 +110,7 @@ bool HandlerOperator::init()
|
||||
this, &HandlerOperator::onOperatorWorkstationAliveChanged);
|
||||
dtc->enableOperatorWorkstationAlive();
|
||||
|
||||
DEBUG_LOG(m_logger) << "m_exeObjMap.size() = " << m_operatorObjMap.size();
|
||||
DEBUG_LOG() << "m_exeObjMap.size() = " << m_operatorObjMap.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -139,7 +138,7 @@ std::vector<int> HandlerOperator::getExercisesForOperator(const QVector<Database
|
||||
void HandlerOperator::onOperatorChangePasswordRequest(const rti::core::SampleIdentity &cookie,
|
||||
const OperatorChangePasswordRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onOperatorChangePasswordRequest()";
|
||||
DEBUG_LOG() << "onOperatorChangePasswordRequest()";
|
||||
ObjectOperator *ifs = m_operatorObjMap.value(request.id());
|
||||
if (!ifs)
|
||||
{
|
||||
@@ -185,14 +184,14 @@ void HandlerOperator::onOperatorCreateModifyRequest(const rti::core::SampleIdent
|
||||
const OperatorCreateModifyRequest &request)
|
||||
{
|
||||
Core::FunctionReplyObject ret;
|
||||
DEBUG_LOG(m_logger) << "onOperatorCreateModifyRequest()";
|
||||
DEBUG_LOG() << "onOperatorCreateModifyRequest()";
|
||||
if (!request.id().is_set())
|
||||
ret = operatorCreateRequest(request);
|
||||
else
|
||||
ret = operatorModifyRequest(request);
|
||||
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
WARNING_LOG() << ret();
|
||||
m_mainHandler->fts()->operatorCreateModifyReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -269,13 +268,13 @@ Core::FunctionReplyObject HandlerOperator::operatorCreateRequest(const OperatorC
|
||||
|
||||
void HandlerOperator::operatorModifyRolePresetId( int operatorId, int rolePresetId)
|
||||
{
|
||||
DEBUG_LOG(m_logger)<< "HandlerOperator::operatorModifyRolePresetId"
|
||||
DEBUG_LOG()<< "HandlerOperator::operatorModifyRolePresetId"
|
||||
<< " operatorId=" << operatorId
|
||||
<< " rolePresetId=" << rolePresetId;
|
||||
ObjectOperator *ifs = m_operatorObjMap.value(operatorId);
|
||||
if (!ifs)
|
||||
{
|
||||
ERROR_LOG(m_logger)<< "No valid operator id given: "<< operatorId;
|
||||
ERROR_LOG()<< "No valid operator id given: "<< operatorId;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -342,7 +341,7 @@ Core::FunctionReplyObject HandlerOperator::operatorModifyRequest(const OperatorC
|
||||
void HandlerOperator::onOperatorRemoveRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Core::RemoveElementRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onOperatorRemoveRequest()" << request;
|
||||
DEBUG_LOG() << "onOperatorRemoveRequest()" << request;
|
||||
|
||||
ObjectOperator *ifs = m_operatorObjMap.value(request.id());
|
||||
if (!ifs)
|
||||
@@ -373,7 +372,7 @@ void HandlerOperator::onOperatorRemoveRequest(const rti::core::SampleIdentity &c
|
||||
Core::FunctionReplyObject ret = m_mainHandler->getHandlerGroup()->remove(groupRemoveRequest);
|
||||
if (ret.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
ERROR_LOG() << ret();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -390,7 +389,7 @@ void HandlerOperator::onOperatorRemoveRequest(const rti::core::SampleIdentity &c
|
||||
void HandlerOperator::onOperatorLoginRequest(const rti::core::SampleIdentity &cookie,
|
||||
const OperatorLoginRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "OperatorLoginRequest: " << request;
|
||||
DEBUG_LOG() << "OperatorLoginRequest: " << request;
|
||||
|
||||
ObjectOperator *ifs = m_operatorObjMap.value(request.id());
|
||||
if (!ifs)
|
||||
@@ -461,7 +460,7 @@ void HandlerOperator::onOperatorLoginRequest(const rti::core::SampleIdentity &co
|
||||
OperatorLogoutRequest req;
|
||||
req.id(otherOperatorId);
|
||||
onOperatorLogoutRequest(cookie, req);
|
||||
WARNING_LOG(m_logger) << "Logged out operator " << otherOperatorId << " on workstation id " << request.workstationId();
|
||||
WARNING_LOG() << "Logged out operator " << otherOperatorId << " on workstation id " << request.workstationId();
|
||||
}
|
||||
}
|
||||
// Claim WS:
|
||||
@@ -472,7 +471,7 @@ void HandlerOperator::onOperatorLoginRequest(const rti::core::SampleIdentity &co
|
||||
}
|
||||
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
WARNING_LOG() << ret();
|
||||
else
|
||||
{
|
||||
m_mainHandler->getHandlerLockedTopics()->operatorLoggedIn(request.id(), request.workstationId());
|
||||
@@ -492,7 +491,7 @@ int HandlerOperator::getLoggedOperatorId(int workstationId) const
|
||||
void HandlerOperator::onOperatorLogoutRequest(const rti::core::SampleIdentity &cookie,
|
||||
const OperatorLogoutRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "OperatorLogoutRequest: " << request;
|
||||
DEBUG_LOG() << "OperatorLogoutRequest: " << request;
|
||||
|
||||
ObjectOperator *ifs = m_operatorObjMap.value(request.id());
|
||||
if (!ifs)
|
||||
@@ -567,10 +566,10 @@ void HandlerOperator::onOperatorGetSetSettingsRequest(const rti::core::SampleIde
|
||||
|
||||
void HandlerOperator::onOperatorApplyForeignAclsRequest(const rti::core::SampleIdentity &cookie, const OperatorApplyForeignAclsRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "peratorApplyForeignAclsRequest: " << request;
|
||||
DEBUG_LOG() << "peratorApplyForeignAclsRequest: " << request;
|
||||
auto reply = operatorApplyForeignAclsRequest(request);
|
||||
if (reply.error())
|
||||
WARNING_LOG(m_logger) << reply();
|
||||
WARNING_LOG() << reply();
|
||||
m_mainHandler->fts()->operatorApplyForeignAclsReply(cookie, reply);
|
||||
}
|
||||
|
||||
@@ -590,11 +589,11 @@ Core::FunctionReplyObject HandlerOperator::operatorApplyForeignAclsRequest(const
|
||||
void HandlerOperator::onOperatorUpdateVisiblePartiesByExerciseRequest(const rti::core::SampleIdentity &cookie,
|
||||
const OperatorUpdateVisiblePartiesByExerciseRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << request;
|
||||
// DEBUG_LOG(m_logger) << "onOperatorUpdateVisiblePartiesByExerciseRequest: " << request;
|
||||
DEBUG_LOG() << Q_FUNC_INFO << request;
|
||||
// DEBUG_LOG() << "onOperatorUpdateVisiblePartiesByExerciseRequest: " << request;
|
||||
Core::FunctionReplyObject reply = operatorUpdateVisiblePartiesByExerciseRequest(request);
|
||||
if (reply.error())
|
||||
WARNING_LOG(m_logger) << reply();
|
||||
WARNING_LOG() << reply();
|
||||
m_mainHandler->fts()->operatorUpdateVisiblePartiesByExerciseReply(cookie, reply);
|
||||
}
|
||||
|
||||
@@ -626,7 +625,7 @@ void HandlerOperator::reloadAcls()
|
||||
|
||||
void HandlerOperator::onOperatorWorkstationAliveChanged(const OperatorManagement::OperatorWorkstationAlive &data, DataModification modType)
|
||||
{
|
||||
INFO_LOG(m_logger) << "onOperatorWorkstationAliveChanged: " << data << ", " << modType;
|
||||
INFO_LOG() << "onOperatorWorkstationAliveChanged: " << data << ", " << modType;
|
||||
if (data.operatorId() < 0)
|
||||
{
|
||||
m_aliveData.remove(data.workstationId());
|
||||
@@ -646,11 +645,11 @@ void HandlerOperator::onCheckAliveTimeout()
|
||||
return;
|
||||
|
||||
const qint64 tTimeoutTime = QDateTime::currentMSecsSinceEpoch() - 90 * 1000; // 90s
|
||||
DEBUG_LOG(m_logger) << "onCheckAliveTimeout, timeoutTime: " << tTimeoutTime;
|
||||
DEBUG_LOG() << "onCheckAliveTimeout, timeoutTime: " << tTimeoutTime;
|
||||
auto it = m_aliveData.begin();
|
||||
while (it != m_aliveData.end())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Checking alive for workstation " << it.key();
|
||||
DEBUG_LOG() << "Checking alive for workstation " << it.key();
|
||||
auto &events = it.value();
|
||||
if (events.isEmpty() || events.last().lastAlive() >= tTimeoutTime)
|
||||
{
|
||||
@@ -660,12 +659,12 @@ void HandlerOperator::onCheckAliveTimeout()
|
||||
// no reference, will be a dangling one after m_aliveData.erase(it) !
|
||||
const OperatorWorkstationAlive owa = events.last();
|
||||
|
||||
WARNING_LOG(m_logger) << "Timeout for workstation " << owa.workstationId()
|
||||
WARNING_LOG() << "Timeout for workstation " << owa.workstationId()
|
||||
<< " and operator " << owa.operatorId() << " - logging out";
|
||||
if (m_logger.isDebugEnabled())
|
||||
{
|
||||
for (const auto &event : events)
|
||||
DEBUG_LOG(m_logger) << "Alive history: " << event;
|
||||
DEBUG_LOG() << "Alive history: " << event;
|
||||
}
|
||||
ObjectOperator *ifs = m_operatorObjMap.value(owa.operatorId());
|
||||
it = m_aliveData.erase(it);
|
||||
|
||||
@@ -79,6 +79,5 @@ private:
|
||||
QHash<int, ObjectOperator*> m_operatorObjMap;
|
||||
QTimer *m_aliveCheckTimer;
|
||||
MainHandler *m_mainHandler;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include "opm_export.h"
|
||||
#include "svcopmcommon_export.h"
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ bool MainHandler::init(int domainId)
|
||||
|
||||
if (!m_dbHandler->init(0, Settings::settings()))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation dbHandler failed.";
|
||||
ERROR_LOG() << "Initialisation dbHandler failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -117,14 +117,14 @@ bool MainHandler::initWebSocketHandler()
|
||||
{
|
||||
// WebSocketServer
|
||||
m_handlerWebSocket = std::make_shared<WebSocketInterface::WebSocketInterfaceHandler>(this);
|
||||
DEBUG_LOG(m_logger) << "Reset WebSocketInterfaceHandler succesful.";
|
||||
DEBUG_LOG() << "Reset WebSocketInterfaceHandler succesful.";
|
||||
if (!m_handlerWebSocket->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler failed.";
|
||||
ERROR_LOG() << "Initialisation WebSocketInterfaceHandler failed.";
|
||||
return false;
|
||||
}
|
||||
m_ddsHandler->pacemaker()->addPort(m_handlerWebSocket->serverWebSocketPort(), Core::PortType::WebSocketServer);
|
||||
DEBUG_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler succesful.";
|
||||
DEBUG_LOG() << "Initialisation WebSocketInterfaceHandler succesful.";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -64,8 +64,5 @@ private:
|
||||
std::shared_ptr<DbHandler> m_dbHandler;
|
||||
std::shared_ptr<WebSocketInterface::WebSocketInterfaceHandler> m_handlerWebSocket;
|
||||
std::shared_ptr<HandlerActiveApps> m_handlerActiveApps;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
} // namespace ExerciseManagement
|
||||
+2
-3
@@ -15,7 +15,6 @@ namespace OperatorManagement
|
||||
|
||||
ObjectAccessControlLevel::ObjectAccessControlLevel(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("ObjectAccessControlLevel"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -56,11 +55,11 @@ void ObjectAccessControlLevel::onPublishData()
|
||||
ddsData.description(m_data.description.toStdString());
|
||||
|
||||
// Todo: Copy as above
|
||||
INFO_LOG(m_logger) << "Publish OpmAccessControlLevel-data to dds (" << m_data.id << ") ...";
|
||||
INFO_LOG() << "Publish OpmAccessControlLevel-data to dds (" << m_data.id << ") ...";
|
||||
|
||||
if (!m_mainHandler->dts()->publish(ddsData))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error publishing OpmAccessControlLevel-data to dds";
|
||||
ERROR_LOG() << "Error publishing OpmAccessControlLevel-data to dds";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <DDS/Core/core_types.h>
|
||||
|
||||
// Generated
|
||||
#include <OperatorManagement/opm_db.h>
|
||||
@@ -33,8 +33,5 @@ protected:
|
||||
private:
|
||||
MainHandler *m_mainHandler;
|
||||
Database::OpmAccessControlLevel m_data;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
@@ -16,7 +16,6 @@ namespace OperatorManagement
|
||||
|
||||
ObjectGroup::ObjectGroup(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("ObjectGroup"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -229,11 +228,11 @@ void ObjectGroup::onPublishData()
|
||||
ddsData.type(m_data.typeId);
|
||||
ddsData.isMemberOf(m_isMemberOf);
|
||||
|
||||
INFO_LOG(m_logger) << "Publish OpmGroup-data to dds (" << m_data.id << ") ...";
|
||||
INFO_LOG() << "Publish OpmGroup-data to dds (" << m_data.id << ") ...";
|
||||
|
||||
if (!m_mainHandler->dts()->publish(ddsData))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error publishing OpmGroup-data to dds";
|
||||
ERROR_LOG() << "Error publishing OpmGroup-data to dds";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <DDS/Core/core_types.h>
|
||||
|
||||
// Generated
|
||||
#include <OperatorManagement/opm_db.h>
|
||||
@@ -49,8 +49,5 @@ private:
|
||||
std::vector<qint32> m_isMemberOf;
|
||||
std::vector<qint32> m_aclAllow;
|
||||
std::vector<qint32> m_aclDeny;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
+12
-13
@@ -21,7 +21,6 @@ namespace OperatorManagement
|
||||
ObjectOperator::ObjectOperator(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
, m_originalPrimaryGroupId(0)
|
||||
, m_logger(getLogger("ObjectOperator"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -93,13 +92,13 @@ Core::FunctionReplyObject ObjectOperator::updateExercises(const std::vector<int>
|
||||
}
|
||||
if (mapping.visibleParties().empty())
|
||||
{
|
||||
DEBUG_LOG(m_logger)<< "Update Operator visible Parties for Execise: No parties found for " << exerciseId << " use default (ex0)";
|
||||
DEBUG_LOG()<< "Update Operator visible Parties for Execise: No parties found for " << exerciseId << " use default (ex0)";
|
||||
// Add default visibleParties from ex0
|
||||
mapping.visibleParties = m_data.visibleParties;
|
||||
}
|
||||
|
||||
if (!m_mainHandler->db()->insert(mapping))
|
||||
INFO_LOG(m_logger) << "Can not add operator " << mapping.operatorId << " to exercise " << exerciseId << " - exercise does no longer exist";
|
||||
INFO_LOG() << "Can not add operator " << mapping.operatorId << " to exercise " << exerciseId << " - exercise does no longer exist";
|
||||
else
|
||||
{
|
||||
if (std::find(m_exercises.begin(), m_exercises.end(), exerciseId) == m_exercises.end())
|
||||
@@ -117,7 +116,7 @@ Core::FunctionReplyObject ObjectOperator::updateExercises(const std::vector<int>
|
||||
Core::FunctionReplyObject ObjectOperator::updateObject(const Database::OpmOperator &data)
|
||||
{
|
||||
m_data.name = data.name;
|
||||
DEBUG_LOG(m_logger) << "ObjectOperator::updateObject"
|
||||
DEBUG_LOG() << "ObjectOperator::updateObject"
|
||||
<< " data.id = " << data.id
|
||||
<< " data.rolePresetId = " << data.rolePresetId;
|
||||
m_data.description = data.description;
|
||||
@@ -134,7 +133,7 @@ Core::FunctionReplyObject ObjectOperator::updateObject(const Database::OpmOperat
|
||||
|
||||
if (!m_mainHandler->db()->update(m_data))
|
||||
{
|
||||
ERROR_LOG(m_logger)<< "Error updating Operator in database: " << m_mainHandler->db()->getLastError().text();
|
||||
ERROR_LOG()<< "Error updating Operator in database: " << m_mainHandler->db()->getLastError().text();
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error updating operator in database."));
|
||||
}
|
||||
m_data.primaryGroupId = data.primaryGroupId;
|
||||
@@ -145,13 +144,13 @@ Core::FunctionReplyObject ObjectOperator::updateObject(const Database::OpmOperat
|
||||
|
||||
Core::FunctionReplyObject ObjectOperator::updateOperatorExercise(const Database::OpmOperatorExercise &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << data.operatorId << " " << data.exerciseId;
|
||||
DEBUG_LOG() << Q_FUNC_INFO << data.operatorId << " " << data.exerciseId;
|
||||
|
||||
// insert can fail due to (deleted) exerciseId
|
||||
m_mainHandler->db()->setEmitMessageOnError(false);
|
||||
for (int i=0; i < m_dataExercise.size(); ++i)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "** m_dataExercise.at(" << i << "): " << m_dataExercise.at(i).exerciseId << "==" << data.exerciseId;
|
||||
DEBUG_LOG() << "** m_dataExercise.at(" << i << "): " << m_dataExercise.at(i).exerciseId << "==" << data.exerciseId;
|
||||
if (m_dataExercise.at(i).exerciseId != data.exerciseId)
|
||||
continue;
|
||||
Database::OpmOperatorExercise mapping = m_dataExercise.at(i);
|
||||
@@ -160,16 +159,16 @@ Core::FunctionReplyObject ObjectOperator::updateOperatorExercise(const Database:
|
||||
mapping.properties = data.properties;
|
||||
m_dataExercise.replace(i, mapping);
|
||||
|
||||
DEBUG_LOG(m_logger) << "** m_dataExercise.at(" << i << "): " << m_dataExercise.at(i).operatorId << ", "
|
||||
DEBUG_LOG() << "** m_dataExercise.at(" << i << "): " << m_dataExercise.at(i).operatorId << ", "
|
||||
<< m_dataExercise.at(i).exerciseId << ", "
|
||||
<< m_dataExercise.at(i).visibleParties.toPgString() << ", "
|
||||
<< m_dataExercise.at(i).hiddenParties.toPgString();
|
||||
DEBUG_LOG(m_logger) << "** mapping: " << mapping.operatorId << ", "
|
||||
DEBUG_LOG() << "** mapping: " << mapping.operatorId << ", "
|
||||
<< mapping.exerciseId << ", "
|
||||
<< mapping.visibleParties.toPgString() << ", "
|
||||
<< mapping.hiddenParties.toPgString();
|
||||
if (!m_mainHandler->db()->update(mapping))
|
||||
ERROR_LOG(m_logger)<< "Error updating OperatorExecise in database: " << m_mainHandler->db()->getLastError().text();
|
||||
ERROR_LOG()<< "Error updating OperatorExecise in database: " << m_mainHandler->db()->getLastError().text();
|
||||
}
|
||||
m_mainHandler->db()->setEmitMessageOnError(true);
|
||||
|
||||
@@ -237,7 +236,7 @@ void ObjectOperator::reloadAcls(bool force)
|
||||
// QStringList stringList;
|
||||
// for (int acl : calculatedAcls)
|
||||
// stringList << QString::number(acl);
|
||||
// DEBUG_LOG(m_logger) << "Effective ACLs for Operator " << m_data.name << "(id: " << m_data.id << "): " << stringList.join(QLatin1String(", "));
|
||||
// DEBUG_LOG() << "Effective ACLs for Operator " << m_data.name << "(id: " << m_data.id << "): " << stringList.join(QLatin1String(", "));
|
||||
|
||||
if (force || m_effectiveAcls != calculatedAcls)
|
||||
updateEffectiveAcls(calculatedAcls);
|
||||
@@ -337,12 +336,12 @@ void ObjectOperator::onPublishData()
|
||||
op.rolePresetId(m_data.rolePresetId);
|
||||
op.properties(m_data.properties.toStdString());
|
||||
|
||||
INFO_LOG(m_logger) << "Publish OpmOperator-data to dds (" << m_data.id
|
||||
INFO_LOG() << "Publish OpmOperator-data to dds (" << m_data.id
|
||||
<< " rolePresetId =" << m_data.rolePresetId
|
||||
<< ") ...";
|
||||
|
||||
if (!m_mainHandler->dts()->publish(op))
|
||||
ERROR_LOG(m_logger) << "Error publishing OpmOperator-data to dds";
|
||||
ERROR_LOG() << "Error publishing OpmOperator-data to dds";
|
||||
}
|
||||
|
||||
std::vector<OperatorManagement::PartiesByExercise> ObjectOperator::toDdsData(const QVector<Database::OpmOperatorExercise> &dbData)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <DDS/Core/core_types.h>
|
||||
#include <QSet>
|
||||
|
||||
// Generated
|
||||
@@ -55,8 +55,6 @@ private:
|
||||
QSet<int> m_effectiveAcls;
|
||||
std::vector<int> m_exercises;
|
||||
int m_originalPrimaryGroupId;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
//Database::OpmOperatorExercise toDbData(const PartiesByExercise &ddsData);
|
||||
std::vector<OperatorManagement::PartiesByExercise> toDdsData(const QVector<Database::OpmOperatorExercise> &dbData);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user