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
+30
-30
@@ -39,7 +39,7 @@ Core::FunctionReplyObject ObjectGasPipe::createObject(const Database::AesGasPipe
|
||||
m_data.operatorId = dbData.operatorId;
|
||||
m_data.partyId = dbData.partyId;
|
||||
m_data.effectStart = dbData.effectStart;
|
||||
m_data.effectStateId = AreaEffectSimulation::AesEffectState_def::EsCreated;
|
||||
m_data.effectStateId = AreaEffectSimulation::AesEffectState::EsCreated;
|
||||
m_data.effectDuration = dbData.effectDuration;
|
||||
m_data.chargeTypeId = 461; // 105 Dummy
|
||||
|
||||
@@ -61,7 +61,7 @@ Core::FunctionReplyObject ObjectGasPipe::createObject(const Database::AesGasPipe
|
||||
{
|
||||
dbSegment.id = 0; // Reset for insert. Otherwise second segment cannot be inserted!
|
||||
dbSegment.gasPipeId = m_data.privGasPipeId; // db
|
||||
dbSegment.position = QPointF(ddsSegments[i].lon(), ddsSegments[i].lat());
|
||||
dbSegment.position = QPointF(ddsSegments[i].lon, ddsSegments[i].lat);
|
||||
dbSegment.positionIndex = i;
|
||||
|
||||
if (!m_mainHandler->db()->insert(dbSegment))
|
||||
@@ -128,7 +128,7 @@ Core::FunctionReplyObject ObjectGasPipe::updateObject(const Database::AesGasPipe
|
||||
// update all segments in tmpDbSegments
|
||||
for (size_t i = 0; i < ddsSegments.size(); ++i)
|
||||
{
|
||||
tmpDbSegments[i].position = QPointF(ddsSegments[i].lon(), ddsSegments[i].lat());
|
||||
tmpDbSegments[i].position = QPointF(ddsSegments[i].lon, ddsSegments[i].lat);
|
||||
tmpDbSegments[i].positionIndex = i;
|
||||
}
|
||||
|
||||
@@ -183,20 +183,20 @@ void ObjectGasPipe::onPublishData()
|
||||
|
||||
|
||||
AreaEffectSimulation::GasPipe ddsData;
|
||||
ddsData.id(m_data.id);
|
||||
ddsData.name(m_data.name.toStdString());
|
||||
ddsData.isDeleted(effectState() == AesEffectState::EsRemoved);
|
||||
ddsData.isUsed(false);
|
||||
ddsData.sampleTime(m_mainHandler->dds()->currentPartitionTimeMSec());
|
||||
ddsData.chargeStruct().chargeTypeId(m_data.chargeTypeId);
|
||||
ddsData.effectDuration(m_data.effectDuration);
|
||||
ddsData.effectStart(toOptional(toMSec(m_data.effectStart)));
|
||||
ddsData.width(m_data.width);
|
||||
ddsData.effectStateId(effectState());
|
||||
ddsData.partyId(toOptional(m_data.partyId));
|
||||
ddsData.participantId(toOptional(m_data.participantId));
|
||||
ddsData.isCentral(m_data.isCentral);
|
||||
dbSegment2DdsSegment(m_dbSegments, ddsData.segments());
|
||||
ddsData.id = m_data.id;
|
||||
ddsData.name = m_data.name.toStdString();
|
||||
ddsData.isDeleted = effectState() == AesEffectState::EsRemoved;
|
||||
ddsData.isUsed = false;
|
||||
ddsData.sampleTime = m_mainHandler->dds()->currentPartitionTimeMSec();
|
||||
ddsData.chargeStruct.chargeTypeId = m_data.chargeTypeId;
|
||||
ddsData.effectDuration = m_data.effectDuration;
|
||||
ddsData.effectStart = toOptional(toMSec(m_data.effectStart));
|
||||
ddsData.width = m_data.width;
|
||||
ddsData.effectStateId = effectState();
|
||||
ddsData.partyId = toOptional(m_data.partyId);
|
||||
ddsData.participantId = toOptional(m_data.participantId);
|
||||
ddsData.isCentral = m_data.isCentral;
|
||||
dbSegment2DdsSegment(m_dbSegments, ddsData.segments);
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->publish(ddsData))
|
||||
ERROR_LOG(m_logger) << "Error publishing AesGasPipe-data to dds";
|
||||
@@ -211,22 +211,22 @@ void ObjectGasPipe::publishAiv()
|
||||
const QRectF bounds(poly.boundingRect());
|
||||
|
||||
AesItemView aiv(m_aiv);
|
||||
aiv.aesItemId(m_data.id);
|
||||
aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId);
|
||||
aiv.effectStart(partitionTimeMSec());
|
||||
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::AtGasPipe);
|
||||
aiv.effectStateId(effectState());
|
||||
aiv.id(1000 * m_data.id + AesType::AtGasPipe);
|
||||
aiv.partyId(m_data.partyId);
|
||||
aiv.aesItemId = m_data.id;
|
||||
aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId;
|
||||
aiv.effectStart = partitionTimeMSec();
|
||||
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::AtGasPipe;
|
||||
aiv.effectStateId = effectState();
|
||||
aiv.id = 1000 * m_data.id + static_cast<int>(AesType::AtGasPipe);
|
||||
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);
|
||||
@@ -238,7 +238,7 @@ void ObjectGasPipe::removeTopics()
|
||||
{
|
||||
auto dts = m_mainHandler->dds()->dts();
|
||||
dts->removeGasPipeByKey(m_data.id);
|
||||
dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtGasPipe);
|
||||
dts->removeAesItemViewByKey(1000 * m_data.id + static_cast<int>(AesType::AtGasPipe));
|
||||
}
|
||||
|
||||
QPolygonF ObjectGasPipe::generateForm()
|
||||
|
||||
Reference in new issue
Block a user