- 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>
69 lines
1.5 KiB
C++
Executable File
69 lines
1.5 KiB
C++
Executable File
/**
|
|
* Handler for the HMI language
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#include "object_xxx_xxx.h"
|
|
|
|
#include "dds_handler.h"
|
|
#include "db_handler.h"
|
|
#include "logger.h"
|
|
|
|
namespace YyyYyyYyy
|
|
{
|
|
|
|
ObjectXxx::ObjectXxx(const std::shared_ptr<DdsHandler> &ddsHandler,
|
|
const std::shared_ptr<DbHandler> &dbHandler,
|
|
QObject *parent)
|
|
: QObject(parent)
|
|
, m_ddsHandler(ddsHandler)
|
|
, m_dbHandler(dbHandler)
|
|
, m_logger(getLogger("ObjectXxx"))
|
|
{
|
|
}
|
|
|
|
ObjectXxx::~ObjectXxx()
|
|
{
|
|
}
|
|
|
|
Core::FunctionReplyObject ObjectXxx::createObject(const Database::YyyXxx &data)
|
|
{
|
|
m_data = data;
|
|
if(m_data.id <= 0)
|
|
return Core::FunctionReplyObject(m_data.id, "It is not intended to insert data this way...");
|
|
|
|
// Publish Data via DTS
|
|
onPublishData();
|
|
|
|
return Core::FunctionReplyObject(m_data.id);
|
|
}
|
|
|
|
Core::FunctionReplyObject ObjectXxx::updateObject(const Database::YyyXxx &data)
|
|
{
|
|
return Core::FunctionReplyObject(m_data.id, "You are not allowed to change this datum.");
|
|
}
|
|
|
|
Core::FunctionReplyObject ObjectXxx::removeObject()
|
|
{
|
|
return Core::FunctionReplyObject(m_data.id, "Data removal denied.");
|
|
}
|
|
|
|
void ObjectXxx::onPublishData()
|
|
{
|
|
|
|
YyyYyyYyy::Xxx ddsData;
|
|
|
|
ddsData.id(m_data.id);
|
|
// Todo: Copy as above
|
|
INFO_LOG(m_logger) << "Publish YyyXxx-data to dds (" << m_data.id << ") ...";
|
|
|
|
if (!m_ddsHandler->dts()->publish(ddsData))
|
|
{
|
|
ERROR_LOG(m_logger) << "Error publishing YyyXxx-data to dds";
|
|
}
|
|
}
|
|
|
|
} // Namespace YyyYyyYyy
|