Migrates AreaEffectSimulation to generated rtiddsgen API
Converts accessor calls to plain member access across aes service and plugin.
This commit is contained in:
102 files changed
+3307
-3313
No files matched your search
+28
-28
@@ -55,19 +55,19 @@ bool HandlerReconArea::init()
|
||||
|
||||
static void fillData(const ReconAreaModifyRequest &src, Database::AesReconArea &dst)
|
||||
{
|
||||
dst.name = QString::fromStdString(src.name());
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.chargeTypeId = 103; // recon area dummy
|
||||
dst.effectDuration = 0; // forever active
|
||||
dst.position.rx() = src.area().cornerBottomLeft().lon();
|
||||
dst.position.ry() = src.area().cornerBottomLeft().lat();
|
||||
dst.rotationAngle = src.area().rotation();
|
||||
dst.height = src.area().height();
|
||||
dst.width = src.area().width();
|
||||
dst.position.rx() = src.area.cornerBottomLeft.lon;
|
||||
dst.position.ry() = src.area.cornerBottomLeft.lat;
|
||||
dst.rotationAngle = src.area.rotation;
|
||||
dst.height = src.area.height;
|
||||
dst.width = src.area.width;
|
||||
dst.effectMarkingInTa = false;
|
||||
dst.effectStart = src.effectStart().is_set() ? QDateTime::fromMSecsSinceEpoch(src.effectStart().get()) : QDateTime();
|
||||
dst.participantId = src.participantId();
|
||||
dst.partyId = src.partyId().is_set() ? src.partyId().get() : 0;
|
||||
dst.purpose = QString::fromStdString(src.purpose());
|
||||
dst.effectStart = src.effectStart.is_set() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.participantId = src.participantId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.purpose = QString::fromStdString(src.purpose);
|
||||
}
|
||||
|
||||
void HandlerReconArea::onReconAreaModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
@@ -100,8 +100,8 @@ Core::FunctionReplyObject HandlerReconArea::reconAreaCreateRequest(const ReconAr
|
||||
m_objectMap.insert(ifs->id(), ifs);
|
||||
if (ifs->isObjectInTrainingArea())
|
||||
{
|
||||
++s_areaCount[AesType::AtReconArea];
|
||||
DEBUG_LOG(m_logger) << "s_areaCount[AesType::AtReconArea] = " << s_areaCount[AesType::AtReconArea];
|
||||
++s_areaCount[static_cast<int>(AesType::AtReconArea)];
|
||||
DEBUG_LOG(m_logger) << "s_areaCount[AesType::AtReconArea] = " << s_areaCount[static_cast<int>(AesType::AtReconArea)];
|
||||
}
|
||||
connect(ifs, &ObjectReconArea::newAiv, this, &HandlerReconArea::newAiv);
|
||||
connect(ifs, &ObjectReconArea::removeAiv, this, &HandlerReconArea::removeAiv);
|
||||
@@ -110,11 +110,11 @@ Core::FunctionReplyObject HandlerReconArea::reconAreaCreateRequest(const ReconAr
|
||||
|
||||
Core::FunctionReplyObject HandlerReconArea::reconAreaModifyRequest(const ReconAreaModifyRequest &request)
|
||||
{
|
||||
if (request.id() <= 0)
|
||||
if (request.id <= 0)
|
||||
return reconAreaCreateRequest(request);
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectReconArea *ifs = getObjectFromMap(m_objectMap, request.id(), ret);
|
||||
ObjectReconArea *ifs = getObjectFromMap(m_objectMap, request.id, ret);
|
||||
if (!ifs)
|
||||
return ret;
|
||||
|
||||
@@ -130,19 +130,19 @@ Core::FunctionReplyObject HandlerReconArea::reconAreaModifyGeometryRequest(const
|
||||
{
|
||||
// WARNING: request.area.cornerBottomLeft() contains center point!
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectReconArea *ifs = getObjectFromMap(m_objectMap, request.id(), ret);
|
||||
ObjectReconArea *ifs = getObjectFromMap(m_objectMap, request.id, ret);
|
||||
if (!ifs)
|
||||
return ret;
|
||||
|
||||
// Todo: IsObjectModifiable() ?!?
|
||||
|
||||
AreaEffectSimulation::Database::AesReconArea aea(ifs->data());
|
||||
aea.position = Polygons::centerPoint2BottomLeft(QPointF(request.area().cornerBottomLeft().lon(),
|
||||
request.area().cornerBottomLeft().lat()),
|
||||
aea.position = Polygons::centerPoint2BottomLeft(QPointF(request.area.cornerBottomLeft.lon,
|
||||
request.area.cornerBottomLeft.lat),
|
||||
ifs->data().width,
|
||||
ifs->data().height,
|
||||
request.area().rotation());
|
||||
aea.rotationAngle = request.area().rotation();
|
||||
request.area.rotation);
|
||||
aea.rotationAngle = request.area.rotation;
|
||||
|
||||
return ifs->updateObject(aea);
|
||||
}
|
||||
@@ -163,23 +163,23 @@ Core::FunctionReplyObject HandlerReconArea::switchTo(int id, AesEffectState effe
|
||||
return Core::FunctionReplyObject(id, tr_lts("dds", "Recon area with id %1 not found.")).arg(id);
|
||||
|
||||
bool succ = false;
|
||||
switch (effectState.underlying()) {
|
||||
case AesEffectState_def::EsActivated:
|
||||
switch (effectState) {
|
||||
case AesEffectState::EsActivated:
|
||||
succ = !ifs->activateObjectNow().error();
|
||||
break;
|
||||
case AesEffectState_def::EsPrepared:
|
||||
case AesEffectState::EsPrepared:
|
||||
succ = ifs->trySwitchToPrepared();
|
||||
break;
|
||||
case AesEffectState_def::EsPaused:
|
||||
case AesEffectState::EsPaused:
|
||||
succ = ifs->trySwitchToPaused();
|
||||
break;
|
||||
case AesEffectState_def::EsExpired:
|
||||
case AesEffectState::EsExpired:
|
||||
succ = ifs->trySwitchToExpired();
|
||||
break;
|
||||
case AesEffectState_def::EsRemoved:
|
||||
case AesEffectState::EsRemoved:
|
||||
succ = ifs->trySwitchToRemoved();
|
||||
break;
|
||||
case AesEffectState_def::EsCreated:
|
||||
case AesEffectState::EsCreated:
|
||||
succ = ifs->trySwitchToCreated();
|
||||
break;
|
||||
default:
|
||||
@@ -187,7 +187,7 @@ Core::FunctionReplyObject HandlerReconArea::switchTo(int id, AesEffectState effe
|
||||
}
|
||||
if (succ)
|
||||
return Core::FunctionReplyObject();
|
||||
return Core::FunctionReplyObject(id, tr_lts("dds", "Could not switch effect simulation with id %1 to state with id %2.")).arg(id).arg(effectState.underlying());
|
||||
return Core::FunctionReplyObject(id, tr_lts("dds", "Could not switch effect simulation with id %1 to state with id %2.")).arg(id).arg(effectState);
|
||||
}
|
||||
|
||||
void HandlerReconArea::onReconAreaRemoveRequest(const rti::core::SampleIdentity &cookie,
|
||||
@@ -195,7 +195,7 @@ void HandlerReconArea::onReconAreaRemoveRequest(const rti::core::SampleIdentity
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onReconAreaRemoveRequest: " << request;
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectReconArea *ifs = getObjectFromMap(m_objectMap, request.id(), ret);
|
||||
ObjectReconArea *ifs = getObjectFromMap(m_objectMap, request.id, ret);
|
||||
if (!ifs)
|
||||
{
|
||||
m_mainHandler->dds()->fts()->reconAreaRemoveReply(cookie, ret);
|
||||
|
||||
Reference in new issue
Block a user