- 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>
77 lines
2.5 KiB
C++
Executable File
77 lines
2.5 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* The ClientMessage class is an abstract base class for concrete ClientMessage objects
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Philipp Dassow, SLST, 2017-12-05
|
|
*/
|
|
#include "client_message.h"
|
|
|
|
#include "WebSocketInterface/Messages/reply_message.h"
|
|
#include "WebSocketInterface/json_keys.h"
|
|
#include "WebSocketInterface/data_manager.h"
|
|
|
|
#include <QtCore/QJsonDocument>
|
|
#include <QtCore/QUuid>
|
|
|
|
namespace AssetManagement
|
|
{
|
|
namespace WebSocketInterface
|
|
{
|
|
namespace ClientMessages
|
|
{
|
|
using namespace JsonKeys;
|
|
|
|
// ####### ClientMessageFactory begin #######
|
|
ClientMessageFactory::ClientMessageFactory(DataManager *dataManager)
|
|
: LtsWebSocket::AbstractClientMessageFactory(getLogger("ClientMessageFactory"))
|
|
, m_dataManager(dataManager)
|
|
{}
|
|
|
|
LtsWebSocket::AbstractClientMessage *ClientMessageFactory::createMessage(LtsWebSocket::ReplyHandler *client,
|
|
const QString &message)
|
|
{
|
|
LtsWebSocket::AbstractClientMessage *result = checkAttributes(client, message);
|
|
if (result)
|
|
return result;
|
|
|
|
if (m_type == OcBaseDownload::WebSocketInterface::JsonKeys::BASE_DL_REQUEST())
|
|
result = new BaseDlRequest(m_dataManager, client, m_type, m_typeId, m_uuid);
|
|
|
|
return checkResult(client, message, result);
|
|
}
|
|
// ####### ClientMessageFactory end #######
|
|
|
|
// ####### ClientMessage begin #######
|
|
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)
|
|
{}
|
|
|
|
void BaseDlRequest::process()
|
|
{
|
|
m_client->addReply(m_dataManager->trainingAreaBaseData(m_uuid));
|
|
m_client->addReply(m_dataManager->technicalAreaBaseData(m_uuid));
|
|
//m_client->addReply(m_dataManager->mapDescriptionBaseData(m_uuid));
|
|
m_client->addReply(m_dataManager->locationBaseData(m_uuid));
|
|
m_client->addReply(m_dataManager->assetBaseData(m_uuid));
|
|
}
|
|
|
|
bool BaseDlRequest::hasValidData() const
|
|
{
|
|
return true;
|
|
}
|
|
// ####### BaseDlRequest end #######
|
|
|
|
} // namespace ClientMessages
|
|
} // namespace WebSocketInterface
|
|
} // namespace AssetManagement
|