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
+273
-273
File diff suppressed because it is too large.
Load diff
+14
-14
@@ -155,7 +155,7 @@ QByteArray HandlerReportGetData::getUnitPowerResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -180,7 +180,7 @@ QByteArray HandlerReportGetData::getParticipantDistanceResult(int reportId) cons
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -204,7 +204,7 @@ QByteArray HandlerReportGetData::getMineAreaResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -232,7 +232,7 @@ QByteArray HandlerReportGetData::getNbcResult(int reportId) const
|
||||
|
||||
QJsonDocument doc(array);
|
||||
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -258,7 +258,7 @@ QByteArray HandlerReportGetData::getFiringsResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -287,7 +287,7 @@ QByteArray HandlerReportGetData::getAirSupportResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -313,7 +313,7 @@ QByteArray HandlerReportGetData::getChargeResupplyResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -340,7 +340,7 @@ QByteArray HandlerReportGetData::getChargeAdminResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -367,7 +367,7 @@ QByteArray HandlerReportGetData::getMaintenanceResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -409,7 +409,7 @@ QByteArray HandlerReportGetData::getTreatmentResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -435,7 +435,7 @@ QByteArray HandlerReportGetData::getBuildingDamageResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -496,7 +496,7 @@ QByteArray HandlerReportGetData::getSanitationMaterialResult(int reportId) const
|
||||
*/
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -516,7 +516,7 @@ QByteArray HandlerReportGetData::getSanNineLinerResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -546,5 +546,5 @@ QByteArray HandlerReportGetData::getTreatmentTimelineResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
+2
-2
@@ -88,8 +88,8 @@ bool HandlerReportData::generateMaintenanceResult(const CreateModifyReportReques
|
||||
qInsert.bindValue(QStringLiteral(":pTypeId"), vrData.participantTypeId);
|
||||
qInsert.bindValue(QStringLiteral(":participantId"), vrData.participantId);
|
||||
qInsert.bindValue(QStringLiteral(":participantName"), ppmDtc->hierarchyFromParticipant(vrData.participantId));
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber().is_set() ?
|
||||
participant.equipmentNumber().get() : 0);
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber.is_set() ?
|
||||
participant.equipmentNumber.get() : 0);
|
||||
|
||||
qInsert.bindValue(QStringLiteral(":time_event"), vrData.time_event);
|
||||
qInsert.bindValue(QStringLiteral(":time_position"), vrData.time_position_changed);
|
||||
|
||||
+2
-2
@@ -151,8 +151,8 @@ bool HandlerReportData::generateParticipantDistanceResult(const CreateModifyRepo
|
||||
qInsert.bindValue(QStringLiteral(":pTypeId"), typeId);
|
||||
qInsert.bindValue(QStringLiteral(":participantId"), partId);
|
||||
qInsert.bindValue(QStringLiteral(":participantName"), ppmDtc->hierarchyFromParticipant(partId));
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber().is_set() ?
|
||||
participant.equipmentNumber().get() : 0);
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber.is_set() ?
|
||||
participant.equipmentNumber.get() : 0);
|
||||
|
||||
// double dist = static_cast<double>(static_cast<int>(itt.value()*100+0.5))/100.0; // round to 2 decimals
|
||||
int dist = static_cast<int>(itt.value());
|
||||
|
||||
+7
-7
@@ -134,8 +134,8 @@ bool HandlerReportData::generateTreatmentResult(const CreateModifyReportRequest
|
||||
qInsert.bindValue(QStringLiteral(":pTypeId"), tData.participantTypeId);
|
||||
qInsert.bindValue(QStringLiteral(":participantId"), tData.participantId);
|
||||
qInsert.bindValue(QStringLiteral(":participantName"), ppmDtc->hierarchyFromParticipant(tData.participantId));
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber().is_set() ?
|
||||
participant.equipmentNumber().get() : 0);
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber.is_set() ?
|
||||
participant.equipmentNumber.get() : 0);
|
||||
qInsert.bindValue(QStringLiteral(":vitality"), tData.vitality);
|
||||
qInsert.bindValue(QStringLiteral(":vulnerability"), tData.vulnerability);
|
||||
qInsert.bindValue(QStringLiteral(":vbg"), tData.vulnerabilityState);
|
||||
@@ -186,12 +186,12 @@ bool HandlerReportData::generateTreatmentResult(const CreateModifyReportRequest
|
||||
DEBUG_LOG(m_logger) << "Initial Time enter area = " << tData.time_enter_area;
|
||||
DEBUG_LOG(m_logger) << "Initial Time 9 liner = " << tData.time_nine_liner;
|
||||
|
||||
//if (tData.time_treatment > 0 && participant.equipmentNumber().is_set())
|
||||
//if (tData.time_treatment > 0 && participant.equipmentNumber.is_set())
|
||||
// get FunctionalArea for participants with vulnerabilityState > 0, too
|
||||
if (participant.equipmentNumber().is_set())
|
||||
if (participant.equipmentNumber.is_set())
|
||||
{
|
||||
// re-calculate time enter in Functional Area
|
||||
QPair<int, qint64> fa = getNextFunctionalAreaEntry(participant.equipmentNumber().get(), tData.time_vulnerability);
|
||||
QPair<int, qint64> fa = getNextFunctionalAreaEntry(participant.equipmentNumber.get(), tData.time_vulnerability);
|
||||
qint64 time_enter_fa = fa.second;
|
||||
int area_id = fa.first;
|
||||
QString area_name;
|
||||
@@ -210,7 +210,7 @@ bool HandlerReportData::generateTreatmentResult(const CreateModifyReportRequest
|
||||
if (tData.time_treatment > 0 )
|
||||
{
|
||||
// recalculate time_nine_liner
|
||||
qint64 time_9liner = get9LinerTime(participant.equipmentNumber().get(), tData.time_vulnerability);
|
||||
qint64 time_9liner = get9LinerTime(participant.equipmentNumber.get(), tData.time_vulnerability);
|
||||
if (time_9liner > 0 && time_9liner != tData.time_nine_liner)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Re-calculated time 9 liner = " << time_9liner;
|
||||
@@ -218,7 +218,7 @@ bool HandlerReportData::generateTreatmentResult(const CreateModifyReportRequest
|
||||
}
|
||||
|
||||
// recalculate time_position_changed
|
||||
qint64 time_pos_changed = getPosChangedTime(participant.equipmentNumber().get(), tData.time_vulnerability);
|
||||
qint64 time_pos_changed = getPosChangedTime(participant.equipmentNumber.get(), tData.time_vulnerability);
|
||||
if (time_pos_changed > 0 && time_pos_changed != tData.time_position_changed)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Re-calculated time position changed = " << time_pos_changed;
|
||||
|
||||
+2
-2
@@ -109,8 +109,8 @@ bool HandlerReportData::generateTreatmentTimelineResult(const CreateModifyReport
|
||||
qInsert.bindValue(QStringLiteral(":pTypeId"), tData.participantTypeId);
|
||||
qInsert.bindValue(QStringLiteral(":participantId"), tData.participantId);
|
||||
qInsert.bindValue(QStringLiteral(":participantName"), ppmDtc->hierarchyFromParticipant(tData.participantId));
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber().is_set() ?
|
||||
participant.equipmentNumber().get() : 0);
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber.is_set() ?
|
||||
participant.equipmentNumber.get() : 0);
|
||||
qInsert.bindValue(QStringLiteral(":vitality"), tData.vitality);
|
||||
qInsert.bindValue(QStringLiteral(":vulnerability"), tData.vulnerability);
|
||||
qInsert.bindValue(QStringLiteral(":vbg"), tData.vulnerabilityState);
|
||||
|
||||
+147
-147
@@ -157,20 +157,20 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
|
||||
INFO_LOG(m_logger) << "trying to send createRequest Report";
|
||||
CreateModifyReportRequest request;
|
||||
|
||||
QString repName = QStringLiteral("Test Report - type ") + QString::number(repType.underlying());
|
||||
request.name(repName.toStdString());
|
||||
request.description("Test Report Description");
|
||||
request.reportType(repType);
|
||||
QString repName = QStringLiteral("Test Report - type ") + QString::number(repType);
|
||||
request.name = repName.toStdString();
|
||||
request.description = "Test Report Description";
|
||||
request.reportType = repType;
|
||||
|
||||
request.operatorId(m_operatorId);
|
||||
request.fileStatus(ReportManagement::FileStatus::Valid);
|
||||
request.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
request.operatorId = m_operatorId;
|
||||
request.fileStatus = ReportManagement::FileStatus::Valid;
|
||||
request.lastModified = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
// common request data
|
||||
request.startTime(QDateTime(QDate::currentDate().addYears(-2), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.endTime(QDateTime(QDate::currentDate().addDays(1), QTime(16, 30)).toMSecsSinceEpoch());
|
||||
request.startTime = QDateTime(QDate::currentDate().addYears(-2), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.endTime = QDateTime(QDate::currentDate().addDays(1), QTime(16, 30)).toMSecsSinceEpoch();
|
||||
if (repType != ReportType::Nbc) // && repType != ReportType::MineArea)
|
||||
request.partyId(2);
|
||||
request.partyId = 2;
|
||||
|
||||
// participant Ids
|
||||
std::vector<qint32> vecPartIds;
|
||||
@@ -184,7 +184,7 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
|
||||
vecPartIds[6] = 13;
|
||||
vecPartIds[7] = 14;
|
||||
vecPartIds[8] = 15;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
// participant types
|
||||
std::vector<qint32> vecPartTypes;
|
||||
@@ -193,135 +193,135 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
|
||||
vecPartTypes[0] = 55;
|
||||
vecPartTypes[1] = 74;
|
||||
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
switch (repType.underlying())
|
||||
switch (repType)
|
||||
{
|
||||
case ReportManagement::ReportType::UnitPower:
|
||||
{
|
||||
request.startTime(QDateTime(QDate::currentDate().addYears(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.startTime(QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.intervalTime(7200000); // 120 min
|
||||
request.visualisationType(ReportManagement::VisualisationType::Line);
|
||||
request.groupByParty(false);
|
||||
request.startTime = QDateTime(QDate::currentDate().addYears(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.startTime = QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.intervalTime = 7200000; // 120 min
|
||||
request.visualisationType = ReportManagement::VisualisationType::Line;
|
||||
request.groupByParty = false;
|
||||
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::ParticipantDistance:
|
||||
{
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::MineArea:
|
||||
{
|
||||
request.mineAreaIds().resize(1);
|
||||
request.mineAreaIds()[0] = 2;
|
||||
request.mineAreaIds.resize(1);
|
||||
request.mineAreaIds[0] = 2;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::Nbc:
|
||||
{
|
||||
request.nbcIds().resize(1);
|
||||
request.nbcIds()[0] = 3;
|
||||
request.nbcIds.resize(1);
|
||||
request.nbcIds[0] = 3;
|
||||
|
||||
request.chargeTypeIds().resize(1);
|
||||
request.chargeTypeIds()[0] = 341;
|
||||
request.chargeTypeIds.resize(1);
|
||||
request.chargeTypeIds[0] = 341;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::Firings:
|
||||
{
|
||||
request.startTime(QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.startTime = QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
// request.intervalTime(1800000); // 30 min
|
||||
|
||||
request.intervalTime(0);
|
||||
request.chargeTypeIds().resize(2);
|
||||
request.chargeTypeIds()[0] = 38;
|
||||
request.chargeTypeIds()[1] = 39;
|
||||
request.intervalTime = 0;
|
||||
request.chargeTypeIds.resize(2);
|
||||
request.chargeTypeIds[0] = 38;
|
||||
request.chargeTypeIds[1] = 39;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::AirSupport:
|
||||
{
|
||||
request.startTime(QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.partyId(4);
|
||||
request.startTime = QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.partyId = 4;
|
||||
|
||||
vecPartIds.resize(3);
|
||||
vecPartIds[0] = 52;
|
||||
vecPartIds[1] = 53;
|
||||
vecPartIds[2] = 54;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
vecPartTypes.resize(2);
|
||||
|
||||
vecPartTypes[0] = 57;
|
||||
vecPartTypes[1] = 78;
|
||||
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
request.intervalTime(0);
|
||||
request.chargeTypeIds().resize(4);
|
||||
request.chargeTypeIds()[0] = 471;
|
||||
request.chargeTypeIds()[1] = 472;
|
||||
request.chargeTypeIds()[2] = 473;
|
||||
request.chargeTypeIds()[3] = 474;
|
||||
request.intervalTime = 0;
|
||||
request.chargeTypeIds.resize(4);
|
||||
request.chargeTypeIds[0] = 471;
|
||||
request.chargeTypeIds[1] = 472;
|
||||
request.chargeTypeIds[2] = 473;
|
||||
request.chargeTypeIds[3] = 474;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::ExplosiveDevice:
|
||||
{
|
||||
request.startTime(QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.partyId(3);
|
||||
request.startTime = QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.partyId = 3;
|
||||
|
||||
vecPartIds.resize(3);
|
||||
vecPartIds[0] = 30;
|
||||
vecPartIds[1] = 31;
|
||||
vecPartIds[2] = 32;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
vecPartTypes.resize(2);
|
||||
|
||||
vecPartTypes[0] = 77;
|
||||
vecPartTypes[1] = 78;
|
||||
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
request.intervalTime(0);
|
||||
request.chargeTypeIds().resize(3);
|
||||
request.chargeTypeIds()[0] = 48;
|
||||
request.chargeTypeIds()[1] = 49;
|
||||
request.chargeTypeIds()[2] = 70;
|
||||
request.intervalTime = 0;
|
||||
request.chargeTypeIds.resize(3);
|
||||
request.chargeTypeIds[0] = 48;
|
||||
request.chargeTypeIds[1] = 49;
|
||||
request.chargeTypeIds[2] = 70;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::ChargeResupply:
|
||||
{
|
||||
request.chargeTypeIds().resize(2);
|
||||
request.chargeTypeIds()[0] = 38;
|
||||
request.chargeTypeIds()[1] = 39;
|
||||
request.chargeTypeIds.resize(2);
|
||||
request.chargeTypeIds[0] = 38;
|
||||
request.chargeTypeIds[1] = 39;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::ChargeAdministration:
|
||||
{
|
||||
request.startTime(QDateTime(QDate::currentDate().addMonths(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.chargeTypeIds().resize(2);
|
||||
request.chargeTypeIds()[0] = 371;
|
||||
request.chargeTypeIds()[1] = 372;
|
||||
request.startTime = QDateTime(QDate::currentDate().addMonths(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.chargeTypeIds.resize(2);
|
||||
request.chargeTypeIds[0] = 371;
|
||||
request.chargeTypeIds[1] = 372;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -333,117 +333,117 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
|
||||
vecPartIds[0] = 30;
|
||||
vecPartIds[1] = 31;
|
||||
vecPartIds[2] = 32;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
// participant types
|
||||
vecPartTypes.clear();
|
||||
vecPartTypes.resize(2);
|
||||
vecPartTypes[0] = 77;
|
||||
vecPartTypes[1] = 78;
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::Decontamination:
|
||||
{
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::Treatment:
|
||||
{
|
||||
request.startTime() = 1594218400000;
|
||||
request.endTime() = 1594219400000;
|
||||
request.startTime = 1594218400000;
|
||||
request.endTime = 1594219400000;
|
||||
|
||||
vecPartIds.clear();
|
||||
vecPartIds.resize(3);
|
||||
vecPartIds[0] = 5;
|
||||
vecPartIds[1] = 6;
|
||||
vecPartIds[2] = 7;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
vecPartTypes.clear();
|
||||
vecPartTypes.resize(1);
|
||||
vecPartTypes[0] = 55;
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::TreatmentChain:
|
||||
{
|
||||
request.startTime() = 1594218400000;
|
||||
request.endTime() = 1594219400000;
|
||||
request.startTime = 1594218400000;
|
||||
request.endTime = 1594219400000;
|
||||
|
||||
vecPartIds.clear();
|
||||
vecPartIds.resize(3);
|
||||
vecPartIds[0] = 5;
|
||||
vecPartIds[1] = 6;
|
||||
vecPartIds[2] = 7;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
vecPartTypes.clear();
|
||||
vecPartTypes.resize(1);
|
||||
vecPartTypes[0] = 55;
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Bar);
|
||||
request.groupByParty(false);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Bar;
|
||||
request.groupByParty = false;
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::TreatmentTimeline:
|
||||
{
|
||||
request.startTime() = 1646118000000;
|
||||
request.endTime() = 1646118010000;
|
||||
request.startTime = 1646118000000;
|
||||
request.endTime = 1646118010000;
|
||||
|
||||
vecPartIds.clear();
|
||||
vecPartIds.resize(2);
|
||||
vecPartIds[0] = 5;
|
||||
vecPartIds[1] = 6;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
vecPartTypes.clear();
|
||||
vecPartTypes.resize(1);
|
||||
vecPartTypes[0] = 55;
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
request.visualisationType(visType);
|
||||
request.groupByParty(true);
|
||||
request.visualisationType = visType;
|
||||
request.groupByParty = true;
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::TreatmentPriority:
|
||||
{
|
||||
request.startTime() = 1594218400000;
|
||||
request.endTime() = 1594219400000;
|
||||
request.startTime = 1594218400000;
|
||||
request.endTime = 1594219400000;
|
||||
|
||||
vecPartIds.clear();
|
||||
vecPartIds.resize(3);
|
||||
vecPartIds[0] = 5;
|
||||
vecPartIds[1] = 6;
|
||||
vecPartIds[2] = 7;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
vecPartTypes.clear();
|
||||
vecPartTypes.resize(1);
|
||||
vecPartTypes[0] = 55;
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
request.cornerBottomLeft().lon(0.09);
|
||||
request.cornerBottomLeft().lat(0.245);
|
||||
request.width(40000);
|
||||
request.height(100000);
|
||||
request.cornerBottomLeft.lon = 0.09;
|
||||
request.cornerBottomLeft.lat = 0.245;
|
||||
request.width = 40000;
|
||||
request.height = 100000;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
break;
|
||||
}
|
||||
|
||||
case ReportManagement::ReportType::BuildingDamage:
|
||||
{
|
||||
request.startTime(QDateTime(QDate::currentDate().addMonths(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.chargeTypeIds().resize(1);
|
||||
request.chargeTypeIds()[0] = 301; // building Id
|
||||
request.startTime = QDateTime(QDate::currentDate().addMonths(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.chargeTypeIds.resize(1);
|
||||
request.chargeTypeIds[0] = 301; // building Id
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -452,31 +452,31 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
|
||||
|
||||
// request.startTime(QDateTime(QDate::currentDate().addMonths(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
int noMaterials = 27;
|
||||
request.chargeTypeIds().resize(noMaterials);
|
||||
request.chargeTypeIds.resize(noMaterials);
|
||||
for (int i = 0; i < noMaterials; i++)
|
||||
request.chargeTypeIds()[i] = i+1;
|
||||
request.chargeTypeIds[i] = i+1;
|
||||
// request.chargeTypeIds().resize(1);
|
||||
// request.chargeTypeIds()[0] = 8;
|
||||
request.startTime(1650455273000);
|
||||
request.endTime(1651232873000);
|
||||
request.startTime = 1650455273000;
|
||||
request.endTime = 1651232873000;
|
||||
|
||||
vecPartIds.clear();
|
||||
vecPartTypes.clear();
|
||||
request.partyId(2);
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.partyId = 2;
|
||||
request.participantIds = vecPartIds;
|
||||
request.participantTypes = vecPartTypes;
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
break;
|
||||
}
|
||||
|
||||
case ReportManagement::ReportType::MedevacNineLiner:
|
||||
{
|
||||
request.cornerBottomLeft().lon(0.09);
|
||||
request.cornerBottomLeft().lat(0.245);
|
||||
request.width(40000);
|
||||
request.height(100000);
|
||||
request.startTime(QDateTime(QDate::currentDate().addMonths(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.cornerBottomLeft.lon = 0.09;
|
||||
request.cornerBottomLeft.lat = 0.245;
|
||||
request.width = 40000;
|
||||
request.height = 100000;
|
||||
request.startTime = QDateTime(QDate::currentDate().addMonths(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -504,31 +504,31 @@ void RepTests::tryModify()
|
||||
|
||||
CreateModifyReportRequest request;
|
||||
|
||||
request.id(m_reportId);
|
||||
request.name("Test Report Updated");
|
||||
request.description("Updated Description");
|
||||
request.id = m_reportId;
|
||||
request.name = "Test Report Updated";
|
||||
request.description = "Updated Description";
|
||||
|
||||
request.reportType(rep.reportType());
|
||||
request.description(rep.description());
|
||||
request.partyId(rep.partyId());
|
||||
request.startTime(rep.startTime());
|
||||
request.endTime(rep.endTime());
|
||||
request.visualisationType(rep.visualisationType());
|
||||
request.intervalTime(rep.intervalTime());
|
||||
request.chargeTypeIds(rep.chargeTypeIds());
|
||||
request.groupByParty(rep.groupByParty());
|
||||
request.mineAreaIds(rep.mineAreaIds());
|
||||
request.nbcIds(rep.nbcIds());
|
||||
request.participantIds(rep.participantIds());
|
||||
request.participantTypes(rep.participantTypes());
|
||||
request.unitIds(rep.unitIds());
|
||||
request.reportType = rep.reportType;
|
||||
request.description = rep.description;
|
||||
request.partyId = rep.partyId;
|
||||
request.startTime = rep.startTime;
|
||||
request.endTime = rep.endTime;
|
||||
request.visualisationType = rep.visualisationType;
|
||||
request.intervalTime = rep.intervalTime;
|
||||
request.chargeTypeIds = rep.chargeTypeIds;
|
||||
request.groupByParty = rep.groupByParty;
|
||||
request.mineAreaIds = rep.mineAreaIds;
|
||||
request.nbcIds = rep.nbcIds;
|
||||
request.participantIds = rep.participantIds;
|
||||
request.participantTypes = rep.participantTypes;
|
||||
request.unitIds = rep.unitIds;
|
||||
|
||||
request.operatorId(m_operatorId);
|
||||
request.fileStatus(ReportManagement::FileStatus::Valid);
|
||||
request.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
request.operatorId = m_operatorId;
|
||||
request.fileStatus = ReportManagement::FileStatus::Valid;
|
||||
request.lastModified = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
DEBUG_LOG(m_logger) << "Start modify";
|
||||
DEBUG_LOG(m_logger) << "Report type = " << rep.reportType();
|
||||
DEBUG_LOG(m_logger) << "Report type = " << rep.reportType;
|
||||
|
||||
if (!m_ftc->createModifyReportRequest(request, this))
|
||||
{
|
||||
@@ -545,8 +545,8 @@ void RepTests::tryGetData()
|
||||
DEBUG_LOG(m_logger) << "trying to send get data request for report Id = " << m_reportId;
|
||||
GetReportDataRequest request;
|
||||
|
||||
request.reportId(m_reportId);
|
||||
request.reportType(ReportManagement::ReportType::ChargeAdministration);
|
||||
request.reportId = m_reportId;
|
||||
request.reportType = ReportManagement::ReportType::ChargeAdministration;
|
||||
|
||||
if (!m_ftc->getReportDataRequest(request, this))
|
||||
{
|
||||
@@ -563,10 +563,10 @@ void RepTests::tryChangeStatus()
|
||||
DEBUG_LOG(m_logger) << "trying to send change status request for report Id = " << m_reportId;
|
||||
ReportChangeStatusRequest request;
|
||||
|
||||
request.id(m_reportId);
|
||||
request.operatorId(m_operatorId);
|
||||
request.fileStatus(ReportManagement::FileStatus::Deleted);
|
||||
request.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
request.id = m_reportId;
|
||||
request.operatorId = m_operatorId;
|
||||
request.fileStatus = ReportManagement::FileStatus::Deleted;
|
||||
request.lastModified = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
if (!m_ftc->reportChangeStatusRequest(request, this))
|
||||
{
|
||||
@@ -592,14 +592,14 @@ void RepTests::tryDelete()
|
||||
void RepTests::onCreateModifyReportReply(const CreateModifyReportReply &replyObject)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "END (onCreateModifyReportReply)";
|
||||
if (replyObject.errorString().size() > 0)
|
||||
if (replyObject.errorString.size() > 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Got onCreateModifyReportReply error: " << replyObject.errorString();
|
||||
ERROR_LOG(m_logger) << "Got onCreateModifyReportReply error: " << replyObject.errorString;
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
INFO_LOG(m_logger) << "Got createModifyReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.errorString();
|
||||
INFO_LOG(m_logger) << "Got createModifyReply with id " << replyObject.id
|
||||
<< " and errorString " << replyObject.errorString;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
@@ -620,16 +620,16 @@ void RepTests::onRemoveReportReply(const Core::FunctionReplyObject &replyObject)
|
||||
void RepTests::onGetReportDataReply(const GetReportDataReply &replyObject)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "END (onGetReportDataReply)";
|
||||
if (replyObject.errorString().size() > 0)
|
||||
if (replyObject.errorString.size() > 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Got onGetReportDataReply error: " << replyObject.errorString();
|
||||
ERROR_LOG(m_logger) << "Got onGetReportDataReply error: " << replyObject.errorString;
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.errorString();
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id
|
||||
<< " and errorString " << replyObject.errorString;
|
||||
|
||||
QByteArray reportData = LtsUtils::toQByteArray(replyObject.reportData());
|
||||
QByteArray reportData = LtsUtils::toQByteArray(replyObject.reportData);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Size reportData: " << reportData.size();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user