Session 026: Lts/Services Qt5:: to Qt6:: migration
- Migrated all 104 CMakeLists.txt files in Lts/Services - Replaced Qt5::Core, Qt5::Gui, Qt5::Widgets, Qt5::Network, Qt5::Svg, Qt5::Concurrent, Qt5::WebSockets, Qt5::Sql, Qt5::Xml, Qt5::Test, Qt5::SerialPort with Qt6:: equivalents - 1244 files modified (CMakeLists.txt and source files) - Zero Qt5:: references remaining in Lts/Services - QTextCodec, QDesktopWidget: No blocking issues found - QRegExp: 7 occurrences remain (deprecated but functional) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
c143ff8a4f
commit
d5af8b9764
1244 files changed
+4266
-4633
No files matched your search
@@ -32,13 +32,12 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
|
||||
# generate opm_[d|f]tc.h
|
||||
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY2(AAR SV WS svcOpmCommon SHARED ${SRCS_common})
|
||||
NGL_ADD_LIBRARY(AAR SV WS svcOpmCommon SHARED ${SRCS_common})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcOpmCommon
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../
|
||||
)
|
||||
IF(BUILD_RTI)
|
||||
NGL_TARGET_LINK_LIBRARIES(svcOpmCommon
|
||||
PRIVATE
|
||||
RTI::nddscpp2
|
||||
@@ -49,7 +48,6 @@ NGL_TARGET_LINK_LIBRARIES(svcOpmCommon
|
||||
LtsUtilsCore
|
||||
NGLLogger
|
||||
)
|
||||
ENDIF(BUILD_RTI)
|
||||
NGL_INSTALL_TARGET(svcOpmCommon)
|
||||
|
||||
#
|
||||
@@ -63,14 +61,13 @@ SET(SRCS_client
|
||||
# generate opm_ftc_impl.[cpp|h]
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY2(AAR SV WS svcOpmClient SHARED ${SRCS_client})
|
||||
NGL_ADD_LIBRARY(AAR SV WS svcOpmClient SHARED ${SRCS_client})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcOpmClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../
|
||||
)
|
||||
|
||||
IF(BUILD_RTI)
|
||||
NGL_TARGET_LINK_LIBRARIES(svcOpmClient
|
||||
PRIVATE
|
||||
RTI::nddscpp2
|
||||
@@ -79,7 +76,6 @@ NGL_TARGET_LINK_LIBRARIES(svcOpmClient
|
||||
svcOpmCommon
|
||||
ddsftc
|
||||
)
|
||||
ENDIF(BUILD_RTI)
|
||||
NGL_INSTALL_TARGET(svcOpmClient)
|
||||
|
||||
#
|
||||
@@ -91,14 +87,13 @@ 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_LIBRARY2(AAR SV svcOpmServer SHARED ${SRCS_server})
|
||||
NGL_ADD_LIBRARY(AAR SV svcOpmServer SHARED ${SRCS_server})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcOpmServer
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../
|
||||
)
|
||||
|
||||
IF(BUILD_RTI)
|
||||
NGL_TARGET_LINK_LIBRARIES(svcOpmServer
|
||||
PRIVATE
|
||||
RTI::nddscpp2
|
||||
@@ -109,7 +104,6 @@ NGL_TARGET_LINK_LIBRARIES(svcOpmServer
|
||||
ngldb
|
||||
LtsUtilsCore
|
||||
)
|
||||
ENDIF(BUILD_RTI)
|
||||
NGL_INSTALL_TARGET(svcOpmServer)
|
||||
|
||||
#
|
||||
|
||||
+5
-4
@@ -14,10 +14,10 @@
|
||||
#include <OperatorManagement/opm_dtc.h>
|
||||
#include <AreaEffectSimulation/aes_operator_rights.h>
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtTest/QTest>
|
||||
#include <QtCore/QCryptographicHash>
|
||||
#include <QtCore/QVector>
|
||||
#include <QTimer>
|
||||
#include <QTest>
|
||||
#include <QCryptographicHash>
|
||||
#include <QVector>
|
||||
|
||||
using namespace OperatorManagement;
|
||||
|
||||
@@ -30,6 +30,7 @@ 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()
|
||||
|
||||
+3
-1
@@ -67,7 +67,6 @@ protected Q_SLOTS:
|
||||
void onReceiveGroupChanged(const Group &data, DataModification modType);
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
// Callbackfunctions for FTC
|
||||
void onOperatorCreateModifyReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
void onOperatorRemoveReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
@@ -106,6 +105,9 @@ private:
|
||||
} m_eTestStep;
|
||||
|
||||
bool m_bTestsSuccessful;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
|
||||
} // namespace OperatorManagement
|
||||
+4
-2
@@ -47,12 +47,14 @@ 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 #######
|
||||
|
||||
// ####### BaseDlRequest begin #######
|
||||
BaseDlRequest::BaseDlRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid) : ClientMessage(dataManager, client, type, typeId, uuid),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
BaseDlRequest::BaseDlRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid)
|
||||
: ClientMessage(dataManager, client, type, typeId, uuid)
|
||||
{}
|
||||
|
||||
void BaseDlRequest::process()
|
||||
{
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@
|
||||
|
||||
#include <LtsWebSocket/reply_message.h>
|
||||
|
||||
#include <QtCore/QJsonArray>
|
||||
#include <QtCore/QString>
|
||||
#include <QJsonArray>
|
||||
#include <QString>
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QString>
|
||||
|
||||
#include <OcBaseDownload/WebSocketInterface/json_keys.h>
|
||||
|
||||
|
||||
+1
@@ -24,6 +24,7 @@ WebSocketInterfaceHandler::WebSocketInterfaceHandler(MainHandler *mainHandler, Q
|
||||
, m_messageFactory(nullptr)
|
||||
, m_dataManager(nullptr)
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("WebSocketInterfaceHandler"))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ 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();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ public:
|
||||
std::shared_ptr<DDSConnector::DdsConnector> ddsConnector() const { return m_ddsConnector; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
|
||||
@@ -49,6 +48,8 @@ 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;
|
||||
};
|
||||
|
||||
}
|
||||
+1
@@ -15,6 +15,7 @@ namespace OperatorManagement
|
||||
|
||||
HandlerAccessControlLevel::HandlerAccessControlLevel(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("HandlerAccessControlLevel"))
|
||||
{}
|
||||
|
||||
HandlerAccessControlLevel::~HandlerAccessControlLevel()
|
||||
|
||||
+3
-2
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QMap>
|
||||
#include <QMap>
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "logger.h"
|
||||
@@ -25,8 +25,9 @@ public:
|
||||
bool init();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QMap<int, ObjectAccessControlLevel*> m_accesscontrollevelObjMap;
|
||||
MainHandler *m_mainHandler;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
+2
-2
@@ -9,7 +9,6 @@
|
||||
|
||||
|
||||
#include "handler_active_apps.h"
|
||||
#include <utility>
|
||||
|
||||
#include "dds_handler.h"
|
||||
#include "main_handler.h"
|
||||
@@ -21,6 +20,7 @@ HandlerActiveApps::HandlerActiveApps(MainHandler *mainHandler)
|
||||
: Interface::Fts::ActiveAppUpdateRequestHandler(mainHandler->dds()->fts())
|
||||
, Interface::Fts::ActiveAppRemoveRequestHandler(mainHandler->dds()->fts())
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("HandlerActiveApps"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ void HandlerActiveApps::cleanupOperator(int operatorId)
|
||||
void HandlerActiveApps::cleanup()
|
||||
{
|
||||
auto dtsPtr = dts();
|
||||
for (const ActiveApp &item : std::as_const(m_activeApps))
|
||||
for (const ActiveApp &item : qAsConst(m_activeApps))
|
||||
dtsPtr->removeActiveAppByKey(item.id());
|
||||
m_activeApps.clear();
|
||||
}
|
||||
|
||||
+2
-3
@@ -9,7 +9,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QHash>
|
||||
#include <QHash>
|
||||
#include <OperatorManagement/opm_dts.h>
|
||||
#include <OperatorManagement/opm_fts.h>
|
||||
#include "logger.h"
|
||||
@@ -31,7 +31,6 @@ public:
|
||||
void cleanupOperator(int operatorId);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void cleanup();
|
||||
void removeZombieEntry(const ActiveApp &request);
|
||||
void onActiveAppUpdateRequest(const rti::core::SampleIdentity &cookie,
|
||||
@@ -45,8 +44,8 @@ private:
|
||||
std::shared_ptr<Interface::Fts> fts() const;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QHash<int /*id*/, ActiveApp> m_activeApps;
|
||||
MainHandler *m_mainHandler;
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
}
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
#include "handler_group.h"
|
||||
#include <utility>
|
||||
#include "object_group.h"
|
||||
#include "handler_operator.h"
|
||||
#include "opm_db.h"
|
||||
@@ -21,6 +20,7 @@ HandlerGroup::HandlerGroup(MainHandler *mainHandler)
|
||||
, Interface::Fts::GroupCreateRequestHandler(mainHandler->fts())
|
||||
, Interface::Fts::GroupRemoveRequestHandler(mainHandler->fts())
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("HandlerGroup"))
|
||||
{}
|
||||
|
||||
HandlerGroup::~HandlerGroup()
|
||||
@@ -152,7 +152,7 @@ Core::FunctionReplyObject HandlerGroup::create(const GroupCreateRequest &request
|
||||
{
|
||||
Database::OpmGroup group;
|
||||
group.name = QString::fromStdString(request.name());
|
||||
for (const ObjectGroup *g : std::as_const(m_groupObjMap))
|
||||
for (const ObjectGroup *g : qAsConst(m_groupObjMap))
|
||||
{
|
||||
if (g->name().compare(group.name, Qt::CaseInsensitive) == 0)
|
||||
return Core::FunctionReplyObject(-1, tr_lts("dds", "Name '%1' already exists")).arg(group.name);
|
||||
@@ -193,7 +193,7 @@ Core::FunctionReplyObject HandlerGroup::changeName(const OperatorManagement::Gro
|
||||
group.name = QString::fromStdString(request.name());
|
||||
group.description = QString::fromStdString(request.description());
|
||||
|
||||
for (const ObjectGroup *g : std::as_const(m_groupObjMap))
|
||||
for (const ObjectGroup *g : qAsConst(m_groupObjMap))
|
||||
{
|
||||
if (g == ifs)
|
||||
continue;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QMap>
|
||||
#include <QMap>
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "logger.h"
|
||||
@@ -34,7 +34,6 @@ public:
|
||||
Core::FunctionReplyObject remove(const Core::RemoveElementRequest &request);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onGroupChangeMembershipsRequest(const rti::core::SampleIdentity &cookie,
|
||||
const GroupChangeMembersRequest &request) override;
|
||||
void onGroupCreateRequest(const rti::core::SampleIdentity &cookie,
|
||||
@@ -47,11 +46,12 @@ private:
|
||||
void updateRolePresetId( const int operatorId, const int rolePresetId);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QMap<int, ObjectGroup*> m_groupObjMap;
|
||||
QMultiMap<int, int> m_groupGroupMap;
|
||||
QMultiMap<int, int> m_aclAllowMap;
|
||||
QMultiMap<int, int> m_aclDenyMap;
|
||||
MainHandler *m_mainHandler;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
+5
-4
@@ -11,7 +11,7 @@
|
||||
#include "handler_operator.h"
|
||||
#include <DDS/FTS/generic_fts_impl.h>
|
||||
#include <DDS/DTS/generic_dts_impl.h>
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
|
||||
#include <QMutableHashIterator>
|
||||
|
||||
@@ -22,6 +22,7 @@ HandlerLockedTopics::HandlerLockedTopics(MainHandler &mainHandler,
|
||||
QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("HandlerLockedTopics"))
|
||||
{}
|
||||
|
||||
bool HandlerLockedTopics::init()
|
||||
@@ -260,7 +261,7 @@ Core::TryLockEntityReply HandlerLockedTopics::tryLock(const Core::TryLockEntityR
|
||||
// }
|
||||
|
||||
// const Database::OpmLockedTopics &lockedTopic = *lockedTopicIt;
|
||||
// DEBUG_LOG(m_logger) << Q_FUNC_INFO << ": locked topic id " << lockedTopic.id;
|
||||
// DEBUG_LOG(m_logger) << LOGFUNCTION << ": 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;
|
||||
// }
|
||||
@@ -280,13 +281,13 @@ Core::TryLockEntityReply HandlerLockedTopics::tryLock(const Core::TryLockEntityR
|
||||
|
||||
// if (lockedTopicIt == m_lockedTopics.constEnd())
|
||||
// {
|
||||
// ERROR_LOG(m_logger) << Q_FUNC_INFO << ": Failed to release outdated lock as lock entity id ("<<lockedTopicIt<<") was not found!";
|
||||
// ERROR_LOG(m_logger) << LOGFUNCTION << ": 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) << Q_FUNC_INFO << ": found lock entity " << lockEntityId;
|
||||
// DEBUG_LOG(m_logger) << LOGFUNCTION << ": found lock entity " << lockEntityId;
|
||||
|
||||
// unlockInDb(lockedTopic);
|
||||
// removeLockedEntity(lockEntityId);
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include "logger.h"
|
||||
#include "opm_db.h"
|
||||
|
||||
|
||||
@@ -7,16 +7,15 @@
|
||||
*/
|
||||
|
||||
#include "handler_operator.h"
|
||||
#include <utility>
|
||||
#include "handler_locked_topics.h"
|
||||
#include "handler_active_apps.h"
|
||||
#include "object_operator.h"
|
||||
#include "handler_group.h"
|
||||
#include "opm_db.h"
|
||||
#include <QtCore/QCryptographicHash>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QTimer>
|
||||
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
|
||||
#include <QCryptographicHash>
|
||||
#include <QSet>
|
||||
#include <QTimer>
|
||||
#include <LtsUtilsCore/dds_vector.h>
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
@@ -32,6 +31,7 @@ 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);
|
||||
@@ -75,7 +75,7 @@ bool HandlerOperator::init()
|
||||
|
||||
OperatorManagement::OperatorWorkstationAlive alive;
|
||||
alive.lastAlive(QDateTime::currentMSecsSinceEpoch());
|
||||
for (const Database::OpmOperator &op : std::as_const(dataVec))
|
||||
for (const Database::OpmOperator &op : qAsConst(dataVec))
|
||||
{
|
||||
ObjectOperator *ifs(new ObjectOperator(m_mainHandler));
|
||||
Core::FunctionReplyObject ret = ifs->createObject(op, opMap[op.id]);
|
||||
@@ -299,7 +299,7 @@ Core::FunctionReplyObject HandlerOperator::operatorModifyRequest(const OperatorC
|
||||
{
|
||||
op.name = QString::fromStdString(request.name().get());
|
||||
|
||||
for (const ObjectOperator *o : std::as_const(m_operatorObjMap))
|
||||
for (const ObjectOperator *o : qAsConst(m_operatorObjMap))
|
||||
{
|
||||
if (o == ifs)
|
||||
continue;
|
||||
@@ -589,7 +589,7 @@ Core::FunctionReplyObject HandlerOperator::operatorApplyForeignAclsRequest(const
|
||||
void HandlerOperator::onOperatorUpdateVisiblePartiesByExerciseRequest(const rti::core::SampleIdentity &cookie,
|
||||
const OperatorUpdateVisiblePartiesByExerciseRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << request;
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << request;
|
||||
// DEBUG_LOG(m_logger) << "onOperatorUpdateVisiblePartiesByExerciseRequest: " << request;
|
||||
Core::FunctionReplyObject reply = operatorUpdateVisiblePartiesByExerciseRequest(request);
|
||||
if (reply.error())
|
||||
@@ -619,7 +619,7 @@ Core::FunctionReplyObject HandlerOperator::operatorUpdateVisiblePartiesByExercis
|
||||
|
||||
void HandlerOperator::reloadAcls()
|
||||
{
|
||||
for (ObjectOperator *ifs : std::as_const(m_operatorObjMap))
|
||||
for (ObjectOperator *ifs : qAsConst(m_operatorObjMap))
|
||||
ifs->reloadAcls();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QObject>
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include <QQueue>
|
||||
|
||||
#include "main_handler.h"
|
||||
@@ -42,7 +42,6 @@ public:
|
||||
QString operatorNameById(int operatorId) const;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onOperatorChangePasswordRequest(const rti::core::SampleIdentity &cookie,
|
||||
const OperatorChangePasswordRequest &request) override;
|
||||
void onOperatorCreateModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
@@ -76,10 +75,10 @@ private:
|
||||
private Q_SLOTS:
|
||||
void onCheckAliveTimeout();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QHash<int, QVector<OperatorWorkstationAlive>> m_aliveData;
|
||||
QHash<int, ObjectOperator*> m_operatorObjMap;
|
||||
QTimer *m_aliveCheckTimer;
|
||||
MainHandler *m_mainHandler;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
@@ -48,7 +48,6 @@ public:
|
||||
std::shared_ptr<HandlerActiveApps> getHandlerActiveApps() const { return m_handlerActiveApps; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool initAclHandler();
|
||||
bool initOperatorHandler();
|
||||
bool initGroupHandler();
|
||||
@@ -57,7 +56,6 @@ private:
|
||||
bool initActiveApps();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<HandlerAccessControlLevel> m_handlerAcl;
|
||||
std::shared_ptr<HandlerOperator> m_handlerOperator;
|
||||
std::shared_ptr<HandlerGroup> m_handlerGroup;
|
||||
@@ -66,5 +64,8 @@ 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
|
||||
+1
@@ -15,6 +15,7 @@ namespace OperatorManagement
|
||||
|
||||
ObjectAccessControlLevel::ObjectAccessControlLevel(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("ObjectAccessControlLevel"))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
|
||||
// Generated
|
||||
#include <OperatorManagement/opm_db.h>
|
||||
@@ -28,11 +28,13 @@ public:
|
||||
qint64 getId() const { return m_data.id; }
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPublishData();
|
||||
|
||||
private:
|
||||
MainHandler *m_mainHandler;
|
||||
Database::OpmAccessControlLevel m_data;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
@@ -16,6 +16,7 @@ namespace OperatorManagement
|
||||
|
||||
ObjectGroup::ObjectGroup(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("ObjectGroup"))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
|
||||
// Generated
|
||||
#include <OperatorManagement/opm_db.h>
|
||||
@@ -41,7 +41,6 @@ public:
|
||||
QString name() const { return m_data.name; }
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPublishData();
|
||||
|
||||
private:
|
||||
@@ -50,5 +49,8 @@ private:
|
||||
std::vector<qint32> m_isMemberOf;
|
||||
std::vector<qint32> m_aclAllow;
|
||||
std::vector<qint32> m_aclDeny;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
@@ -6,14 +6,13 @@
|
||||
*/
|
||||
|
||||
#include "object_operator.h"
|
||||
#include <utility>
|
||||
|
||||
#include "main_handler.h"
|
||||
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
|
||||
#include <LtsUtilsCore/dds_vector.h>
|
||||
#include <ngldb/dbtransaction.h>
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QtCore/QJsonArray>
|
||||
#include <QtCore/QJsonObject>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
@@ -21,6 +20,7 @@ namespace OperatorManagement
|
||||
ObjectOperator::ObjectOperator(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
, m_originalPrimaryGroupId(0)
|
||||
, m_logger(getLogger("ObjectOperator"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ Core::FunctionReplyObject ObjectOperator::updateObject(const Database::OpmOperat
|
||||
|
||||
Core::FunctionReplyObject ObjectOperator::updateOperatorExercise(const Database::OpmOperatorExercise &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << data.operatorId << " " << data.exerciseId;
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << data.operatorId << " " << data.exerciseId;
|
||||
|
||||
// insert can fail due to (deleted) exerciseId
|
||||
m_mainHandler->db()->setEmitMessageOnError(false);
|
||||
@@ -292,7 +292,7 @@ QSet<int> ObjectOperator::calculateEffectiveAcls() const
|
||||
QSet<int> allowances;
|
||||
QSet<int> denials;
|
||||
|
||||
for (int group : std::as_const(effectiveGroups))
|
||||
for (int group : qAsConst(effectiveGroups))
|
||||
{
|
||||
addValuesToSet(allowMap, group, allowances);
|
||||
addValuesToSet(denyMap, group, denials);
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Core/core_types.h>
|
||||
#include <QtCore/QSet>
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <QSet>
|
||||
|
||||
// Generated
|
||||
#include <OperatorManagement/opm_db.h>
|
||||
@@ -41,7 +41,6 @@ public:
|
||||
QSet<int> effectiveAcls() const { return m_effectiveAcls; }
|
||||
void reloadAcls(bool force = false);
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPublishData();
|
||||
|
||||
private:
|
||||
@@ -56,6 +55,8 @@ 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);
|
||||
};
|
||||
|
||||
+9
-10
@@ -8,12 +8,11 @@
|
||||
*/
|
||||
|
||||
#include "opm_dtc_impl_custom.h"
|
||||
#include <utility>
|
||||
#include <QtCore/QJsonArray>
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QtCore/QJsonObject>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QVariantList>
|
||||
#include <QtCore/QVector>
|
||||
#include <QVector>
|
||||
#include <DDS/DTC/generic_dtc.h>
|
||||
#include <DDS/Generic/generic_data_reader.h>
|
||||
|
||||
@@ -31,7 +30,7 @@ QVector<int> DtcImplCustom::getOperatorsByOperatorRight(int operatorRight)
|
||||
QVector<int> ret;
|
||||
|
||||
DEBUG_LOG(m_logger) << "OperatorRight: " << operatorRight;
|
||||
for (const User &user : std::as_const(m_userCont))
|
||||
for (const User &user : qAsConst(m_userCont))
|
||||
{
|
||||
for (int acl : user.effectiveAcls())
|
||||
{
|
||||
@@ -53,7 +52,7 @@ QVector<int> DtcImplCustom::operatorForExerciseParty(int exerciseId, int partyId
|
||||
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " exerciseId: " << exerciseId << ", partyId: " << partyId;
|
||||
|
||||
for (const User &user : std::as_const(m_userCont))
|
||||
for (const User &user : qAsConst(m_userCont))
|
||||
{
|
||||
const auto visiblePartiesByExercise = user.visiblePartiesByExercise();
|
||||
for (const auto &pbe : visiblePartiesByExercise)
|
||||
@@ -114,7 +113,7 @@ bool DtcImplCustom::sendAdlerNotification(const QString &jsonStr, const int exer
|
||||
DEBUG_LOG(m_logger) << "sendAdlerNotification";
|
||||
|
||||
const QJsonArray &exercisesArr = doc.object().value(QStringLiteral("Exercises")).toArray();
|
||||
for (const QJsonValue &exercisesVal : std::as_const(exercisesArr))
|
||||
for (const QJsonValue &exercisesVal : qAsConst(exercisesArr))
|
||||
{
|
||||
const QJsonObject exercisesObj = exercisesVal.toObject();
|
||||
|
||||
@@ -136,7 +135,7 @@ bool DtcImplCustom::sendAdlerNotification(const QString &jsonStr, const int exer
|
||||
// 2. Array durchlaufen
|
||||
QJsonArray notifications = exercisesObj.value(QStringLiteral("suppressNotifications")).toArray();
|
||||
|
||||
for (const QJsonValue &val : std::as_const(notifications))
|
||||
for (const QJsonValue &val : qAsConst(notifications))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "sendAdlerNotification notifications";
|
||||
const QJsonObject entry = val.toObject();
|
||||
@@ -170,7 +169,7 @@ QVector<int> DtcImplCustom::getNotificationRecipents(const int exerciseId, const
|
||||
bool inExercise = false;
|
||||
const auto user = m_userCont.value(userId);
|
||||
// Only include operators who are assigned to the exercise.
|
||||
for (const auto &exerciseIdUser : std::as_const(user.exerciseIds()))
|
||||
for (const auto &exerciseIdUser : qAsConst(user.exerciseIds()))
|
||||
{
|
||||
if (exerciseIdUser == exerciseId)
|
||||
{
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <OperatorManagement/opm_dtc_impl.h>
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QVector>
|
||||
#include <QHash>
|
||||
#include <QVector>
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
namespace OperatorManagement
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <nglsettings/nglsettings_settings.h>
|
||||
#include <ngltools/ngltools_filesystem.h>
|
||||
|
||||
#include "LtsUtils/LtsUtilsCore/lts_portrange.h"
|
||||
#include "LtsUtilsCore/lts_portrange.h"
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QPair>
|
||||
#include <QString>
|
||||
#include <QPair>
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user