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
+53
-53
@@ -74,22 +74,22 @@ Core::FunctionReplyObject ObjectEffectShow::removeObject()
|
||||
//=============================================================================
|
||||
Core::FunctionReplyObject ObjectEffectShow::updateObject(const EffectShowManagement::EffectShow &data)
|
||||
{
|
||||
if (data.id() <= 0)
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Object not valid/blocked"));
|
||||
if (data.id <= 0)
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Object not valid/blocked"));
|
||||
|
||||
if (m_data.orderConfirmation == EffectShowManagement::OrderConfirmation_e_def::Execution)
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Changes rejected due to Effect Show in execution."));
|
||||
if (m_data.orderConfirmation == static_cast<int>(EffectShowManagement::OrderConfirmation_e::Execution))
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Changes rejected due to Effect Show in execution."));
|
||||
|
||||
DEBUG_LOG(m_logger) << "updateObject(data topic) complete ->"
|
||||
<< "\n id " << m_data.id << " new: " << data.id()
|
||||
<< "\n centerPosition x " << m_data.centerPosition.x() << " new: " << data.position().lon()
|
||||
<< "\n centerPosition y " << m_data.centerPosition.y() << " new: " << data.position().lat()
|
||||
<< "\n idAreaEffectSimulation " << m_data.idAreaEffectSimulation << " new: " << data.idAreaEffectSimulation()
|
||||
<< "\n esmParticipantId " << m_data.esmParticipantId << " new: " << data.esmParticipantId()
|
||||
<< "\n numOfVolley " << m_data.numOfVolley << " new: " << data.numOfVolley()
|
||||
<< "\n shotsPerVolley " << m_data.shotsPerVolley << " new: " << data.shotsPerVolley()
|
||||
<< "\n orderConfirmation " << m_data.orderConfirmation << " new: " << data.orderConfirmation().underlying()
|
||||
<< "\n answerText " << m_data.answerText << " new: " << QString::fromStdString((data.answerText()))
|
||||
<< "\n id " << m_data.id << " new: " << data.id
|
||||
<< "\n centerPosition x " << m_data.centerPosition.x() << " new: " << data.position.lon
|
||||
<< "\n centerPosition y " << m_data.centerPosition.y() << " new: " << data.position.lat
|
||||
<< "\n idAreaEffectSimulation " << m_data.idAreaEffectSimulation << " new: " << data.idAreaEffectSimulation
|
||||
<< "\n esmParticipantId " << m_data.esmParticipantId << " new: " << data.esmParticipantId
|
||||
<< "\n numOfVolley " << m_data.numOfVolley << " new: " << data.numOfVolley
|
||||
<< "\n shotsPerVolley " << m_data.shotsPerVolley << " new: " << data.shotsPerVolley
|
||||
<< "\n orderConfirmation " << m_data.orderConfirmation << " new: " << data.orderConfirmation
|
||||
<< "\n answerText " << m_data.answerText << " new: " << QString::fromStdString((data.answerText))
|
||||
<< "\n startTime " << m_data.startTime
|
||||
<< "\n duration " << m_data.duration
|
||||
<< "\n lowerLeftPosition x " << m_data.lowerLeftPosition.x()
|
||||
@@ -99,24 +99,24 @@ Core::FunctionReplyObject ObjectEffectShow::updateObject(const EffectShowManagem
|
||||
<< "\n areaRotation " << m_data.areaRotation
|
||||
<< "\n typeOfAmmunition " << m_data.typeOfAmmunition;
|
||||
|
||||
m_data.id = data.id();
|
||||
m_data.name = QString::fromStdString(data.name());
|
||||
m_data.startTime = data.startTime().is_set() ? data.startTime().get() : 0;
|
||||
m_data.duration = data.duration();
|
||||
m_data.idAreaEffectSimulation = data.idAreaEffectSimulation();
|
||||
m_data.nameAreaEfffectSimulation = QString::fromStdString(data.nameAreaEffectSimulation());
|
||||
m_data.esmParticipantId = data.esmParticipantId();
|
||||
m_data.centerPosition.setX(data.position().lon());
|
||||
m_data.centerPosition.setY(data.position().lat());
|
||||
m_data.numOfVolley = data.numOfVolley();
|
||||
m_data.shotsPerVolley = data.shotsPerVolley();
|
||||
m_data.lowerLeftPosition.setX(data.lowerLeftPosition().lon());
|
||||
m_data.lowerLeftPosition.setY(data.lowerLeftPosition().lat());
|
||||
m_data.areaDepth = data.areaDepth();
|
||||
m_data.areaWidth = data.areaWidth();
|
||||
m_data.areaRotation = data.areaRotation();
|
||||
m_data.orderConfirmation = data.orderConfirmation().underlying();
|
||||
m_data.answerText = QString::fromStdString((data.answerText()));
|
||||
m_data.id = data.id;
|
||||
m_data.name = QString::fromStdString(data.name);
|
||||
m_data.startTime = data.startTime.is_set() ? data.startTime.get() : 0;
|
||||
m_data.duration = data.duration;
|
||||
m_data.idAreaEffectSimulation = data.idAreaEffectSimulation;
|
||||
m_data.nameAreaEfffectSimulation = QString::fromStdString(data.nameAreaEffectSimulation);
|
||||
m_data.esmParticipantId = data.esmParticipantId;
|
||||
m_data.centerPosition.setX(data.position.lon);
|
||||
m_data.centerPosition.setY(data.position.lat);
|
||||
m_data.numOfVolley = data.numOfVolley;
|
||||
m_data.shotsPerVolley = data.shotsPerVolley;
|
||||
m_data.lowerLeftPosition.setX(data.lowerLeftPosition.lon);
|
||||
m_data.lowerLeftPosition.setY(data.lowerLeftPosition.lat);
|
||||
m_data.areaDepth = data.areaDepth;
|
||||
m_data.areaWidth = data.areaWidth;
|
||||
m_data.areaRotation = data.areaRotation;
|
||||
m_data.orderConfirmation = data.orderConfirmation;
|
||||
m_data.answerText = QString::fromStdString((data.answerText));
|
||||
|
||||
if (!m_mainHandler->db()->update(m_data))
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error updating EffectShow into database"));
|
||||
@@ -132,10 +132,10 @@ Core::FunctionReplyObject ObjectEffectShow::updateObject(const EffectShowManagem
|
||||
bool ObjectEffectShow::updateObject(const ConvertFromTab::OrderConfirmation_t &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "updateObject() partly ->"
|
||||
<< "\n orderConfirmation " << m_data.orderConfirmation << " new: " << data.confirmation.underlying()
|
||||
<< "\n orderConfirmation " << m_data.orderConfirmation << " new: " << data.confirmation
|
||||
<< "\n answerText " << m_data.answerText << " new: " << data.answerText;
|
||||
|
||||
m_data.orderConfirmation = data.confirmation.underlying();
|
||||
m_data.orderConfirmation = data.confirmation;
|
||||
m_data.answerText = data.answerText;
|
||||
|
||||
if (!m_mainHandler->db()->update(m_data))
|
||||
@@ -190,7 +190,7 @@ bool ObjectEffectShow::updateObject(const Database::EsmEffectShow &data)
|
||||
//=============================================================================
|
||||
bool ObjectEffectShow::resetOrderConfirmation()
|
||||
{
|
||||
m_data.orderConfirmation = EffectShowManagement::OrderConfirmation_e_def::WaitingForAcceptance;
|
||||
m_data.orderConfirmation = EffectShowManagement::OrderConfirmation_e::WaitingForAcceptance;
|
||||
m_data.answerText.clear();
|
||||
|
||||
if (!m_mainHandler->db()->update(m_data))
|
||||
@@ -265,27 +265,27 @@ ConvertToTab::EffectShowContinue_t ObjectEffectShow::getContinueOrder() const
|
||||
void ObjectEffectShow::onPublishData()
|
||||
{
|
||||
EffectShowManagement::EffectShow ddsData;
|
||||
ddsData.id(m_data.id);
|
||||
ddsData.name(m_data.name.toStdString());
|
||||
ddsData.startTime(m_data.startTime);
|
||||
ddsData.duration(m_data.duration);
|
||||
ddsData.idAreaEffectSimulation(m_data.idAreaEffectSimulation);
|
||||
ddsData.nameAreaEffectSimulation(m_data.nameAreaEfffectSimulation.toStdString());
|
||||
ddsData.esmParticipantId(m_data.esmParticipantId);
|
||||
ddsData.position() = Core::GeoPosition2D(m_data.centerPosition.x(), m_data.centerPosition.y());
|
||||
ddsData.numOfVolley(m_data.numOfVolley);
|
||||
ddsData.shotsPerVolley(m_data.shotsPerVolley);
|
||||
ddsData.id = m_data.id;
|
||||
ddsData.name = m_data.name.toStdString();
|
||||
ddsData.startTime = m_data.startTime;
|
||||
ddsData.duration = m_data.duration;
|
||||
ddsData.idAreaEffectSimulation = m_data.idAreaEffectSimulation;
|
||||
ddsData.nameAreaEffectSimulation = m_data.nameAreaEfffectSimulation.toStdString();
|
||||
ddsData.esmParticipantId = m_data.esmParticipantId;
|
||||
ddsData.position = Core::GeoPosition2D(m_data.centerPosition.x(), m_data.centerPosition.y());
|
||||
ddsData.numOfVolley = m_data.numOfVolley;
|
||||
ddsData.shotsPerVolley = m_data.shotsPerVolley;
|
||||
//we need this for the smoke type
|
||||
ddsData.lowerLeftPosition() = Core::GeoPosition2D(m_data.lowerLeftPosition.x(), m_data.lowerLeftPosition.y());
|
||||
ddsData.areaDepth(m_data.areaDepth);
|
||||
ddsData.areaWidth(m_data.areaWidth);
|
||||
ddsData.areaRotation(m_data.areaRotation);
|
||||
ddsData.typeOfAmmunition(m_data.typeOfAmmunition);
|
||||
ddsData.lowerLeftPosition = Core::GeoPosition2D(m_data.lowerLeftPosition.x(), m_data.lowerLeftPosition.y());
|
||||
ddsData.areaDepth = m_data.areaDepth;
|
||||
ddsData.areaWidth = m_data.areaWidth;
|
||||
ddsData.areaRotation = m_data.areaRotation;
|
||||
ddsData.typeOfAmmunition = m_data.typeOfAmmunition;
|
||||
|
||||
ddsData.orderConfirmation(EffectShowManagement::OrderConfirmation_e::inner_enum(m_data.orderConfirmation));
|
||||
ddsData.answerText(m_data.answerText.toStdString());
|
||||
ddsData.isDeleted(false);
|
||||
ddsData.isUsed(false);
|
||||
ddsData.orderConfirmation = EffectShowManagement::OrderConfirmation_e::inner_enum(m_data.orderConfirmation);
|
||||
ddsData.answerText = m_data.answerText.toStdString();
|
||||
ddsData.isDeleted = false;
|
||||
ddsData.isUsed = false;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user