Migrates remaining services and plugins to generated rtiddsgen API
Converts accessor calls to plain member access across the residual service set.
This commit is contained in:
104 files changed
+2424
-2430
No files matched your search
+49
-49
@@ -22,7 +22,7 @@ ObjectCodificationData::ObjectCodificationData(const std::shared_ptr<DdsHandler>
|
||||
|
||||
ObjectCodificationData::~ObjectCodificationData()
|
||||
{
|
||||
m_ddsHandler->dts()->removeCodificationDataByKey(m_ddsData.id());
|
||||
m_ddsHandler->dts()->removeCodificationDataByKey(m_ddsData.id);
|
||||
} // end of dtor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -31,9 +31,9 @@ Core::FunctionReplyObject ObjectCodificationData::createObject(const Codificatio
|
||||
DEBUG_LOG(m_logger) << "ObjectCodificationData::createObject()";
|
||||
|
||||
m_ddsData = ddsData;
|
||||
if (m_ddsData.id() <= 0)
|
||||
if (m_ddsData.id <= 0)
|
||||
{
|
||||
m_ddsData.isUsed(false);
|
||||
m_ddsData.isUsed = false;
|
||||
|
||||
Database::CodCodificationTable dbData;
|
||||
dbData = toDbData(ddsData);
|
||||
@@ -41,14 +41,14 @@ Core::FunctionReplyObject ObjectCodificationData::createObject(const Codificatio
|
||||
if (!m_dbHandler->db()->insert(dbData))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting codification_table data into database"));
|
||||
|
||||
m_ddsData.id(dbData.id);
|
||||
DEBUG_LOG(m_logger) << "New codificationTable id: " << m_ddsData.id();
|
||||
m_ddsData.id = dbData.id;
|
||||
DEBUG_LOG(m_logger) << "New codificationTable id: " << m_ddsData.id;
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_ddsData.id());
|
||||
return Core::FunctionReplyObject(m_ddsData.id);
|
||||
} // end of createObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -57,22 +57,22 @@ Core::FunctionReplyObject ObjectCodificationData::updateObject(const Codificatio
|
||||
DEBUG_LOG(m_logger) << "ObjectCodificationData::updateObject()";
|
||||
|
||||
if (!isValid())
|
||||
return Core::FunctionReplyObject(ddsData.id(), tr_lts("dds", "Object not valid/blocked"));
|
||||
return Core::FunctionReplyObject(ddsData.id, tr_lts("dds", "Object not valid/blocked"));
|
||||
|
||||
// convert request ddsData -> dbData
|
||||
Database::CodCodificationTable dbData;
|
||||
dbData = toDbData(ddsData);
|
||||
|
||||
if (!m_dbHandler->db()->update(dbData))
|
||||
return Core::FunctionReplyObject(ddsData.id(), tr_lts("dds", "Error updating codification_table data in database"));
|
||||
return Core::FunctionReplyObject(ddsData.id, tr_lts("dds", "Error updating codification_table data in database"));
|
||||
// update internal objectdata
|
||||
m_ddsData = ddsData;
|
||||
DEBUG_LOG(m_logger) << "Data changed for codification_table id: " << m_ddsData.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for codification_table id: " << m_ddsData.id;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_ddsData.id());
|
||||
return Core::FunctionReplyObject(m_ddsData.id);
|
||||
|
||||
} // end of updateObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -82,21 +82,21 @@ Core::FunctionReplyObject ObjectCodificationData::removeObject()
|
||||
DEBUG_LOG(m_logger) << "ObjectCodificationData::removeObject()";
|
||||
|
||||
if (isUsed())
|
||||
return Core::FunctionReplyObject(m_ddsData.id(), tr_lts("dds", "codification_table data still in use"));
|
||||
return Core::FunctionReplyObject(m_ddsData.id, tr_lts("dds", "codification_table data still in use"));
|
||||
|
||||
if (!m_dbHandler->db()->removeCodCodificationTable(m_ddsData.id()))
|
||||
return Core::FunctionReplyObject(m_ddsData.id(), tr_lts("dds", "codification_table with id %1 can not be removed")).arg(m_ddsData.id());
|
||||
if (!m_dbHandler->db()->removeCodCodificationTable(m_ddsData.id))
|
||||
return Core::FunctionReplyObject(m_ddsData.id, tr_lts("dds", "codification_table with id %1 can not be removed")).arg(m_ddsData.id);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Removed codification_table id " << m_ddsData.id();
|
||||
m_ddsHandler->dts()->removeCodificationDataByKey(m_ddsData.id());
|
||||
DEBUG_LOG(m_logger) << "Removed codification_table id " << m_ddsData.id;
|
||||
m_ddsHandler->dts()->removeCodificationDataByKey(m_ddsData.id);
|
||||
|
||||
return Core::FunctionReplyObject(m_ddsData.id());
|
||||
return Core::FunctionReplyObject(m_ddsData.id);
|
||||
} // end of removeObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void ObjectCodificationData::onPublishData()
|
||||
{
|
||||
INFO_LOG(m_logger) << "Publish CodificationData data to dds (" << m_ddsData.id() << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish CodificationData data to dds (" << m_ddsData.id << ") ...";
|
||||
|
||||
if (!m_ddsHandler->dts()->publish(m_ddsData))
|
||||
ERROR_LOG(m_logger) << "Error publishing CodificationData data to dds";
|
||||
@@ -105,13 +105,13 @@ void ObjectCodificationData::onPublishData()
|
||||
|
||||
bool ObjectCodificationData::isValid() const
|
||||
{
|
||||
return m_ddsData.id() > 0;
|
||||
return m_ddsData.id > 0;
|
||||
} // end of isValid()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool ObjectCodificationData::isUsed() const
|
||||
{
|
||||
return m_ddsData.isUsed();
|
||||
return m_ddsData.isUsed;
|
||||
} // end of isUsed()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -120,24 +120,24 @@ CodificationManagement::CodificationData ObjectCodificationData::toDdsData(const
|
||||
{
|
||||
CodificationManagement::CodificationData ddsData;
|
||||
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.numeralCodeTableColumnIndex(dbData.numeralCodeTableColumnIndex.toStdString());
|
||||
ddsData.numeralCodeTableRowIndex(dbData.numeralCodeTableRowIndex.toStdString());
|
||||
ddsData.authenticationTableColumnIndex(dbData.authenticationTableColumnIndex.toStdString());
|
||||
ddsData.authenticationTableRowIndex(dbData.authenticationTableRowIndex.toStdString());
|
||||
ddsData.authenticationTableMatirx(dbData.authenticationTableMatirx.toStdString());
|
||||
ddsData.logisticalTermTableColumnIndex(dbData.logisticalTermTableColumnIndex.toStdString());
|
||||
ddsData.logisticalTermTableRowIndex(dbData.logisticalTermTableRowIndex.toStdString());
|
||||
ddsData.logisticalTermTableMatrix(dbData.logisticalTermTableMatrix.toStdString());
|
||||
ddsData.phraseTable(dbData.phraseTable.toStdString());
|
||||
ddsData.note(dbData.note.toStdString());
|
||||
ddsData.identifier(dbData.identifier.toStdString()),
|
||||
ddsData.validityTime(dbData.validityTime);
|
||||
ddsData.partyId(dbData.partyId);
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.numeralCodeTableColumnIndex = dbData.numeralCodeTableColumnIndex.toStdString();
|
||||
ddsData.numeralCodeTableRowIndex = dbData.numeralCodeTableRowIndex.toStdString();
|
||||
ddsData.authenticationTableColumnIndex = dbData.authenticationTableColumnIndex.toStdString();
|
||||
ddsData.authenticationTableRowIndex = dbData.authenticationTableRowIndex.toStdString();
|
||||
ddsData.authenticationTableMatirx = dbData.authenticationTableMatirx.toStdString();
|
||||
ddsData.logisticalTermTableColumnIndex = dbData.logisticalTermTableColumnIndex.toStdString();
|
||||
ddsData.logisticalTermTableRowIndex = dbData.logisticalTermTableRowIndex.toStdString();
|
||||
ddsData.logisticalTermTableMatrix = dbData.logisticalTermTableMatrix.toStdString();
|
||||
ddsData.phraseTable = dbData.phraseTable.toStdString();
|
||||
ddsData.note = dbData.note.toStdString();
|
||||
ddsData.identifier = dbData.identifier.toStdString(),
|
||||
ddsData.validityTime = dbData.validityTime;
|
||||
ddsData.partyId = dbData.partyId;
|
||||
|
||||
// init data not in db
|
||||
ddsData.isDeleted(false);
|
||||
ddsData.isUsed(false);
|
||||
ddsData.isDeleted = false;
|
||||
ddsData.isUsed = false;
|
||||
|
||||
return ddsData;
|
||||
} // end of toDdsData()
|
||||
@@ -147,20 +147,20 @@ Database::CodCodificationTable ObjectCodificationData::toDbData(const Codificati
|
||||
{
|
||||
Database::CodCodificationTable dbData;
|
||||
|
||||
dbData.id = ddsData.id();
|
||||
dbData.numeralCodeTableColumnIndex = QString::fromStdString(ddsData.numeralCodeTableColumnIndex());
|
||||
dbData.numeralCodeTableRowIndex = QString::fromStdString(ddsData.numeralCodeTableRowIndex());
|
||||
dbData.authenticationTableColumnIndex = QString::fromStdString(ddsData.authenticationTableColumnIndex());
|
||||
dbData.authenticationTableRowIndex = QString::fromStdString(ddsData.authenticationTableRowIndex());
|
||||
dbData.authenticationTableMatirx = QString::fromStdString(ddsData.authenticationTableMatirx());
|
||||
dbData.logisticalTermTableColumnIndex = QString::fromStdString(ddsData.logisticalTermTableColumnIndex());
|
||||
dbData.logisticalTermTableRowIndex = QString::fromStdString(ddsData.logisticalTermTableRowIndex());
|
||||
dbData.logisticalTermTableMatrix = QString::fromStdString(ddsData.logisticalTermTableMatrix());
|
||||
dbData.phraseTable = QString::fromStdString(ddsData.phraseTable());
|
||||
dbData.note = QString::fromStdString(ddsData.note());
|
||||
dbData.identifier = QString::fromStdString(ddsData.identifier());
|
||||
dbData.validityTime = ddsData.validityTime();
|
||||
dbData.partyId = ddsData.partyId();
|
||||
dbData.id = ddsData.id;
|
||||
dbData.numeralCodeTableColumnIndex = QString::fromStdString(ddsData.numeralCodeTableColumnIndex);
|
||||
dbData.numeralCodeTableRowIndex = QString::fromStdString(ddsData.numeralCodeTableRowIndex);
|
||||
dbData.authenticationTableColumnIndex = QString::fromStdString(ddsData.authenticationTableColumnIndex);
|
||||
dbData.authenticationTableRowIndex = QString::fromStdString(ddsData.authenticationTableRowIndex);
|
||||
dbData.authenticationTableMatirx = QString::fromStdString(ddsData.authenticationTableMatirx);
|
||||
dbData.logisticalTermTableColumnIndex = QString::fromStdString(ddsData.logisticalTermTableColumnIndex);
|
||||
dbData.logisticalTermTableRowIndex = QString::fromStdString(ddsData.logisticalTermTableRowIndex);
|
||||
dbData.logisticalTermTableMatrix = QString::fromStdString(ddsData.logisticalTermTableMatrix);
|
||||
dbData.phraseTable = QString::fromStdString(ddsData.phraseTable);
|
||||
dbData.note = QString::fromStdString(ddsData.note);
|
||||
dbData.identifier = QString::fromStdString(ddsData.identifier);
|
||||
dbData.validityTime = ddsData.validityTime;
|
||||
dbData.partyId = ddsData.partyId;
|
||||
|
||||
return dbData;
|
||||
} // end of toDbData()
|
||||
|
||||
Reference in new issue
Block a user