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
+19
-19
@@ -28,7 +28,7 @@ ObjectNContamination::~ObjectNContamination()
|
||||
Core::FunctionReplyObject ObjectNContamination::createObject(const Database::AesNContamination &data)
|
||||
{
|
||||
Core::FunctionReplyObject ret = ObjectBaseTmpl::createObject(data);
|
||||
if (m_data.effectStateId == AesEffectState_def::EsActivated)
|
||||
if (m_data.effectStateId == AesEffectState::EsActivated)
|
||||
m_updateWeatherData = true;
|
||||
|
||||
return ret;
|
||||
@@ -92,7 +92,7 @@ void ObjectNContamination::onUpdateWeatherData()
|
||||
|
||||
if (m_data.weatherSourceId != AesWeatherSource::AwsNone)
|
||||
{
|
||||
m_data.rotationAngle = fmod(md.windDirection() + 180.0, 360.0);
|
||||
m_data.rotationAngle = fmod(md.windDirection + 180.0, 360.0);
|
||||
m_publishDataTimer->start();
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ void ObjectNContamination::onPublishData()
|
||||
if (!m_mainHandler->db()->update(m_data))
|
||||
ERROR_LOG(m_logger) << "Error updating AesIndirectFireSingle-data in database";
|
||||
|
||||
if (m_data.effectStateId == AesEffectState_def::EsActivated && !m_updateWeatherData)
|
||||
if (m_data.effectStateId == AesEffectState::EsActivated && !m_updateWeatherData)
|
||||
onUpdateWeatherData();
|
||||
|
||||
NContamination ddsData(m_data.id,
|
||||
@@ -142,9 +142,9 @@ void ObjectNContamination::onPublishData()
|
||||
void ObjectNContamination::publishAiv()
|
||||
{
|
||||
QPolygonF poly;
|
||||
if ((m_data.effectStateId == AesEffectState_def::EsCreated ||
|
||||
m_data.effectStateId == AesEffectState_def::EsPrepared ||
|
||||
m_data.effectStateId == AesEffectState_def::EsReceived) && m_data.weatherSourceId != AesWeatherSource_def::AwsNone)
|
||||
if ((m_data.effectStateId == AesEffectState::EsCreated ||
|
||||
m_data.effectStateId == AesEffectState::EsPrepared ||
|
||||
m_data.effectStateId == AesEffectState::EsReceived) && m_data.weatherSourceId != AesWeatherSource::AwsNone)
|
||||
{
|
||||
Database::AesNContamination tmpData = m_data;
|
||||
tmpData.borderLengthInner = tmpData.impactRadius;
|
||||
@@ -158,23 +158,23 @@ void ObjectNContamination::publishAiv()
|
||||
const QRectF bounds(poly.boundingRect());
|
||||
|
||||
AesItemView aiv(m_aiv);
|
||||
aiv.aesItemId(m_data.id);
|
||||
aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId);
|
||||
aiv.effectStart(toMSec(m_data.effectStart));
|
||||
ddsVecFromPoly(poly, aiv.form());
|
||||
aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()));
|
||||
aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()));
|
||||
aiv.aesTypeId(AesType::AtNContamination);
|
||||
aiv.effectStateId(effectState());
|
||||
aiv.id(1000 * m_data.id + AesType::AtNContamination);
|
||||
aiv.aesItemId = m_data.id;
|
||||
aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId;
|
||||
aiv.effectStart = toMSec(m_data.effectStart);
|
||||
ddsVecFromPoly(poly, aiv.form);
|
||||
aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y());
|
||||
aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y());
|
||||
aiv.aesTypeId = AesType::AtNContamination;
|
||||
aiv.effectStateId = effectState();
|
||||
aiv.id = 1000 * m_data.id + static_cast<int>(AesType::AtNContamination);
|
||||
if (m_data.partyId != 0)
|
||||
aiv.partyId(m_data.partyId);
|
||||
aiv.partyId = m_data.partyId;
|
||||
|
||||
checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral);
|
||||
checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral);
|
||||
|
||||
if (aiv != m_aiv)
|
||||
{
|
||||
aiv.sampleTime(partitionTimeMSec());
|
||||
aiv.sampleTime = partitionTimeMSec();
|
||||
m_aiv = aiv;
|
||||
m_mainHandler->dds()->dts()->publish(aiv);
|
||||
emit newAiv(aiv);
|
||||
@@ -185,7 +185,7 @@ void ObjectNContamination::removeTopics()
|
||||
{
|
||||
auto dts = m_mainHandler->dds()->dts();
|
||||
dts->removeNContaminationByKey(m_data.id);
|
||||
dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtNContamination);
|
||||
dts->removeAesItemViewByKey(1000 * m_data.id + static_cast<int>(AesType::AtNContamination));
|
||||
emit removeAiv(m_data.id);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user