Migrates EffectShow and AssetManagement to generated rtiddsgen API
Converts accessor calls to plain member access across esc and asm services.
This commit is contained in:
39 files changed
+818
-818
No files matched your search
+99
-99
@@ -117,45 +117,45 @@ bool HandlerAesData::init()
|
||||
//=============================================================================
|
||||
void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType)
|
||||
{
|
||||
const Core::GeoPosition2D &posLl = data.impactPosition();
|
||||
const Core::GeoPosition2D &posLl = data.impactPosition;
|
||||
AreaEffectSimulation::ExplosionArea areaData;
|
||||
areaData.altitude(data.altitude());
|
||||
areaData.cannonCount(1);
|
||||
areaData.cannonRounds(1);
|
||||
areaData.chargeStruct().chargeTypeId(data.chargeStruct().chargeTypeId());
|
||||
areaData.effectDuration(data.effectDuration());
|
||||
areaData.effectMarkingInTa(data.effectMarkingInTa());
|
||||
areaData.effectStart(data.effectStart());
|
||||
areaData.effectStateId(data.effectStateId());
|
||||
areaData.externalId(data.externalId());
|
||||
areaData.fireRequestTime(data.fireRequestTime());
|
||||
areaData.remainExplosionNumber(1);
|
||||
areaData.id(data.id());
|
||||
areaData.name(data.name());
|
||||
areaData.isDeleted(data.isDeleted());
|
||||
areaData.isUsed(data.isUsed());
|
||||
areaData.altitude = data.altitude;
|
||||
areaData.cannonCount = 1;
|
||||
areaData.cannonRounds = 1;
|
||||
areaData.chargeStruct.chargeTypeId = data.chargeStruct.chargeTypeId;
|
||||
areaData.effectDuration = data.effectDuration;
|
||||
areaData.effectMarkingInTa = data.effectMarkingInTa;
|
||||
areaData.effectStart = data.effectStart;
|
||||
areaData.effectStateId = data.effectStateId;
|
||||
areaData.externalId = data.externalId;
|
||||
areaData.fireRequestTime = data.fireRequestTime;
|
||||
areaData.remainExplosionNumber = 1;
|
||||
areaData.id = data.id;
|
||||
areaData.name = data.name;
|
||||
areaData.isDeleted = data.isDeleted;
|
||||
areaData.isUsed = data.isUsed;
|
||||
AreaEffectSimulation::Area area;
|
||||
area.cornerBottomLeft(posLl);
|
||||
area.height(50);
|
||||
area.width(50);
|
||||
areaData.area(area);
|
||||
area.cornerBottomLeft = posLl;
|
||||
area.height = 50;
|
||||
area.width = 50;
|
||||
areaData.area = area;
|
||||
|
||||
HandlerEffectShow::KindOfModification_e kindOfModification = HandlerEffectShow::KindOfModification_e::Removed;
|
||||
if (takeIntoAccountEffectShow(data.effectStateId()) && data.effectMarkingInTa())
|
||||
if (takeIntoAccountEffectShow(data.effectStateId) && data.effectMarkingInTa)
|
||||
kindOfModification = getKindOfModification(ObjectAesData::asEsmAesData(areaData), modType);
|
||||
|
||||
ObjectAesData *ifs = m_AesDataObjMap.value(data.id());
|
||||
ObjectAesData *ifs = m_AesDataObjMap.value(data.id);
|
||||
if (kindOfModification == HandlerEffectShow::KindOfModification_e::Added && ifs)
|
||||
kindOfModification = HandlerEffectShow::KindOfModification_e::ModifiedData;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got ExplosionArea: "
|
||||
<< "\n ID: " << data.id()
|
||||
<< "\n Name: " << data.name()
|
||||
<< "\n Effect status: " << data.effectStateId()
|
||||
<< "\n Effect show (y/n): " << data.effectMarkingInTa()
|
||||
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon(), posLl.lat())
|
||||
<< "\n Start: " << data.effectStart()
|
||||
<< "\n Duration: " << data.effectDuration()
|
||||
<< "\n ID: " << data.id
|
||||
<< "\n Name: " << data.name
|
||||
<< "\n Effect status: " << data.effectStateId
|
||||
<< "\n Effect show (y/n): " << data.effectMarkingInTa
|
||||
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon, posLl.lat)
|
||||
<< "\n Start: " << data.effectStart
|
||||
<< "\n Duration: " << data.effectDuration
|
||||
<< "\n Modification: " << modType
|
||||
<< "\n detected Mod: " << HandlerEffectShow::enumToString(kindOfModification);
|
||||
|
||||
@@ -172,7 +172,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
|
||||
}
|
||||
else
|
||||
{
|
||||
m_AesDataObjMap.insert(data.id(), ifs);
|
||||
m_AesDataObjMap.insert(data.id, ifs);
|
||||
m_mainHandler->handlerEffectShow()->onExplosionAreaChanged(areaData, kindOfModification);
|
||||
}
|
||||
break;
|
||||
@@ -191,15 +191,15 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id();
|
||||
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id;
|
||||
break;
|
||||
}
|
||||
case HandlerEffectShow::KindOfModification_e::Removed:
|
||||
{
|
||||
if (ifs != nullptr)
|
||||
{
|
||||
if (!m_AesDataObjMap.remove(data.id()))
|
||||
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
|
||||
if (!m_AesDataObjMap.remove(data.id))
|
||||
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id << ") from map failed.";
|
||||
|
||||
Core::FunctionReplyObject ret = ifs->removeObject();
|
||||
if (ret.error())
|
||||
@@ -221,25 +221,25 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
|
||||
void HandlerAesData::onExplosionAreaChanged(const AreaEffectSimulation::ExplosionArea &data, DataModification modType)
|
||||
{
|
||||
HandlerEffectShow::KindOfModification_e kindOfModification = HandlerEffectShow::KindOfModification_e::Removed;
|
||||
if (takeIntoAccountEffectShow(data.effectStateId()) && data.effectMarkingInTa())
|
||||
if (takeIntoAccountEffectShow(data.effectStateId) && data.effectMarkingInTa)
|
||||
kindOfModification = getKindOfModification(ObjectAesData::asEsmAesData(data), modType);
|
||||
|
||||
ObjectAesData *ifs = m_AesDataObjMap.value(data.id());
|
||||
ObjectAesData *ifs = m_AesDataObjMap.value(data.id);
|
||||
if (kindOfModification == HandlerEffectShow::KindOfModification_e::Added && ifs)
|
||||
kindOfModification = HandlerEffectShow::KindOfModification_e::ModifiedData;
|
||||
|
||||
const Core::GeoPosition2D &posLl = data.area().cornerBottomLeft();
|
||||
const Core::GeoPosition2D &posLl = data.area.cornerBottomLeft;
|
||||
DEBUG_LOG(m_logger) << "Got ExplosionArea: "
|
||||
<< "\n ID: " << data.id()
|
||||
<< "\n Name: " << data.name()
|
||||
<< "\n Effect status: " << data.effectStateId()
|
||||
<< "\n Effect show (y/n): " << data.effectMarkingInTa()
|
||||
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon(), posLl.lat())
|
||||
<< "\n Width: " << data.area().width()
|
||||
<< "\n Height: " << data.area().height()
|
||||
<< "\n Rotation: " << data.area().rotation()
|
||||
<< "\n Start: " << data.effectStart()
|
||||
<< "\n Duration: " << data.effectDuration()
|
||||
<< "\n ID: " << data.id
|
||||
<< "\n Name: " << data.name
|
||||
<< "\n Effect status: " << data.effectStateId
|
||||
<< "\n Effect show (y/n): " << data.effectMarkingInTa
|
||||
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon, posLl.lat)
|
||||
<< "\n Width: " << data.area.width
|
||||
<< "\n Height: " << data.area.height
|
||||
<< "\n Rotation: " << data.area.rotation
|
||||
<< "\n Start: " << data.effectStart
|
||||
<< "\n Duration: " << data.effectDuration
|
||||
<< "\n Modification: " << modType
|
||||
<< "\n detected Mod: " << HandlerEffectShow::enumToString(kindOfModification);
|
||||
|
||||
@@ -275,15 +275,15 @@ void HandlerAesData::onExplosionAreaChanged(const AreaEffectSimulation::Explosio
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id();
|
||||
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id;
|
||||
break;
|
||||
}
|
||||
case HandlerEffectShow::KindOfModification_e::Removed:
|
||||
{
|
||||
if (ifs != nullptr)
|
||||
{
|
||||
if (!m_AesDataObjMap.remove(data.id()))
|
||||
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
|
||||
if (!m_AesDataObjMap.remove(data.id))
|
||||
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id << ") from map failed.";
|
||||
|
||||
Core::FunctionReplyObject ret = ifs->removeObject();
|
||||
if (ret.error())
|
||||
@@ -303,25 +303,25 @@ void HandlerAesData::onExplosionAreaChanged(const AreaEffectSimulation::Explosio
|
||||
void HandlerAesData::onExplosionClusterChanged(const AreaEffectSimulation::ExplosionCluster &data, DataModification modType)
|
||||
{
|
||||
HandlerEffectShow::KindOfModification_e kindOfModification = HandlerEffectShow::KindOfModification_e::Removed;
|
||||
if (takeIntoAccountEffectShow(data.effectStateId()) && data.effectMarkingInTa())
|
||||
if (takeIntoAccountEffectShow(data.effectStateId) && data.effectMarkingInTa)
|
||||
kindOfModification = getKindOfModification(ObjectAesData::asEsmAesData(data), modType);
|
||||
|
||||
ObjectAesData *ifs = m_AesDataObjMap.value(data.id());
|
||||
ObjectAesData *ifs = m_AesDataObjMap.value(data.id);
|
||||
if (kindOfModification == HandlerEffectShow::KindOfModification_e::Added && ifs)
|
||||
kindOfModification = HandlerEffectShow::KindOfModification_e::ModifiedData;
|
||||
|
||||
const Core::GeoPosition2D &posLl = data.area().cornerBottomLeft();
|
||||
const Core::GeoPosition2D &posLl = data.area.cornerBottomLeft;
|
||||
DEBUG_LOG(m_logger) << ">>>> Got Cluster: "
|
||||
<< "\n ID: " << data.id()
|
||||
<< "\n Name: " << data.name()
|
||||
<< "\n Effect status: " << data.effectStateId()
|
||||
<< "\n Effect show (y/n): " << data.effectMarkingInTa()
|
||||
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon(), posLl.lat())
|
||||
<< "\n Width: " << data.area().width()
|
||||
<< "\n Height: " << data.area().height()
|
||||
<< "\n Rotation: " << data.area().rotation()
|
||||
<< "\n Start: " << data.effectStart()
|
||||
<< "\n Duration: " << data.effectDuration()
|
||||
<< "\n ID: " << data.id
|
||||
<< "\n Name: " << data.name
|
||||
<< "\n Effect status: " << data.effectStateId
|
||||
<< "\n Effect show (y/n): " << data.effectMarkingInTa
|
||||
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon, posLl.lat)
|
||||
<< "\n Width: " << data.area.width
|
||||
<< "\n Height: " << data.area.height
|
||||
<< "\n Rotation: " << data.area.rotation
|
||||
<< "\n Start: " << data.effectStart
|
||||
<< "\n Duration: " << data.effectDuration
|
||||
<< "\n Modification: " << modType
|
||||
<< "\n detected Mod: " << HandlerEffectShow::enumToString(kindOfModification);
|
||||
|
||||
@@ -338,7 +338,7 @@ void HandlerAesData::onExplosionClusterChanged(const AreaEffectSimulation::Explo
|
||||
}
|
||||
else
|
||||
{
|
||||
m_AesDataObjMap.insert(data.id(), ifs);
|
||||
m_AesDataObjMap.insert(data.id, ifs);
|
||||
m_mainHandler->handlerEffectShow()->onExplosionClusterChanged(data, kindOfModification);
|
||||
}
|
||||
break;
|
||||
@@ -357,15 +357,15 @@ void HandlerAesData::onExplosionClusterChanged(const AreaEffectSimulation::Explo
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id();
|
||||
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id;
|
||||
break;
|
||||
}
|
||||
case HandlerEffectShow::KindOfModification_e::Removed:
|
||||
{
|
||||
if (ifs != nullptr)
|
||||
{
|
||||
if (!m_AesDataObjMap.remove(data.id()))
|
||||
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
|
||||
if (!m_AesDataObjMap.remove(data.id))
|
||||
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id << ") from map failed.";
|
||||
|
||||
Core::FunctionReplyObject ret = ifs->removeObject();
|
||||
if (ret.error())
|
||||
@@ -384,25 +384,25 @@ void HandlerAesData::onExplosionClusterChanged(const AreaEffectSimulation::Explo
|
||||
void HandlerAesData::onEffectClusterChanged(const AreaEffectSimulation::EffectCluster &data, DataModification modType)
|
||||
{
|
||||
HandlerEffectShow::KindOfModification_e kindOfModification = HandlerEffectShow::KindOfModification_e::Removed;
|
||||
if (takeIntoAccountEffectShow(data.effectStateId()) && data.effectMarkingInTa())
|
||||
if (takeIntoAccountEffectShow(data.effectStateId) && data.effectMarkingInTa)
|
||||
kindOfModification = getKindOfModification(ObjectAesData::asEsmAesData(data), modType);
|
||||
|
||||
ObjectAesData *ifs = m_AesDataObjMap.value(data.id());
|
||||
ObjectAesData *ifs = m_AesDataObjMap.value(data.id);
|
||||
if (kindOfModification == HandlerEffectShow::KindOfModification_e::Added && ifs)
|
||||
kindOfModification = HandlerEffectShow::KindOfModification_e::ModifiedData;
|
||||
|
||||
const Core::GeoPosition2D &posLl = data.area().cornerBottomLeft();
|
||||
const Core::GeoPosition2D &posLl = data.area.cornerBottomLeft;
|
||||
DEBUG_LOG(m_logger) << ">>>> Got EffectCluster: "
|
||||
<< "\n ID: " << data.id()
|
||||
<< "\n Name: " << data.name()
|
||||
<< "\n Effect status: " << data.effectStateId()
|
||||
<< "\n Effect show (y/n): " << data.effectMarkingInTa()
|
||||
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon(), posLl.lat())
|
||||
<< "\n Width: " << data.area().width()
|
||||
<< "\n Height: " << data.area().height()
|
||||
<< "\n Rotation: " << data.area().rotation()
|
||||
<< "\n Start: " << data.effectStart()
|
||||
<< "\n Duration: " << data.effectDuration()
|
||||
<< "\n ID: " << data.id
|
||||
<< "\n Name: " << data.name
|
||||
<< "\n Effect status: " << data.effectStateId
|
||||
<< "\n Effect show (y/n): " << data.effectMarkingInTa
|
||||
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon, posLl.lat)
|
||||
<< "\n Width: " << data.area.width
|
||||
<< "\n Height: " << data.area.height
|
||||
<< "\n Rotation: " << data.area.rotation
|
||||
<< "\n Start: " << data.effectStart
|
||||
<< "\n Duration: " << data.effectDuration
|
||||
<< "\n Modification: " << modType
|
||||
<< "\n detected Mod: " << HandlerEffectShow::enumToString(kindOfModification);
|
||||
|
||||
@@ -419,7 +419,7 @@ void HandlerAesData::onEffectClusterChanged(const AreaEffectSimulation::EffectCl
|
||||
}
|
||||
else
|
||||
{
|
||||
m_AesDataObjMap.insert(data.id(), ifs);
|
||||
m_AesDataObjMap.insert(data.id, ifs);
|
||||
m_mainHandler->handlerEffectShow()->onEffectClusterChanged(data, kindOfModification);
|
||||
}
|
||||
break;
|
||||
@@ -438,15 +438,15 @@ void HandlerAesData::onEffectClusterChanged(const AreaEffectSimulation::EffectCl
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id();
|
||||
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id;
|
||||
break;
|
||||
}
|
||||
case HandlerEffectShow::KindOfModification_e::Removed:
|
||||
{
|
||||
if (ifs != nullptr)
|
||||
{
|
||||
if (!m_AesDataObjMap.remove(data.id()))
|
||||
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
|
||||
if (!m_AesDataObjMap.remove(data.id))
|
||||
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id << ") from map failed.";
|
||||
|
||||
Core::FunctionReplyObject ret = ifs->removeObject();
|
||||
if (ret.error())
|
||||
@@ -466,26 +466,26 @@ void HandlerAesData::onEffectClusterChanged(const AreaEffectSimulation::EffectCl
|
||||
void HandlerAesData::onMineAreaChanged(const AreaEffectSimulation::MineArea &data, DataModification modType)
|
||||
{
|
||||
HandlerEffectShow::KindOfModification_e kindOfModification = HandlerEffectShow::KindOfModification_e::Removed;
|
||||
if (takeIntoAccountEffectShow(data.effectStateId()) && data.effectMarkingInTa())
|
||||
if (takeIntoAccountEffectShow(data.effectStateId) && data.effectMarkingInTa)
|
||||
kindOfModification = getKindOfModification(ObjectAesData::asEsmAesData(data), modType);
|
||||
|
||||
ObjectAesData *ifs = m_AesDataObjMap.value(data.id());
|
||||
ObjectAesData *ifs = m_AesDataObjMap.value(data.id);
|
||||
if (kindOfModification == HandlerEffectShow::KindOfModification_e::Added && ifs)
|
||||
kindOfModification = HandlerEffectShow::KindOfModification_e::ModifiedData;
|
||||
|
||||
if (data.segments().size() == 0)
|
||||
if (data.segments.size() == 0)
|
||||
return;
|
||||
|
||||
const Core::GeoPosition2D &posLl = data.segments().at(data.segments().size() / 2).positionStart();
|
||||
const Core::GeoPosition2D &posLl = data.segments.at(data.segments.size() / 2).positionStart;
|
||||
DEBUG_LOG(m_logger) << "Got MineArea: "
|
||||
<< "\n ID: " << data.id()
|
||||
<< "\n Name: " << data.name()
|
||||
<< "\n Effect status: " << data.effectStateId()
|
||||
<< "\n Effect show (y/n): " << data.effectMarkingInTa()
|
||||
<< "\n Start Position " << LtsCoordTrans::mgrsFromGeographic(posLl.lon(), posLl.lat())
|
||||
<< "\n Start: " << data.effectStart()
|
||||
<< "\n Duration: " << data.effectDuration()
|
||||
<< "\n Num of segments: " << data.segments().size()
|
||||
<< "\n ID: " << data.id
|
||||
<< "\n Name: " << data.name
|
||||
<< "\n Effect status: " << data.effectStateId
|
||||
<< "\n Effect show (y/n): " << data.effectMarkingInTa
|
||||
<< "\n Start Position " << LtsCoordTrans::mgrsFromGeographic(posLl.lon, posLl.lat)
|
||||
<< "\n Start: " << data.effectStart
|
||||
<< "\n Duration: " << data.effectDuration
|
||||
<< "\n Num of segments: " << data.segments.size()
|
||||
<< "\n Modification: " << modType
|
||||
<< "\n detected Mod: " << HandlerEffectShow::enumToString(kindOfModification);
|
||||
|
||||
@@ -502,7 +502,7 @@ void HandlerAesData::onMineAreaChanged(const AreaEffectSimulation::MineArea &dat
|
||||
}
|
||||
else
|
||||
{
|
||||
m_AesDataObjMap.insert(data.id(), ifs);
|
||||
m_AesDataObjMap.insert(data.id, ifs);
|
||||
m_mainHandler->handlerEffectShow()->onMineAreaChanged(data, kindOfModification);
|
||||
}
|
||||
break;
|
||||
@@ -521,15 +521,15 @@ void HandlerAesData::onMineAreaChanged(const AreaEffectSimulation::MineArea &dat
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger) << "Mine Area not available for modification: " << data.id();
|
||||
WARNING_LOG(m_logger) << "Mine Area not available for modification: " << data.id;
|
||||
break;
|
||||
}
|
||||
case HandlerEffectShow::KindOfModification_e::Removed:
|
||||
{
|
||||
if (ifs != nullptr)
|
||||
{
|
||||
if (!m_AesDataObjMap.remove(data.id()))
|
||||
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
|
||||
if (!m_AesDataObjMap.remove(data.id))
|
||||
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id << ") from map failed.";
|
||||
|
||||
Core::FunctionReplyObject ret = ifs->removeObject();
|
||||
if (ret.error())
|
||||
|
||||
Reference in new issue
Block a user