Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+94
-95
@@ -35,10 +35,9 @@ static inline QString gStrSymbolFolderPath()
|
||||
return QDir::tempPath() + QStringLiteral("/excon_bgviewer_symbols/");
|
||||
}
|
||||
|
||||
BuildingViewerDdsController::BuildingViewerDdsController(CommunicationInterfaceInternal *connection, VCtrl::ViewerInterface* viewerInterface)
|
||||
: m_connection(connection)
|
||||
, m_viewerInterface(viewerInterface)
|
||||
{}
|
||||
BuildingViewerDdsController::BuildingViewerDdsController(CommunicationInterfaceInternal *connection, VCtrl::ViewerInterface* viewerInterface) : m_connection(connection)
|
||||
, m_viewerInterface(viewerInterface),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
|
||||
|
||||
|
||||
BuildingViewerDdsController::~BuildingViewerDdsController()
|
||||
@@ -52,7 +51,7 @@ BuildingViewerDdsController::~BuildingViewerDdsController()
|
||||
|
||||
bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QString &modelPath, PluginProvider *session)
|
||||
{
|
||||
DEBUG_LOG() << "BDV:: init";
|
||||
DEBUG_LOG(m_logger) << "BDV:: init";
|
||||
m_session = session;
|
||||
m_irreplacableWidget = irreplacableWidget;
|
||||
|
||||
@@ -61,7 +60,7 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin
|
||||
|
||||
if (!m_session)
|
||||
{
|
||||
ERROR_LOG() << "No m_session for BuildingViewerController!";
|
||||
ERROR_LOG(m_logger) << "No m_session for BuildingViewerController!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -71,7 +70,7 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin
|
||||
{
|
||||
|
||||
m_session = nullptr;
|
||||
DEBUG_LOG() << getSessionInfo() << "BDV:: BuildingViewerDdsController: m_session has been destroyed!";
|
||||
DEBUG_LOG(m_logger) << getSessionInfo() << "BDV:: BuildingViewerDdsController: m_session has been destroyed!";
|
||||
stopAndClearTimer();
|
||||
uninitialize();
|
||||
}
|
||||
@@ -80,35 +79,35 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin
|
||||
m_asbIfc = session->asbIfc();
|
||||
if (!m_asbIfc)
|
||||
{
|
||||
ERROR_LOG() << "Fetching 'm_asbIfc' failed!";
|
||||
ERROR_LOG(m_logger) << "Fetching 'm_asbIfc' failed!";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_bldDtc = session->bldDtc();
|
||||
if (!m_bldDtc)
|
||||
{
|
||||
ERROR_LOG() << "Fetching 'm_bldDtc' failed!";
|
||||
ERROR_LOG(m_logger) << "Fetching 'm_bldDtc' failed!";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_ismDtc = session->ismDtc();
|
||||
if (!m_ismDtc)
|
||||
{
|
||||
ERROR_LOG() << "Fetching 'm_ismDtc' failed!";
|
||||
ERROR_LOG(m_logger) << "Fetching 'm_ismDtc' failed!";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_pdmDtc = session->pdmDtc();
|
||||
if (!m_pdmDtc)
|
||||
{
|
||||
ERROR_LOG() << "Fetching 'm_pdmDtc' failed!";
|
||||
ERROR_LOG(m_logger) << "Fetching 'm_pdmDtc' failed!";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_ismIfc = session->ismDataIfc();
|
||||
if (!m_ismIfc)
|
||||
{
|
||||
WARNING_LOG() << "Fetching 'm_ismIfc' failed!";
|
||||
WARNING_LOG(m_logger) << "Fetching 'm_ismIfc' failed!";
|
||||
return false;
|
||||
}
|
||||
connect(m_ismIfc.get(), &InfrastructureManagement::ForeignDataInterface::mountingPointChanged,
|
||||
@@ -132,7 +131,7 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin
|
||||
|
||||
if (!dir.mkpath(QStringLiteral(".")))
|
||||
{
|
||||
ERROR_LOG() << getSessionInfo() << "Could not create path \"" << gStrSymbolFolderPath() << "\" which is required to store BgViewer symbol files!";
|
||||
ERROR_LOG(m_logger) << getSessionInfo() << "Could not create path \"" << gStrSymbolFolderPath() << "\" which is required to store BgViewer symbol files!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -140,7 +139,7 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin
|
||||
connect(m_connection, &CommunicationInterfaceInternal::signalAssetPicked, this, &BuildingViewerDdsController::onAssetPicked, Qt::UniqueConnection);
|
||||
connect(m_connection, &CommunicationInterfaceInternal::signalBgViewerInitFinished, this, &BuildingViewerDdsController::onBgViewerInitFinished, Qt::UniqueConnection);
|
||||
|
||||
INFO_LOG() << getSessionInfo() << "BuildingViewerDdsController::init: The order of the following output must be [1],[2],[3],[4],[5],[6]";
|
||||
INFO_LOG(m_logger) << getSessionInfo() << "BuildingViewerDdsController::init: The order of the following output must be [1],[2],[3],[4],[5],[6]";
|
||||
|
||||
|
||||
|
||||
@@ -169,10 +168,10 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin
|
||||
|
||||
void BuildingViewerDdsController::onBgViewerInitFinished()
|
||||
{
|
||||
DEBUG_LOG() << "onBgViewerInitFinished";
|
||||
DEBUG_LOG(m_logger) << "onBgViewerInitFinished";
|
||||
|
||||
INFO_LOG() << getSessionInfo() << "[2] Training area initialization acknowledged by BgViewer";
|
||||
INFO_LOG() << getSessionInfo() << "[3] Sending mounting points, teams, ..., to BgViewer";
|
||||
INFO_LOG(m_logger) << getSessionInfo() << "[2] Training area initialization acknowledged by BgViewer";
|
||||
INFO_LOG(m_logger) << getSessionInfo() << "[3] Sending mounting points, teams, ..., to BgViewer";
|
||||
|
||||
if (!m_pSimTimeSyncTimer)
|
||||
{
|
||||
@@ -192,7 +191,7 @@ void BuildingViewerDdsController::onBgViewerInitFinished()
|
||||
const bool useExactPositioning = ps->value(QStringLiteral("bld"), QStringLiteral("useExactPositioning")).toBool();
|
||||
m_connection->excUseExactPositioning(useExactPositioning);
|
||||
|
||||
INFO_LOG() << getSessionInfo() << "[4] Getting building DDS data ('mainStructureElements')";
|
||||
INFO_LOG(m_logger) << getSessionInfo() << "[4] Getting building DDS data ('mainStructureElements')";
|
||||
connect(m_ismDtc.get(), &InfrastructureManagement::Interface::Dtc::mainStructureElementChanged,
|
||||
this, &BuildingViewerDdsController::onMainStructureElementChanged);
|
||||
|
||||
@@ -200,17 +199,17 @@ void BuildingViewerDdsController::onBgViewerInitFinished()
|
||||
{
|
||||
onMainStructureElementChanged(data, DataModification::eAdded);
|
||||
});
|
||||
INFO_LOG() << getSessionInfo() << "\t[4.1] Done";
|
||||
INFO_LOG(m_logger) << getSessionInfo() << "\t[4.1] Done";
|
||||
|
||||
INFO_LOG() << getSessionInfo() << "[5] Creating participants";
|
||||
INFO_LOG(m_logger) << getSessionInfo() << "[5] Creating participants";
|
||||
|
||||
createParticipants();
|
||||
INFO_LOG() << getSessionInfo() << "\t[5.1] Done";
|
||||
INFO_LOG() << getSessionInfo() << "[5] Creating Booby Trap";
|
||||
INFO_LOG(m_logger) << getSessionInfo() << "\t[5.1] Done";
|
||||
INFO_LOG(m_logger) << getSessionInfo() << "[5] Creating Booby Trap";
|
||||
createBoobyTraps();
|
||||
INFO_LOG() << getSessionInfo() << "\t[5.2] Done";
|
||||
INFO_LOG(m_logger) << getSessionInfo() << "\t[5.2] Done";
|
||||
|
||||
INFO_LOG() << getSessionInfo() << "[6] Getting building DDS data ('buildingStates')";
|
||||
INFO_LOG(m_logger) << getSessionInfo() << "[6] Getting building DDS data ('buildingStates')";
|
||||
connect(m_bldDtc.get(), &Buildings::Interface::Dtc::buildingStateChanged,
|
||||
this, &BuildingViewerDdsController::onBuildingStateChanged, Qt::UniqueConnection);
|
||||
m_bldDtc->buildingStates([this](const Buildings::BuildingState & data)
|
||||
@@ -219,7 +218,7 @@ void BuildingViewerDdsController::onBgViewerInitFinished()
|
||||
});
|
||||
connect(m_bldDtc.get(), &Buildings::Interface::Dtc::buildingHitLineInfoChanged,
|
||||
this, &BuildingViewerDdsController::onBuildingHitLineInfoChanged, Qt::UniqueConnection);
|
||||
INFO_LOG() << getSessionInfo() << "\t[6.1] Done";
|
||||
INFO_LOG(m_logger) << getSessionInfo() << "\t[6.1] Done";
|
||||
|
||||
|
||||
m_connection->excSetGlobalTransparency(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("BgViewer"), QStringLiteral("GlobalTransparency"), 75).toInt() );
|
||||
@@ -259,7 +258,7 @@ void BuildingViewerDdsController::onBgViewerInitFinished()
|
||||
}
|
||||
m_pBuildingHitlineCleanupTimer->start();
|
||||
|
||||
INFO_LOG() << getSessionInfo() << "[7] Emitting 'signalDdsInitFinished'";
|
||||
INFO_LOG(m_logger) << getSessionInfo() << "[7] Emitting 'signalDdsInitFinished'";
|
||||
m_ddsInitFinished = true;
|
||||
emit signalDdsInitFinished();
|
||||
onSynchronizeSimulationTime();
|
||||
@@ -269,7 +268,7 @@ void BuildingViewerDdsController::onBgViewerInitFinished()
|
||||
|
||||
void BuildingViewerDdsController::stopAndClearTimer()
|
||||
{
|
||||
DEBUG_LOG() << "stopAndClearTimer";
|
||||
DEBUG_LOG(m_logger) << "stopAndClearTimer";
|
||||
|
||||
if (m_pFireEventFlashTimer)
|
||||
m_pFireEventFlashTimer->stop();
|
||||
@@ -284,15 +283,15 @@ void BuildingViewerDdsController::stopAndClearTimer()
|
||||
|
||||
void BuildingViewerDdsController::uninitialize()
|
||||
{
|
||||
DEBUG_LOG() << "uninitialize";
|
||||
DEBUG_LOG(m_logger) << "uninitialize";
|
||||
if (!m_bldDtc)
|
||||
return;
|
||||
|
||||
|
||||
if (m_ddsInitFinished)
|
||||
DEBUG_LOG() << "Flag 'm_ddsInitFinished' set which means that initialization had been finished completely";
|
||||
DEBUG_LOG(m_logger) << "Flag 'm_ddsInitFinished' set which means that initialization had been finished completely";
|
||||
else
|
||||
WARNING_LOG() << "Flag 'm_ddsInitFinished' has not been set within timeout value, forcing quit!";
|
||||
WARNING_LOG(m_logger) << "Flag 'm_ddsInitFinished' has not been set within timeout value, forcing quit!";
|
||||
|
||||
stopAndClearTimer();
|
||||
|
||||
@@ -321,7 +320,7 @@ void BuildingViewerDdsController::uninitialize()
|
||||
m_ddsInitFinished = false;
|
||||
m_buildingHeight.clear();
|
||||
|
||||
DEBUG_LOG() << "BuildingViewerDdsController::uninitialize() finished";
|
||||
DEBUG_LOG(m_logger) << "BuildingViewerDdsController::uninitialize() finished";
|
||||
}
|
||||
|
||||
QPointF BuildingViewerDdsController::toRelativePosition(const Core::GeoPosition &geoPos) const
|
||||
@@ -344,7 +343,7 @@ LtsUtils::QPoint3D BuildingViewerDdsController::toRelative3D(const Core::GeoPosi
|
||||
|
||||
bool BuildingViewerDdsController::clear()
|
||||
{
|
||||
DEBUG_LOG() << "clear m_connection->playerClear();";
|
||||
DEBUG_LOG(m_logger) << "clear m_connection->playerClear();";
|
||||
m_connection->playerClear();
|
||||
return true;
|
||||
}
|
||||
@@ -354,7 +353,7 @@ bool BuildingViewerDdsController::syncTeams()
|
||||
{
|
||||
if (!m_ppmDtc)
|
||||
return false;
|
||||
INFO_LOG() << "BuildingViewerDdsController::syncTeams";
|
||||
INFO_LOG(m_logger) << "BuildingViewerDdsController::syncTeams";
|
||||
|
||||
m_connection->setTeamConfiguration(m_ppmDtc->partys());
|
||||
return true;
|
||||
@@ -386,7 +385,7 @@ bool BuildingViewerDdsController::calcBaseCoordinate(const QMap<qint32, Infrastr
|
||||
}
|
||||
if (!bAtLeasOneFound)
|
||||
{
|
||||
WARNING_LOG() << "No building available in exercise " << m_exerciseId;
|
||||
WARNING_LOG(m_logger) << "No building available in exercise " << m_exerciseId;
|
||||
return false;
|
||||
}
|
||||
m_baseCoordinate = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPosition.lon(), geoPosition.lat());
|
||||
@@ -405,7 +404,7 @@ bool BuildingViewerDdsController::writeBuildingDataToXML(const QString &modelPat
|
||||
QFile f(getBuildingConfigurationXml());
|
||||
if (!f.open(QIODevice::WriteOnly))
|
||||
{
|
||||
WARNING_LOG() << "Can not open file " << f.fileName() << " for writing: " << f.errorString();
|
||||
WARNING_LOG(m_logger) << "Can not open file " << f.fileName() << " for writing: " << f.errorString();
|
||||
return false;
|
||||
}
|
||||
m_knownBuildings.clear();
|
||||
@@ -416,7 +415,7 @@ bool BuildingViewerDdsController::writeBuildingDataToXML(const QString &modelPat
|
||||
if (!jsonConfig.exists())
|
||||
jsonConfig.setFileName(modelPath + QStringLiteral("/../buildings.json"));
|
||||
|
||||
DEBUG_LOG() << "jsonConfig:" << jsonConfig.fileName();
|
||||
DEBUG_LOG(m_logger) << "jsonConfig:" << jsonConfig.fileName();
|
||||
if (jsonConfig.exists() && jsonConfig.open(QIODevice::ReadOnly))
|
||||
{
|
||||
m_ismDtc->disconnect(this);
|
||||
@@ -444,17 +443,17 @@ bool BuildingViewerDdsController::writeBuildingDataToXML(const QString &modelPat
|
||||
continue;
|
||||
if (!m_ismDtc->isElementAssignedToExercise(mse, m_exerciseId))
|
||||
{
|
||||
DEBUG_LOG() << "Not writing mse with id " << mse.id() << " to building xml file since it is not assigned to the current exercise which has id " << m_exerciseId;
|
||||
DEBUG_LOG(m_logger) << "Not writing mse with id " << mse.id() << " to building xml file since it is not assigned to the current exercise which has id " << m_exerciseId;
|
||||
continue;
|
||||
}
|
||||
mseMap.insert(mse.id(), mse);
|
||||
}
|
||||
}
|
||||
INFO_LOG() << getSessionInfo() << "writeBuildingDataToXML(): Identified Main Structure Elements: " << mseMap.size();
|
||||
INFO_LOG(m_logger) << getSessionInfo() << "writeBuildingDataToXML(): Identified Main Structure Elements: " << mseMap.size();
|
||||
|
||||
if (!calcBaseCoordinate(mseMap))
|
||||
{
|
||||
WARNING_LOG() << "failed to calc base coordinate";
|
||||
WARNING_LOG(m_logger) << "failed to calc base coordinate";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -530,7 +529,7 @@ QString BuildingViewerDdsController::getBuildingConfigurationXml() const
|
||||
|
||||
void BuildingViewerDdsController::clearAssets()
|
||||
{
|
||||
INFO_LOG() << "clearAssets: Removing " << m_knownAssetsInBgViewer.size() << " assets";
|
||||
INFO_LOG(m_logger) << "clearAssets: Removing " << m_knownAssetsInBgViewer.size() << " assets";
|
||||
|
||||
for (const auto &strUniqueAsset : std::as_const(m_knownAssetsInBgViewer))
|
||||
m_connection->extHideMountingPointAsset(strUniqueAsset);
|
||||
@@ -635,13 +634,13 @@ void BuildingViewerDdsController::handleMountingPoint(const InfrastructureManage
|
||||
QString strfeatureID = BuildingViewer::databaseId2FeatureId(mp.buildingId());
|
||||
QString strMountingPointID = strfeatureID + QStringLiteral("_MountingPoint_") + QString::number(mountingPointId);
|
||||
|
||||
DEBUG_LOG() << "Sending asset for building id " << mp.buildingId() << " ("<<strfeatureID<<")"
|
||||
DEBUG_LOG(m_logger) << "Sending asset for building id " << mp.buildingId() << " ("<<strfeatureID<<")"
|
||||
<< " with asset_id " << mp.associatedAssetId()
|
||||
<< " matched to structure_element_id " << mp.id() << " as \"" << strMountingPointID <<" \""
|
||||
<< " with asset type \"" << strAssetType << "\"";
|
||||
|
||||
if (m_mountingPointId2AssetType.contains(mountingPointId))
|
||||
WARNING_LOG() << "Mounting point id " << mountingPointId << " already used for other asset?! Overriding...";
|
||||
WARNING_LOG(m_logger) << "Mounting point id " << mountingPointId << " already used for other asset?! Overriding...";
|
||||
|
||||
m_mountingPointId2AssetType[mountingPointId] = assetType;
|
||||
m_knownAssetsInBgViewer[mountingPointId] = strMountingPointID;
|
||||
@@ -653,24 +652,24 @@ void BuildingViewerDdsController::setCurrentTrainingAreaMap(const QString &model
|
||||
{
|
||||
if (!m_connection)
|
||||
{
|
||||
WARNING_LOG() << "BuildingViewerDdsController::setCurrentTrainingAreaMap: (!m_connection)";
|
||||
WARNING_LOG(m_logger) << "BuildingViewerDdsController::setCurrentTrainingAreaMap: (!m_connection)";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
m_connection->excDeleteBuildingList();
|
||||
|
||||
INFO_LOG() << getSessionInfo() << "[1] Initializing BgViewer with training area...";
|
||||
INFO_LOG(m_logger) << getSessionInfo() << "[1] Initializing BgViewer with training area...";
|
||||
|
||||
if (modelPath.isEmpty())
|
||||
{
|
||||
QString strErr = tr("Error initializing Building Viewer - can not find map directory.");
|
||||
DEBUG_LOG() << getSessionInfo() << "setCurrentTrainingAreaMap: " << strErr;
|
||||
DEBUG_LOG(m_logger) << getSessionInfo() << "setCurrentTrainingAreaMap: " << strErr;
|
||||
QWidget *parentWidgetx = (m_viewerInterface ? m_viewerInterface->getMainWindow() : nullptr);
|
||||
LtsWidgets::LtsMessageDialog::showMessage(parentWidgetx, strErr, tr("Error"));
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Map path for building viewer: " << modelPath;
|
||||
INFO_LOG(m_logger) << "Map path for building viewer: " << modelPath;
|
||||
|
||||
writeBuildingDataToXML(modelPath);
|
||||
|
||||
@@ -715,14 +714,14 @@ bool BuildingViewerDdsController::isValidParticipant(const ParticipantManagement
|
||||
if (participant.id() == 0)
|
||||
{
|
||||
if (m_logger.isDebugEnabled())
|
||||
DEBUG_LOG() << getSessionInfo() << "isValidParticipant: Not handling invalid participant with invalid id (0)";
|
||||
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling invalid participant with invalid id (0)";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (participant.isDeleted())
|
||||
{
|
||||
DEBUG_LOG() << getSessionInfo() << "isValidParticipant: Not handling participant with id "
|
||||
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id "
|
||||
<< participant.id() << " since it is marked as 'deleted'";
|
||||
return false;
|
||||
}
|
||||
@@ -733,7 +732,7 @@ bool BuildingViewerDdsController::isValidParticipant(const ParticipantManagement
|
||||
|
||||
if (!m_session->isVisibleParty(participant.partyId()))
|
||||
{
|
||||
DEBUG_LOG() << getSessionInfo() << "isValidParticipant: Not handling participant with id "
|
||||
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id "
|
||||
<< participant.id() << " since it is not visible for party with id " << participant.partyId();
|
||||
return false;
|
||||
}
|
||||
@@ -746,7 +745,7 @@ bool BuildingViewerDdsController::isValidParticipant(const ParticipantManagement
|
||||
if(tc == ParticipantManagement::TypeClass_def::SupportUnit ||
|
||||
tc == ParticipantManagement::TypeClass_def::Unit)
|
||||
{
|
||||
DEBUG_LOG() << getSessionInfo() << "isValidParticipant: Not handling participant with id "
|
||||
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id "
|
||||
<< participant.id() << " since its type is 'SupportUnit', 'Unit' or 'Structure'";
|
||||
return false;
|
||||
}
|
||||
@@ -758,7 +757,7 @@ void BuildingViewerDdsController::createBoobyTraps()
|
||||
{
|
||||
if (!m_aesDtc)
|
||||
return;
|
||||
DEBUG_LOG() << "BDV:: create Booby Traps: "<< m_session->exerciseId() << " is replay: " << m_session->isReplayPartition();
|
||||
DEBUG_LOG(m_logger) << "BDV:: create Booby Traps: "<< m_session->exerciseId() << " is replay: " << m_session->isReplayPartition();
|
||||
|
||||
m_aesDtc->enableBoobyTrap();
|
||||
|
||||
@@ -787,7 +786,7 @@ void BuildingViewerDdsController::createParticipants()
|
||||
{
|
||||
if (!m_ppmDtc)
|
||||
return;
|
||||
DEBUG_LOG() << "BDV:: create participants: "<< m_session->exerciseId() << " is replay: " << m_session->isReplayPartition();
|
||||
DEBUG_LOG(m_logger) << "BDV:: create participants: "<< m_session->exerciseId() << " is replay: " << m_session->isReplayPartition();
|
||||
|
||||
const int sizeL = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("BgViewer"), QStringLiteral("PlayerSymbolSize"), 20).toInt();
|
||||
|
||||
@@ -906,11 +905,11 @@ void BuildingViewerDdsController::onDynParticipantChanged(const ParticipantManag
|
||||
|
||||
void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManagement::HitLineInfo &hli, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "X 0000 onHitLineInfoChanged id=" << hli.id();
|
||||
DEBUG_LOG(m_logger) << "X 0000 onHitLineInfoChanged id=" << hli.id();
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
DEBUG_LOG() << "onHitLineInfoChanged removeHit id=" << hli.id();
|
||||
DEBUG_LOG(m_logger) << "onHitLineInfoChanged removeHit id=" << hli.id();
|
||||
m_connection->removeRoomHit(hli.id());
|
||||
return;
|
||||
}
|
||||
@@ -923,14 +922,14 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
|
||||
const ParticipantManagement::Participant &partDst = m_ppmDtc->participant(hli.injuryParticipantId());
|
||||
if (partSrc.id() == 0 || partDst.id() == 0)
|
||||
{
|
||||
ERROR_LOG() << "no knownn part: " << partSrc.id() << " dst: " << partDst.id();
|
||||
ERROR_LOG(m_logger) << "no knownn part: " << partSrc.id() << " dst: " << partDst.id();
|
||||
return;
|
||||
}
|
||||
|
||||
const QString &strFeatureID = BuildingViewer::databaseId2FeatureId(hli.injuryBuildingId());
|
||||
if (!m_viewerInterface->isViewOpen(strFeatureID.toStdString()))
|
||||
{
|
||||
DEBUG_LOG() << "building not opened: hli.buildingId()=" << hli;
|
||||
DEBUG_LOG(m_logger) << "building not opened: hli.buildingId()=" << hli;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -946,14 +945,14 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
|
||||
{
|
||||
const QVector<BuildingHit> &bHits = itBuildingHit.value();
|
||||
|
||||
DEBUG_LOG() << "Got Hit lines to add? " << bHits.size();
|
||||
DEBUG_LOG(m_logger) << "Got Hit lines to add? " << bHits.size();
|
||||
for (const BuildingHit &bh : bHits)
|
||||
{
|
||||
|
||||
const bool testFlag = (bh.chargeTypeId == hli.chargeTypeId() &&
|
||||
bh.originatorParticipantId == hli.originatorParticipantId() &&
|
||||
hli.sampleTime() - m_hitlineDuration_ms < bh.sampleTime);
|
||||
DEBUG_LOG() << "testFlag " << testFlag;
|
||||
DEBUG_LOG(m_logger) << "testFlag " << testFlag;
|
||||
|
||||
|
||||
if (bh.chargeTypeId == hli.chargeTypeId() &&
|
||||
@@ -964,10 +963,10 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "onHitLineInfoChanged: " << hli;
|
||||
DEBUG_LOG(m_logger) << "onHitLineInfoChanged: " << hli;
|
||||
|
||||
int sizeL = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("BgViewer"), QStringLiteral("PlayerSymbolSize"), 20).toInt();
|
||||
DEBUG_LOG() << "onHitLineInfoChanged createPlayerSymbols";
|
||||
DEBUG_LOG(m_logger) << "onHitLineInfoChanged createPlayerSymbols";
|
||||
createPlayerSymbols(partDst, sizeL);
|
||||
|
||||
|
||||
@@ -975,7 +974,7 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
|
||||
LtsUtils::QPoint3D originatorSrc = toRelative3D(hli.originatorPos());
|
||||
LtsUtils::QPoint3D injuryDest = toRelative3D(hli.injuryPos());
|
||||
|
||||
DEBUG_LOG() << "onHitLineInfoChanged playerHit"
|
||||
DEBUG_LOG(m_logger) << "onHitLineInfoChanged playerHit"
|
||||
<< " hli.originatorPos() z=" << hli.originatorPos().z()
|
||||
<< " hli.injuryPos() z=" <<hli.injuryPos().z()
|
||||
<< " Src=" << originatorSrc.x() << "/" << originatorSrc.y() << "/" << originatorSrc.z()
|
||||
@@ -986,7 +985,7 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
|
||||
<< " hli.injuryRoomId=" << hli.injuryRoomId();
|
||||
|
||||
|
||||
DEBUG_LOG() << "Before z-correction:"
|
||||
DEBUG_LOG(m_logger) << "Before z-correction:"
|
||||
<< " Src=" << originatorSrc.x() << "/" << originatorSrc.y() << "/" << originatorSrc.z()
|
||||
<< " Dest= " << injuryDest.x() << "/" << injuryDest.y() << "/" << injuryDest.z();
|
||||
|
||||
@@ -999,8 +998,8 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
|
||||
|
||||
double zAddOriginator = m_buildingHeight.value(hli.originatorBuildingId(), 0);
|
||||
double zAddInjury = m_buildingHeight.value(hli.injuryBuildingId(), 0);
|
||||
DEBUG_LOG() << "z-correction: zAddOriginator=" << zAddOriginator;
|
||||
DEBUG_LOG() << "z-correction: zAddInjury=" << zAddInjury;
|
||||
DEBUG_LOG(m_logger) << "z-correction: zAddOriginator=" << zAddOriginator;
|
||||
DEBUG_LOG(m_logger) << "z-correction: zAddInjury=" << zAddInjury;
|
||||
|
||||
if (hli.originatorBuildingId() <= 0)
|
||||
zAddOriginator = zAddInjury;
|
||||
@@ -1011,7 +1010,7 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
|
||||
originatorSrc.setZ(originatorSrc.z() + zAddInjury);
|
||||
injuryDest.setZ(injuryDest.z() + zAddInjury);
|
||||
|
||||
DEBUG_LOG() << "After z-correction:"
|
||||
DEBUG_LOG(m_logger) << "After z-correction:"
|
||||
<< " Src=" << originatorSrc.x() << "/" << originatorSrc.y() << "/" << originatorSrc.z()
|
||||
<< " Dest= " << injuryDest.x() << "/" << injuryDest.y() << "/" << injuryDest.z();
|
||||
|
||||
@@ -1033,7 +1032,7 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
|
||||
roomNumberSrc = itRoom.value();
|
||||
}
|
||||
else
|
||||
WARNING_LOG() << "onHitLineInfoChanged: Room id can not be mapped! Building id: " << hli.injuryBuildingId()<<", originatorRoomId: "<< hli.originatorRoomId();
|
||||
WARNING_LOG(m_logger) << "onHitLineInfoChanged: Room id can not be mapped! Building id: " << hli.injuryBuildingId()<<", originatorRoomId: "<< hli.originatorRoomId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1051,11 +1050,11 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
|
||||
roomNumberDst = itRoom.value();
|
||||
}
|
||||
else
|
||||
WARNING_LOG() << "onHitLineInfoChanged: Room id can not be mapped! Building id: " << hli.injuryBuildingId()<<", room id: "<< hli.injuryRoomId();
|
||||
WARNING_LOG(m_logger) << "onHitLineInfoChanged: Room id can not be mapped! Building id: " << hli.injuryBuildingId()<<", room id: "<< hli.injuryRoomId();
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "After translate buildingId, roomId:"
|
||||
DEBUG_LOG(m_logger) << "After translate buildingId, roomId:"
|
||||
<< " hli.originatorBuildingId=" << hli.originatorBuildingId() << " -> " << buildingIdSrc
|
||||
<< " hli.originatorRoomId=" << hli.originatorRoomId() << " -> " << roomNumberSrc
|
||||
<< " hli.injuryBuildingId=" << hli.injuryBuildingId() << " -> " << buildingIdDst
|
||||
@@ -1097,7 +1096,7 @@ void BuildingViewerDdsController::onPositionChanged(const ParticipantManagement:
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "onPositionChanged: " << position;
|
||||
DEBUG_LOG(m_logger) << "onPositionChanged: " << position;
|
||||
|
||||
|
||||
|
||||
@@ -1117,7 +1116,7 @@ void BuildingViewerDdsController::onPositionChanged(const ParticipantManagement:
|
||||
}
|
||||
else
|
||||
{
|
||||
WARNING_LOG() << "onPositionChanged: Room id can not be mapped! Building id: " << position.buildingId()<<", room id: "<< position.roomId();
|
||||
WARNING_LOG(m_logger) << "onPositionChanged: Room id can not be mapped! Building id: " << position.buildingId()<<", room id: "<< position.roomId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1156,7 +1155,7 @@ void BuildingViewerDdsController::onPositionChanged(const ParticipantManagement:
|
||||
|
||||
if (!m_baseCoordinate.isValid())
|
||||
{
|
||||
WARNING_LOG() << "not calling playerPlace as there is no base coordinate set - are there no buildings in this exercise?";
|
||||
WARNING_LOG(m_logger) << "not calling playerPlace as there is no base coordinate set - are there no buildings in this exercise?";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1195,7 +1194,7 @@ void BuildingViewerDdsController::createParticipant(const ParticipantManagement:
|
||||
{
|
||||
if (!m_baseCoordinate.isValid())
|
||||
{
|
||||
WARNING_LOG() << "not calling playerPlace as there is no base coordinate set - are there no buildings in this exercise?";
|
||||
WARNING_LOG(m_logger) << "not calling playerPlace as there is no base coordinate set - are there no buildings in this exercise?";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1240,8 +1239,8 @@ void BuildingViewerDdsController::createBoobyTrap(const AreaEffectSimulation::Bo
|
||||
pos.lat() = trap.impactPosition().lat();
|
||||
pos.lon() = trap.impactPosition().lon();
|
||||
|
||||
DEBUG_LOG() << "Try create Booby trap with id " << trap.id() << " internal id " << participant.id();
|
||||
DEBUG_LOG() << "Try create Booby trap with pos " << pos.lat() << " " << pos.lon();
|
||||
DEBUG_LOG(m_logger) << "Try create Booby trap with id " << trap.id() << " internal id " << participant.id();
|
||||
DEBUG_LOG(m_logger) << "Try create Booby trap with pos " << pos.lat() << " " << pos.lon();
|
||||
m_connection->playerCreate(participant.id(), participant.partyId(),
|
||||
buildPlayerSymbolFilePath(participant.id()),
|
||||
toRelative3D(pos),
|
||||
@@ -1321,7 +1320,7 @@ void BuildingViewerDdsController::createSymbolResultWatcher(const ParticipantMan
|
||||
std::shared_ptr<int> symbolWatcherDeleter(nullptr, [this, pSymbolWatcher, symbolWatcherBenchmark](int *)
|
||||
{
|
||||
if (symbolWatcherBenchmark && pSymbolWatcher->m_et != nullptr)
|
||||
DEBUG_LOG() << "Symbol creation took " << pSymbolWatcher->m_et->elapsed() << " ms";
|
||||
DEBUG_LOG(m_logger) << "Symbol creation took " << pSymbolWatcher->m_et->elapsed() << " ms";
|
||||
|
||||
pSymbolWatcher->deleteLater();
|
||||
});
|
||||
@@ -1329,7 +1328,7 @@ void BuildingViewerDdsController::createSymbolResultWatcher(const ParticipantMan
|
||||
|
||||
if (!pSymbolWatcher->symbolResult()->symbolImage().isValid())
|
||||
{
|
||||
WARNING_LOG() << getSessionInfo() << "'slot_SymbolWatcherResultReady': Symbol creation failed -> '!symbolImage.isValid()', BgViewer might not display symbol(s)!";
|
||||
WARNING_LOG(m_logger) << getSessionInfo() << "'slot_SymbolWatcherResultReady': Symbol creation failed -> '!symbolImage.isValid()', BgViewer might not display symbol(s)!";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1338,7 +1337,7 @@ void BuildingViewerDdsController::createSymbolResultWatcher(const ParticipantMan
|
||||
if (writeParticipantSymbols)
|
||||
if (!pSymbolWatcher->symbolResult()->symbolImage().image().save(symbolInfo.strPathToSymbolFile))
|
||||
{
|
||||
WARNING_LOG() << getSessionInfo() << "Could not write symbol file for BgViewer: \"" << symbolInfo.strPathToSymbolFile << "\", BgViewer might not display symbol(s)!";
|
||||
WARNING_LOG(m_logger) << getSessionInfo() << "Could not write symbol file for BgViewer: \"" << symbolInfo.strPathToSymbolFile << "\", BgViewer might not display symbol(s)!";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1388,7 +1387,7 @@ void BuildingViewerDdsController::onSynchronizeSimulationTime()
|
||||
m_connection->systemSetSimulationTime(m_session->partitionTime());
|
||||
}
|
||||
else
|
||||
WARNING_LOG() << getSessionInfo() << "'slotSynchronizeSimulationTime': m_session is nullptr, could not query partitionTime!";
|
||||
WARNING_LOG(m_logger) << getSessionInfo() << "'slotSynchronizeSimulationTime': m_session is nullptr, could not query partitionTime!";
|
||||
}
|
||||
|
||||
void BuildingViewerDdsController::updateBuildingRoomNames(const InfrastructureManagement::MainStructureElement& building)
|
||||
@@ -1421,7 +1420,7 @@ void BuildingViewerDdsController::onPlayerPicked(int playerId)
|
||||
if (m_ppmGuiIfc)
|
||||
m_ppmGuiIfc->showParticipantInfoWindow(playerId, true);
|
||||
else
|
||||
INFO_LOG() << "No m_ppmGuiIfc";
|
||||
INFO_LOG(m_logger) << "No m_ppmGuiIfc";
|
||||
}
|
||||
|
||||
|
||||
@@ -1430,13 +1429,13 @@ void BuildingViewerDdsController::effectGenerationUnitPicked(int structureElemen
|
||||
if (m_blgGuiIfc)
|
||||
m_blgGuiIfc->showEffectGenerationUnitWindow(structureElementId);
|
||||
else
|
||||
INFO_LOG() << "No m_blgGuiIfc";
|
||||
INFO_LOG(m_logger) << "No m_blgGuiIfc";
|
||||
}
|
||||
|
||||
|
||||
void BuildingViewerDdsController::onAssetPicked(int structureElementId)
|
||||
{
|
||||
DEBUG_LOG() << "User clicked on asset with structureElementId " << structureElementId << " from " << QString::number((quintptr)m_session->adr(), 16);
|
||||
DEBUG_LOG(m_logger) << "User clicked on asset with structureElementId " << structureElementId << " from " << QString::number((quintptr)m_session->adr(), 16);
|
||||
|
||||
if (m_session->isReplayPartition())
|
||||
return;
|
||||
@@ -1446,7 +1445,7 @@ void BuildingViewerDdsController::onAssetPicked(int structureElementId)
|
||||
auto it = m_mountingPointId2AssetType.find(structureElementId);
|
||||
if (it == m_mountingPointId2AssetType.end())
|
||||
{
|
||||
WARNING_LOG() << "onAssetPicked: User clicked on asset mounted to structureElementId " << structureElementId << " which was not added beforehand?! Ignoring...";
|
||||
WARNING_LOG(m_logger) << "onAssetPicked: User clicked on asset mounted to structureElementId " << structureElementId << " which was not added beforehand?! Ignoring...";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1454,18 +1453,18 @@ void BuildingViewerDdsController::onAssetPicked(int structureElementId)
|
||||
switch (assetType)
|
||||
{
|
||||
case BuildingViewer::AssetTypes::AnnouncementUnit:
|
||||
DEBUG_LOG() << "Clicked asset is of type is AnnouncementUnit";
|
||||
DEBUG_LOG(m_logger) << "Clicked asset is of type is AnnouncementUnit";
|
||||
if (m_avmIfc)
|
||||
m_avmIfc->showAnnouncementUnit(structureElementId);
|
||||
return;
|
||||
|
||||
case BuildingViewer::AssetTypes::EffectGenerationUnit:
|
||||
DEBUG_LOG() << "Clicked asset is of type is EffectGenerationUnit";
|
||||
DEBUG_LOG(m_logger) << "Clicked asset is of type is EffectGenerationUnit";
|
||||
effectGenerationUnitPicked(structureElementId);
|
||||
return;
|
||||
|
||||
case BuildingViewer::AssetTypes::IndoorCameraWithSpeaker:
|
||||
DEBUG_LOG() << "Clicked asset is of type is IndoorCameraWithSpeaker";
|
||||
DEBUG_LOG(m_logger) << "Clicked asset is of type is IndoorCameraWithSpeaker";
|
||||
if (m_avmIfc)
|
||||
{
|
||||
m_avmIfc->showCamera(m_irreplacableWidget, structureElementId);
|
||||
@@ -1474,12 +1473,12 @@ void BuildingViewerDdsController::onAssetPicked(int structureElementId)
|
||||
return;
|
||||
|
||||
case BuildingViewer::AssetTypes::IndoorCamera:
|
||||
DEBUG_LOG() << "Clicked asset is of type is IndoorCamera";
|
||||
DEBUG_LOG(m_logger) << "Clicked asset is of type is IndoorCamera";
|
||||
if (m_avmIfc)
|
||||
m_avmIfc->showCamera(m_irreplacableWidget, structureElementId);
|
||||
return;
|
||||
}
|
||||
WARNING_LOG() << "onAssetPicked: BuildingViewer::AssetTypes is unknown: " << assetType;
|
||||
WARNING_LOG(m_logger) << "onAssetPicked: BuildingViewer::AssetTypes is unknown: " << assetType;
|
||||
}
|
||||
|
||||
|
||||
@@ -1514,12 +1513,12 @@ void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings::
|
||||
{
|
||||
int topidId = static_cast <int>(hli.id());
|
||||
|
||||
DEBUG_LOG() << "onBuildingHitLineInfoChanged: " << hli;
|
||||
DEBUG_LOG(m_logger) << "onBuildingHitLineInfoChanged: " << hli;
|
||||
|
||||
const QString &strFeatureID = BuildingViewer::databaseId2FeatureId(hli.buildingId());
|
||||
if (!m_viewerInterface->isViewOpen(strFeatureID.toStdString()))
|
||||
{
|
||||
DEBUG_LOG() << "building not opened: hli.buildingId()=" << hli.buildingId() ;
|
||||
DEBUG_LOG(m_logger) << "building not opened: hli.buildingId()=" << hli.buildingId() ;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1529,11 +1528,11 @@ void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings::
|
||||
|
||||
|
||||
const bool isRemove = (modType == DataModification::eRemoved);
|
||||
DEBUG_LOG() << "isRemove=" << isRemove;
|
||||
DEBUG_LOG(m_logger) << "isRemove=" << isRemove;
|
||||
|
||||
if (isRemove)
|
||||
{
|
||||
DEBUG_LOG() << "onBuildingHitLineInfoChanged: remove ";
|
||||
DEBUG_LOG(m_logger) << "onBuildingHitLineInfoChanged: remove ";
|
||||
QVector<BuildingHit> &bhl = m_buildingHits[hli.buildingId()];
|
||||
|
||||
auto it = std::find_if(bhl.begin(), bhl.end(), [hli](const BuildingHit &bh)
|
||||
@@ -1543,7 +1542,7 @@ void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings::
|
||||
|
||||
if (it != bhl.end())
|
||||
{
|
||||
DEBUG_LOG() << "bhl.erase(it)";
|
||||
DEBUG_LOG(m_logger) << "bhl.erase(it)";
|
||||
bhl.erase(it);
|
||||
}
|
||||
m_connection->removeRoomHit(hli.id());
|
||||
@@ -1578,7 +1577,7 @@ void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings::
|
||||
|
||||
void BuildingViewerDdsController::onCleanupBuildingHitlines()
|
||||
{
|
||||
DEBUG_LOG() << "onCleanupBuildingHitlines: ";
|
||||
DEBUG_LOG(m_logger) << "onCleanupBuildingHitlines: ";
|
||||
const qint64 tNow = QDateTime::currentMSecsSinceEpoch();
|
||||
const auto isOutdated = [tNow](const BuildingHit &bh)
|
||||
{
|
||||
@@ -1600,7 +1599,7 @@ void BuildingViewerDdsController::onMainStructureElementChanged(const Infrastruc
|
||||
{
|
||||
if (mse.modelId() != 0 && m_ismDtc->isElementAssignedToExercise(mse, m_exerciseId))
|
||||
{
|
||||
DEBUG_LOG() << "m_buildingHeight.insert id=" << mse.id() << " z=" << mse.geoPosition().z();
|
||||
DEBUG_LOG(m_logger) << "m_buildingHeight.insert id=" << mse.id() << " z=" << mse.geoPosition().z();
|
||||
m_buildingHeight.insert(mse.id(), mse.geoPosition().z());
|
||||
QHash<int, int> roomId2RoomNumber;
|
||||
for (const InfrastructureManagement::StructureElement &se : mse.elements())
|
||||
@@ -1638,7 +1637,7 @@ void BuildingViewerDdsController::onFireEventFlashTimer()
|
||||
|
||||
if (m_session == nullptr)
|
||||
{
|
||||
DEBUG_LOG() << getSessionInfo() << "onFireEventFlashTimer: Session is not available, flashing not possible!";
|
||||
DEBUG_LOG(m_logger) << getSessionInfo() << "onFireEventFlashTimer: Session is not available, flashing not possible!";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user