Complete Qt6 migration: full clean build green across groups G1-G12 incl. runtime plugin set
new_docker_build.sh gains Group 12 (212 GUI/Data plugins); fixes LtsUtilsGuiDds visibility (LTO-stripped exports), LtsProjectionWorkstation unity name shadow, 6 unity-off dirs (dup file-scope statics, ddsftc INTERFACE sources) and reconfigures BUILD_FILTERMANAGEMENT/BUILD_PLUGINS_SERVICEMONITOR=ON
This commit is contained in:
1 parent
eb1d949edc
commit
815e16368e
1718 files changed
+126739
-18495
No files matched your search
@@ -84,7 +84,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
{
|
||||
auto cb = [this](const ParticipantManagement::Participant & participant)
|
||||
{
|
||||
if (participant.equipmentNumber.is_set())
|
||||
if (participant.equipmentNumber.has_value())
|
||||
{
|
||||
m_partId2EquipNoMap.insert(participant.id, participant.equipmentNumber.get());
|
||||
m_equipNo2partIdMap.insert(participant.equipmentNumber.get(), participant.id);
|
||||
@@ -127,8 +127,8 @@ void DdsHandler::onParticipantChanged(const ParticipantManagement::Participant &
|
||||
m_partId2EquipNoMap.remove(data.id);
|
||||
else
|
||||
{
|
||||
m_partId2EquipNoMap[data.id] = data.equipmentNumber.is_set() ? data.equipmentNumber.get() : 0;
|
||||
if (data.equipmentNumber.is_set())
|
||||
m_partId2EquipNoMap[data.id] = data.equipmentNumber.has_value() ? data.equipmentNumber.get() : 0;
|
||||
if (data.equipmentNumber.has_value())
|
||||
m_equipNo2partIdMap.insert(data.equipmentNumber.get(), data.id);
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -93,11 +93,11 @@ Core::FunctionReplyObject HandlerShootbackArea::shootbackAreaModifyRequest(const
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
// modify
|
||||
if (request.id() > 0)
|
||||
if (request.id > 0)
|
||||
{
|
||||
ObjectShootbackArea *ifs = m_objectMap.value(request.id());
|
||||
ObjectShootbackArea *ifs = m_objectMap.value(request.id);
|
||||
if (!ifs)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "ShootbackArea with id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "ShootbackArea with id %1 not found")).arg(request.id);
|
||||
return ifs->updateObject(request);
|
||||
}
|
||||
// create
|
||||
@@ -121,11 +121,11 @@ void HandlerShootbackArea::onShootbackAreaRemoveRequest(const rti::core::SampleI
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " request=" << request;
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectShootbackArea *ifs = m_objectMap.value(request.id());
|
||||
ObjectShootbackArea *ifs = m_objectMap.value(request.id);
|
||||
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "ShootbackArea with id %1 not found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "ShootbackArea with id %1 not found")).arg(request.id);
|
||||
m_mainHandler->dds()->ftsTgt()->shootbackAreaRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
@@ -155,14 +155,14 @@ void HandlerShootbackArea::onShootbackAreaRemoveRequest(const rti::core::SampleI
|
||||
{
|
||||
// delete Object
|
||||
delete ifs;
|
||||
m_objectMap.remove(request.id());
|
||||
m_objectMap.remove(request.id);
|
||||
}
|
||||
|
||||
m_mainHandler->dds()->ftsTgt()->shootbackAreaRemoveReply(cookie, ret);
|
||||
|
||||
// For ShootbackController
|
||||
if (!ret.error())
|
||||
emit objectChanged(request.id(), true);
|
||||
emit objectChanged(request.id, true);
|
||||
|
||||
return;
|
||||
}
|
||||
+8
-8
@@ -106,16 +106,16 @@ Core::FunctionReplyObject HandlerShootbackTarget::shootbackTargetModifyRequest(c
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
// modify
|
||||
if (request.id() > 0)
|
||||
if (request.id > 0)
|
||||
{
|
||||
ObjectShootbackTarget *ifs = m_objectMap.value(request.id());
|
||||
ObjectShootbackTarget *ifs = m_objectMap.value(request.id);
|
||||
if (!ifs)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "ShootbackTarget with id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "ShootbackTarget with id %1 not found")).arg(request.id);
|
||||
|
||||
// since the attribute 'visibleParticipants' is *not* part of the db,
|
||||
// ignore request.visibleParticipants and use the value of the current memory:
|
||||
ShootbackTarget copy = request;
|
||||
copy.visibleParticipants(ifs->getData().visibleParticipants());
|
||||
copy.visibleParticipants = ifs->getData().visibleParticipants;
|
||||
return ifs->updateObject(copy);
|
||||
}
|
||||
// create
|
||||
@@ -139,11 +139,11 @@ void HandlerShootbackTarget::onShootbackTargetRemoveRequest(const rti::core::Sam
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " request=" << request;
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectShootbackTarget *ifs = m_objectMap.value(request.id());
|
||||
ObjectShootbackTarget *ifs = m_objectMap.value(request.id);
|
||||
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "ShootbackTarget with id %1 not found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "ShootbackTarget with id %1 not found")).arg(request.id);
|
||||
m_mainHandler->dds()->ftsTgt()->shootbackTargetRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
@@ -172,14 +172,14 @@ void HandlerShootbackTarget::onShootbackTargetRemoveRequest(const rti::core::Sam
|
||||
{
|
||||
// delete Object
|
||||
delete ifs;
|
||||
m_objectMap.remove(request.id());
|
||||
m_objectMap.remove(request.id);
|
||||
}
|
||||
|
||||
m_mainHandler->dds()->ftsTgt()->shootbackTargetRemoveReply(cookie, ret);
|
||||
|
||||
// For ShootbackController
|
||||
if (!ret.error())
|
||||
emit objectChanged(request.id(), true);
|
||||
emit objectChanged(request.id, true);
|
||||
|
||||
return;
|
||||
}
|
||||
+9
-9
@@ -69,7 +69,7 @@ bool HandlerTargetAreaAssignment::init()
|
||||
bool HandlerTargetAreaAssignment::isAreaIdUsedInAny(int areaId)
|
||||
{
|
||||
for (const ObjectTargetAreaAssignment *sample : std::as_const(m_objectMap))
|
||||
if (sample && (sample->getData().areaId() == areaId))
|
||||
if (sample && (sample->getData().areaId == areaId))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ bool HandlerTargetAreaAssignment::isAreaIdUsedInAny(int areaId)
|
||||
bool HandlerTargetAreaAssignment::isTargetDataIdUsedInAny(int targetDataId)
|
||||
{
|
||||
for (const ObjectTargetAreaAssignment *sample : std::as_const(m_objectMap))
|
||||
if (sample && (sample->getData().targetParticipantId() == targetDataId))
|
||||
if (sample && (sample->getData().targetParticipantId == targetDataId))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -100,11 +100,11 @@ Core::FunctionReplyObject HandlerTargetAreaAssignment::TargetAreaAssignmentModif
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
// modify
|
||||
if (request.id() > 0)
|
||||
if (request.id > 0)
|
||||
{
|
||||
ObjectTargetAreaAssignment *ifs = m_objectMap.value(request.id());
|
||||
ObjectTargetAreaAssignment *ifs = m_objectMap.value(request.id);
|
||||
if (!ifs)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "TargetAreaAssignment with id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "TargetAreaAssignment with id %1 not found")).arg(request.id);
|
||||
return ifs->updateObject(request);
|
||||
}
|
||||
// create
|
||||
@@ -128,11 +128,11 @@ void HandlerTargetAreaAssignment::onTargetAreaAssignmentRemoveRequest(const rti:
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " request=" << request;
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectTargetAreaAssignment *ifs = m_objectMap.value(request.id());
|
||||
ObjectTargetAreaAssignment *ifs = m_objectMap.value(request.id);
|
||||
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "TargetAreaAssignment with id %1 not found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "TargetAreaAssignment with id %1 not found")).arg(request.id);
|
||||
m_mainHandler->dds()->ftsTgt()->targetAreaAssignmentRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
@@ -152,14 +152,14 @@ void HandlerTargetAreaAssignment::onTargetAreaAssignmentRemoveRequest(const rti:
|
||||
{
|
||||
// delete Object
|
||||
delete ifs;
|
||||
m_objectMap.remove(request.id());
|
||||
m_objectMap.remove(request.id);
|
||||
}
|
||||
|
||||
m_mainHandler->dds()->ftsTgt()->targetAreaAssignmentRemoveReply(cookie, ret);
|
||||
|
||||
// For ShootbackController
|
||||
if (!ret.error())
|
||||
emit objectChanged(request.id(), true);
|
||||
emit objectChanged(request.id, true);
|
||||
|
||||
return;
|
||||
}
|
||||
+5
-5
@@ -81,7 +81,7 @@ void HandlerTargetConfig::onConfigureTargetRequest(const rti::core::SampleIdenti
|
||||
tgt.equipmentNumber = m_ddsHandler->participantId2EquipNo(participantId);
|
||||
tgt.participantId = request.participantId;
|
||||
|
||||
tgt.payload.push_back(request.tgtCommand);
|
||||
tgt.payload.push_back(static_cast<unsigned char>(request.tgtCommand));
|
||||
|
||||
switch (request.tgtCommand)
|
||||
{
|
||||
@@ -100,18 +100,18 @@ void HandlerTargetConfig::onConfigureTargetRequest(const rti::core::SampleIdenti
|
||||
}
|
||||
case TargetManagement::TgtCommand::SetMode:
|
||||
{
|
||||
if (!request.mode.is_set())
|
||||
if (!request.mode.has_value())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Set mode requested, but mode ist not set";
|
||||
m_ddsHandler->ftsTgt()->configureTargetReply(cookie, Core::FunctionReplyObject(request.participantId, tr_lts("dds", "Set mode requested, but mode is not set")));
|
||||
return;
|
||||
}
|
||||
tgt.payload.push_back(request.mode.get());
|
||||
tgt.payload.push_back(static_cast<unsigned char>(request.mode.get()));
|
||||
break;
|
||||
}
|
||||
case TargetManagement::TgtCommand::SetWeapon:
|
||||
{
|
||||
if (!request.weapon.is_set())
|
||||
if (!request.weapon.has_value())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Set weapon requested, but weapon ist not set";
|
||||
m_ddsHandler->ftsTgt()->configureTargetReply(cookie, Core::FunctionReplyObject(request.participantId, tr_lts("dds", "Set weapon requested, but weapon is not set")));
|
||||
@@ -122,7 +122,7 @@ void HandlerTargetConfig::onConfigureTargetRequest(const rti::core::SampleIdenti
|
||||
}
|
||||
case TargetManagement::TgtCommand::SetParameter:
|
||||
{
|
||||
if (!request.parameterSet.is_set())
|
||||
if (!request.parameterSet.has_value())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Set parameterset requested, but parameterset ist not set";
|
||||
m_ddsHandler->ftsTgt()->configureTargetReply(cookie, Core::FunctionReplyObject(request.participantId, tr_lts("dds", "Set parameterset requested, but parameterset is not set")));
|
||||
|
||||
+34
-34
@@ -26,20 +26,20 @@ ObjectShootbackArea::~ObjectShootbackArea()
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
if (isValid())
|
||||
m_mainHandler->dds()->dtsTgt()->removeShootbackAreaByKey(m_data.id());
|
||||
m_mainHandler->dds()->dtsTgt()->removeShootbackAreaByKey(m_data.id);
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool ObjectShootbackArea::isValid() const
|
||||
{
|
||||
return m_data.id() > 0;
|
||||
return m_data.id > 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool ObjectShootbackArea::isUsed() const
|
||||
{
|
||||
return m_data.isUsed();
|
||||
return m_data.isUsed;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -48,24 +48,24 @@ Core::FunctionReplyObject ObjectShootbackArea::createObject(const ShootbackArea
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
m_data = data;
|
||||
|
||||
if (m_data.id() <= 0)
|
||||
if (m_data.id <= 0)
|
||||
{
|
||||
m_data.isUsed(false);
|
||||
m_data.isUsed = false;
|
||||
|
||||
Database::TgtShootbackArea dbData(toDbData(data));
|
||||
|
||||
if (!m_mainHandler->db()->insert(dbData))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting ShootbackArea-data into database"));
|
||||
|
||||
m_data.id(dbData.id);
|
||||
DEBUG_LOG(m_logger) << "New TgtShootbackArea: " << m_data.id();
|
||||
m_data.id = dbData.id;
|
||||
DEBUG_LOG(m_logger) << "New TgtShootbackArea: " << m_data.id;
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -73,36 +73,36 @@ Core::FunctionReplyObject ObjectShootbackArea::updateObject(const ShootbackArea
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
if (!isValid())
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Object not valid/blocked"));
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Object not valid/blocked"));
|
||||
|
||||
Database::TgtShootbackArea dbData;
|
||||
dbData = toDbData(data);
|
||||
|
||||
if (!m_mainHandler->db()->update(dbData))
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating ShootbackArea-data into database"));
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Error updating ShootbackArea-data into database"));
|
||||
|
||||
m_data = data;
|
||||
DEBUG_LOG(m_logger) << "Data changed for ShootbackAreaId: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for ShootbackAreaId: " << m_data.id;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject ObjectShootbackArea::setUsed(bool isUsed)
|
||||
{
|
||||
if (!isValid())
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "Trying to update an already removed ShootbackArea object"));
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Trying to update an already removed ShootbackArea object"));
|
||||
|
||||
m_data.isUsed(isUsed);
|
||||
m_data.isUsed = isUsed;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -110,22 +110,22 @@ Core::FunctionReplyObject ObjectShootbackArea::removeObject()
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
if (isUsed())
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "ShootbackArea still in use"));
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "ShootbackArea still in use"));
|
||||
|
||||
if (!m_mainHandler->db()->removeTgtShootbackArea(m_data.id()))
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "ShootbackArea with id %1 can not be removed from DB")).arg(m_data.id());
|
||||
if (!m_mainHandler->db()->removeTgtShootbackArea(m_data.id))
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "ShootbackArea with id %1 can not be removed from DB")).arg(m_data.id);
|
||||
|
||||
if (!m_mainHandler->dds()->dtsTgt()->removeShootbackAreaByKey(m_data.id()))
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "ShootbackArea with id %1 can not be removed from DDS")).arg(m_data.id());
|
||||
if (!m_mainHandler->dds()->dtsTgt()->removeShootbackAreaByKey(m_data.id))
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "ShootbackArea with id %1 can not be removed from DDS")).arg(m_data.id);
|
||||
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void ObjectShootbackArea::onPublishData()
|
||||
{
|
||||
TRACE_LOG(m_logger) << "Publish ShootbackArea-data to dds (" << m_data.id() << ") ...";
|
||||
TRACE_LOG(m_logger) << "Publish ShootbackArea-data to dds (" << m_data.id << ") ...";
|
||||
|
||||
if (!m_mainHandler->dds()->dtsTgt()->publish(m_data))
|
||||
ERROR_LOG(m_logger) << "Error publishing ShootbackArea-data to dds";
|
||||
@@ -140,11 +140,11 @@ Database::TgtShootbackArea ObjectShootbackArea::toDbData(const ShootbackArea &dd
|
||||
{
|
||||
Database::TgtShootbackArea dbData;
|
||||
|
||||
dbData.id = ddsData.id();
|
||||
dbData.name = QString::fromStdString(ddsData.name());
|
||||
dbData.position = QPointF(ddsData.position().lon(), ddsData.position().lat());
|
||||
dbData.width = ddsData.width();
|
||||
dbData.height = ddsData.height();
|
||||
dbData.id = ddsData.id;
|
||||
dbData.name = QString::fromStdString(ddsData.name);
|
||||
dbData.position = QPointF(ddsData.position.lon, ddsData.position.lat);
|
||||
dbData.width = ddsData.width;
|
||||
dbData.height = ddsData.height;
|
||||
|
||||
return dbData;
|
||||
}
|
||||
@@ -155,15 +155,15 @@ ShootbackArea ObjectShootbackArea::toDdsData(const Database::TgtShootbackArea &d
|
||||
{
|
||||
ShootbackArea ddsData;
|
||||
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.name(dbData.name.toStdString());
|
||||
ddsData.position(Core::GeoPosition2D(dbData.position.x(), dbData.position.y()));
|
||||
ddsData.width(dbData.width);
|
||||
ddsData.height(dbData.height);
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.name = dbData.name.toStdString();
|
||||
ddsData.position = Core::GeoPosition2D(dbData.position.x(), dbData.position.y());
|
||||
ddsData.width = dbData.width;
|
||||
ddsData.height = dbData.height;
|
||||
|
||||
// init data not in db
|
||||
ddsData.isDeleted(false);
|
||||
ddsData.isUsed(false);
|
||||
ddsData.isDeleted = false;
|
||||
ddsData.isUsed = false;
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
|
||||
+2
-2
@@ -35,8 +35,8 @@ public:
|
||||
Core::FunctionReplyObject updateObject(const ShootbackArea &data);
|
||||
Core::FunctionReplyObject removeObject();
|
||||
|
||||
qint32 getId() const { return m_data.id(); }
|
||||
QString getName() const { return QString::fromStdString(m_data.name()); }
|
||||
qint32 getId() const { return m_data.id; }
|
||||
QString getName() const { return QString::fromStdString(m_data.name); }
|
||||
const ShootbackArea &getData() const { return m_data; }
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
+54
-54
@@ -26,20 +26,20 @@ ObjectShootbackTarget::~ObjectShootbackTarget()
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
if (isValid())
|
||||
m_mainHandler->dds()->dtsTgt()->removeShootbackTargetByKey(m_data.id());
|
||||
m_mainHandler->dds()->dtsTgt()->removeShootbackTargetByKey(m_data.id);
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool ObjectShootbackTarget::isValid() const
|
||||
{
|
||||
return m_data.id() > 0;
|
||||
return m_data.id > 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool ObjectShootbackTarget::isUsed() const
|
||||
{
|
||||
return m_data.isUsed();
|
||||
return m_data.isUsed;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -48,33 +48,33 @@ Core::FunctionReplyObject ObjectShootbackTarget::createObject(const ShootbackTar
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
m_data = data;
|
||||
|
||||
if (m_data.id() <= 0)
|
||||
if (m_data.id <= 0)
|
||||
{
|
||||
m_data.isUsed(false);
|
||||
m_data.isUsed = false;
|
||||
|
||||
Database::TgtShootbackTarget dbData(toDbData(data));
|
||||
|
||||
if (!m_mainHandler->db()->insert(dbData))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting ShootbackTarget-data into database"));
|
||||
|
||||
m_data.id(dbData.id);
|
||||
DEBUG_LOG(m_logger) << "New TgtShootbackTarget: " << m_data.id();
|
||||
m_data.id = dbData.id;
|
||||
DEBUG_LOG(m_logger) << "New TgtShootbackTarget: " << m_data.id;
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject ObjectShootbackTarget::updateObject(const ShootbackTarget &data)
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START, id=" << data.id()
|
||||
<< " size =" << data.visibleParticipants().size();
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START, id=" << data.id
|
||||
<< " size =" << data.visibleParticipants.size();
|
||||
if (!isValid())
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Object not valid/blocked"));
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Object not valid/blocked"));
|
||||
|
||||
Database::TgtShootbackTarget dbData;
|
||||
dbData = toDbData(data);
|
||||
@@ -82,32 +82,32 @@ Core::FunctionReplyObject ObjectShootbackTarget::updateObject(const ShootbackTar
|
||||
if (isDifferent(dbData))
|
||||
{
|
||||
if (!m_mainHandler->db()->update(dbData))
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating ShootbackTarget-data into database"));
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Error updating ShootbackTarget-data into database"));
|
||||
}
|
||||
|
||||
m_data = data;
|
||||
DEBUG_LOG(m_logger) << "Data changed for ShootbackTargetId: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for ShootbackTargetId: " << m_data.id;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END, id=" << data.id()
|
||||
<< " size =" << data.visibleParticipants().size();
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END, id=" << data.id
|
||||
<< " size =" << data.visibleParticipants.size();
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject ObjectShootbackTarget::setUsed(bool isUsed)
|
||||
{
|
||||
if (!isValid())
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "Trying to update an already removed ShootbackTarget object"));
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Trying to update an already removed ShootbackTarget object"));
|
||||
|
||||
m_data.isUsed(isUsed);
|
||||
m_data.isUsed = isUsed;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -115,21 +115,21 @@ Core::FunctionReplyObject ObjectShootbackTarget::removeObject()
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
if (isUsed())
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "ShootbackTarget still in use"));
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "ShootbackTarget still in use"));
|
||||
|
||||
if (!m_mainHandler->db()->removeTgtShootbackTarget(m_data.id()))
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "ShootbackTarget with id %1 can not be removed from DB")).arg(m_data.id());
|
||||
if (!m_mainHandler->db()->removeTgtShootbackTarget(m_data.id))
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "ShootbackTarget with id %1 can not be removed from DB")).arg(m_data.id);
|
||||
|
||||
if (!m_mainHandler->dds()->dtsTgt()->removeShootbackTargetByKey(m_data.id()))
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "ShootbackTarget with id %1 can not be removed from DDS")).arg(m_data.id());
|
||||
if (!m_mainHandler->dds()->dtsTgt()->removeShootbackTargetByKey(m_data.id))
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "ShootbackTarget with id %1 can not be removed from DDS")).arg(m_data.id);
|
||||
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
void ObjectShootbackTarget::updateVolatileData(const std::vector<int32_t> &visibleParticipant)
|
||||
{
|
||||
m_data.visibleParticipants(visibleParticipant);
|
||||
m_data.visibleParticipants = visibleParticipant;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -137,7 +137,7 @@ void ObjectShootbackTarget::updateVolatileData(const std::vector<int32_t> &visib
|
||||
|
||||
void ObjectShootbackTarget::updateVolatileData(const Core::GeoPosition &position)
|
||||
{
|
||||
m_data.position(position);
|
||||
m_data.position = position;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -146,7 +146,7 @@ void ObjectShootbackTarget::updateVolatileData(const Core::GeoPosition &position
|
||||
//------------------------------------------------------------------------------
|
||||
void ObjectShootbackTarget::onPublishData()
|
||||
{
|
||||
TRACE_LOG(m_logger) << "Publish ShootbackTarget-data to dds (" << m_data.id() << ") ...";
|
||||
TRACE_LOG(m_logger) << "Publish ShootbackTarget-data to dds (" << m_data.id << ") ...";
|
||||
|
||||
if (!m_mainHandler->dds()->dtsTgt()->publish(m_data))
|
||||
ERROR_LOG(m_logger) << "Error publishing ShootbackTarget-data to dds";
|
||||
@@ -161,15 +161,15 @@ Database::TgtShootbackTarget ObjectShootbackTarget::toDbData(const ShootbackTarg
|
||||
{
|
||||
Database::TgtShootbackTarget dbData;
|
||||
|
||||
dbData.id = ddsData.id();
|
||||
dbData.targetParticipantId = ddsData.targetParticipantId();
|
||||
dbData.name = QString::fromStdString(ddsData.name());
|
||||
dbData.id = ddsData.id;
|
||||
dbData.targetParticipantId = ddsData.targetParticipantId;
|
||||
dbData.name = QString::fromStdString(ddsData.name);
|
||||
|
||||
dbData.activateLaserDesignation = ddsData.activateLaserDesignation();
|
||||
dbData.activateLights = ddsData.activateLights();
|
||||
dbData.activatePopupAutomatic = ddsData.activatePopupAutomatic();
|
||||
dbData.hitsToKill = ddsData.hitsToKill();
|
||||
dbData.permanentInstalledTarget = ddsData.permanentInstalledTarget();
|
||||
dbData.activateLaserDesignation = ddsData.activateLaserDesignation;
|
||||
dbData.activateLights = ddsData.activateLights;
|
||||
dbData.activatePopupAutomatic = ddsData.activatePopupAutomatic;
|
||||
dbData.hitsToKill = ddsData.hitsToKill;
|
||||
dbData.permanentInstalledTarget = ddsData.permanentInstalledTarget;
|
||||
|
||||
return dbData;
|
||||
}
|
||||
@@ -180,19 +180,19 @@ ShootbackTarget ObjectShootbackTarget::toDdsData(const Database::TgtShootbackTar
|
||||
{
|
||||
ShootbackTarget ddsData;
|
||||
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.targetParticipantId(dbData.targetParticipantId);
|
||||
ddsData.name(dbData.name.toStdString());
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.targetParticipantId = dbData.targetParticipantId;
|
||||
ddsData.name = dbData.name.toStdString();
|
||||
|
||||
ddsData.activateLaserDesignation(dbData.activateLaserDesignation);
|
||||
ddsData.activateLights(dbData.activateLights);
|
||||
ddsData.activatePopupAutomatic(dbData.activatePopupAutomatic);
|
||||
ddsData.hitsToKill(dbData.hitsToKill);
|
||||
ddsData.permanentInstalledTarget(dbData.permanentInstalledTarget);
|
||||
ddsData.activateLaserDesignation = dbData.activateLaserDesignation;
|
||||
ddsData.activateLights = dbData.activateLights;
|
||||
ddsData.activatePopupAutomatic = dbData.activatePopupAutomatic;
|
||||
ddsData.hitsToKill = dbData.hitsToKill;
|
||||
ddsData.permanentInstalledTarget = dbData.permanentInstalledTarget;
|
||||
|
||||
// init data not in db
|
||||
ddsData.isDeleted(false);
|
||||
ddsData.isUsed(false);
|
||||
ddsData.isDeleted = false;
|
||||
ddsData.isUsed = false;
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -200,15 +200,15 @@ ShootbackTarget ObjectShootbackTarget::toDdsData(const Database::TgtShootbackTar
|
||||
bool ObjectShootbackTarget::isDifferent(const Database::TgtShootbackTarget &dbData)
|
||||
{
|
||||
return (
|
||||
dbData.id != m_data.id() ||
|
||||
dbData.targetParticipantId != m_data.targetParticipantId() ||
|
||||
dbData.name.toStdString() != m_data.name() ||
|
||||
dbData.id != m_data.id ||
|
||||
dbData.targetParticipantId != m_data.targetParticipantId ||
|
||||
dbData.name.toStdString() != m_data.name ||
|
||||
|
||||
dbData.activateLaserDesignation != m_data.activateLaserDesignation() ||
|
||||
dbData.activateLights != m_data.activateLights() ||
|
||||
dbData.activatePopupAutomatic != m_data.activatePopupAutomatic() ||
|
||||
dbData.hitsToKill != m_data.hitsToKill() ||
|
||||
dbData.permanentInstalledTarget != m_data.permanentInstalledTarget()
|
||||
dbData.activateLaserDesignation != m_data.activateLaserDesignation ||
|
||||
dbData.activateLights != m_data.activateLights ||
|
||||
dbData.activatePopupAutomatic != m_data.activatePopupAutomatic ||
|
||||
dbData.hitsToKill != m_data.hitsToKill ||
|
||||
dbData.permanentInstalledTarget != m_data.permanentInstalledTarget
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -39,9 +39,9 @@ public:
|
||||
void updateVolatileData(const Core::GeoPosition &position);
|
||||
|
||||
|
||||
qint32 getId() const { return m_data.id(); }
|
||||
QString getName() const { return QString::fromStdString(m_data.name()); }
|
||||
qint32 getTargetParticipantId() const { return m_data.targetParticipantId(); }
|
||||
qint32 getId() const { return m_data.id; }
|
||||
QString getName() const { return QString::fromStdString(m_data.name); }
|
||||
qint32 getTargetParticipantId() const { return m_data.targetParticipantId; }
|
||||
const ShootbackTarget &getData() const { return m_data; }
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
+49
-49
@@ -26,20 +26,20 @@ ObjectTargetAreaAssignment::~ObjectTargetAreaAssignment()
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
if (isValid())
|
||||
m_mainHandler->dds()->dtsTgt()->removeTargetAreaAssignmentByKey(m_data.id());
|
||||
m_mainHandler->dds()->dtsTgt()->removeTargetAreaAssignmentByKey(m_data.id);
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool ObjectTargetAreaAssignment::isValid() const
|
||||
{
|
||||
return m_data.id() > 0;
|
||||
return m_data.id > 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool ObjectTargetAreaAssignment::isUsed() const
|
||||
{
|
||||
return m_data.isUsed();
|
||||
return m_data.isUsed;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -48,9 +48,9 @@ Core::FunctionReplyObject ObjectTargetAreaAssignment::createObject(const TargetA
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
m_data = data;
|
||||
|
||||
if (m_data.id() <= 0)
|
||||
if (m_data.id <= 0)
|
||||
{
|
||||
m_data.isUsed(false);
|
||||
m_data.isUsed = false;
|
||||
|
||||
Database::TgtTargetAreaAssignment dbData(toDbData(data));
|
||||
|
||||
@@ -59,20 +59,20 @@ Core::FunctionReplyObject ObjectTargetAreaAssignment::createObject(const TargetA
|
||||
QString errText = m_mainHandler->db()->getLastError().nativeErrorCode();
|
||||
ERROR_LOG(m_logger) << "Error inserting TargetAreaAssignment into database: " << m_mainHandler->db()->getLastError().text();
|
||||
if (errText.contains(QStringLiteral("23505")))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting TargetAreaAssignment into database: unique key violation for '%1'")).arg(m_data.name());
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting TargetAreaAssignment into database: unique key violation for '%1'")).arg(m_data.name);
|
||||
else
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting TargetAreaAssignment with name %1 into database: %2")).arg(m_data.name()).arg(errText);
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting TargetAreaAssignment with name %1 into database: %2")).arg(m_data.name).arg(errText);
|
||||
}
|
||||
|
||||
m_data.id(dbData.id);
|
||||
DEBUG_LOG(m_logger) << "New TgtTargetAreaAssignment: " << m_data.id();
|
||||
m_data.id = dbData.id;
|
||||
DEBUG_LOG(m_logger) << "New TgtTargetAreaAssignment: " << m_data.id;
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -80,36 +80,36 @@ Core::FunctionReplyObject ObjectTargetAreaAssignment::updateObject(const TargetA
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
if (!isValid())
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Object not valid/blocked"));
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Object not valid/blocked"));
|
||||
|
||||
Database::TgtTargetAreaAssignment dbData;
|
||||
dbData = toDbData(data);
|
||||
|
||||
if (!m_mainHandler->db()->update(dbData))
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating TargetAreaAssignment-data into database"));
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Error updating TargetAreaAssignment-data into database"));
|
||||
|
||||
m_data = data;
|
||||
DEBUG_LOG(m_logger) << "Data changed for TargetAreaAssignmentId: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for TargetAreaAssignmentId: " << m_data.id;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject ObjectTargetAreaAssignment::setUsed(bool isUsed)
|
||||
{
|
||||
if (!isValid())
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "Trying to update an already removed TargetAreaAssignment object"));
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Trying to update an already removed TargetAreaAssignment object"));
|
||||
|
||||
m_data.isUsed(isUsed);
|
||||
m_data.isUsed = isUsed;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -117,22 +117,22 @@ Core::FunctionReplyObject ObjectTargetAreaAssignment::removeObject()
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
if (isUsed())
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "TargetAreaAssignment still in use"));
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "TargetAreaAssignment still in use"));
|
||||
|
||||
if (!m_mainHandler->db()->removeTgtTargetAreaAssignment(m_data.id()))
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "TargetAreaAssignment with id %1 can not be removed from DB")).arg(m_data.id());
|
||||
if (!m_mainHandler->db()->removeTgtTargetAreaAssignment(m_data.id))
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "TargetAreaAssignment with id %1 can not be removed from DB")).arg(m_data.id);
|
||||
|
||||
if (!m_mainHandler->dds()->dtsTgt()->removeTargetAreaAssignmentByKey(m_data.id()))
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "TargetAreaAssignment with id %1 can not be removed from DDS")).arg(m_data.id());
|
||||
if (!m_mainHandler->dds()->dtsTgt()->removeTargetAreaAssignmentByKey(m_data.id))
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "TargetAreaAssignment with id %1 can not be removed from DDS")).arg(m_data.id);
|
||||
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void ObjectTargetAreaAssignment::onPublishData()
|
||||
{
|
||||
TRACE_LOG(m_logger) << "Publish TargetAreaAssignment-data to dds (" << m_data.id() << ") ...";
|
||||
TRACE_LOG(m_logger) << "Publish TargetAreaAssignment-data to dds (" << m_data.id << ") ...";
|
||||
|
||||
if (!m_mainHandler->dds()->dtsTgt()->publish(m_data))
|
||||
ERROR_LOG(m_logger) << "Error publishing TargetAreaAssignment-data to dds";
|
||||
@@ -147,19 +147,19 @@ Database::TgtTargetAreaAssignment ObjectTargetAreaAssignment::toDbData(const Tar
|
||||
{
|
||||
Database::TgtTargetAreaAssignment dbData;
|
||||
|
||||
dbData.id = ddsData.id();
|
||||
dbData.name = QString::fromStdString(ddsData.name());
|
||||
dbData.areaId = ddsData.areaId();
|
||||
dbData.targetParticipantId = ddsData.targetParticipantId();
|
||||
dbData.isActive = ddsData.isActive();
|
||||
dbData.id = ddsData.id;
|
||||
dbData.name = QString::fromStdString(ddsData.name);
|
||||
dbData.areaId = ddsData.areaId;
|
||||
dbData.targetParticipantId = ddsData.targetParticipantId;
|
||||
dbData.isActive = ddsData.isActive;
|
||||
|
||||
dbData.interval1 = ddsData.configuration().interval1();
|
||||
dbData.effect1 = ddsData.configuration().effect1();
|
||||
dbData.flash1 = ddsData.configuration().flash1();
|
||||
dbData.interval1 = ddsData.configuration.interval1;
|
||||
dbData.effect1 = ddsData.configuration.effect1;
|
||||
dbData.flash1 = ddsData.configuration.flash1;
|
||||
|
||||
dbData.interval2 = ddsData.configuration().interval2();
|
||||
dbData.effect2 = ddsData.configuration().effect2();
|
||||
dbData.flash2 = ddsData.configuration().flash2();
|
||||
dbData.interval2 = ddsData.configuration.interval2;
|
||||
dbData.effect2 = ddsData.configuration.effect2;
|
||||
dbData.flash2 = ddsData.configuration.flash2;
|
||||
|
||||
return dbData;
|
||||
}
|
||||
@@ -170,24 +170,24 @@ TargetAreaAssignment ObjectTargetAreaAssignment::toDdsData(const Database::TgtTa
|
||||
{
|
||||
TargetAreaAssignment ddsData;
|
||||
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.name(dbData.name.toStdString());
|
||||
ddsData.areaId(dbData.areaId);
|
||||
ddsData.targetParticipantId(dbData.targetParticipantId);
|
||||
ddsData.isActive(dbData.isActive);
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.name = dbData.name.toStdString();
|
||||
ddsData.areaId = dbData.areaId;
|
||||
ddsData.targetParticipantId = dbData.targetParticipantId;
|
||||
ddsData.isActive = dbData.isActive;
|
||||
|
||||
ShootbackConfiguration conf;
|
||||
conf.interval1(dbData.interval1);
|
||||
conf.effect1(dbData.effect1);
|
||||
conf.flash1(dbData.flash1);
|
||||
conf.interval2(dbData.interval2);
|
||||
conf.effect2(dbData.effect2);
|
||||
conf.flash2(dbData.flash2);
|
||||
ddsData.configuration(conf);
|
||||
conf.interval1 = dbData.interval1;
|
||||
conf.effect1 = dbData.effect1;
|
||||
conf.flash1 = dbData.flash1;
|
||||
conf.interval2 = dbData.interval2;
|
||||
conf.effect2 = dbData.effect2;
|
||||
conf.flash2 = dbData.flash2;
|
||||
ddsData.configuration = conf;
|
||||
|
||||
// init data not in db
|
||||
ddsData.isDeleted(false);
|
||||
ddsData.isUsed(false);
|
||||
ddsData.isDeleted = false;
|
||||
ddsData.isUsed = false;
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
|
||||
+2
-2
@@ -35,8 +35,8 @@ public:
|
||||
Core::FunctionReplyObject updateObject(const TargetAreaAssignment &data);
|
||||
Core::FunctionReplyObject removeObject();
|
||||
|
||||
qint32 getId() const { return m_data.id(); }
|
||||
QString getName() const { return QString::fromStdString(m_data.name()); }
|
||||
qint32 getId() const { return m_data.id; }
|
||||
QString getName() const { return QString::fromStdString(m_data.name); }
|
||||
const TargetAreaAssignment &getData() const { return m_data; }
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
+31
-31
@@ -245,7 +245,7 @@ void ShootbackController::onParticipantPositionChanged(const ParticipantManageme
|
||||
return;
|
||||
}
|
||||
|
||||
const int participantId = posData.participantId();
|
||||
const int participantId = posData.participantId;
|
||||
|
||||
bool bIsTarget = false;
|
||||
if (isTarget(participantId, bIsTarget) && bIsTarget)
|
||||
@@ -258,7 +258,7 @@ void ShootbackController::onParticipantPositionChanged(const ParticipantManageme
|
||||
ERROR_LOG(m_logger) << LOGFUNCTION << " ObjectShootbackTarget not found for participantId=" << participantId;
|
||||
return;
|
||||
}
|
||||
osbTarget->updateVolatileData(posData.pos());
|
||||
osbTarget->updateVolatileData(posData.pos);
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << LOGFUNCTION << " participantId=" << participantId << ", isTarget=" << bIsTarget;
|
||||
@@ -310,9 +310,9 @@ bool ShootbackController::participantPositionTopicIsValid(const ParticipantManag
|
||||
// (!LtsUtils::isPositionTimeOutdated(ddsHandler->currentPartitionTime(), sampleTime)) &&
|
||||
// participantTypeId // maybe check: typeId -> typeClassId...
|
||||
|
||||
return ((posData.participantId() > 0) &&
|
||||
(posData.partyId() >= 2) && // 0->POOLS ; 1 -> O/C Service ; 2 RED...
|
||||
(!LtsUtils::isPositionTimeOutdated(QDateTime::currentDateTimeUtc().toMSecsSinceEpoch(), posData.sampleTime()))
|
||||
return ((posData.participantId > 0) &&
|
||||
(posData.partyId >= 2) && // 0->POOLS ; 1 -> O/C Service ; 2 RED...
|
||||
(!LtsUtils::isPositionTimeOutdated(QDateTime::currentDateTimeUtc().toMSecsSinceEpoch(), posData.sampleTime))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -328,20 +328,20 @@ bool ShootbackController::isTarget(qint32 participantId, bool &bIsTarget) const
|
||||
}
|
||||
|
||||
const ParticipantManagement::Participant &participant = dtcPpm->participant(participantId);
|
||||
if (participant.id() != participantId)
|
||||
if (participant.id != participantId)
|
||||
return false;
|
||||
|
||||
const int typeId = participant.typeId();
|
||||
const int typeId = participant.typeId;
|
||||
const ParticipantManagement::Type &type = dtcPpm->type(typeId);
|
||||
if (type.id() != typeId)
|
||||
if (type.id != typeId)
|
||||
return false;
|
||||
|
||||
const int equipmentTypeId = type.equipmentTypeId();
|
||||
const int equipmentTypeId = type.equipmentTypeId;
|
||||
const ParticipantManagement::EquipmentType &eqType = dtcPpm->equipmentType(equipmentTypeId);
|
||||
if (eqType.id() != equipmentTypeId)
|
||||
if (eqType.id != equipmentTypeId)
|
||||
return false;
|
||||
|
||||
switch (eqType.wmsTypeClass().underlying())
|
||||
switch (eqType.wmsTypeClass)
|
||||
{
|
||||
case ParticipantManagement::WmsTypeClass::None:
|
||||
case ParticipantManagement::WmsTypeClass::Building:
|
||||
@@ -366,7 +366,7 @@ void ShootbackController::updateInternal_participantPerArea(const ObjectShootbac
|
||||
const ParticipantManagement::ParticipantPosition &posData)
|
||||
{
|
||||
const int areaId = area.getId();
|
||||
const int participantId = posData.participantId();
|
||||
const int participantId = posData.participantId;
|
||||
|
||||
bool contains = areaContainsPosition(area, posData);
|
||||
|
||||
@@ -378,7 +378,7 @@ void ShootbackController::updateInternal_participantPerArea(const ObjectShootbac
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " "
|
||||
<< " shootbackAreaId=" << areaId
|
||||
<< " shootbackAreaName=" << area.getName()
|
||||
<< " area.position=" << area.getData().position()
|
||||
<< " area.position=" << area.getData().position
|
||||
<< " participantId=" << participantId
|
||||
<< " ParticipantPosition=" << posData
|
||||
<< " contains=" << contains
|
||||
@@ -406,15 +406,15 @@ bool ShootbackController::areaContainsPosition(const TargetManagement::ObjectSho
|
||||
{
|
||||
const ShootbackArea &sbArea = area.getData();
|
||||
const LtsCoordTrans::UtmCoordinate &utmCoordCenter =
|
||||
LtsCoordTrans::UtmCoordinate::fromGeographic(sbArea.position().lon(), sbArea.position().lat());
|
||||
LtsCoordTrans::UtmCoordinate::fromGeographic(sbArea.position.lon, sbArea.position.lat);
|
||||
|
||||
double xMin = utmCoordCenter.x - (sbArea.width() / 2.0);
|
||||
double xMax = utmCoordCenter.x + (sbArea.width() / 2.0);
|
||||
double yMin = utmCoordCenter.y - (sbArea.height() / 2.0);
|
||||
double yMax = utmCoordCenter.y + (sbArea.height() / 2.0);
|
||||
double xMin = utmCoordCenter.x - (sbArea.width / 2.0);
|
||||
double xMax = utmCoordCenter.x + (sbArea.width / 2.0);
|
||||
double yMin = utmCoordCenter.y - (sbArea.height / 2.0);
|
||||
double yMax = utmCoordCenter.y + (sbArea.height / 2.0);
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate &utmCoordParticipant =
|
||||
LtsCoordTrans::UtmCoordinate::fromGeographic(posData.pos().lon(), posData.pos().lat());
|
||||
LtsCoordTrans::UtmCoordinate::fromGeographic(posData.pos.lon, posData.pos.lat);
|
||||
|
||||
if (
|
||||
(xMin <= utmCoordParticipant.x) && (utmCoordParticipant.x <= xMax) &&
|
||||
@@ -464,7 +464,7 @@ QSet<int> ShootbackController::assignmentsWithTargetParticipantId(qint32 targetP
|
||||
if (!targetAreaAssignment)
|
||||
continue;
|
||||
|
||||
if (targetAreaAssignment->getData().targetParticipantId() == targetParticipantId)
|
||||
if (targetAreaAssignment->getData().targetParticipantId == targetParticipantId)
|
||||
ret += targetAreaAssignment->getId();
|
||||
} // for
|
||||
|
||||
@@ -513,7 +513,7 @@ void ShootbackController::updateInternalLos(const QSet<int> &changingAssignmentI
|
||||
const TargetAreaAssignment &assignmentData = assignment->getData();
|
||||
|
||||
// 2. check changingAreaIds
|
||||
const int areaId = assignmentData.areaId();
|
||||
const int areaId = assignmentData.areaId;
|
||||
if (!idIsRelevantHelper(changingAreaIds, areaId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " continue, curAssignment " << assignment->getId();
|
||||
@@ -521,7 +521,7 @@ void ShootbackController::updateInternalLos(const QSet<int> &changingAssignmentI
|
||||
}
|
||||
|
||||
// 3. check changingTartgetIds
|
||||
const int targetParticpantId = assignmentData.targetParticipantId();
|
||||
const int targetParticpantId = assignmentData.targetParticipantId;
|
||||
const int targetDataId = m_handlerShootbackTarget->targetDataIdForTargetParticipantId(targetParticpantId);
|
||||
if (!idIsRelevantHelper(changingTartgetIds, targetDataId))
|
||||
{
|
||||
@@ -572,8 +572,8 @@ bool ShootbackController::updateInternalLosSingleAssignment(ObjectTargetAreaAssi
|
||||
|
||||
|
||||
const TargetAreaAssignment &assignmentData = assignment->getData();
|
||||
const int areaId = assignmentData.areaId();
|
||||
const int targetParticipantId = assignmentData.targetParticipantId();
|
||||
const int areaId = assignmentData.areaId;
|
||||
const int targetParticipantId = assignmentData.targetParticipantId;
|
||||
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " START, assignmentId=" << assignmentId
|
||||
<< ", areaId = " << areaId
|
||||
@@ -612,18 +612,18 @@ bool ShootbackController::updateInternalLosSingleAssignment(ObjectTargetAreaAssi
|
||||
|
||||
// 1 targetGeoPos
|
||||
ShootbackTarget sbTarget = target->getData();
|
||||
const Core::GeoPosition &sbTargetGeoPos = sbTarget.position();
|
||||
const Core::GeoPosition &sbTargetGeoPos = sbTarget.position;
|
||||
|
||||
// 2 participantId -> geoPos:
|
||||
const ParticipantManagement::ParticipantPosition &participantPos =
|
||||
m_mainHandler->dds()->dtcPpm()->participantPosition(participantId);
|
||||
|
||||
if (participantPos.participantId() != participantId)
|
||||
if (participantPos.participantId != participantId)
|
||||
{
|
||||
ERROR_LOG(m_logger) << LOGFUNCTION << " no position for participantId=" << participantId;
|
||||
return false;
|
||||
}
|
||||
const Core::GeoPosition &participantGeoPos = participantPos.pos();
|
||||
const Core::GeoPosition &participantGeoPos = participantPos.pos;
|
||||
|
||||
bool visi = lineOfSight(sbTargetGeoPos, participantGeoPos);
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " current targetId = " << target->getId() << " visi = " << visi;
|
||||
@@ -687,11 +687,11 @@ void ShootbackController::syncExternal()
|
||||
|
||||
|
||||
const ShootbackTarget &sbTarget = target->getData();
|
||||
if (visiPartPerTargetStd != sbTarget.visibleParticipants())
|
||||
if (visiPartPerTargetStd != sbTarget.visibleParticipants)
|
||||
{
|
||||
// data has changed
|
||||
INFO_LOG(m_logger) << LOGFUNCTION << " targetId differ -> updateObject..";
|
||||
INFO_LOG(m_logger) << LOGFUNCTION << " visiOld =" << toString(sbTarget.visibleParticipants());
|
||||
INFO_LOG(m_logger) << LOGFUNCTION << " visiOld =" << toString(sbTarget.visibleParticipants);
|
||||
INFO_LOG(m_logger) << LOGFUNCTION << " visiNew =" << toString(visiPartPerTargetStd);
|
||||
target->updateVolatileData(visiPartPerTargetStd); // update and publish
|
||||
}
|
||||
@@ -713,8 +713,8 @@ bool ShootbackController::lineOfSight(const Core::GeoPosition &observerPos, cons
|
||||
return false;
|
||||
}
|
||||
|
||||
SituationMap::ObserverTargetData observerTarget(Point3D(observerPos.lon(), observerPos.lat(), observerPos.z() + 2.0), // 2.0m als Augenhöhe
|
||||
Point3D(targetPos.lon(), targetPos.lat(), observerPos.z() + 2.0) // 2.0m als Augenhöhe
|
||||
SituationMap::ObserverTargetData observerTarget(Point3D(observerPos.lon, observerPos.lat, observerPos.z + 2.0), // 2.0m als Augenhöhe
|
||||
Point3D(targetPos.lon, targetPos.lat, observerPos.z + 2.0) // 2.0m als Augenhöhe
|
||||
);
|
||||
|
||||
bool success = m_losCalculation->calculate(observerTarget);
|
||||
|
||||
Reference in new issue
Block a user