Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+2
@@ -42,6 +42,8 @@ public:
|
||||
const std::shared_ptr<ParticipantManagement::ForeignGuiComboboxInterface> &ppmGuiCbxIfc);
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void retranslate() override;
|
||||
bool apply() override;
|
||||
void tableColumnOrganiserSetting() override;
|
||||
|
||||
+15
-15
@@ -91,14 +91,14 @@ void ExportSaab::onStartExport()
|
||||
if (!file.open(QIODevice::WriteOnly))
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Not possible to start export. You do not have the permission to write the selected file."));
|
||||
ERROR_LOG() << "Could not export exercise: \"" << strExportFile << "\" could not be opened for writing";
|
||||
ERROR_LOG(m_logger) << "Could not export exercise: \"" << strExportFile << "\" could not be opened for writing";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isValidConfigFile())
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Not possible to start export. Config file invalid."));
|
||||
ERROR_LOG() << "Could not export exercise: \"" << strConfigFile << "\" invalid";
|
||||
ERROR_LOG(m_logger) << "Could not export exercise: \"" << strConfigFile << "\" invalid";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -181,13 +181,13 @@ bool ExportSaab::isValidConfigFile()
|
||||
{
|
||||
if (!m_configFile)
|
||||
{
|
||||
ERROR_LOG() << "Not possible to read config: No file selected";
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: No file selected";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_configFile->open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG() << "Not possible to read config: Could not open file \""
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \""
|
||||
<< m_configFile->fileName()
|
||||
<< "\" for reading.";
|
||||
return false;
|
||||
@@ -217,11 +217,11 @@ bool ExportSaab::isValidConfigFile()
|
||||
m_configFile->close();
|
||||
|
||||
if (!hasEchelons)
|
||||
ERROR_LOG() << "Could not find " << SAAB_ECHELONS() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_ECHELONS() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
if (!hasSymbols)
|
||||
ERROR_LOG() << "Could not find " << SAAB_SYMBOLS() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_SYMBOLS() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
if (!hasForces)
|
||||
ERROR_LOG() << "Could not find " << SAAB_FORCES() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_FORCES() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
|
||||
return hasEchelons && hasSymbols && hasForces;
|
||||
}
|
||||
@@ -243,13 +243,13 @@ void ExportSaab::importConfig()
|
||||
|
||||
if (!m_configFile)
|
||||
{
|
||||
ERROR_LOG() << "Not possible to read config: No file selected";
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: No file selected";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_configFile->open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG() << "Not possible to read config: Could not open file \""
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \""
|
||||
<< m_configFile->fileName()
|
||||
<< "\" for reading.";
|
||||
return;
|
||||
@@ -456,13 +456,13 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p
|
||||
{
|
||||
if (participant.isDeleted())
|
||||
{
|
||||
DEBUG_LOG() << "Participant with id " << participant.id() << " id deleted --> skipping";
|
||||
DEBUG_LOG(m_logger) << "Participant with id " << participant.id() << " id deleted --> skipping";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (participant.externalId())
|
||||
{
|
||||
DEBUG_LOG() << "Particpant with id " << participant.id() << " has external ID set to " << participant.externalId() << " --> not being exported.";
|
||||
DEBUG_LOG(m_logger) << "Particpant with id " << participant.id() << " has external ID set to " << participant.externalId() << " --> not being exported.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -491,7 +491,7 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p
|
||||
{
|
||||
result = new SaabUnit;
|
||||
|
||||
DEBUG_LOG() << "Reading unit with " << participant.inferiorIds().size() << " inferiors";
|
||||
DEBUG_LOG(m_logger) << "Reading unit with " << participant.inferiorIds().size() << " inferiors";
|
||||
|
||||
for (int32_t id : participant.inferiorIds())
|
||||
{
|
||||
@@ -499,7 +499,7 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p
|
||||
|
||||
if (player == nullptr)
|
||||
{
|
||||
DEBUG_LOG() << "Skipping inferior with id " << id;
|
||||
DEBUG_LOG(m_logger) << "Skipping inferior with id " << id;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -509,7 +509,7 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p
|
||||
|
||||
if (!static_cast<SaabUnit *>(result)->inferiors.size())
|
||||
{
|
||||
DEBUG_LOG() << "Unit " << participant.id() << " has no inferiors.";
|
||||
DEBUG_LOG(m_logger) << "Unit " << participant.id() << " has no inferiors.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -519,7 +519,7 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p
|
||||
case ParticipantManagement::TypeClass::Aircraft:
|
||||
case ParticipantManagement::TypeClass::Unknown:
|
||||
default:
|
||||
DEBUG_LOG() << "Type " << participant.typeId() << " is not supported.";
|
||||
DEBUG_LOG(m_logger) << "Type " << participant.typeId() << " is not supported.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
+22
-22
@@ -35,7 +35,7 @@ ImportSaab::ImportSaab(ParticipantManagement::ParticipantEditModel *pModel, cons
|
||||
|
||||
if (!pSession->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc) || !pSession->getFtc<ParticipantManagement::DataInterface>(m_ppmFtc))
|
||||
{
|
||||
ERROR_LOG() << "Fetching m_ppmDtc or m_ppmFtc failed!";
|
||||
ERROR_LOG(m_logger) << "Fetching m_ppmDtc or m_ppmFtc failed!";
|
||||
setEnabled(false);
|
||||
}
|
||||
else
|
||||
@@ -230,13 +230,13 @@ void ImportSaab::importOrbat()
|
||||
{
|
||||
if (!m_xmlFile)
|
||||
{
|
||||
ERROR_LOG() << "Not possible to import ORBAT: No file selected";
|
||||
ERROR_LOG(m_logger) << "Not possible to import ORBAT: No file selected";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_xmlFile->open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG() << "Not possible to import ORBAT: Could not open file \""
|
||||
ERROR_LOG(m_logger) << "Not possible to import ORBAT: Could not open file \""
|
||||
<< m_xmlFile->fileName()
|
||||
<< "\" for reading.";
|
||||
return;
|
||||
@@ -267,7 +267,7 @@ void ImportSaab::importOrbat()
|
||||
if (m_logger.isDebugEnabled())
|
||||
{
|
||||
for (SaabUnit *u : std::as_const(m_rootUnits))
|
||||
DEBUG_LOG() << u->toString();
|
||||
DEBUG_LOG(m_logger) << u->toString();
|
||||
}
|
||||
|
||||
m_xmlFile->close();
|
||||
@@ -290,13 +290,13 @@ void ImportSaab::importConfig()
|
||||
|
||||
if (!m_configFile)
|
||||
{
|
||||
ERROR_LOG() << "Not possible to read config: No file selected";
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: No file selected";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_configFile->open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG() << "Not possible to read config: Could not open file \""
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \""
|
||||
<< m_configFile->fileName()
|
||||
<< "\" for reading.";
|
||||
return;
|
||||
@@ -374,7 +374,7 @@ QVector<SaabPlayer *> ImportSaab::inferiors(SaabPlayer *player) const
|
||||
|
||||
SaabPlayer *ImportSaab::readUnit(QXmlStreamReader *reader) const
|
||||
{
|
||||
DEBUG_LOG() << "reading unit: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
|
||||
DEBUG_LOG(m_logger) << "reading unit: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
|
||||
|
||||
SaabUnit *result = new SaabUnit;
|
||||
|
||||
@@ -433,7 +433,7 @@ SaabPlayer *ImportSaab::readUnit(QXmlStreamReader *reader) const
|
||||
int index = playerIndexByGuid(result->guid, result->inferiors);
|
||||
|
||||
if (index < 0)
|
||||
WARNING_LOG() << SAAB_POSITION_BY_PLAYER_ID() << " set, but GUID " << result->positionByPlayerId << " could not be found.";
|
||||
WARNING_LOG(m_logger) << SAAB_POSITION_BY_PLAYER_ID() << " set, but GUID " << result->positionByPlayerId << " could not be found.";
|
||||
else
|
||||
result->inferiors.prepend(result->inferiors.takeAt(index));
|
||||
}
|
||||
@@ -443,21 +443,21 @@ SaabPlayer *ImportSaab::readUnit(QXmlStreamReader *reader) const
|
||||
|
||||
SaabPlayer *ImportSaab::readOcPlayer(QXmlStreamReader *reader) const
|
||||
{
|
||||
DEBUG_LOG() << "reading oc player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
|
||||
DEBUG_LOG(m_logger) << "reading oc player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
|
||||
|
||||
return readPersonOcPlayer<SaabOcPlayer>(reader, XmlStrings::SAAB_OC_PLAYER());;
|
||||
}
|
||||
|
||||
SaabPlayer *ImportSaab::readPersonPlayer(QXmlStreamReader *reader) const
|
||||
{
|
||||
DEBUG_LOG() << "reading person player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
|
||||
DEBUG_LOG(m_logger) << "reading person player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
|
||||
|
||||
return readPersonOcPlayer<SaabPersonPlayer>(reader, XmlStrings::SAAB_PERSON_PLAYER());
|
||||
}
|
||||
|
||||
SaabPlayer *ImportSaab::readVehiclePlayer(QXmlStreamReader *reader) const
|
||||
{
|
||||
DEBUG_LOG() << "reading vehicle player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
|
||||
DEBUG_LOG(m_logger) << "reading vehicle player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString();
|
||||
|
||||
using namespace XmlStrings;
|
||||
|
||||
@@ -468,7 +468,7 @@ SaabPlayer *ImportSaab::readVehiclePlayer(QXmlStreamReader *reader) const
|
||||
SaabVehicle vehicle = saabVehicleByGUID(reader->readElementText());
|
||||
|
||||
if (vehicle.guid.isEmpty())
|
||||
WARNING_LOG() << SAAB_VEHICLE_REF_ID() << " set, but GUID " << result->refId << " could not be found.";
|
||||
WARNING_LOG(m_logger) << SAAB_VEHICLE_REF_ID() << " set, but GUID " << result->refId << " could not be found.";
|
||||
else
|
||||
{
|
||||
result->registrationNumber = vehicle.registrationNumber;
|
||||
@@ -577,7 +577,7 @@ void ImportSaab::buildImportTreeView(const QVector<SaabPlayer *> &vecUnitsWithVa
|
||||
if (vecUnitsWithValidDISTypes.contains(player->superior))
|
||||
tmp.append(player);
|
||||
else
|
||||
WARNING_LOG() << "Parent missing: Could not import player " << player->designation;
|
||||
WARNING_LOG(m_logger) << "Parent missing: Could not import player " << player->designation;
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -595,13 +595,13 @@ bool ImportSaab::isValidSaabOrbatFile() const
|
||||
{
|
||||
if (!m_xmlFile)
|
||||
{
|
||||
ERROR_LOG() << "Not possible to import ORBAT: No file selected";
|
||||
ERROR_LOG(m_logger) << "Not possible to import ORBAT: No file selected";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_xmlFile->open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG() << "Not possible to import ORBAT: Could not open file \""
|
||||
ERROR_LOG(m_logger) << "Not possible to import ORBAT: Could not open file \""
|
||||
<< m_xmlFile->fileName()
|
||||
<< "\" for reading.";
|
||||
return false;
|
||||
@@ -631,11 +631,11 @@ bool ImportSaab::isValidSaabOrbatFile() const
|
||||
m_xmlFile->close();
|
||||
|
||||
if (!hasExerciseOrbatRoot)
|
||||
ERROR_LOG() << "Could not find " << SAAB_EXERCISE_ORBAT() << " in file \"" << m_xmlFile->fileName() << '\"';
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_EXERCISE_ORBAT() << " in file \"" << m_xmlFile->fileName() << '\"';
|
||||
if (!hasExercise)
|
||||
ERROR_LOG() << "Could not find " << SAAB_EXERCISE() << " in file \"" << m_xmlFile->fileName() << '\"';
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_EXERCISE() << " in file \"" << m_xmlFile->fileName() << '\"';
|
||||
if (!hasOrbat)
|
||||
ERROR_LOG() << "Could not find " << SAAB_ORBAT() << " in file \"" << m_xmlFile->fileName() << '\"';
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_ORBAT() << " in file \"" << m_xmlFile->fileName() << '\"';
|
||||
|
||||
return hasExerciseOrbatRoot && hasExercise && hasOrbat;
|
||||
}
|
||||
@@ -644,13 +644,13 @@ bool ImportSaab::isValidConfigFile() const
|
||||
{
|
||||
if (!m_configFile)
|
||||
{
|
||||
ERROR_LOG() << "Not possible to read config: No file selected";
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: No file selected";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_configFile->open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG() << "Not possible to read config: Could not open file \""
|
||||
ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \""
|
||||
<< m_configFile->fileName()
|
||||
<< "\" for reading.";
|
||||
return false;
|
||||
@@ -677,9 +677,9 @@ bool ImportSaab::isValidConfigFile() const
|
||||
m_configFile->close();
|
||||
|
||||
if (!hasEchelons)
|
||||
ERROR_LOG() << "Could not find " << SAAB_ECHELONS() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_ECHELONS() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
if (!hasSymbols)
|
||||
ERROR_LOG() << "Could not find " << SAAB_SYMBOLS() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
ERROR_LOG(m_logger) << "Could not find " << SAAB_SYMBOLS() << " in file \"" << m_configFile->fileName() << '\"';
|
||||
|
||||
return hasEchelons && hasSymbols;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user