Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list
Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF
Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
- Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
- Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)
Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified
Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
134 lines
4.6 KiB
C++
134 lines
4.6 KiB
C++
/**
|
|
* Handler for the HMI language
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#include "object_video_receiver.h"
|
|
|
|
#include "dds_handler.h"
|
|
#include "logger.h"
|
|
|
|
namespace AudioVideoManagement
|
|
{
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
ObjectVideoReceiver::ObjectVideoReceiver(Interface::Dts *dts,
|
|
DatabaseInterface *db)
|
|
: m_dts(dts)
|
|
, m_db(db)
|
|
, m_logger(getLogger("ObjectVideoReceiver"))
|
|
{
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
ObjectVideoReceiver::~ObjectVideoReceiver()
|
|
{
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
Core::FunctionReplyObject ObjectVideoReceiver::createObject(const VideoReceiver &data)
|
|
{
|
|
m_data = data;
|
|
if (m_data.id() <= 0)
|
|
{
|
|
Database::AvmVideoReceiver dbData;
|
|
dbData = toDbData(data);
|
|
|
|
if (!m_db->insert(dbData))
|
|
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AvmVideoReceiver-data into database"));
|
|
|
|
m_data.id(dbData.id);
|
|
DEBUG_LOG(m_logger) << "New Id: " << m_data.id();
|
|
}
|
|
|
|
// Publish Data via DTS
|
|
onPublishData();
|
|
|
|
return Core::FunctionReplyObject(m_data.id());
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
Core::FunctionReplyObject ObjectVideoReceiver::updateObject(const VideoReceiver &data)
|
|
{
|
|
m_data = data;
|
|
DEBUG_LOG(m_logger) << "ObjectVideoReceiver::updateObject id=" << data.id()
|
|
<< " isActive=" << data.isActive()
|
|
<< " hostName=" << data.hostName()
|
|
<< " isLocked=" << data.isLocked();
|
|
Database::AvmVideoReceiver dbData(toDbData(data));
|
|
|
|
|
|
if (!m_db->update(dbData))
|
|
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating VideoReceiver2 into database"));
|
|
|
|
|
|
DEBUG_LOG(m_logger) << "Data changed for VideoReceiver Id: " << data.id();
|
|
|
|
// Publish Data via DTS
|
|
onPublishData();
|
|
|
|
return Core::FunctionReplyObject(data.id());
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
Core::FunctionReplyObject ObjectVideoReceiver::removeObject()
|
|
{
|
|
if (!m_db->removeAvmVideoReceiver(m_data.id()))
|
|
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "Video Receiver with id %1 can not be removed from DB")).arg(m_data.id());
|
|
|
|
if (!m_dts->removeVideoReceiverByKey(m_data.id()))
|
|
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "Video Receiver with id %1 can not be removed from DDS")).arg(m_data.id());
|
|
|
|
return Core::FunctionReplyObject(m_data.id());
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
void ObjectVideoReceiver::onPublishData()
|
|
{
|
|
INFO_LOG(m_logger) << "Publish MvsVideoReceiver-data to dds (" << m_data.id() << ") ...";
|
|
|
|
if (!m_dts->publish(m_data))
|
|
ERROR_LOG(m_logger) << "Error publishing MvsVideoReceiver-data to dds";
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
Database::AvmVideoReceiver ObjectVideoReceiver::toDbData(const VideoReceiver &ddsData)
|
|
{
|
|
Database::AvmVideoReceiver dbData;
|
|
|
|
dbData.id = ddsData.id();
|
|
dbData.streamName = QString::fromStdString(ddsData.streamName());
|
|
dbData.mainStructureElementId = ddsData.mainStructureElementId();
|
|
dbData.teamId = ddsData.teamId();
|
|
dbData.isActive = ddsData.isActive();
|
|
dbData.info = QString::fromStdString(ddsData.info());
|
|
dbData.hostName = QString::fromStdString(ddsData.hostName());
|
|
dbData.frequency = ddsData.frequency();
|
|
dbData.isLocked = ddsData.isLocked();
|
|
|
|
return dbData;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
AudioVideoManagement::VideoReceiver ObjectVideoReceiver::toDdsData(const Database::AvmVideoReceiver &dbData)
|
|
{
|
|
AudioVideoManagement::VideoReceiver ddsData;
|
|
ddsData.id(dbData.id);
|
|
ddsData.streamName(dbData.streamName.toStdString());
|
|
ddsData.mainStructureElementId(dbData.mainStructureElementId);
|
|
ddsData.teamId(dbData.teamId);
|
|
ddsData.isActive(dbData.isActive);
|
|
ddsData.isLocked(dbData.isLocked);
|
|
ddsData.info(dbData.info.toStdString());
|
|
ddsData.hostName(dbData.hostName.toStdString());
|
|
ddsData.frequency(dbData.frequency);
|
|
|
|
// init data not in db
|
|
ddsData.dbm(0);
|
|
ddsData.snr(0);
|
|
|
|
return ddsData;
|
|
} // end of toDdsData()
|
|
} // Namespace AudioVideoManagement
|