Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -27,6 +27,7 @@ struct ReportAesEntry
int id() const { return _id; }
void setId(int newId) { _id = newId; }
private:
NGL::INGLLogger &m_logger;
int _id = 0;
};
@@ -30,6 +30,8 @@ public:
QVariant data(const QModelIndex &index, int role) const override;
private:
NGL::INGLLogger &m_logger;
LtsSession::LtsSession *m_session;
std::shared_ptr<InfrastructureManagement::Interface::Dtc> m_ismDtc;
ReportType m_reportType;
@@ -31,6 +31,8 @@ public:
QVariant data(const QModelIndex &index, int role) const override;
protected:
NGL::INGLLogger &m_logger;
bool isFiltered(const ProjectDataManagement::ChargeType &data, DataModification modType) const override;
private:
@@ -29,6 +29,8 @@ public:
QVariant data(const QModelIndex &index, int role) const override;
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_pdmDtc;
ReportType m_reportType;
};
@@ -30,6 +30,8 @@ public:
QVariant data(const QModelIndex &index, int role) const override;
protected:
NGL::INGLLogger &m_logger;
bool isFiltered(const ParticipantManagement::Type &data, DataModification) const override;
private:
@@ -109,12 +109,12 @@ bool AirSupportModel::fetchInterfaces()
{
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
{
ERROR_LOG() << "Could not fetch PDM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface";
return false;
}
if (!m_session->getDtc<AreaEffectSimulation::DataInterface>(m_aesDtc))
{
ERROR_LOG() << "Could not fetch PDM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface";
return false;
}
return true;
@@ -328,7 +328,7 @@ QVariant AirSupportModel::headerData(int section, Qt::Orientation orientation, i
void AirSupportModel::fillReportData()
{
DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
int chargeTypeId = -1;
QMap<int, QVector<int> > sums;
@@ -350,10 +350,10 @@ void AirSupportModel::fillReportData()
resData.hits[2] = obj[QStringLiteral("hits")].toInt();
resData.hits[1] = resData.hits[2] + resData.hits[3] + resData.hits[0];
INFO_LOG() << "Charge type id = " << resData.chargeTypeId;
INFO_LOG() << "Start time = " << resData.startTime;
INFO_LOG() << "VulnerabilityState = " << resData.vulnerabilityState;
INFO_LOG() << "Hits = ("
INFO_LOG(m_logger) << "Charge type id = " << resData.chargeTypeId;
INFO_LOG(m_logger) << "Start time = " << resData.startTime;
INFO_LOG(m_logger) << "VulnerabilityState = " << resData.vulnerabilityState;
INFO_LOG(m_logger) << "Hits = ("
<< resData.hits[0] << ", "
<< resData.hits[1] << ", "
<< resData.hits[2] << ", "
@@ -362,7 +362,7 @@ void AirSupportModel::fillReportData()
if (chargeTypeId != resData.chargeTypeId)
{
DEBUG_LOG() << "New chargeTypeId: " << resData.chargeTypeId;
DEBUG_LOG(m_logger) << "New chargeTypeId: " << resData.chargeTypeId;
if (chargeTypeId != -1)
{
resultDataTable totalChargeTypeId;
@@ -380,7 +380,7 @@ void AirSupportModel::fillReportData()
}
else
{
DEBUG_LOG() << "Adding values to chargeType id: " << chargeTypeId;
DEBUG_LOG(m_logger) << "Adding values to chargeType id: " << chargeTypeId;
resData.hits[4] = 0;
sumUp(sums[chargeTypeId], resData.hits, resData.hits.size());
}
@@ -414,7 +414,7 @@ void AirSupportModel::fillReportData()
void AirSupportModel::fillPieData()
{
DEBUG_LOG() << "fillPieData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillPieData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
QMap<QPair<int,double>, QVector<int> > sums;
@@ -430,9 +430,9 @@ void AirSupportModel::fillPieData()
resPieData.hits[2] = obj[QStringLiteral("hits")].toInt();
resPieData.hits[1] = resPieData.hits[2] + resPieData.hits[3];
INFO_LOG() << "Charge type id = " << resPieData.chargeTypeId;
INFO_LOG() << "Start time = " << resPieData.startTime;
INFO_LOG() << "Hits = ("
INFO_LOG(m_logger) << "Charge type id = " << resPieData.chargeTypeId;
INFO_LOG(m_logger) << "Start time = " << resPieData.startTime;
INFO_LOG(m_logger) << "Hits = ("
<< resPieData.hits[0] << ", "
<< resPieData.hits[1] << ", "
<< resPieData.hits[2] << ", "
@@ -458,10 +458,10 @@ void AirSupportModel::fillPieData()
resPie.startTime = key.second;
resPie.hits = sums[key];
INFO_LOG() << "ChargeType: " << resPie.chargeTypeId;
INFO_LOG() << "StartTime: " << resPie.startTime;
INFO_LOG(m_logger) << "ChargeType: " << resPie.chargeTypeId;
INFO_LOG(m_logger) << "StartTime: " << resPie.startTime;
for(int i = 0; i < resPie.hits.size(); ++i)
INFO_LOG() << "Hits = ("
INFO_LOG(m_logger) << "Hits = ("
<< resPie.hits[0] << ", "
<< resPie.hits[1] << ", "
<< resPie.hits[2] << ", "
@@ -160,7 +160,7 @@ QVariant BuildingDamageModel::headerData(int section, Qt::Orientation orientatio
void BuildingDamageModel::fillReportData()
{
DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
for (const QJsonValue &arrVal : std::as_const(m_reportJsonArray))
{
@@ -176,10 +176,10 @@ void BuildingDamageModel::fillReportData()
resData.damages[4] = obj[QStringLiteral("damage_100")].toInt();
resData.buildingDamagePercent = obj[QStringLiteral("damage_percent")].toInt();
INFO_LOG() << "Building Id = " << resData.buildingId;
INFO_LOG() << "Time point = " << resData.timePoint;
INFO_LOG() << "Damages = " << resData.damages;
INFO_LOG() << "Building Damage Percent = " << resData.buildingDamagePercent;
INFO_LOG(m_logger) << "Building Id = " << resData.buildingId;
INFO_LOG(m_logger) << "Time point = " << resData.timePoint;
INFO_LOG(m_logger) << "Damages = " << resData.damages;
INFO_LOG(m_logger) << "Building Damage Percent = " << resData.buildingDamagePercent;
m_data.append(std::move(resData));
}
@@ -190,7 +190,7 @@ bool BuildingDamageModel::fetchInterfaces()
{
if (!m_session->getDtc<InfrastructureManagement::DataInterface>(m_ismDtc))
{
ERROR_LOG() << "Could not fetch ISM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch ISM DTC Interface";
return false;
}
return true;
@@ -57,7 +57,7 @@ bool ChargeAdministrationModel::fetchInterfaces()
{
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
{
ERROR_LOG() << "Could not fetch PDM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface";
return false;
}
return true;
@@ -184,7 +184,7 @@ QVariant ChargeAdministrationModel::headerData(int section, Qt::Orientation orie
void ChargeAdministrationModel::fillReportData()
{
DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
int sums[6] = {0, 0, 0, 0, 0, 0};
int bigTotal[6] = {0, 0, 0, 0, 0, 0};
@@ -204,15 +204,15 @@ void ChargeAdministrationModel::fillReportData()
resData.charges[4] = obj[QStringLiteral("charge_planned")].toInt();
resData.charges[5] = obj[QStringLiteral("charge_available")].toInt();
INFO_LOG() << "Charge type id = " << resData.chargeTypeId;
INFO_LOG() << "Effect Source id = " << resData.effectSourceId;
INFO_LOG() << "Charges = (" << resData.charges[0] << ", " << resData.charges[1] << ", " << resData.charges[2] << ", " << resData.charges[3] << ", "
INFO_LOG(m_logger) << "Charge type id = " << resData.chargeTypeId;
INFO_LOG(m_logger) << "Effect Source id = " << resData.effectSourceId;
INFO_LOG(m_logger) << "Charges = (" << resData.charges[0] << ", " << resData.charges[1] << ", " << resData.charges[2] << ", " << resData.charges[3] << ", "
<< resData.charges[4] << ", " << resData.charges[5] << ")";
if (effectSourceId != resData.effectSourceId)
{
DEBUG_LOG() << "New effectSourceId: " << resData.effectSourceId;
DEBUG_LOG(m_logger) << "New effectSourceId: " << resData.effectSourceId;
if (effectSourceId != ProjectDataManagement::EffectSource::ES_Unknown)
{
resultData totalEffectSource;
@@ -23,6 +23,8 @@ class ChargeAdministrationModel final : public AbstractModel
bool fetchInterfaces() override final;
private:
NGL::INGLLogger &m_logger;
explicit ChargeAdministrationModel(const ReportManagement::ReportInfo &report, LtsSession::LtsSession *session, QObject *parent);
void fillReportData() override final;
@@ -99,12 +99,12 @@ bool ChargeResupplyModel::fetchInterfaces()
{
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
{
ERROR_LOG() << "Could not fetch PDM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface";
return false;
}
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
ERROR_LOG() << "Could not fetch PPM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface";
return false;
}
return true;
@@ -251,7 +251,7 @@ QVariant ChargeResupplyModel::headerData(int section, Qt::Orientation orientatio
void ChargeResupplyModel::fillReportData()
{
DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
int participantTypeId = -1;
QMap<int, QVector<int> > sums;
@@ -271,9 +271,9 @@ void ChargeResupplyModel::fillReportData()
resData.charges[3] = obj[QStringLiteral("charge_end")].toInt();
resData.charges[4] = obj[QStringLiteral("charge_fired")].toInt();
INFO_LOG() << "Participant type id = " << resData.participantTypeId;
INFO_LOG() << "Charge type id = " << resData.chargeTypeId;
INFO_LOG() << "Charges = ("
INFO_LOG(m_logger) << "Participant type id = " << resData.participantTypeId;
INFO_LOG(m_logger) << "Charge type id = " << resData.chargeTypeId;
INFO_LOG(m_logger) << "Charges = ("
<< resData.charges[0] << ", "
<< resData.charges[1] << ", "
<< resData.charges[2] << ", "
@@ -282,7 +282,7 @@ void ChargeResupplyModel::fillReportData()
if (participantTypeId != resData.participantTypeId)
{
DEBUG_LOG() << "New participant type id: " << resData.participantTypeId;
DEBUG_LOG(m_logger) << "New participant type id: " << resData.participantTypeId;
if (participantTypeId != -1)
{
resultData totalType;
@@ -299,7 +299,7 @@ void ChargeResupplyModel::fillReportData()
}
else
{
DEBUG_LOG() << "Adding values to participant type id: " << participantTypeId;
DEBUG_LOG(m_logger) << "Adding values to participant type id: " << participantTypeId;
sumUp(sums[participantTypeId], resData.charges, resData.charges.size());
}
@@ -108,7 +108,7 @@ bool FiringsModel::fetchInterfaces()
{
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
{
ERROR_LOG() << "Could not fetch PDM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface";
return false;
}
return true;
@@ -314,7 +314,7 @@ QVariant FiringsModel::headerData(int section, Qt::Orientation orientation, int
void FiringsModel::fillReportData()
{
DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
int chargeTypeId = -1;
QMap<int, QVector<int> > sums;
@@ -335,10 +335,10 @@ void FiringsModel::fillReportData()
resData.hits[2] = obj[QStringLiteral("hits")].toInt();
resData.hits[1] = resData.hits[2] + resData.hits[3];
INFO_LOG() << "Charge type id = " << resData.chargeTypeId;
INFO_LOG() << "Start time = " << resData.startTime;
INFO_LOG() << "VulnerabilityState = " << resData.vulnerabilityState;
INFO_LOG() << "Hits = ("
INFO_LOG(m_logger) << "Charge type id = " << resData.chargeTypeId;
INFO_LOG(m_logger) << "Start time = " << resData.startTime;
INFO_LOG(m_logger) << "VulnerabilityState = " << resData.vulnerabilityState;
INFO_LOG(m_logger) << "Hits = ("
<< resData.hits[0] << ", "
<< resData.hits[1] << ", "
<< resData.hits[2] << ", "
@@ -346,7 +346,7 @@ void FiringsModel::fillReportData()
if (chargeTypeId != resData.chargeTypeId)
{
DEBUG_LOG() << "New charge type id: " << resData.chargeTypeId;
DEBUG_LOG(m_logger) << "New charge type id: " << resData.chargeTypeId;
if (chargeTypeId != -1)
{
resultDataTable totalChargeType;
@@ -364,7 +364,7 @@ void FiringsModel::fillReportData()
}
else
{
DEBUG_LOG() << "Adding values to charge type id: " << chargeTypeId;
DEBUG_LOG(m_logger) << "Adding values to charge type id: " << chargeTypeId;
sumUp(sums[chargeTypeId], resData.hits, resData.hits.size());
}
@@ -397,7 +397,7 @@ void FiringsModel::fillReportData()
void FiringsModel::fillPieData()
{
DEBUG_LOG() << "fillPieData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillPieData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
QMap<QPair<int,double>, QVector<int> > sums;
@@ -414,9 +414,9 @@ void FiringsModel::fillPieData()
resPieData.hits[2] = obj[QStringLiteral("hits")].toInt();
resPieData.hits[1] = resPieData.hits[2] + resPieData.hits[3];
INFO_LOG() << "Charge type id = " << resPieData.chargeTypeId;
INFO_LOG() << "Start time = " << resPieData.startTime;
INFO_LOG() << "Hits = ("
INFO_LOG(m_logger) << "Charge type id = " << resPieData.chargeTypeId;
INFO_LOG(m_logger) << "Start time = " << resPieData.startTime;
INFO_LOG(m_logger) << "Hits = ("
<< resPieData.hits[0] << ", "
<< resPieData.hits[1] << ", "
<< resPieData.hits[2] << ", "
@@ -440,10 +440,10 @@ void FiringsModel::fillPieData()
resPie.startTime = key.second;
resPie.hits = sums[key];
INFO_LOG() << "ChargeType: " << resPie.chargeTypeId;
INFO_LOG() << "StartTime: " << resPie.startTime;
INFO_LOG(m_logger) << "ChargeType: " << resPie.chargeTypeId;
INFO_LOG(m_logger) << "StartTime: " << resPie.startTime;
for(int i = 0; i < resPie.hits.size(); ++i)
INFO_LOG() << "Hits = ("
INFO_LOG(m_logger) << "Hits = ("
<< resPie.hits[0] << ", "
<< resPie.hits[1] << ", "
<< resPie.hits[2] << ", "
@@ -16,10 +16,9 @@
using namespace ReportManagement;
MaintenanceModel::MaintenanceModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent)
: AbstractModel(report, session, parent)
, m_ppmDtc(nullptr)
{
MaintenanceModel::MaintenanceModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent) : AbstractModel(report, session, parent)
, m_ppmDtc(nullptr),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
if (!fetchInterfaces())
return;
@@ -68,7 +67,7 @@ bool MaintenanceModel::fetchInterfaces()
{
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
ERROR_LOG() << "Could not fetch PPM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface";
return false;
}
return true;
@@ -197,7 +196,7 @@ QVariant MaintenanceModel::headerData(int section, Qt::Orientation orientation,
void MaintenanceModel::fillReportData()
{
DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
for (const QJsonValue &arrVal : std::as_const(m_reportJsonArray))
{
@@ -212,11 +211,11 @@ void MaintenanceModel::fillReportData()
resData.time_position = obj[QStringLiteral("time_position_changed")].toDouble();
resData.time_vulnerability = obj[QStringLiteral("time_vulnerability")].toDouble();
INFO_LOG() << "Participant id = " << resData.participantId;
INFO_LOG() << "Participant type id = " << resData.participantTypeId;
INFO_LOG() << "Time event = " << resData.time_event;
INFO_LOG() << "Time pos = " << resData.time_position;
INFO_LOG() << "Time vulnerability = " << resData.time_vulnerability;
INFO_LOG(m_logger) << "Participant id = " << resData.participantId;
INFO_LOG(m_logger) << "Participant type id = " << resData.participantTypeId;
INFO_LOG(m_logger) << "Time event = " << resData.time_event;
INFO_LOG(m_logger) << "Time pos = " << resData.time_position;
INFO_LOG(m_logger) << "Time vulnerability = " << resData.time_vulnerability;
m_data.append(std::move(resData));
}
@@ -52,7 +52,7 @@ bool MedevacNineLinerModel::fetchInterfaces()
{
if (!m_session->getDtc<Evaluations::DataInterface>(m_evlDtc))
{
ERROR_LOG() << "Could not fetch EVL DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch EVL DTC Interface";
return false;
}
return true;
@@ -162,7 +162,7 @@ QVariant MedevacNineLinerModel::headerData(int section, Qt::Orientation orientat
void MedevacNineLinerModel::fillReportData()
{
ERROR_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
ERROR_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
for (const QJsonValue &arrVal : std::as_const(m_reportJsonArray))
{
@@ -170,7 +170,7 @@ void MedevacNineLinerModel::fillReportData()
resultData resData;
resData.nineLinerId = obj[QStringLiteral("nine_liner_id")].toInt();
DEBUG_LOG() << "Nine Liner id = " << resData.nineLinerId;
DEBUG_LOG(m_logger) << "Nine Liner id = " << resData.nineLinerId;
Evaluations::SanNineLiner crtNineLiner = m_evlDtc->sanNineLiner(resData.nineLinerId);
if (crtNineLiner.id() <= 0 )
@@ -184,7 +184,7 @@ void MedevacNineLinerModel::fillReportData()
QVector<Evaluations::Database::SanCategoryLine> linesCategory = Evaluations::SanCategoryLine::fromJson(crtNineLiner.lines(), crtNineLiner.id());
INFO_LOG() << "linesCategory size: " << linesCategory.size();
INFO_LOG(m_logger) << "linesCategory size: " << linesCategory.size();
for (const Evaluations::Database::SanCategoryLine &cl : std::as_const(linesCategory))
{
@@ -72,7 +72,7 @@ bool MineAreaModel::fetchInterfaces()
{
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
ERROR_LOG() << "Could not fetch PPM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface";
return false;
}
return true;
@@ -203,7 +203,7 @@ QVariant MineAreaModel::headerData(int section, Qt::Orientation orientation, int
void MineAreaModel::fillReportData()
{
DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
int mineAreaId = -1;
QString mineAreaName;
@@ -223,10 +223,10 @@ void MineAreaModel::fillReportData()
resData.hits[2] = obj[QStringLiteral("hit_friendly_fire")].toInt();
resData.hits[1] = resData.hits[0] - resData.hits[2];
INFO_LOG() << "Mine area id = " << resData.mineAreaId;
INFO_LOG() << "Mine area name = " << resData.mineAreaName;
INFO_LOG() << "Participant type id = " << resData.participantTypeId;
INFO_LOG() << "Hits = ("
INFO_LOG(m_logger) << "Mine area id = " << resData.mineAreaId;
INFO_LOG(m_logger) << "Mine area name = " << resData.mineAreaName;
INFO_LOG(m_logger) << "Participant type id = " << resData.participantTypeId;
INFO_LOG(m_logger) << "Hits = ("
<< resData.hits[0] << ", "
<< resData.hits[1] << ", "
<< resData.hits[2] << ")" ;
@@ -105,12 +105,12 @@ bool NbcModel::fetchInterfaces()
{
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
ERROR_LOG() << "Could not fetch PPM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface";
return false;
}
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
{
ERROR_LOG() << "Could not fetch PDM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface";
return false;
}
return true;
@@ -256,7 +256,7 @@ QVariant NbcModel::headerData(int section, Qt::Orientation orientation, int role
void NbcModel::fillReportData()
{
DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
int nbcId = -1;
QString nbcName;
@@ -278,10 +278,10 @@ void NbcModel::fillReportData()
resData.hits[0] = obj[QStringLiteral("hit")].toInt();
resData.hits[1] = obj[QStringLiteral("protection")].toInt();
INFO_LOG() << "Nbc id = " << resData.nbcId;
INFO_LOG() << "Nbc name = " << resData.nbcName;
INFO_LOG() << "Participant type id = " << resData.participantTypeId;
INFO_LOG() << "Hits = ("
INFO_LOG(m_logger) << "Nbc id = " << resData.nbcId;
INFO_LOG(m_logger) << "Nbc name = " << resData.nbcName;
INFO_LOG(m_logger) << "Participant type id = " << resData.participantTypeId;
INFO_LOG(m_logger) << "Hits = ("
<< resData.hits[0] << ", "
<< resData.hits[1];
@@ -71,7 +71,7 @@ bool ParticipantDistanceModel::fetchInterfaces()
{
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
ERROR_LOG() << "Could not fetch PPM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface";
return false;
}
return true;
@@ -199,7 +199,7 @@ QVariant ParticipantDistanceModel::headerData(int section, Qt::Orientation orien
void ParticipantDistanceModel::fillReportData()
{
DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
int participantTypeId = -1;
long bigTotal = 0;
@@ -216,9 +216,9 @@ void ParticipantDistanceModel::fillReportData()
resData.participantEqNo = obj[QStringLiteral("participant_equipment_number")].toInt();
resData.distance = obj[QStringLiteral("distance")].toDouble();
INFO_LOG() << "Participant id = " << resData.participantId;
INFO_LOG() << "Participant type id = " << resData.participantTypeId;
INFO_LOG() << "Participant distance = " << resData.distance;
INFO_LOG(m_logger) << "Participant id = " << resData.participantId;
INFO_LOG(m_logger) << "Participant type id = " << resData.participantTypeId;
INFO_LOG(m_logger) << "Participant distance = " << resData.distance;
if (participantTypeId != resData.participantTypeId)
{
@@ -93,7 +93,7 @@ bool SanitationMaterialModel::fetchInterfaces()
{
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
{
ERROR_LOG() << "Could not fetch PDM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface";
return false;
}
return true;
@@ -235,7 +235,7 @@ QVariant SanitationMaterialModel::headerData(int section, Qt::Orientation orient
void SanitationMaterialModel::fillReportData()
{
DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
@@ -256,11 +256,11 @@ void SanitationMaterialModel::fillReportData()
resData.amounts[3] = obj[QStringLiteral("amount_used")].toInt();
resData.duration = obj[QStringLiteral("duration")].toDouble();
ERROR_LOG() << "Unique id = " << resData.uniqueId;
ERROR_LOG() << "qualification = " << resData.qualification;
ERROR_LOG() << "Material id = " << resData.materialId;
ERROR_LOG() << "Duration with no stock = " << resData.duration;
ERROR_LOG() << "Amounts = ("
ERROR_LOG(m_logger) << "Unique id = " << resData.uniqueId;
ERROR_LOG(m_logger) << "qualification = " << resData.qualification;
ERROR_LOG(m_logger) << "Material id = " << resData.materialId;
ERROR_LOG(m_logger) << "Duration with no stock = " << resData.duration;
ERROR_LOG(m_logger) << "Amounts = ("
<< resData.amounts[0] << ", "
<< resData.amounts[1] << ", "
<< resData.amounts[2] << ", "
@@ -291,7 +291,7 @@ void SanitationMaterialModel::fillReportData()
totalMatId.qualification = 0;
totalMatId.amounts = totals[matId];
DEBUG_LOG() << "Totals per material id = " << matId << " : "
DEBUG_LOG(m_logger) << "Totals per material id = " << matId << " : "
<< totalMatId.amounts[0] << ", "
<< totalMatId.amounts[1] << ", "
<< totalMatId.amounts[2] << ", "
@@ -20,11 +20,10 @@
using namespace ReportManagement;
TreatmentModel::TreatmentModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent)
: AbstractModel(report, session, parent)
TreatmentModel::TreatmentModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent) : AbstractModel(report, session, parent)
, m_ppmDtc(nullptr)
, m_pdmDtc(nullptr)
{
, m_pdmDtc(nullptr),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
if (!fetchInterfaces())
return;
@@ -115,12 +114,12 @@ bool TreatmentModel::fetchInterfaces()
{
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
ERROR_LOG() << "Could not fetch PPM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface";
return false;
}
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
{
ERROR_LOG() << "Could not fetch PDM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface";
return false;
}
return true;
@@ -252,7 +251,7 @@ QVariant TreatmentModel::data(const QModelIndex &index, int role) const
if (m_report.visualisationType() == VisualisationType::Bar && m_report.reportType() == ReportType::Treatment)
{
int sanResult = index.row();
DEBUG_LOG() << "SanRes = " << sanResult;
DEBUG_LOG(m_logger) << "SanRes = " << sanResult;
const resultDataPieEvaluation &pieInfo = m_bars[sanResult];
if (role == Qt::EditRole)
return pieInfo.groupId;
@@ -428,7 +427,7 @@ QVariant TreatmentModel::headerData(int section, Qt::Orientation orientation, in
void TreatmentModel::fillReportData()
{
DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
resultDataPie pie;
@@ -490,11 +489,11 @@ void TreatmentModel::fillReportData()
{
if (resData.timeTreatmentVulnerability < (10 * 60 * 1000))
resData.inbetween10Minutes = true;
DEBUG_LOG() << "qualification: " << resData.qualification;
DEBUG_LOG(m_logger) << "qualification: " << resData.qualification;
if (resData.timeTreatmentVulnerability < (60 * 60 * 1000) && resData.qualification == ParticipantManagement::Qualification_def::SANPers)
{
resData.goldenHour = true;
DEBUG_LOG() << "golden hour particpantId: " << resData.participantId;
DEBUG_LOG(m_logger) << "golden hour particpantId: " << resData.participantId;
}
}
if (resData.sanitationResult == ParticipantManagement::SanitationResult_def::Optimal)
@@ -505,7 +504,7 @@ void TreatmentModel::fillReportData()
int key = getParticipantKey(resData.participantId);
DEBUG_LOG() << "getParticipantKey: " << key;
DEBUG_LOG(m_logger) << "getParticipantKey: " << key;
countVulnerabilityState(key, resData);
@@ -533,12 +532,12 @@ void TreatmentModel::fillReportData()
if (resData.timeEnterArea <= 0)
{
DEBUG_LOG() << "1. not entered RS: " << resData.participantId;
DEBUG_LOG(m_logger) << "1. not entered RS: " << resData.participantId;
if (!m_rescueStationNotTreated[key].contains(resData.participantId) &&
!m_rescueStationTreated[key].contains(resData.participantId))
{
m_treatmentIntervalMap[key][PIE_notEnteredRecueArea].insert(resData.participantId);
DEBUG_LOG() << "2. not entered RS: " << resData.participantId;
DEBUG_LOG(m_logger) << "2. not entered RS: " << resData.participantId;
}
}
@@ -581,19 +580,19 @@ void TreatmentModel::fillReportData()
resDataTable.amountLightlyWounded = tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::LightDamage).size();
resDataTotal.amountLightlyWounded += resDataTable.amountLightlyWounded;
for ( int id : tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::LightDamage))
INFO_LOG() << "participantId: lightlyWouned: " << id;
INFO_LOG(m_logger) << "participantId: lightlyWouned: " << id;
resDataTable.amountMediumWounded = tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::MediumDamage).size();
resDataTotal.amountMediumWounded += resDataTable.amountMediumWounded;
for ( int id : tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::MediumDamage))
INFO_LOG() << "participantId: mediumWouned: " << id;
INFO_LOG(m_logger) << "participantId: mediumWouned: " << id;
resDataTable.amountHeavyWounded = tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::HeavyDamage).size();
resDataTotal.amountHeavyWounded += resDataTable.amountHeavyWounded;
for ( int id : tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::HeavyDamage))
INFO_LOG() << "participantId: heavyWouned: " << id;
INFO_LOG(m_logger) << "participantId: heavyWouned: " << id;
resDataTable.amountInjuryTotal = resDataTable.amountLightlyWounded + resDataTable.amountMediumWounded
@@ -607,7 +606,7 @@ void TreatmentModel::fillReportData()
for ( int id : tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::CatastrophicKill))
{
INFO_LOG() << "participantId: KIA: " << id;
INFO_LOG(m_logger) << "participantId: KIA: " << id;
m_rescueStationTreated[resDataTable.participantId].remove(id);
m_rescueStationNotTreated[resDataTable.participantId].remove(id);
}
@@ -618,7 +617,7 @@ void TreatmentModel::fillReportData()
for ( int id : tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::TemporarySeverance))
{
INFO_LOG() << "participantId: kiaAfterWia: " << id;
INFO_LOG(m_logger) << "participantId: kiaAfterWia: " << id;
m_rescueStationTreated[resDataTable.participantId].remove(id);
m_rescueStationNotTreated[resDataTable.participantId].remove(id);
}
@@ -627,7 +626,7 @@ void TreatmentModel::fillReportData()
resDataTable.amountTreated = m_treatmentAmount.value(resDataTable.participantId).size();
resDataTotal.amountTreated += resDataTable.amountTreated;
for ( int id : m_treatmentAmount.value(resDataTable.participantId))
INFO_LOG() << "participantId: treated " << id;
INFO_LOG(m_logger) << "participantId: treated " << id;
resDataTable.amountPlatin = m_treatmentIntervalMap[resDataTable.participantId][PIE_platin].size();
resDataTable.amountGoldenHour = m_treatmentIntervalMap[resDataTable.participantId][PIE_goldenHour].size();
@@ -645,13 +644,13 @@ void TreatmentModel::fillReportData()
resDataTable.amountEnterRescueStationNotTreated = m_rescueStationNotTreated.value(resDataTable.participantId).size();
resDataTotal.amountEnterRescueStationNotTreated += resDataTable.amountEnterRescueStationNotTreated;
for ( int id : m_rescueStationNotTreated.value(resDataTable.participantId))
INFO_LOG() << "participantId: in RescueStation - not treated: " << id;
INFO_LOG(m_logger) << "participantId: in RescueStation - not treated: " << id;
resDataTable.amountEnterRescueStationTreated = m_rescueStationTreated.value(resDataTable.participantId).size();
resDataTotal.amountEnterRescueStationTreated += resDataTable.amountEnterRescueStationTreated;
for ( int id : m_rescueStationTreated.value(resDataTable.participantId))
INFO_LOG() << "participantId: in RescueStation - treated: " << id;
INFO_LOG(m_logger) << "participantId: in RescueStation - treated: " << id;
m_dataTable.append(std::move(resDataTable));
}
@@ -664,7 +663,7 @@ void TreatmentModel::fillReportData()
for ( const QMap<int,QSet<int>> &map : std::as_const(m_treatmentIntervalMap))
{
INFO_LOG() << "not entered RS: " << map[PIE_notEnteredRecueArea].size();
INFO_LOG(m_logger) << "not entered RS: " << map[PIE_notEnteredRecueArea].size();
pie.results[PIE_platin] += map[PIE_platin].size();
pie.results[PIE_goldenHour] += map[PIE_goldenHour].size();
pie.results[PIE_notEnteredRecueArea] += map[PIE_notEnteredRecueArea].size();
@@ -682,28 +681,28 @@ void TreatmentModel::fillReportData()
for (auto it = m_bars.begin(); it != m_bars.end(); ++it)
{
resultDataPieEvaluation data = it.value();
DEBUG_LOG() << it.key() << ", GroupId = " << data.groupId << ", results = {" << data.results[0] << "," << data.results[1] << "," << data.results[2] << "}";
DEBUG_LOG(m_logger) << it.key() << ", GroupId = " << data.groupId << ", results = {" << data.results[0] << "," << data.results[1] << "," << data.results[2] << "}";
}
INFO_LOG() << "Pie Results: ";
INFO_LOG() << "Inbetween 10 min: " << pie.results[PIE_platin];
INFO_LOG() << "Golden Hour: " << pie.results[PIE_goldenHour];
INFO_LOG() << "KIA: " << pie.results[PIE_KIA];
INFO_LOG() << "Enter RS: " << pie.results[PIE_enterRescueArea];
INFO_LOG() << "Not Enter RS: " << pie.results[PIE_notEnteredRecueArea];
INFO_LOG() << "Total: " << pie.results[PIE_total];
INFO_LOG(m_logger) << "Pie Results: ";
INFO_LOG(m_logger) << "Inbetween 10 min: " << pie.results[PIE_platin];
INFO_LOG(m_logger) << "Golden Hour: " << pie.results[PIE_goldenHour];
INFO_LOG(m_logger) << "KIA: " << pie.results[PIE_KIA];
INFO_LOG(m_logger) << "Enter RS: " << pie.results[PIE_enterRescueArea];
INFO_LOG(m_logger) << "Not Enter RS: " << pie.results[PIE_notEnteredRecueArea];
INFO_LOG(m_logger) << "Total: " << pie.results[PIE_total];
for (auto it = m_vulnerabilityMap.begin(); it != m_vulnerabilityMap.end(); ++it)
{
INFO_LOG() << "UnitId: " << it.key();
INFO_LOG(m_logger) << "UnitId: " << it.key();
for (auto it2 = it.value().begin(); it2 != it.value().end(); ++it2)
INFO_LOG() << "VulnerabilityState: " << it2.key() << ", Count: " << it2.value().size();
INFO_LOG(m_logger) << "VulnerabilityState: " << it2.key() << ", Count: " << it2.value().size();
}
for (auto it = m_rescueStationTreated.begin(); it != m_rescueStationTreated.end(); ++it)
INFO_LOG() << "troupId: " << it.key() << ", amount RescueStation - treated: " << it.value().size();
INFO_LOG(m_logger) << "troupId: " << it.key() << ", amount RescueStation - treated: " << it.value().size();
for (auto it = m_rescueStationNotTreated.begin(); it != m_rescueStationNotTreated.end(); ++it)
INFO_LOG() << "troupId: " << it.key() << ", amount RescueStation - not treated: " << it.value().size();
INFO_LOG(m_logger) << "troupId: " << it.key() << ", amount RescueStation - not treated: " << it.value().size();
m_dataPie.append(std::move(pie));
@@ -716,7 +715,7 @@ void TreatmentModel::fillParticipantMap()
for (const Superior &sup : m_report.superiorIds())
m_partSuperiorMap.insert(sup.participantId(), sup.superiorId());
DEBUG_LOG() << "size m_partSuperiorMap: " << m_partSuperiorMap.size();
DEBUG_LOG(m_logger) << "size m_partSuperiorMap: " << m_partSuperiorMap.size();
QMapIterator<int,int> it(m_partSuperiorMap);
QList<int> unitIdsNull;
@@ -727,7 +726,7 @@ void TreatmentModel::fillParticipantMap()
if (it.value() == 0)
{
unitIdsNull.append(it.key());
DEBUG_LOG() << "unitId: " << it.key();
DEBUG_LOG(m_logger) << "unitId: " << it.key();
}
}
@@ -740,10 +739,10 @@ void TreatmentModel::fillParticipantMap()
m_participantMap.insert(it.key(), QSet<int>());
}
DEBUG_LOG() << "size m_participantMap: " << m_participantMap.size();
DEBUG_LOG(m_logger) << "size m_participantMap: " << m_participantMap.size();
const auto &ids = m_participantMap.keys();
for (int id : ids)
DEBUG_LOG() << "TroupId: " << id;
DEBUG_LOG(m_logger) << "TroupId: " << id;
it.toFront();
@@ -759,7 +758,7 @@ void TreatmentModel::fillParticipantMap()
while(it2.hasNext())
{
it2.next();
DEBUG_LOG() << "TroupId: " << it2.key();
DEBUG_LOG(m_logger) << "TroupId: " << it2.key();
QMap<int,QSet<int>> vulnMap;
QSet<int> partIds;
@@ -775,7 +774,7 @@ void TreatmentModel::fillParticipantMap()
m_rescueStationNotTreated.insert(it2.key(), partIds);
for (int participantId : it2.value())
DEBUG_LOG() << " Participants: " << participantId;
DEBUG_LOG(m_logger) << " Participants: " << participantId;
}
}
@@ -808,7 +807,7 @@ int TreatmentModel::getParticipantKey(int participantId)
while(it.hasNext())
{
it.next();
DEBUG_LOG() << "it.key: " << it.key() << ", participantId: " << participantId;
DEBUG_LOG(m_logger) << "it.key: " << it.key() << ", participantId: " << participantId;
if (it.value().contains(participantId) || it.key() == participantId)
{
key = it.key();
@@ -829,7 +828,7 @@ void TreatmentModel::countVulnerabilityState( int key, const resultData &data)
if ( key <= 0)
return;
DEBUG_LOG() << "key: " << key << ", participantId: " << data.participantId;
DEBUG_LOG(m_logger) << "key: " << key << ", participantId: " << data.participantId;
QMap<int,QSet<int>> vulMapTemp = m_vulnerabilityMap.value(key);
QMapIterator<int,QSet<int>> itVul(vulMapTemp);
@@ -18,11 +18,10 @@
using namespace ReportManagement;
TreatmentTimelineModel::TreatmentTimelineModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent)
: AbstractModel(report, session, parent)
TreatmentTimelineModel::TreatmentTimelineModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent) : AbstractModel(report, session, parent)
, m_ppmDtc(nullptr)
, m_pdmDtc(nullptr)
{
, m_pdmDtc(nullptr),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
if (!fetchInterfaces())
return;
@@ -137,12 +136,12 @@ bool TreatmentTimelineModel::fetchInterfaces()
{
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
ERROR_LOG() << "Could not fetch PPM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface";
return false;
}
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
{
ERROR_LOG() << "Could not fetch PDM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface";
return false;
}
return true;
@@ -311,7 +310,7 @@ QVariant TreatmentTimelineModel::headerData(int section, Qt::Orientation orienta
void TreatmentTimelineModel::fillReportData()
{
DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
for (const QJsonValue &arrVal : std::as_const(m_reportJsonArray))
{
@@ -329,11 +328,11 @@ void TreatmentTimelineModel::fillReportData()
resData.eventTypeId = static_cast<ReportManagement::EventType::type>(obj[QStringLiteral("event_type_id")].toInt());
resData.properties = obj[QStringLiteral("properties")].toString();
DEBUG_LOG() << "Participant type id = " << resData.participantTypeId;
DEBUG_LOG() << "Participant id = " << resData.participantId;
DEBUG_LOG() << "Event type = " << resData.eventTypeId;
DEBUG_LOG() << "Event time = " << resData.eventTime;
DEBUG_LOG() << "Properties = " << resData.properties;
DEBUG_LOG(m_logger) << "Participant type id = " << resData.participantTypeId;
DEBUG_LOG(m_logger) << "Participant id = " << resData.participantId;
DEBUG_LOG(m_logger) << "Event type = " << resData.eventTypeId;
DEBUG_LOG(m_logger) << "Event time = " << resData.eventTime;
DEBUG_LOG(m_logger) << "Properties = " << resData.properties;
m_data.append(std::move(resData));
}
@@ -342,7 +341,7 @@ void TreatmentTimelineModel::fillReportData()
QString TreatmentTimelineModel::getAreaName(const QString& properties) const
{
DEBUG_LOG() << "getAreaName from " << properties;
DEBUG_LOG(m_logger) << "getAreaName from " << properties;
QJsonDocument doc = QJsonDocument::fromJson(properties.toUtf8());
const QJsonObject obj = doc.object();
@@ -356,7 +355,7 @@ QString TreatmentTimelineModel::getAreaName(const QString& properties) const
QColor TreatmentTimelineModel::eventColor(ReportManagement::EventType eventTypeId) const
{
DEBUG_LOG() << "eventColor for event type " << eventTypeId;
DEBUG_LOG(m_logger) << "eventColor for event type " << eventTypeId;
switch (eventTypeId.underlying())
{
case ReportManagement::EventType::VBGChanged: return QColor(Qt::red);
@@ -376,7 +375,7 @@ QColor TreatmentTimelineModel::eventColor(ReportManagement::EventType eventTypeI
QString TreatmentTimelineModel::getSanProcs(const QString& properties) const
{
DEBUG_LOG() << "getSanProcs from " << properties;
DEBUG_LOG(m_logger) << "getSanProcs from " << properties;
QString sanProcs;
@@ -15,10 +15,9 @@
using namespace ReportManagement;
UnitPowerModel::UnitPowerModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent)
: AbstractModel(report, session, parent)
, m_ppmDtc(nullptr)
{
UnitPowerModel::UnitPowerModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent) : AbstractModel(report, session, parent)
, m_ppmDtc(nullptr),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
if (!fetchInterfaces())
return;
@@ -50,7 +49,7 @@ bool UnitPowerModel::fetchInterfaces()
{
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
ERROR_LOG() << "Could not fetch PPM DTC Interface";
ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface";
return false;
}
return true;
@@ -179,7 +178,7 @@ QVariant UnitPowerModel::headerData(int section, Qt::Orientation orientation, in
void UnitPowerModel::fillReportData()
{
DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size();
for (const QJsonValue &arrVal : std::as_const(m_reportJsonArray))
{
const QJsonObject obj = arrVal.toObject();
@@ -202,10 +201,10 @@ void UnitPowerModel::fillReportData()
resData.notReadyVbgs[9] = obj[QStringLiteral("vulnerability_state10")].toInt();
resData.notReadyVbgs[10] = obj[QStringLiteral("vulnerability_state11")].toInt();
INFO_LOG() << "Group id = " << resData.groupId;
INFO_LOG() << "Ready = " << resData.ready;
INFO_LOG() << "Not ready = " << resData.notReady;
INFO_LOG() << "Start time = " << resData.startTime;
INFO_LOG(m_logger) << "Group id = " << resData.groupId;
INFO_LOG(m_logger) << "Ready = " << resData.ready;
INFO_LOG(m_logger) << "Not ready = " << resData.notReady;
INFO_LOG(m_logger) << "Start time = " << resData.startTime;
m_data.append(std::move(resData));
}
@@ -66,7 +66,7 @@ ReportTopicEditor::~ReportTopicEditor()
void ReportTopicEditor::updateInternalData()
{
DEBUG_LOG() << Q_FUNC_INFO;
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
if (m_topicData.x < 0 && m_topicData.y < 0 && m_topicData.h < 0 && m_topicData.w < 0)
{
@@ -81,7 +81,7 @@ void ReportTopicEditor::updateInternalData()
if (m_reportId > 0)
{
DEBUG_LOG() << Q_FUNC_INFO << " report id = " << m_reportId;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " report id = " << m_reportId;
QModelIndex idx = m_reportModel->findIndexForId(m_reportId);
const ReportManagement::ReportInfo report = m_reportModel->getRowData(idx.row());
@@ -91,7 +91,7 @@ void ReportTopicEditor::updateInternalData()
m_ui->reportsDataView->selectRow(idx);
m_ui->lblName->setText(QString::fromStdString(report.name()));
m_reportInfo = m_reportModel->getRowData(idx.row());
DEBUG_LOG() << Q_FUNC_INFO << " selected report: " << m_reportInfo.name();
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " selected report: " << m_reportInfo.name();
}
else
{
@@ -36,6 +36,8 @@ public:
~ReportTopicEditor();
private:
NGL::INGLLogger &m_logger;
void updateInternalData() override final;
void retranslate() override final;
@@ -283,8 +283,8 @@ bool ReportEdit::init(const ReportInfo &currReport, LtsSession::LtsSession *sess
m_minDateTime -= m_minDateTime % 1000;
m_maxDateTime -= m_maxDateTime % 1000;
DEBUG_LOG() << "m_minDateTime = " << m_minDateTime;
DEBUG_LOG() << "m_maxDateTime = " << m_maxDateTime;
DEBUG_LOG(m_logger) << "m_minDateTime = " << m_minDateTime;
DEBUG_LOG(m_logger) << "m_maxDateTime = " << m_maxDateTime;
m_ui->dteStart->setRetrieveCurrentTimeCallback([this]() { return m_session->partitionTime(); });
m_ui->dteEnd->setRetrieveCurrentTimeCallback([this]() { return m_session->partitionTime(); });
@@ -1078,7 +1078,7 @@ bool ReportEdit::initInputs()
});
}
DEBUG_LOG() << "m_report effectSources size: " << m_report.effectSources().size();
DEBUG_LOG(m_logger) << "m_report effectSources size: " << m_report.effectSources().size();
if (!m_report.effectSources().empty())
{
QStringList toolTip;
@@ -1088,7 +1088,7 @@ bool ReportEdit::initInputs()
auto it = std::find(m_report.effectSources().begin(), m_report.effectSources().end(), effectSourceId.underlying());
if (it != m_report.effectSources().end())
{
DEBUG_LOG() << "To be checked: effectSourceId: " << effectSourceId;
DEBUG_LOG(m_logger) << "To be checked: effectSourceId: " << effectSourceId;
action->setChecked(true);
toolTip.append(ProjectDataManagement::toString(effectSourceId));
}
@@ -1113,7 +1113,7 @@ void ReportEdit::fillCbInterval()
else
{
int mins = m_report.intervalTime() / (1000 * 60);
DEBUG_LOG() << "Report interval mins " << mins;
DEBUG_LOG(m_logger) << "Report interval mins " << mins;
m_ui->cbInterval->setCurrentIndex(m_ui->cbInterval->findData(mins));
if (m_report.visualisationType() == VisualisationType::Pie || m_report.visualisationType() == VisualisationType::Table)
m_ui->cbInterval->setCurrentIndex(0);
@@ -1128,7 +1128,7 @@ void ReportEdit::getParticipantSuperiorAndUnitIds(std::vector<int> &participantI
if (!m_ui->treeViewParticipants->selectionModel())
return;
DEBUG_LOG() << "getParticipantAndUnitIds";
DEBUG_LOG(m_logger) << "getParticipantAndUnitIds";
const QModelIndexList &selIndexs = m_ui->treeViewParticipants->selectionModel()->selectedRows();
@@ -1179,7 +1179,7 @@ void ReportEdit::recursiveGetParticipant(int participantId, std::vector<int> &pa
const int superiorId = part.superiorModId();
ERROR_LOG() << "participantId: " << participantId << ", superiorId: " << superiorId;
ERROR_LOG(m_logger) << "participantId: " << participantId << ", superiorId: " << superiorId;
Superior sup;
sup.participantId(participantId);
sup.superiorId(superiorId);
@@ -1421,47 +1421,47 @@ bool ReportEdit::fetchInterfaces()
{
if (!m_session->getDtc<ReportManagement::DataInterface>(m_dtc))
{
ERROR_LOG() << "Cannot retrieve ReportManagament Dtc interface!";
ERROR_LOG(m_logger) << "Cannot retrieve ReportManagament Dtc interface!";
return false;
}
if (!m_session->getFtc<ReportManagement::DataInterface>(m_ftc))
{
ERROR_LOG() << "Cannot retrieve ReportManagament Ftc interface!";
ERROR_LOG(m_logger) << "Cannot retrieve ReportManagament Ftc interface!";
return false;
}
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
ERROR_LOG() << "Cannot retrieve ParticipantManagament Dtc interface!";
ERROR_LOG(m_logger) << "Cannot retrieve ParticipantManagament Dtc interface!";
return false;
}
if (!m_session->getFtc<ParticipantManagement::DataInterface>(m_ppmFtc))
{
ERROR_LOG() << "Cannot retrieve ParticipantManagament Ftc interface!";
ERROR_LOG(m_logger) << "Cannot retrieve ParticipantManagament Ftc interface!";
return false;
}
if (!m_session->getDtc<AreaEffectSimulation::DataInterface>(m_aesDtc))
{
ERROR_LOG() << "Cannot retrieve AreaEffectSimulation Dtc interface!";
ERROR_LOG(m_logger) << "Cannot retrieve AreaEffectSimulation Dtc interface!";
return false;
}
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
{
ERROR_LOG() << "Cannot retrieve ProjectDataManagement Dtc interface!";
ERROR_LOG(m_logger) << "Cannot retrieve ProjectDataManagement Dtc interface!";
return false;
}
if (!m_session->getForeignGuiInterface<ParticipantManagement::ForeignGuiComboboxInterface>(m_ppmGuiCbxIfc))
{
ERROR_LOG() << "Cannot retrieve ParticipantManagement ForeignGuiCombobox interface!";
ERROR_LOG(m_logger) << "Cannot retrieve ParticipantManagement ForeignGuiCombobox interface!";
return false;
}
if (!m_session->getDtc<InfrastructureManagement::DataInterface>(m_ismDtc))
{
ERROR_LOG() << "Cannot retrieve InfrastructureManagement Dtc interface!";
ERROR_LOG(m_logger) << "Cannot retrieve InfrastructureManagement Dtc interface!";
return false;
}
if (!m_session->getDtc<ExerciseManagement::DataInterface>(m_exmDtc))
{
ERROR_LOG() << "Cannot retrieve ExerciseManagement Dtc interface!";
ERROR_LOG(m_logger) << "Cannot retrieve ExerciseManagement Dtc interface!";
return false;
}
m_session->getForeignGuiInterface<SituationMap::ForeignGuiInterface>(m_sitMapGuiIfc);
@@ -1511,7 +1511,7 @@ bool ReportEdit::apply()
break;
}
}
WARNING_LOG() << "Too many samples to be generated, max = " << MAX_SAMPLES_KDAB;
WARNING_LOG(m_logger) << "Too many samples to be generated, max = " << MAX_SAMPLES_KDAB;
LtsWidgets::LtsMessageDialog::showMessage(this,
tr("Please limit time period and save again the report. Interval was changed to minimum value %1.")
.arg(m_ui->cbInterval->currentText().toInt()));
@@ -1603,7 +1603,7 @@ void ReportEdit::onCheck()
if ((m_ui->pbEffectSource->isVisible() && m_activeEffectSources.size() == 0))
enabled = false;
}
DEBUG_LOG() << "onCheck() : " << enabled;
DEBUG_LOG(m_logger) << "onCheck() : " << enabled;
m_buttonBox->getButton(LtsWidgets::DialogButton::Ok)->setEnabled(enabled);
if (enabled)
@@ -1691,13 +1691,13 @@ void ReportEdit::onCreateModifyReportReply(const CreateModifyReportReply &replyO
switch (replyObject.replyState().underlying())
{
case Core::FtReplyState::InProgress:
DEBUG_LOG() << "onCreateModifyReportReply InProgress";
DEBUG_LOG(m_logger) << "onCreateModifyReportReply InProgress";
m_ftcTimer->start();
break;
case Core::FtReplyState::Completed:
{
m_ftcTimer->stop();
DEBUG_LOG() << "onCreateModifyReportReply Completed";
DEBUG_LOG(m_logger) << "onCreateModifyReportReply Completed";
m_requestHelper->requestReply(replyObject);
if (!m_requestHelper->failed())
{
@@ -1715,12 +1715,12 @@ void ReportEdit::onCreateModifyReportReply(const CreateModifyReportReply &replyO
}
case Core::FtReplyState::NotStarted:
{
DEBUG_LOG() << "onCreateModifyReportReply NotStarted";
DEBUG_LOG(m_logger) << "onCreateModifyReportReply NotStarted";
break;
}
case Core::FtReplyState::Error:
{
DEBUG_LOG() << "onCreateModifyReportReply Error";
DEBUG_LOG(m_logger) << "onCreateModifyReportReply Error";
m_ftcTimer->stop();
m_requestHelper->requestReply(replyObject);
break;
@@ -1731,7 +1731,7 @@ void ReportEdit::onCreateModifyReportReply(const CreateModifyReportReply &replyO
void ReportEdit::onFtcTimerTimeout()
{
ERROR_LOG() << "onFtcTimerTimeout";
ERROR_LOG(m_logger) << "onFtcTimerTimeout";
m_requestHelper->failure();
m_ftcTimer->stop();
}
@@ -1739,13 +1739,13 @@ void ReportEdit::onFtcTimerTimeout()
void ReportEdit::onPreviewReport()
{
DEBUG_LOG() << "onPreviewReport";
DEBUG_LOG(m_logger) << "onPreviewReport";
ReportPreview *dialog = new ReportPreview(m_session, this);
if (dialog->init(m_report))
dialog->previewReport();
else
ERROR_LOG() << "Can not preview report!";
ERROR_LOG(m_logger) << "Can not preview report!";
}
@@ -1868,11 +1868,11 @@ void ReportEdit::onSelectInterval()
if (res != QDialog::Accepted)
{
delete dialog;
DEBUG_LOG() << "Select dialog closed by user";
DEBUG_LOG(m_logger) << "Select dialog closed by user";
return;
}
DEBUG_LOG() << "Set new values for start time = " << dialog->getStartTime();
DEBUG_LOG(m_logger) << "Set new values for start time = " << dialog->getStartTime();
m_ui->dteStart->setMsecsSinceEpoch(dialog->getStartTime());
m_ui->dteEnd->setMsecsSinceEpoch(dialog->getEndTime());
@@ -68,6 +68,8 @@ class ReportEdit
void onCreateModifyReportReply(const CreateModifyReportReply &replyObject) override final;
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
VisualisationType getVisualization() const;
bool initInputs();
@@ -34,7 +34,7 @@ bool ReportIntervalDialog::init(LtsSession::LtsSessionDataDds *session, const st
m_session = session;
m_exmDtc = exmDtc;
DEBUG_LOG() << "Exercise id = " << m_session->exerciseId();
DEBUG_LOG(m_logger) << "Exercise id = " << m_session->exerciseId();
m_phaseModel = new ReportIntervalModel(this);
m_phaseModel->initModel(m_session->exerciseId(), m_exmDtc);
@@ -63,8 +63,8 @@ void ReportIntervalDialog::selectPhase()
m_startTime = phase.beginTime();
m_endTime = phase.endTime();
ERROR_LOG() << "Start time: " << m_startTime;
ERROR_LOG() << "End time: " << m_endTime;
ERROR_LOG(m_logger) << "Start time: " << m_startTime;
ERROR_LOG(m_logger) << "End time: " << m_endTime;
accept();
close();
@@ -30,7 +30,7 @@ bool ReportIntervalModel::initModel(int exerciseId, const std::shared_ptr<Exerci
m_exmDtc->exercisePhases([this](const ExerciseManagement::ExercisePhase &item) { insertRow(item); });
INFO_LOG() << "initModel - #exercise phases: " << m_vecData.size();
INFO_LOG(m_logger) << "initModel - #exercise phases: " << m_vecData.size();
return true;
}
@@ -33,6 +33,8 @@ public:
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override final;
protected:
NGL::INGLLogger &m_logger;
bool isFiltered(const ExerciseManagement::ExercisePhase &data, DataModification modType) const override
{
if (data.exerciseId() != m_exerciseId)
@@ -143,14 +143,14 @@ void ReportList::onSelectionChanged()
void ReportList::onEditReport()
{
DEBUG_LOG() << "onEditReport";
DEBUG_LOG(m_logger) << "onEditReport";
QModelIndex selIndex = m_ui->widget->currentIndex();
if (!selIndex.isValid())
return;
ReportManagement::ReportInfo data = m_model->getRowData(m_ui->widget->currentIndex().row());
DEBUG_LOG() << "onEditReport Id = " << data.id();
DEBUG_LOG(m_logger) << "onEditReport Id = " << data.id();
ReportEdit *dialog = new ReportEdit(m_session, this);
if (!dialog->init(data, m_session))
@@ -165,14 +165,14 @@ void ReportList::onEditReport()
void ReportList::onShowReport()
{
DEBUG_LOG() << "onShowReport";
DEBUG_LOG(m_logger) << "onShowReport";
QModelIndex selIndex = m_ui->widget->currentIndex();
if (!selIndex.isValid())
return;
ReportManagement::ReportInfo data = m_model->getRowData(m_ui->widget->currentIndex().row());
DEBUG_LOG() << "onShowReport Id = " << data.id();
DEBUG_LOG(m_logger) << "onShowReport Id = " << data.id();
ReportPreview *dialog = new ReportPreview(m_session, this);
if (dialog->init(data))
@@ -186,10 +186,10 @@ void ReportList::onRemoveReport()
if (!selIndex.isValid())
return;
DEBUG_LOG() << "onRemoveReport";
DEBUG_LOG(m_logger) << "onRemoveReport";
ReportManagement::ReportInfo data = m_model->getRowData(m_ui->widget->currentIndex().row());
INFO_LOG() << "Removing report with id = " << data.id();
INFO_LOG(m_logger) << "Removing report with id = " << data.id();
Core::RemoveElementRequest req(data.id());
m_requestHelper->startSingleRequest([req, this]()
{
@@ -197,20 +197,20 @@ void ReportList::onRemoveReport()
});
if (m_requestHelper->failed())
ERROR_LOG() << "Failed to remove report";
ERROR_LOG(m_logger) << "Failed to remove report";
}
void ReportList::slotDelete()
{
DEBUG_LOG() << "ReportList::slotDelete";
DEBUG_LOG(m_logger) << "ReportList::slotDelete";
changeStatus(FileStatus::Deleted);
}
void ReportList::slotRestore()
{
DEBUG_LOG() << "ReportList::slotRestore";
DEBUG_LOG(m_logger) << "ReportList::slotRestore";
changeStatus(FileStatus::Valid);
}
@@ -224,39 +224,39 @@ void ReportList::onPrint()
void ReportList::onPreviewReport()
{
DEBUG_LOG() << "onPreviewReport";
DEBUG_LOG(m_logger) << "onPreviewReport";
QModelIndex selIndex = m_ui->widget->currentIndex();
if (!selIndex.isValid())
return;
ReportManagement::ReportInfo data = m_model->getRowData(m_ui->widget->currentIndex().row());
DEBUG_LOG() << "onPreviewReport Id = " << data.id();
DEBUG_LOG(m_logger) << "onPreviewReport Id = " << data.id();
ReportPreview *dialog = new ReportPreview(m_session, this);
if (dialog->init(data))
dialog->previewReport();
else
ERROR_LOG() << "Can not preview report with id = " << data.id();
ERROR_LOG(m_logger) << "Can not preview report with id = " << data.id();
}
void ReportList::onExportReport()
{
DEBUG_LOG() << "onExportReport";
DEBUG_LOG(m_logger) << "onExportReport";
QModelIndex selIndex = m_ui->widget->currentIndex();
if (!selIndex.isValid())
return;
ReportManagement::ReportInfo data = m_model->getRowData(m_ui->widget->currentIndex().row());
DEBUG_LOG() << "onExportReport Id = " << data.id();
DEBUG_LOG(m_logger) << "onExportReport Id = " << data.id();
ReportPreview *dialog = new ReportPreview(m_session, this);
if (dialog->init(data))
dialog->onExport();
else
ERROR_LOG() << "Can not export report with id = " << data.id();
ERROR_LOG(m_logger) << "Can not export report with id = " << data.id();
}
@@ -274,7 +274,7 @@ void ReportList::changeStatus(const FileStatus &fs)
m_requestHelper->startSingleRequest([ = ]()
{
DEBUG_LOG() << "Changing status for report id = " << rep.id();
DEBUG_LOG(m_logger) << "Changing status for report id = " << rep.id();
ReportChangeStatusRequest req;
req.id(rep.id());
@@ -287,7 +287,7 @@ void ReportList::changeStatus(const FileStatus &fs)
});
if (m_requestHelper->failed())
ERROR_LOG() << "Failed to change status for report with id = " << rep.id();
ERROR_LOG(m_logger) << "Failed to change status for report with id = " << rep.id();
}
@@ -302,37 +302,37 @@ bool ReportList::fetchInterfaces()
{
if (!m_session->getDtc<ReportManagement::DataInterface>(m_dtc))
{
ERROR_LOG() << "Cannot retrieve ReportManagament Dtc interface!";
ERROR_LOG(m_logger) << "Cannot retrieve ReportManagament Dtc interface!";
return false;
}
if (!m_session->getFtc<ReportManagement::DataInterface>(m_ftc))
{
ERROR_LOG() << "Cannot retrieve ReportManagament Ftc interface!";
ERROR_LOG(m_logger) << "Cannot retrieve ReportManagament Ftc interface!";
return false;
}
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
ERROR_LOG() << "Cannot retrieve ParticipantManagament Dtc interface!";
ERROR_LOG(m_logger) << "Cannot retrieve ParticipantManagament Dtc interface!";
return false;
}
if (!m_session->getDtc<AreaEffectSimulation::DataInterface>(m_aesDtc))
{
ERROR_LOG() << "Cannot retrieve AreaEffectSimulation Dtc interface!";
ERROR_LOG(m_logger) << "Cannot retrieve AreaEffectSimulation Dtc interface!";
return false;
}
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
{
ERROR_LOG() << "Cannot retrieve ProjectDataManagement Dtc interface!";
ERROR_LOG(m_logger) << "Cannot retrieve ProjectDataManagement Dtc interface!";
return false;
}
if (!m_session->getForeignGuiInterface<ParticipantManagement::ForeignGuiComboboxInterface>(m_ppmGuiCbxIfc))
{
ERROR_LOG() << "Cannot retrieve ParticipantManagement ForeignGuiCombobox interface!";
ERROR_LOG(m_logger) << "Cannot retrieve ParticipantManagement ForeignGuiCombobox interface!";
return false;
}
if (!m_session->getDtc<OperatorManagement::DataInterface>(m_opmDtc))
{
ERROR_LOG() << "Cannot retrieve OperatorManagement Dtc interface!";
ERROR_LOG(m_logger) << "Cannot retrieve OperatorManagement Dtc interface!";
return false;
}
return true;
@@ -44,6 +44,8 @@ public:
void onReportChangeStatusReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
void onSelectionChanged();
bool fetchInterfaces();
@@ -49,6 +49,7 @@ public:
QVariant data(const QModelIndex &, int) const override final;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
protected:
NGL::INGLLogger &m_logger;
void onUpdateComboboxFilterData();
void updateComboboxFilterData(const QSet<ReportType> &availableReportTypes,
const QSet<VisualisationType> &availableVisualisationTypes,
@@ -116,7 +116,7 @@ bool ReportPreview::init(const ReportManagement::ReportInfo &report)
(m_useAes && m_report.mineAreaIds().size() == 0 && m_report.nbcIds().size() == 0) ||
(m_useCharge && m_report.chargeTypeIds().size() == 0))
{
ERROR_LOG() << "Empty selection for report: m_report.id() = " << m_report.id();
ERROR_LOG(m_logger) << "Empty selection for report: m_report.id() = " << m_report.id();
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Not possible to preview this report! No elements selected!"));
return false;
}
@@ -126,8 +126,8 @@ bool ReportPreview::init(const ReportManagement::ReportInfo &report)
m_dataModel = AbstractModel::create(m_report, m_session, this);
DEBUG_LOG() << "m_dataModel.rowCount() = " << m_dataModel->rowCount(QModelIndex());
DEBUG_LOG() << "m_dataModel.columnCount() = " << m_dataModel->columnCount();
DEBUG_LOG(m_logger) << "m_dataModel.rowCount() = " << m_dataModel->rowCount(QModelIndex());
DEBUG_LOG(m_logger) << "m_dataModel.columnCount() = " << m_dataModel->columnCount();
m_headerDataModel = new QStandardItemModel(this);
@@ -179,7 +179,7 @@ bool ReportPreview::displayReport()
displayReportAsTable();
break;
default:
ERROR_LOG() << "Unknown visualisation type for report id = " << m_report.id()
ERROR_LOG(m_logger) << "Unknown visualisation type for report id = " << m_report.id()
<< ": " << m_report.visualisationType().underlying();
return false;
}
@@ -203,17 +203,17 @@ void ReportPreview::onExport()
fileName += reportName;
fileName += QStringLiteral(".jpg");
DEBUG_LOG() << "Trying to export Report to " << fileName;
DEBUG_LOG(m_logger) << "Trying to export Report to " << fileName;
bool ret = m_reportDisplay->exportToImage(QSize(1200, 1600), fileName, "jpg");
INFO_LOG() << "Exported to " << fileName << " - " << ret;
INFO_LOG(m_logger) << "Exported to " << fileName << " - " << ret;
if (ret)
{
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly))
{
ERROR_LOG() << "Cannot read file " << fileName;
ERROR_LOG(m_logger) << "Cannot read file " << fileName;
return;
}
@@ -222,8 +222,8 @@ void ReportPreview::onExport()
int exeFolderId = m_flmDtc->getExerciseFolderId(m_session->exerciseId());
int folderId = m_flmDtc->findFolder(exeFolderId,QStringLiteral("Reports"));
DEBUG_LOG() << "ExeFolderId = " << exeFolderId;
DEBUG_LOG() << "FolderId = " << folderId;
DEBUG_LOG(m_logger) << "ExeFolderId = " << exeFolderId;
DEBUG_LOG(m_logger) << "FolderId = " << folderId;
FileManagement::FileContentModifyRequest req;
req.id(0);
@@ -247,19 +247,19 @@ void ReportPreview::onExport()
if (m_requestHelper->failed())
{
ERROR_LOG() << "Failed to save file content";
ERROR_LOG(m_logger) << "Failed to save file content";
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Failed to save report image into library."));
}
else
{
INFO_LOG() << "Successfully exported to FLM (folderId, fileId, fileName) = (" << folderId << ", " << m_requestHelper->getRepliedId() << ", " << reportName;
INFO_LOG(m_logger) << "Successfully exported to FLM (folderId, fileId, fileName) = (" << folderId << ", " << m_requestHelper->getRepliedId() << ", " << reportName;
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Successfully saved report image into library."));
}
}
}
else
WARNING_LOG() << "Failed to create report content";
WARNING_LOG(m_logger) << "Failed to create report content";
}
@@ -267,49 +267,49 @@ bool ReportPreview::fetchInterfaces()
{
if (!m_session->getFtc<ReportManagement::DataInterface>(m_ftc))
{
DEBUG_LOG() << "Failed to fetch Report Management FTC interface";
DEBUG_LOG(m_logger) << "Failed to fetch Report Management FTC interface";
return false;
}
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
DEBUG_LOG() << "Failed to fetch Participant Management DTC interface";
DEBUG_LOG(m_logger) << "Failed to fetch Participant Management DTC interface";
return false;
}
if (!m_session->getDtc<ExerciseManagement::DataInterface>(m_exmDtc))
{
DEBUG_LOG() << "Failed to fetch Exercise Management DTC interface";
DEBUG_LOG(m_logger) << "Failed to fetch Exercise Management DTC interface";
return false;
}
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
{
DEBUG_LOG() << "Failed to fetch ProjectDataManagement DTC interface";
DEBUG_LOG(m_logger) << "Failed to fetch ProjectDataManagement DTC interface";
return false;
}
if (!m_session->getDtc<AreaEffectSimulation::DataInterface>(m_aesDtc))
{
DEBUG_LOG() << "Failed to fetch AreaEffectSimulation DTC interface";
DEBUG_LOG(m_logger) << "Failed to fetch AreaEffectSimulation DTC interface";
return false;
}
if (!m_session->getDtc<InfrastructureManagement::DataInterface>(m_ismDtc))
{
DEBUG_LOG() << "Failed to fetch InfrastructureManagement DTC interface";
DEBUG_LOG(m_logger) << "Failed to fetch InfrastructureManagement DTC interface";
return false;
}
if (!m_session->getFtc<FileManagement::DataInterface>(m_flmFtc))
{
DEBUG_LOG() << "Failed to fetch FileManagement FTC interface";
DEBUG_LOG(m_logger) << "Failed to fetch FileManagement FTC interface";
return false;
}
if (!m_session->getDtc<FileManagement::DataInterface>(m_flmDtc))
{
DEBUG_LOG() << "Failed to fetch FileManagement DTC interface";
DEBUG_LOG(m_logger) << "Failed to fetch FileManagement DTC interface";
return false;
}
@@ -508,7 +508,7 @@ bool ReportPreview::displayReportAsTable()
{
int groupId = m_dataModel->data(m_dataModel->index(i, 0), Qt::EditRole).toInt();
QString title = m_dataModel->data(m_dataModel->index(i, 0), Qt::UserRole).toString();
DEBUG_LOG() << "Group Id = " << groupId << ", title = " << title;
DEBUG_LOG(m_logger) << "Group Id = " << groupId << ", title = " << title;
if (!m_groupIds.contains(groupId))
{
@@ -563,7 +563,7 @@ bool ReportPreview::displayReportAsPie()
for (int i = 0; i < m_dataModel->rowCount(QModelIndex()); ++i)
{
int groupId = m_dataModel->data(m_dataModel->index(i, 0), Qt::EditRole).toInt();
DEBUG_LOG() << "Group Id = " << groupId;
DEBUG_LOG(m_logger) << "Group Id = " << groupId;
if (!m_groupIds.contains(groupId))
{
@@ -593,14 +593,14 @@ bool ReportPreview::displayReportAsLine()
for (int i = 0; i < m_dataModel->rowCount(QModelIndex()); ++i)
{
int groupId = m_dataModel->data(m_dataModel->index(i, 0), Qt::EditRole).toInt();
DEBUG_LOG() << "displayReportAsLine: Group Id = " << groupId;
DEBUG_LOG(m_logger) << "displayReportAsLine: Group Id = " << groupId;
if (!m_groupIds.contains(groupId))
{
m_groupIds.append(groupId);
QString title = m_dataModel->data(m_dataModel->index(i, 0), Qt::UserRole).toString();
DEBUG_LOG() << "displayReportAsLine: Group title = " << title;
DEBUG_LOG(m_logger) << "displayReportAsLine: Group title = " << title;
AbstractProxyModel *proxyModel = new AbstractProxyModel(this);
proxyModel->setSourceModel(m_dataModel);
@@ -629,7 +629,7 @@ bool ReportPreview::displayReportAsBar()
for (int i = 0; i < m_dataModel->rowCount(QModelIndex()); ++i)
{
int groupId = m_dataModel->data(m_dataModel->index(i, 0), Qt::EditRole).toInt();
DEBUG_LOG() << "Group Id = " << groupId;
DEBUG_LOG(m_logger) << "Group Id = " << groupId;
if (!m_groupIds.contains(groupId))
{
@@ -673,7 +673,7 @@ void ReportPreview::addToHeaderData(const QString &strLeft, const QString &strRi
item = new QStandardItem(strRight);
itemList += item;
DEBUG_LOG() << "Added to header: " << strRight;
DEBUG_LOG(m_logger) << "Added to header: " << strRight;
m_headerDataModel->appendRow(itemList);
}
@@ -983,7 +983,7 @@ KDChart::Chart *ReportPreview::createNewChart(const ChartType &chartType, bool h
if (!diagram)
{
ERROR_LOG() << "Got unkown chart type. Aborting.";
ERROR_LOG(m_logger) << "Got unkown chart type. Aborting.";
return result;
}
@@ -1124,8 +1124,8 @@ KDChart::Chart *ReportPreview::createNewChart(const ChartType &chartType, bool h
int eventTypeId = diagram->model()->data(diagram->model()->index(iRow, 0), Qt::UserRole + 1).toInt();
QColor eventColor = m_eventsModel->eventColor(static_cast<ReportManagement::EventType::type>(eventTypeId));
DEBUG_LOG() << "Row " << iRow << ", eventTypeId " << eventTypeId;
DEBUG_LOG() << "Event color " << eventColor.name();
DEBUG_LOG(m_logger) << "Row " << iRow << ", eventTypeId " << eventTypeId;
DEBUG_LOG(m_logger) << "Event color " << eventColor.name();
for (int iColumn = 0; iColumn < colCount; ++iColumn )
{
QModelIndex mi = diagram->model()->index(iRow, iColumn);
@@ -1281,7 +1281,7 @@ void EventTypeModel::initModel()
QColor EventTypeModel::eventColor(ReportManagement::EventType eventTypeId) const
{
DEBUG_LOG() << "eventColor for event type " << eventTypeId;
DEBUG_LOG(m_logger) << "eventColor for event type " << eventTypeId;
switch (eventTypeId.underlying())
{
case ReportManagement::EventType::VBGChanged: return QColor(Qt::red);
@@ -67,6 +67,8 @@ public:
int columnCount(const QModelIndex &parent) const override final;
private:
NGL::INGLLogger &m_logger;
};
class ReportPreview : public LtsWidgets::LtsFramelessDialog
@@ -47,12 +47,12 @@ bool InterfaceImpl::fetchInterfaces()
{
if (!m_session->getDtc<ReportManagement::DataInterface>(m_dtc))
{
DEBUG_LOG() << "Failed to fetch ReportManagement DTC interface!";
DEBUG_LOG(m_logger) << "Failed to fetch ReportManagement DTC interface!";
return false;
}
if (!m_session->getFtc<ReportManagement::DataInterface>(m_ftc))
{
DEBUG_LOG() << "Failed to fetch ReportManagement FTC interface!";
DEBUG_LOG(m_logger) << "Failed to fetch ReportManagement FTC interface!";
return false;
}
@@ -60,22 +60,22 @@ bool InterfaceImpl::fetchInterfaces()
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
DEBUG_LOG() << "Failed to fetch ParticipantManagement DTC interface!";
DEBUG_LOG(m_logger) << "Failed to fetch ParticipantManagement DTC interface!";
return false;
}
if (!m_session->getForeignGuiInterface<ParticipantManagement::ForeignGuiComboboxInterface>(m_ppmGuiCbxIfc))
{
DEBUG_LOG() << "Failed to fetch ParticipantManagement ForeignGuiComboboxInterface!";
DEBUG_LOG(m_logger) << "Failed to fetch ParticipantManagement ForeignGuiComboboxInterface!";
return false;
}
if (!m_session->getDtc<AreaEffectSimulation::DataInterface>(m_aesDtc))
{
DEBUG_LOG() << "Failed to fetch AreaEffectSimulation DTC interface!";
DEBUG_LOG(m_logger) << "Failed to fetch AreaEffectSimulation DTC interface!";
return false;
}
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
{
DEBUG_LOG() << "Failed to fetch ProjectDataManagement DTC interface!";
DEBUG_LOG(m_logger) << "Failed to fetch ProjectDataManagement DTC interface!";
return false;
}
@@ -85,7 +85,7 @@ bool InterfaceImpl::fetchInterfaces()
if (!m_session->getDtc<OperatorManagement::DataInterface>(m_opmDtc))
{
DEBUG_LOG() << "Failed to fetch OperatorManagement DTC interface!";
DEBUG_LOG(m_logger) << "Failed to fetch OperatorManagement DTC interface!";
return false;
}
return true;
@@ -478,29 +478,29 @@ bool InterfaceImpl::TopicReplayInterface::playbackInit(const QJsonObject &attrib
if (reportId > 0)
ri = m_dtc->reportInfo(reportId);
DEBUG_LOG() << "Report Id = " << ri.id();
DEBUG_LOG(m_logger) << "Report Id = " << ri.id();
if (!m_previewDialog)
{
ERROR_LOG() << "Widgets1 not available, playback not possible for report id = "<< ri.id();
ERROR_LOG(m_logger) << "Widgets1 not available, playback not possible for report id = "<< ri.id();
return false;
}
if ( !m_previewReport)
{
ERROR_LOG() << "Widgets2 not available, playback not possible for report id = "<< ri.id();
ERROR_LOG(m_logger) << "Widgets2 not available, playback not possible for report id = "<< ri.id();
return false;
}
if (!m_previewWidget)
{
ERROR_LOG() << "Widgets3 not available, playback not possible for report id = "<< ri.id();
ERROR_LOG(m_logger) << "Widgets3 not available, playback not possible for report id = "<< ri.id();
return false;
}
if (!m_previewDialog->init(ri))
{
ERROR_LOG() << "Preview dialog could not be initialized!";
ERROR_LOG(m_logger) << "Preview dialog could not be initialized!";
return false;
}
m_previewDialog->getReportDisplay()->exportToFile(QStringLiteral("/tmp/rep.pdf"));
@@ -549,7 +549,7 @@ bool InterfaceImpl::TopicReplayInterface::exportTopic(const QJsonObject &attribu
const int reportId = attributes.value(QStringLiteral("ReportId")).toInt(0);
if (reportId < 1)
{
ERROR_LOG() << "No valid report id given";
ERROR_LOG(m_logger) << "No valid report id given";
pExportNotifier->setExportFailed();
return false;
}
@@ -563,14 +563,14 @@ bool InterfaceImpl::TopicReplayInterface::exportTopic(const QJsonObject &attribu
ReportManagement::ReportInfo ri = m_dtc->reportInfo(reportId);
if (ri.fileStatus() != ReportManagement::FileStatus::Valid)
{
ERROR_LOG() << "Report with id " << reportId << " was deleted";
ERROR_LOG(m_logger) << "Report with id " << reportId << " was deleted";
pExportNotifier->setExportFailed();
return false;
}
if (!m_previewDialog->init(ri))
{
ERROR_LOG() << "Could not init preview for report id = " << reportId;
ERROR_LOG(m_logger) << "Could not init preview for report id = " << reportId;
pExportNotifier->setExportFailed();
return false;
}
@@ -578,14 +578,14 @@ bool InterfaceImpl::TopicReplayInterface::exportTopic(const QJsonObject &attribu
KDReports::Report* rp = m_previewDialog->getReportDisplay();
if (rp == nullptr)
{
ERROR_LOG() << "Could not retrieve KDReport for report id = " << reportId;
ERROR_LOG(m_logger) << "Could not retrieve KDReport for report id = " << reportId;
pExportNotifier->setExportFailed();
return false;
}
rp->exportToFile(strPathToFile + strFileName);
pExportNotifier->setExportSuccessful(strFileName);
INFO_LOG() << "Successfully exported topic for report with id " << reportId;
INFO_LOG(m_logger) << "Successfully exported topic for report with id " << reportId;
rp->deleteLater();
return true;
@@ -63,6 +63,8 @@ public:
TopicEditorBase::TopicEditor *createTopicEditor(const TopicEditorBase::TopicData &data) override;
private:
NGL::INGLLogger &m_logger;
LtsWidgets::LtsDialog *onShowReportList(QWidget *parent);
LtsWidgets::LtsDialog *onShowAddReport(QWidget *parent, const ReportType &reportType);
QString getAESNbcReportTypeName();