Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen

- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung
- 44 Export-Header Include-Pfade korrigiert (_export.h)
- 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h)
- INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros
- Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits)
- FATAL_LOG Makro hinzugefügt
- InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h)
- FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h)
- AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp)
- SymbolAppearance Klasse vollständig definiert mit content() Methode
- BuildingComponentFilter Klasse definiert mit Copy-Konstruktor
- Ftc Factory: nullptr Return (abstract class)
- AesFilter Klasse in aes.hpp hinzugefügt
- Dtc Klasse in ppm.hpp mit participantChanged Signal
- AesType Enum: alle 15 At* Werte definiert
- AesEffectState_def: EsReceived hinzugefügt
- DataModification Enum: eAdded/eModified/eRemoved
- function_reply_object.h → core_types.h Include-Pfad (72 Dateien)
- Enum-Class-Streaming Template-Operator in INGLLogger.h
- ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen
- ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge
- QRegExp → QRegularExpression in tpm_js_parser.cpp
- .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert
- Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-08-19 06:06:24 +02:00
1 parent 010f91928a
commit b774f4035c
2785 files changed
+18754 -18316

No files matched your search

@@ -230,16 +230,16 @@ void BuildingManager::Tick(const dtEntity::Message &message)
dtEntityOSG::LayerAttachPointComponent *lac;
if (!mEntityManager->GetComponent(dspl.mAttachPointId, lac))
{
WARNING_LOG(m_logger) << "NO sLayerAttachPointComponent";
WARNING_LOG() << "NO sLayerAttachPointComponent";
return;
}
if( shotdspl.mGeode.valid())
{
DEBUG_LOG(m_logger) << "displayTimeOver OVER KILL IT drawables: !" << shotdspl.mGeode->getNumDrawables();
DEBUG_LOG() << "displayTimeOver OVER KILL IT drawables: !" << shotdspl.mGeode->getNumDrawables();
while (shotdspl.mGeode->getNumDrawables() > 0)
shotdspl.mGeode->removeDrawables(0, shotdspl.mGeode->getNumDrawables());
bool ret = lac->GetNode()->asGroup()->removeChild(shotdspl.mGeode);
DEBUG_LOG(m_logger) << "displayTimeOver OVER KILL IT! result: " << ret;
DEBUG_LOG() << "displayTimeOver OVER KILL IT! result: " << ret;
dtEntity::GetWindowInterface()->RequestRedraw(dspl.mContextId);
@@ -248,7 +248,7 @@ void BuildingManager::Tick(const dtEntity::Message &message)
if (lifeTimeOver)
{
DEBUG_LOG(m_logger) << "lifeTimeOver OVER ERASE IT!";
DEBUG_LOG() << "lifeTimeOver OVER ERASE IT!";
itShotDisplay = dspl.mShotDisplays.erase(itShotDisplay);
}
else
@@ -280,7 +280,7 @@ bool BuildingManager::getFloorOfRoom(const std::string &bdlgFeatureId, int roomN
void BuildingManager::updateShotDuration(unsigned int newDuration_s)
{
DEBUG_LOG(m_logger) << LOGFUNCTION << " newDuration_s= " << newDuration_s;
DEBUG_LOG() << Q_FUNC_INFO << " newDuration_s= " << newDuration_s;
QMutexLocker locker(&m_mutexShots);
@@ -294,7 +294,7 @@ void BuildingManager::updateShotDuration(unsigned int newDuration_s)
if (!building->mDisplays.empty())
{
BuildingDisplay buildingDisplay = building->mDisplays.front();
DEBUG_LOG(m_logger) << LOGFUNCTION << " buildingDisplay.mContextId " << buildingDisplay.mContextId;
DEBUG_LOG() << Q_FUNC_INFO << " buildingDisplay.mContextId " << buildingDisplay.mContextId;
updateShots(*building, buildingDisplay);
dtEntity::GetWindowInterface()->RequestRedraw(buildingDisplay.mContextId);
}
@@ -426,7 +426,7 @@ bool BuildingManager::displayBuilding(const std::string& featureId, unsigned int
bool BuildingManager::displayBuilding(unsigned int contextid, dtEntity::EntityId buildingid, const osg::Vec4& bgcolor, ViewMode viewmode, bool exactPos)
{
DEBUG_LOG (m_logger ) << "BuildingManager::displayBuilding";
DEBUG_LOG() << "BuildingManager::displayBuilding";
mExactPos = exactPos;
dtEntity::EntityManager &em = *mEntityManager;
@@ -629,7 +629,7 @@ bool BuildingManager::displayBuilding(unsigned int contextid, dtEntity::EntityId
{
DEBUG_LOG(m_logger) << "mDevices.size = " << building->mDevices.size();
DEBUG_LOG() << "mDevices.size = " << building->mDevices.size();
if (!building->mDevices.empty())
{
for (Device *d : building->mDevices)
@@ -1333,7 +1333,7 @@ void BuildingManager::updatePlayerPosition(const std::string &navmeshgrpname, dt
osg::Vec3d BuildingManager::remapPosition(const Building &bd, const BuildingDisplay &dspl, const osg::Vec3d &world, int roomNumber)
{
DEBUG_LOG(m_logger) << LOGFUNCTION << " mFeatureId = " << bd.mFeatureId.c_str()
DEBUG_LOG() << Q_FUNC_INFO << " mFeatureId = " << bd.mFeatureId.c_str()
<< ", roomNumber= " << roomNumber;
if (roomNumber > 0)
@@ -1349,7 +1349,7 @@ osg::Vec3d BuildingManager::remapPosition(const Building &bd, const BuildingDisp
if (level.mFloorId == floorOut)
{
const osg::Vec3d &l = world * bd.mWorldToLocal;
DEBUG_LOG(m_logger) << LOGFUNCTION << " mFeatureId = " << bd.mFeatureId.c_str()
DEBUG_LOG() << Q_FUNC_INFO << " mFeatureId = " << bd.mFeatureId.c_str()
<< ", roomNumber= " << roomNumber
<< ", floorOut= " << floorOut
<< ", world.z()= " << world.z()
@@ -1369,7 +1369,7 @@ osg::Vec3d BuildingManager::remapPosition(const Building &bd, const BuildingDisp
if (i == (numlevels - 1) || (dspl.mLevels[i + 1].mHeightAboveGround - 0.1f) > l[2])
{
const BuildingLevel &level = dspl.mLevels[i];
DEBUG_LOG(m_logger) << LOGFUNCTION
DEBUG_LOG() << Q_FUNC_INFO
<< " remapXPosition"
<< ", l.z=" << l.z()
<< ", i=" << i
@@ -1603,11 +1603,11 @@ dtEntity::EntityId BuildingManager::getWorldPlayerIdFromLocalPlayer(dtEntity::En
void BuildingManager::removeShoot(int32_t id)
{
DEBUG_LOG(m_logger) << "removeShoot id=" << id;
DEBUG_LOG() << "removeShoot id=" << id;
QMutexLocker locker(&m_mutexShots);
for (Building *bldg : mBuildings)
{
DEBUG_LOG(m_logger) << "Vorher: bldg->mShots.size()=" << bldg->mShots.size();
DEBUG_LOG() << "Vorher: bldg->mShots.size()=" << bldg->mShots.size();
auto it = std::remove_if(bldg->mShots.begin(), bldg->mShots.end(),
[id]( Shot *shot)
{
@@ -1625,12 +1625,12 @@ void BuildingManager::removeShoot(int32_t id)
bool wasRemoved = (it != bldg->mShots.end());
bldg->mShots.erase(it, bldg->mShots.end());
DEBUG_LOG(m_logger) << "Nachher: bldg->mShots.size()=" << bldg->mShots.size();
DEBUG_LOG() << "Nachher: bldg->mShots.size()=" << bldg->mShots.size();
if (wasRemoved)
for (BuildingDisplay &dspl : bldg->mDisplays)
{
DEBUG_LOG(m_logger) << "wasRemoved id=" << id;
DEBUG_LOG() << "wasRemoved id=" << id;
updateShots(*bldg, dspl);
dtEntity::GetWindowInterface()->RequestRedraw(dspl.mContextId);
}
@@ -1694,13 +1694,13 @@ void BuildingManager::showShoot(int32_t id, dtEntity::EntityId shooter, dtEntity
}
}
bldg->mShots.push_back(shot);
DEBUG_LOG(m_logger) << "XXXX SIM TIME CREATED = " << QString::number(_simTimeCreated, 'f', 5) << " and SIM TIME IS " <<QString::number(dtEntity::GetSystemInterface()->GetSimulationTime(), 'f', 5);
DEBUG_LOG() << "XXXX SIM TIME CREATED = " << QString::number(_simTimeCreated, 'f', 5) << " and SIM TIME IS " <<QString::number(dtEntity::GetSystemInterface()->GetSimulationTime(), 'f', 5);
for (BuildingDisplay &bldgDispl : bldg->mDisplays)
{
ShotDisplay shotDispl;
shotDispl.mShot = shot;
DEBUG_LOG(m_logger) << "mShotDisplays.push_back id=" << shot->getId();
DEBUG_LOG() << "mShotDisplays.push_back id=" << shot->getId();
bldgDispl.mShotDisplays.push_back(std::move(shotDispl));
updateShots(*bldg, bldgDispl);
@@ -1715,7 +1715,7 @@ void BuildingManager::showShoot(int32_t id, dtEntity::EntityId shooter, dtEntity
void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl)
{
DEBUG_LOG(m_logger) << LOGFUNCTION << " Building= " << bd.mWorldBuildingId;
DEBUG_LOG() << Q_FUNC_INFO << " Building= " << bd.mWorldBuildingId;
dtEntityOSG::CameraComponent *camcomp;
if (!mEntityManager->GetComponent(dspl.mCameraId, camcomp))
@@ -1728,7 +1728,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl)
const double simTime = dtEntity::GetSystemInterface()->GetSimulationTime();
DEBUG_LOG(m_logger) << LOGFUNCTION << " dspl.mShotDisplays.size()= " << dspl.mShotDisplays.size()
DEBUG_LOG() << Q_FUNC_INFO << " dspl.mShotDisplays.size()= " << dspl.mShotDisplays.size()
<< ", simTime=" << (int)simTime;
for (ShotDisplay &shotdspl : dspl.mShotDisplays)
@@ -1754,7 +1754,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl)
if (shotdspl.mGeode)
numParents = shotdspl.mGeode->getNumParents();
DEBUG_LOG(m_logger) << LOGFUNCTION << " BB shotdspl.mShot->getId()= " << shotdspl.mShot->getId()
DEBUG_LOG() << Q_FUNC_INFO << " BB shotdspl.mShot->getId()= " << shotdspl.mShot->getId()
<< ", shotdspl.mGeode=" << shotdspl.mGeode
<< ", shotdspl.mGeode->getNumParents=" << numParents
<< ", bDisplay=" << bDisplay;
@@ -1762,7 +1762,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl)
if ((!shotdspl.mGeode || shotdspl.mGeode->getNumParents() == 0) && bDisplay)
{
DEBUG_LOG(m_logger) << "NEW mGeode! id " << shotdspl.mShot->getId();
DEBUG_LOG() << "NEW mGeode! id " << shotdspl.mShot->getId();
if (!shotdspl.mGeode)
shotdspl.mGeode = new osg::Geode();
@@ -1770,7 +1770,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl)
ss->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
ss->setRenderBinDetails(240001, "RenderBin");
osg::ref_ptr<osg::LineWidth> lw = new osg::LineWidth();
DEBUG_LOG(m_logger) << "NEW LINE " << shotdspl.mShot->getLineType();
DEBUG_LOG() << "NEW LINE " << shotdspl.mShot->getLineType();
if (shotdspl.mShot->getLineType() < 2 )
{
@@ -1806,7 +1806,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl)
shooterpos[2] += 1;
targetpos[2] += 1;
DEBUG_LOG(m_logger) << LOGFUNCTION << " shotdspl.mShot->getId()= " << shotdspl.mShot->getId()
DEBUG_LOG() << Q_FUNC_INFO << " shotdspl.mShot->getId()= " << shotdspl.mShot->getId()
<< ", getShooterPos.z()=" << shotdspl.mShot->getShooterPos().z()
<< ", BuildingIdSrc=" << shotdspl.mShot->getBuildingIdSrc() << ", RoomNumberSrc=" << shotdspl.mShot->getRoomNumberSrc()
<< ", shooterpos=" << shooterpos
@@ -1906,16 +1906,16 @@ void BuildingManager::updateDevices(const Building &bd, BuildingDisplay &dspl)
void BuildingManager::addDeviceToBuilding(dtEntity::EntityId iconmainid, dtEntity::EntityId buildingid,
const osg::Vec3d &pos, const std::string &iconpath)
{
DEBUG_LOG(m_logger) << "addDeviceToBuilding";
DEBUG_LOG() << "addDeviceToBuilding";
for (Building *building : mBuildings)
{
DEBUG_LOG(m_logger) << "mWorldBuildingId=" << building->mWorldBuildingId
DEBUG_LOG() << "mWorldBuildingId=" << building->mWorldBuildingId
<< " buildingid=" << buildingid;
if (building->mWorldBuildingId != buildingid)
continue;
DEBUG_LOG(m_logger) << "addDeviceToBuilding 1";
DEBUG_LOG() << "addDeviceToBuilding 1";
Device *device = new Device();
device->mWorldPlayerId = iconmainid;
@@ -1923,10 +1923,10 @@ void BuildingManager::addDeviceToBuilding(dtEntity::EntityId iconmainid, dtEntit
device->mPosition = pos;
building->mDevices.push_back(device);
DEBUG_LOG(m_logger) << "building->mDisplays.size=" << building->mDisplays.size();
DEBUG_LOG() << "building->mDisplays.size=" << building->mDisplays.size();
for (BuildingDisplay &dspl : building->mDisplays)
{
DEBUG_LOG(m_logger) << "addDeviceToBuilding 2";
DEBUG_LOG() << "addDeviceToBuilding 2";
DeviceDisplay dd;
dd.mDevice = device;
dd.mWorldPlayerId = iconmainid;
@@ -475,8 +475,6 @@ private:
std::map<std::string, std::map<int,int> > mRoomToFloorPerBldg;
NGL::INGLLogger &m_logger;
};
}
@@ -30,7 +30,6 @@ static inline std::string createRoomNumberString(int roomNumber)
CommunicationInterfaceInternal::CommunicationInterfaceInternal(VCtrl::ViewerInterface* pviewerInterface)
: m_pviewerInterface(pviewerInterface)
, m_logger(getLogger("CommunicationInterface"))
{
assert(m_pviewerInterface);
}
@@ -71,7 +70,7 @@ void CommunicationInterfaceInternal::playerPlace(int playerID, const LtsUtils::Q
auto it = m_playerId2String.find(playerID);
if (it == m_playerId2String.end())
{
WARNING_LOG(m_logger) << "Trying to set player position for unknown (=not created) player with id " << playerID;
WARNING_LOG() << "Trying to set player position for unknown (=not created) player with id " << playerID;
return;
}
@@ -149,7 +148,7 @@ void CommunicationInterfaceInternal::playerHit(const int32_t id, int playerIdSrc
int buildingIdSrc, int roomNumberSrc, int buildingIdDst, int roomNumberDst,
int lineType, int64_t time)
{
DEBUG_LOG(m_logger) << "playerHit id= " << id;
DEBUG_LOG() << "playerHit id= " << id;
const std::string playerIdStrDst = m_playerId2String.value(playerIdDst);
const std::string playerIdStrSrc = m_playerId2String.value(playerIdSrc);
const VCtrl::Vec3d src(posSrc.x(), posSrc.y(), posSrc.z());
@@ -163,7 +162,7 @@ void CommunicationInterfaceInternal::playerHit(const int32_t id, int playerIdSrc
void CommunicationInterfaceInternal::buildingHit(const int32_t id, int buildingId, int damagePercent, const QMap<int,int>& mapRoomDestructions)
{
DEBUG_LOG(m_logger) << "buildingHit for building " << buildingId
DEBUG_LOG() << "buildingHit for building " << buildingId
<< " id=" << id
<< " damagePercent " << damagePercent
<< " roomlist size: " << mapRoomDestructions.size();
@@ -182,12 +181,12 @@ void CommunicationInterfaceInternal::buildingHit(const int32_t id, int buildingI
for (auto it = mapRoomDestructions.begin(); it != mapRoomDestructions.end(); ++it)
{
const int roomNumber = it.key();
DEBUG_LOG(m_logger) << "BuildingId " << buildingId
DEBUG_LOG() << "BuildingId " << buildingId
<< ", room: "<< roomNumber
<< ", destruction: " << it.value();
std::string roomNumberStr = createRoomNumberString(roomNumber);
if (!m_pviewerInterface->SetRoomDestructionValue(buildingIdStr, roomNumberStr,it.value() / 100.f))
ERROR_LOG(m_logger) << "SetRoomDestructionValue failed for room "<< roomNumber;
ERROR_LOG() << "SetRoomDestructionValue failed for room "<< roomNumber;
}
}
}
@@ -202,7 +201,7 @@ void CommunicationInterfaceInternal::roomHit(const int32_t id, int playerIdSrc,
const std::string roomNumberStrDst = createRoomNumberString(roomNumber);
const VCtrl::Vec3d src(posSrc.x(), posSrc.y(), posSrc.z());
DEBUG_LOG(m_logger) << "roomHit for building palyer " << playerIdStrSrc
DEBUG_LOG() << "roomHit for building palyer " << playerIdStrSrc
<< " building " << buildingIdStrDst
<< " room " << roomNumberStrDst
<< " id=" << id;
@@ -213,7 +212,7 @@ void CommunicationInterfaceInternal::roomHit(const int32_t id, int playerIdSrc,
void CommunicationInterfaceInternal::removeRoomHit(const int32_t id)
{
DEBUG_LOG(m_logger) << "removeRoomHit id=" << id;
DEBUG_LOG() << "removeRoomHit id=" << id;
m_pviewerInterface->removeShoot(id);
}
@@ -286,21 +285,21 @@ void CommunicationInterfaceInternal::systemSetMountingPoint(const Infrastructure
if(!show)
{
DEBUG_LOG(m_logger) << "Hiding mounting point \"" << mountingPointName<< "\"";
DEBUG_LOG() << "Hiding mounting point \"" << mountingPointName<< "\"";
m_pviewerInterface->HideDeviceIcon(mountingPointName.toStdString());
return;
}
if(m_deviceMap.contains(mountingPointName))
{
WARNING_LOG(m_logger) << "Trying to add a mounting point which was already added - trying to re-add";
WARNING_LOG() << "Trying to add a mounting point which was already added - trying to re-add";
m_pviewerInterface->HideDeviceIcon(mountingPointName.toStdString());
}
const VCtrl::Vec3d position(x,y,z);
if(m_pviewerInterface->ShowDeviceIcon(mountingPointName.toStdString(), buildingIdStr, position, filename.toStdString())) {
DEBUG_LOG(m_logger) << "Added mounting point to scene: " << mountingPointName;
DEBUG_LOG() << "Added mounting point to scene: " << mountingPointName;
m_deviceMap[mountingPointName] = DeviceInfo(buildingId, mountingPointName);
}
}
@@ -334,7 +333,7 @@ void CommunicationInterfaceInternal::excDeleteBuildingList()
void CommunicationInterfaceInternal::excSetHitlineDuration(uint32_t duration_s)
{
DEBUG_LOG(m_logger) << "excSetHitlineDuration=" << duration_s;
DEBUG_LOG() << "excSetHitlineDuration=" << duration_s;
m_pviewerInterface->setHitLineDuration(duration_s);
}
@@ -452,7 +451,7 @@ void CommunicationInterfaceInternal::clearCameras()
if (!di.deviceName.startsWith(QLatin1String("Camera")))
continue;
if (!m_pviewerInterface->HideDeviceIcon(di.deviceName.toStdString()))
ERROR_LOG(m_logger) << "Could not remove camera with id " << di.deviceName;
ERROR_LOG() << "Could not remove camera with id " << di.deviceName;
}
m_deviceMap.clear();
}
@@ -498,10 +497,10 @@ void CommunicationInterfaceInternal::PlayerPicked(const std::string &strId)
QString str = QString::fromStdString(strId);
int structureElementId = str.remove(0, str.lastIndexOf(QStringLiteral("_")) + 1).toInt();
INFO_LOG(m_logger) << "Picked mounting point with id " << strId
INFO_LOG() << "Picked mounting point with id " << strId
<< " mountingPointId=" << structureElementId;
if(structureElementId < 0) {
WARNING_LOG(m_logger) << "Picked mounting point with id " << strId;
WARNING_LOG() << "Picked mounting point with id " << strId;
return;
}
@@ -18,7 +18,7 @@
#include <QVector3D>
#include "logger.h"
#include <Common/buildingviewercommon_export.h>
#include "buildingviewercommon_export.h"
#include <BuildingViewer/share/exccommands.h>
#include <InfrastructureManagement/Shared/ism_mounting_point.h>
#include <ParticipantManagement/ppm_data_plugin_interface.h>
@@ -156,7 +156,6 @@ private:
VCtrl::ViewerInterface *m_pviewerInterface = nullptr;
bool m_useExactPositioning = true;
LOGGER_T m_logger;
};
}
@@ -29,7 +29,6 @@ BgViewerController::BgViewerController(QObject *parent)
, m_pBgViewerDDSController(nullptr)
, m_bgvApp(nullptr)
, m_tickTimer(new QTimer(this))
, m_logger(getLogger("BgViewerControllerSingleton"))
{
m_tickTimer->setInterval(1000 / 25);
connect(m_tickTimer, &QTimer::timeout, this, [this]() { m_mainloop.tick(); });
@@ -183,7 +182,7 @@ QString BgViewerController::buildingModelPath()
void BgViewerController::clearInterfaces(const LtsSession::DdsConnectionParams &conParams)
{
DEBUG_LOG(m_logger) << "BgViewerControllerSingleton::clearInterfaces()";
DEBUG_LOG() << "BgViewerControllerSingleton::clearInterfaces()";
if (m_pBgViewerDDSController && m_currentDdsConnParams == conParams)
{
m_pBgViewerDDSController->uninitialize();
@@ -220,13 +219,13 @@ PluginProvider *BgViewerController::activeSession() const
bool BgViewerController::init(PluginProvider *pSession, bool bStartRendering, const QString &modelPath)
{
DEBUG_LOG(m_logger) << "getDdsController init: " << pSession->toString();
DEBUG_LOG() << "getDdsController init: " << pSession->toString();
if (m_currentDdsConnParams == pSession->connParams())
{
if (m_initExerciseWasSuccessful)
{
DEBUG_LOG(m_logger) << "BgViewerControllerSingleton::init Already initialized";
DEBUG_LOG() << "BgViewerControllerSingleton::init Already initialized";
slotLoadBuilding();
@@ -252,7 +251,7 @@ bool BgViewerController::forceInit(PluginProvider *pSession)
delete m_pBgViewerDDSController;
m_pBgViewerDDSController = new BuildingViewerDdsController(m_comIfc, m_viewerInterface);
DEBUG_LOG(m_logger) << "FORCE INIT! with " << pSession;
DEBUG_LOG() << "FORCE INIT! with " << pSession;
return (m_pBgViewerDDSController->init(m_bgViewerBaseLayoutWidget, buildingModelPath(), pSession));
}
@@ -282,11 +281,11 @@ void BgViewerController::showBgViewerInfoMessageBox()
bool BgViewerController::startBgViewerAppInSession(PluginProvider* pStartingSession)
{
DEBUG_LOG(m_logger) << std::hex << this << " startBgViewerAppInSession " << (m_currentDdsConnParams == pStartingSession->connParams());
DEBUG_LOG() << std::hex << this << " startBgViewerAppInSession " << (m_currentDdsConnParams == pStartingSession->connParams());
if (m_bgvApp && (m_currentDdsConnParams == pStartingSession->connParams()))
{
INFO_LOG(m_logger) << std::hex << this << " BuildingViewer already opened. Doing nothing...";
INFO_LOG() << std::hex << this << " BuildingViewer already opened. Doing nothing...";
return true;
}
@@ -299,7 +298,7 @@ bool BgViewerController::startBgViewerAppInSession(PluginProvider* pStartingSess
if (m_bgvApp)
{
DEBUG_LOG(m_logger) << std::hex << this << " Releasing m_bgvApp";
DEBUG_LOG() << std::hex << this << " Releasing m_bgvApp";
delete m_bgvApp;
m_bgvApp = nullptr;
@@ -311,7 +310,7 @@ bool BgViewerController::startBgViewerAppInSession(PluginProvider* pStartingSess
m_bgvApp = LtsAppManager::LtsAppManager::getInstance()->createApp(LtsAppDescriptor::App::BuildingViewer, pStartingSession->connParams());
if (!m_bgvApp || !m_bgvApp->sessions().size())
{
ERROR_LOG(m_logger) << std::hex << this << " m_bgvApp is nullptr or has no associated session!";
ERROR_LOG() << std::hex << this << " m_bgvApp is nullptr or has no associated session!";
return false;
}
@@ -336,7 +335,7 @@ bool BgViewerController::startBgViewerAppInSession(PluginProvider* pStartingSess
connect(m_bgvApp, &LtsPluginManager::LtsPluginManager::destroyed,
this, [this]()
{
DEBUG_LOG(m_logger) << std::hex << this << " LtsPluginManager destroyed m_bgvApp";
DEBUG_LOG() << std::hex << this << " LtsPluginManager destroyed m_bgvApp";
m_tickTimer->stop();
clearInterfaces(m_currentDdsConnParams);
m_comIfc->excCloseAllViews();
@@ -8,7 +8,7 @@
#include <QTimer>
#include <QString>
#include <Common/buildingviewercommon_export.h>
#include "buildingviewercommon_export.h"
#include <BuildingViewer/share/exccommands.h>
#include <LtsWidgets/lts_dialog.h>
#include <LtsSession/lts_session_data_dds.h>
@@ -121,7 +121,6 @@ private:
QTimer *m_tickTimer{nullptr};
QWidget *m_bgViewerBaseLayoutWidget{nullptr};
LOGGER_T m_logger;
};
}
@@ -38,7 +38,6 @@ static inline QString gStrSymbolFolderPath()
BuildingViewerDdsController::BuildingViewerDdsController(CommunicationInterfaceInternal *connection, VCtrl::ViewerInterface* viewerInterface)
: m_connection(connection)
, m_viewerInterface(viewerInterface)
, m_logger(getLogger("BuildingViewerDdsController"))
{}
@@ -53,7 +52,7 @@ BuildingViewerDdsController::~BuildingViewerDdsController()
bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QString &modelPath, PluginProvider *session)
{
DEBUG_LOG(m_logger) << "BDV:: init";
DEBUG_LOG() << "BDV:: init";
m_session = session;
m_irreplacableWidget = irreplacableWidget;
@@ -62,7 +61,7 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin
if (!m_session)
{
ERROR_LOG(m_logger) << "No m_session for BuildingViewerController!";
ERROR_LOG() << "No m_session for BuildingViewerController!";
return false;
}
@@ -72,7 +71,7 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin
{
m_session = nullptr;
DEBUG_LOG(m_logger) << getSessionInfo() << "BDV:: BuildingViewerDdsController: m_session has been destroyed!";
DEBUG_LOG() << getSessionInfo() << "BDV:: BuildingViewerDdsController: m_session has been destroyed!";
stopAndClearTimer();
uninitialize();
}
@@ -81,35 +80,35 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin
m_asbIfc = session->asbIfc();
if (!m_asbIfc)
{
ERROR_LOG(m_logger) << "Fetching 'm_asbIfc' failed!";
ERROR_LOG() << "Fetching 'm_asbIfc' failed!";
return false;
}
m_bldDtc = session->bldDtc();
if (!m_bldDtc)
{
ERROR_LOG(m_logger) << "Fetching 'm_bldDtc' failed!";
ERROR_LOG() << "Fetching 'm_bldDtc' failed!";
return false;
}
m_ismDtc = session->ismDtc();
if (!m_ismDtc)
{
ERROR_LOG(m_logger) << "Fetching 'm_ismDtc' failed!";
ERROR_LOG() << "Fetching 'm_ismDtc' failed!";
return false;
}
m_pdmDtc = session->pdmDtc();
if (!m_pdmDtc)
{
ERROR_LOG(m_logger) << "Fetching 'm_pdmDtc' failed!";
ERROR_LOG() << "Fetching 'm_pdmDtc' failed!";
return false;
}
m_ismIfc = session->ismDataIfc();
if (!m_ismIfc)
{
WARNING_LOG(m_logger) << "Fetching 'm_ismIfc' failed!";
WARNING_LOG() << "Fetching 'm_ismIfc' failed!";
return false;
}
connect(m_ismIfc.get(), &InfrastructureManagement::ForeignDataInterface::mountingPointChanged,
@@ -133,7 +132,7 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin
if (!dir.mkpath(QStringLiteral(".")))
{
ERROR_LOG(m_logger) << getSessionInfo() << "Could not create path \"" << gStrSymbolFolderPath() << "\" which is required to store BgViewer symbol files!";
ERROR_LOG() << getSessionInfo() << "Could not create path \"" << gStrSymbolFolderPath() << "\" which is required to store BgViewer symbol files!";
return false;
}
@@ -141,7 +140,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(m_logger) << getSessionInfo() << "BuildingViewerDdsController::init: The order of the following output must be [1],[2],[3],[4],[5],[6]";
INFO_LOG() << getSessionInfo() << "BuildingViewerDdsController::init: The order of the following output must be [1],[2],[3],[4],[5],[6]";
@@ -170,10 +169,10 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin
void BuildingViewerDdsController::onBgViewerInitFinished()
{
DEBUG_LOG(m_logger) << "onBgViewerInitFinished";
DEBUG_LOG() << "onBgViewerInitFinished";
INFO_LOG(m_logger) << getSessionInfo() << "[2] Training area initialization acknowledged by BgViewer";
INFO_LOG(m_logger) << getSessionInfo() << "[3] Sending mounting points, teams, ..., to BgViewer";
INFO_LOG() << getSessionInfo() << "[2] Training area initialization acknowledged by BgViewer";
INFO_LOG() << getSessionInfo() << "[3] Sending mounting points, teams, ..., to BgViewer";
if (!m_pSimTimeSyncTimer)
{
@@ -193,7 +192,7 @@ void BuildingViewerDdsController::onBgViewerInitFinished()
const bool useExactPositioning = ps->value(QStringLiteral("bld"), QStringLiteral("useExactPositioning")).toBool();
m_connection->excUseExactPositioning(useExactPositioning);
INFO_LOG(m_logger) << getSessionInfo() << "[4] Getting building DDS data ('mainStructureElements')";
INFO_LOG() << getSessionInfo() << "[4] Getting building DDS data ('mainStructureElements')";
connect(m_ismDtc.get(), &InfrastructureManagement::Interface::Dtc::mainStructureElementChanged,
this, &BuildingViewerDdsController::onMainStructureElementChanged);
@@ -201,17 +200,17 @@ void BuildingViewerDdsController::onBgViewerInitFinished()
{
onMainStructureElementChanged(data, DataModification::eAdded);
});
INFO_LOG(m_logger) << getSessionInfo() << "\t[4.1] Done";
INFO_LOG() << getSessionInfo() << "\t[4.1] Done";
INFO_LOG(m_logger) << getSessionInfo() << "[5] Creating participants";
INFO_LOG() << getSessionInfo() << "[5] Creating participants";
createParticipants();
INFO_LOG(m_logger) << getSessionInfo() << "\t[5.1] Done";
INFO_LOG(m_logger) << getSessionInfo() << "[5] Creating Booby Trap";
INFO_LOG() << getSessionInfo() << "\t[5.1] Done";
INFO_LOG() << getSessionInfo() << "[5] Creating Booby Trap";
createBoobyTraps();
INFO_LOG(m_logger) << getSessionInfo() << "\t[5.2] Done";
INFO_LOG() << getSessionInfo() << "\t[5.2] Done";
INFO_LOG(m_logger) << getSessionInfo() << "[6] Getting building DDS data ('buildingStates')";
INFO_LOG() << 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)
@@ -220,7 +219,7 @@ void BuildingViewerDdsController::onBgViewerInitFinished()
});
connect(m_bldDtc.get(), &Buildings::Interface::Dtc::buildingHitLineInfoChanged,
this, &BuildingViewerDdsController::onBuildingHitLineInfoChanged, Qt::UniqueConnection);
INFO_LOG(m_logger) << getSessionInfo() << "\t[6.1] Done";
INFO_LOG() << getSessionInfo() << "\t[6.1] Done";
m_connection->excSetGlobalTransparency(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("BgViewer"), QStringLiteral("GlobalTransparency"), 75).toInt() );
@@ -260,7 +259,7 @@ void BuildingViewerDdsController::onBgViewerInitFinished()
}
m_pBuildingHitlineCleanupTimer->start();
INFO_LOG(m_logger) << getSessionInfo() << "[7] Emitting 'signalDdsInitFinished'";
INFO_LOG() << getSessionInfo() << "[7] Emitting 'signalDdsInitFinished'";
m_ddsInitFinished = true;
emit signalDdsInitFinished();
onSynchronizeSimulationTime();
@@ -270,7 +269,7 @@ void BuildingViewerDdsController::onBgViewerInitFinished()
void BuildingViewerDdsController::stopAndClearTimer()
{
DEBUG_LOG(m_logger) << "stopAndClearTimer";
DEBUG_LOG() << "stopAndClearTimer";
if (m_pFireEventFlashTimer)
m_pFireEventFlashTimer->stop();
@@ -285,15 +284,15 @@ void BuildingViewerDdsController::stopAndClearTimer()
void BuildingViewerDdsController::uninitialize()
{
DEBUG_LOG(m_logger) << "uninitialize";
DEBUG_LOG() << "uninitialize";
if (!m_bldDtc)
return;
if (m_ddsInitFinished)
DEBUG_LOG(m_logger) << "Flag 'm_ddsInitFinished' set which means that initialization had been finished completely";
DEBUG_LOG() << "Flag 'm_ddsInitFinished' set which means that initialization had been finished completely";
else
WARNING_LOG(m_logger) << "Flag 'm_ddsInitFinished' has not been set within timeout value, forcing quit!";
WARNING_LOG() << "Flag 'm_ddsInitFinished' has not been set within timeout value, forcing quit!";
stopAndClearTimer();
@@ -322,7 +321,7 @@ void BuildingViewerDdsController::uninitialize()
m_ddsInitFinished = false;
m_buildingHeight.clear();
DEBUG_LOG(m_logger) << "BuildingViewerDdsController::uninitialize() finished";
DEBUG_LOG() << "BuildingViewerDdsController::uninitialize() finished";
}
QPointF BuildingViewerDdsController::toRelativePosition(const Core::GeoPosition &geoPos) const
@@ -345,7 +344,7 @@ LtsUtils::QPoint3D BuildingViewerDdsController::toRelative3D(const Core::GeoPosi
bool BuildingViewerDdsController::clear()
{
DEBUG_LOG(m_logger) << "clear m_connection->playerClear();";
DEBUG_LOG() << "clear m_connection->playerClear();";
m_connection->playerClear();
return true;
}
@@ -355,7 +354,7 @@ bool BuildingViewerDdsController::syncTeams()
{
if (!m_ppmDtc)
return false;
INFO_LOG(m_logger) << "BuildingViewerDdsController::syncTeams";
INFO_LOG() << "BuildingViewerDdsController::syncTeams";
m_connection->setTeamConfiguration(m_ppmDtc->partys());
return true;
@@ -387,7 +386,7 @@ bool BuildingViewerDdsController::calcBaseCoordinate(const QMap<qint32, Infrastr
}
if (!bAtLeasOneFound)
{
WARNING_LOG(m_logger) << "No building available in exercise " << m_exerciseId;
WARNING_LOG() << "No building available in exercise " << m_exerciseId;
return false;
}
m_baseCoordinate = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPosition.lon(), geoPosition.lat());
@@ -406,7 +405,7 @@ bool BuildingViewerDdsController::writeBuildingDataToXML(const QString &modelPat
QFile f(getBuildingConfigurationXml());
if (!f.open(QIODevice::WriteOnly))
{
WARNING_LOG(m_logger) << "Can not open file " << f.fileName() << " for writing: " << f.errorString();
WARNING_LOG() << "Can not open file " << f.fileName() << " for writing: " << f.errorString();
return false;
}
m_knownBuildings.clear();
@@ -417,7 +416,7 @@ bool BuildingViewerDdsController::writeBuildingDataToXML(const QString &modelPat
if (!jsonConfig.exists())
jsonConfig.setFileName(modelPath + QStringLiteral("/../buildings.json"));
DEBUG_LOG(m_logger) << "jsonConfig:" << jsonConfig.fileName();
DEBUG_LOG() << "jsonConfig:" << jsonConfig.fileName();
if (jsonConfig.exists() && jsonConfig.open(QIODevice::ReadOnly))
{
m_ismDtc->disconnect(this);
@@ -445,17 +444,17 @@ bool BuildingViewerDdsController::writeBuildingDataToXML(const QString &modelPat
continue;
if (!m_ismDtc->isElementAssignedToExercise(mse, 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;
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;
continue;
}
mseMap.insert(mse.id(), mse);
}
}
INFO_LOG(m_logger) << getSessionInfo() << "writeBuildingDataToXML(): Identified Main Structure Elements: " << mseMap.size();
INFO_LOG() << getSessionInfo() << "writeBuildingDataToXML(): Identified Main Structure Elements: " << mseMap.size();
if (!calcBaseCoordinate(mseMap))
{
WARNING_LOG(m_logger) << "failed to calc base coordinate";
WARNING_LOG() << "failed to calc base coordinate";
return false;
}
@@ -531,7 +530,7 @@ QString BuildingViewerDdsController::getBuildingConfigurationXml() const
void BuildingViewerDdsController::clearAssets()
{
INFO_LOG(m_logger) << "clearAssets: Removing " << m_knownAssetsInBgViewer.size() << " assets";
INFO_LOG() << "clearAssets: Removing " << m_knownAssetsInBgViewer.size() << " assets";
for (const auto &strUniqueAsset : std::as_const(m_knownAssetsInBgViewer))
m_connection->extHideMountingPointAsset(strUniqueAsset);
@@ -636,13 +635,13 @@ void BuildingViewerDdsController::handleMountingPoint(const InfrastructureManage
QString strfeatureID = BuildingViewer::databaseId2FeatureId(mp.buildingId());
QString strMountingPointID = strfeatureID + QStringLiteral("_MountingPoint_") + QString::number(mountingPointId);
DEBUG_LOG(m_logger) << "Sending asset for building id " << mp.buildingId() << " ("<<strfeatureID<<")"
DEBUG_LOG() << "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(m_logger) << "Mounting point id " << mountingPointId << " already used for other asset?! Overriding...";
WARNING_LOG() << "Mounting point id " << mountingPointId << " already used for other asset?! Overriding...";
m_mountingPointId2AssetType[mountingPointId] = assetType;
m_knownAssetsInBgViewer[mountingPointId] = strMountingPointID;
@@ -654,24 +653,24 @@ void BuildingViewerDdsController::setCurrentTrainingAreaMap(const QString &model
{
if (!m_connection)
{
WARNING_LOG(m_logger) << "BuildingViewerDdsController::setCurrentTrainingAreaMap: (!m_connection)";
WARNING_LOG() << "BuildingViewerDdsController::setCurrentTrainingAreaMap: (!m_connection)";
return;
}
m_connection->excDeleteBuildingList();
INFO_LOG(m_logger) << getSessionInfo() << "[1] Initializing BgViewer with training area...";
INFO_LOG() << getSessionInfo() << "[1] Initializing BgViewer with training area...";
if (modelPath.isEmpty())
{
QString strErr = tr("Error initializing Building Viewer - can not find map directory.");
DEBUG_LOG(m_logger) << getSessionInfo() << "setCurrentTrainingAreaMap: " << strErr;
DEBUG_LOG() << getSessionInfo() << "setCurrentTrainingAreaMap: " << strErr;
QWidget *parentWidgetx = (m_viewerInterface ? m_viewerInterface->getMainWindow() : nullptr);
LtsWidgets::LtsMessageDialog::showMessage(parentWidgetx, strErr, tr("Error"));
return;
}
INFO_LOG(m_logger) << "Map path for building viewer: " << modelPath;
INFO_LOG() << "Map path for building viewer: " << modelPath;
writeBuildingDataToXML(modelPath);
@@ -716,14 +715,14 @@ bool BuildingViewerDdsController::isValidParticipant(const ParticipantManagement
if (participant.id() == 0)
{
if (m_logger.isDebugEnabled())
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling invalid participant with invalid id (0)";
DEBUG_LOG() << getSessionInfo() << "isValidParticipant: Not handling invalid participant with invalid id (0)";
return false;
}
if (participant.isDeleted())
{
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id "
DEBUG_LOG() << getSessionInfo() << "isValidParticipant: Not handling participant with id "
<< participant.id() << " since it is marked as 'deleted'";
return false;
}
@@ -734,7 +733,7 @@ bool BuildingViewerDdsController::isValidParticipant(const ParticipantManagement
if (!m_session->isVisibleParty(participant.partyId()))
{
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id "
DEBUG_LOG() << getSessionInfo() << "isValidParticipant: Not handling participant with id "
<< participant.id() << " since it is not visible for party with id " << participant.partyId();
return false;
}
@@ -747,7 +746,7 @@ bool BuildingViewerDdsController::isValidParticipant(const ParticipantManagement
if(tc == ParticipantManagement::TypeClass_def::SupportUnit ||
tc == ParticipantManagement::TypeClass_def::Unit)
{
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id "
DEBUG_LOG() << getSessionInfo() << "isValidParticipant: Not handling participant with id "
<< participant.id() << " since its type is 'SupportUnit', 'Unit' or 'Structure'";
return false;
}
@@ -759,7 +758,7 @@ void BuildingViewerDdsController::createBoobyTraps()
{
if (!m_aesDtc)
return;
DEBUG_LOG(m_logger) << "BDV:: create Booby Traps: "<< m_session->exerciseId() << " is replay: " << m_session->isReplayPartition();
DEBUG_LOG() << "BDV:: create Booby Traps: "<< m_session->exerciseId() << " is replay: " << m_session->isReplayPartition();
m_aesDtc->enableBoobyTrap();
@@ -788,7 +787,7 @@ void BuildingViewerDdsController::createParticipants()
{
if (!m_ppmDtc)
return;
DEBUG_LOG(m_logger) << "BDV:: create participants: "<< m_session->exerciseId() << " is replay: " << m_session->isReplayPartition();
DEBUG_LOG() << "BDV:: create participants: "<< m_session->exerciseId() << " is replay: " << m_session->isReplayPartition();
const int sizeL = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("BgViewer"), QStringLiteral("PlayerSymbolSize"), 20).toInt();
@@ -907,11 +906,11 @@ void BuildingViewerDdsController::onDynParticipantChanged(const ParticipantManag
void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManagement::HitLineInfo &hli, DataModification modType)
{
DEBUG_LOG(m_logger) << "X 0000 onHitLineInfoChanged id=" << hli.id();
DEBUG_LOG() << "X 0000 onHitLineInfoChanged id=" << hli.id();
if (modType == DataModification::eRemoved)
{
DEBUG_LOG(m_logger) << "onHitLineInfoChanged removeHit id=" << hli.id();
DEBUG_LOG() << "onHitLineInfoChanged removeHit id=" << hli.id();
m_connection->removeRoomHit(hli.id());
return;
}
@@ -924,14 +923,14 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
const ParticipantManagement::Participant &partDst = m_ppmDtc->participant(hli.injuryParticipantId());
if (partSrc.id() == 0 || partDst.id() == 0)
{
ERROR_LOG(m_logger) << "no knownn part: " << partSrc.id() << " dst: " << partDst.id();
ERROR_LOG() << "no knownn part: " << partSrc.id() << " dst: " << partDst.id();
return;
}
const QString &strFeatureID = BuildingViewer::databaseId2FeatureId(hli.injuryBuildingId());
if (!m_viewerInterface->isViewOpen(strFeatureID.toStdString()))
{
DEBUG_LOG(m_logger) << "building not opened: hli.buildingId()=" << hli;
DEBUG_LOG() << "building not opened: hli.buildingId()=" << hli;
return;
}
@@ -947,14 +946,14 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
{
const QVector<BuildingHit> &bHits = itBuildingHit.value();
DEBUG_LOG(m_logger) << "Got Hit lines to add? " << bHits.size();
DEBUG_LOG() << "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(m_logger) << "testFlag " << testFlag;
DEBUG_LOG() << "testFlag " << testFlag;
if (bh.chargeTypeId == hli.chargeTypeId() &&
@@ -965,10 +964,10 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
}
}
DEBUG_LOG(m_logger) << "onHitLineInfoChanged: " << hli;
DEBUG_LOG() << "onHitLineInfoChanged: " << hli;
int sizeL = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("BgViewer"), QStringLiteral("PlayerSymbolSize"), 20).toInt();
DEBUG_LOG(m_logger) << "onHitLineInfoChanged createPlayerSymbols";
DEBUG_LOG() << "onHitLineInfoChanged createPlayerSymbols";
createPlayerSymbols(partDst, sizeL);
@@ -976,7 +975,7 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
LtsUtils::QPoint3D originatorSrc = toRelative3D(hli.originatorPos());
LtsUtils::QPoint3D injuryDest = toRelative3D(hli.injuryPos());
DEBUG_LOG(m_logger) << "onHitLineInfoChanged playerHit"
DEBUG_LOG() << "onHitLineInfoChanged playerHit"
<< " hli.originatorPos() z=" << hli.originatorPos().z()
<< " hli.injuryPos() z=" <<hli.injuryPos().z()
<< " Src=" << originatorSrc.x() << "/" << originatorSrc.y() << "/" << originatorSrc.z()
@@ -987,7 +986,7 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
<< " hli.injuryRoomId=" << hli.injuryRoomId();
DEBUG_LOG(m_logger) << "Before z-correction:"
DEBUG_LOG() << "Before z-correction:"
<< " Src=" << originatorSrc.x() << "/" << originatorSrc.y() << "/" << originatorSrc.z()
<< " Dest= " << injuryDest.x() << "/" << injuryDest.y() << "/" << injuryDest.z();
@@ -1000,8 +999,8 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
double zAddOriginator = m_buildingHeight.value(hli.originatorBuildingId(), 0);
double zAddInjury = m_buildingHeight.value(hli.injuryBuildingId(), 0);
DEBUG_LOG(m_logger) << "z-correction: zAddOriginator=" << zAddOriginator;
DEBUG_LOG(m_logger) << "z-correction: zAddInjury=" << zAddInjury;
DEBUG_LOG() << "z-correction: zAddOriginator=" << zAddOriginator;
DEBUG_LOG() << "z-correction: zAddInjury=" << zAddInjury;
if (hli.originatorBuildingId() <= 0)
zAddOriginator = zAddInjury;
@@ -1012,7 +1011,7 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
originatorSrc.setZ(originatorSrc.z() + zAddInjury);
injuryDest.setZ(injuryDest.z() + zAddInjury);
DEBUG_LOG(m_logger) << "After z-correction:"
DEBUG_LOG() << "After z-correction:"
<< " Src=" << originatorSrc.x() << "/" << originatorSrc.y() << "/" << originatorSrc.z()
<< " Dest= " << injuryDest.x() << "/" << injuryDest.y() << "/" << injuryDest.z();
@@ -1034,7 +1033,7 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
roomNumberSrc = itRoom.value();
}
else
WARNING_LOG(m_logger) << "onHitLineInfoChanged: Room id can not be mapped! Building id: " << hli.injuryBuildingId()<<", originatorRoomId: "<< hli.originatorRoomId();
WARNING_LOG() << "onHitLineInfoChanged: Room id can not be mapped! Building id: " << hli.injuryBuildingId()<<", originatorRoomId: "<< hli.originatorRoomId();
}
}
@@ -1052,11 +1051,11 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
roomNumberDst = itRoom.value();
}
else
WARNING_LOG(m_logger) << "onHitLineInfoChanged: Room id can not be mapped! Building id: " << hli.injuryBuildingId()<<", room id: "<< hli.injuryRoomId();
WARNING_LOG() << "onHitLineInfoChanged: Room id can not be mapped! Building id: " << hli.injuryBuildingId()<<", room id: "<< hli.injuryRoomId();
}
}
DEBUG_LOG(m_logger) << "After translate buildingId, roomId:"
DEBUG_LOG() << "After translate buildingId, roomId:"
<< " hli.originatorBuildingId=" << hli.originatorBuildingId() << " -> " << buildingIdSrc
<< " hli.originatorRoomId=" << hli.originatorRoomId() << " -> " << roomNumberSrc
<< " hli.injuryBuildingId=" << hli.injuryBuildingId() << " -> " << buildingIdDst
@@ -1098,7 +1097,7 @@ void BuildingViewerDdsController::onPositionChanged(const ParticipantManagement:
return;
}
DEBUG_LOG(m_logger) << "onPositionChanged: " << position;
DEBUG_LOG() << "onPositionChanged: " << position;
@@ -1118,7 +1117,7 @@ void BuildingViewerDdsController::onPositionChanged(const ParticipantManagement:
}
else
{
WARNING_LOG(m_logger) << "onPositionChanged: Room id can not be mapped! Building id: " << position.buildingId()<<", room id: "<< position.roomId();
WARNING_LOG() << "onPositionChanged: Room id can not be mapped! Building id: " << position.buildingId()<<", room id: "<< position.roomId();
}
}
@@ -1157,7 +1156,7 @@ void BuildingViewerDdsController::onPositionChanged(const ParticipantManagement:
if (!m_baseCoordinate.isValid())
{
WARNING_LOG(m_logger) << "not calling playerPlace as there is no base coordinate set - are there no buildings in this exercise?";
WARNING_LOG() << "not calling playerPlace as there is no base coordinate set - are there no buildings in this exercise?";
return;
}
@@ -1196,7 +1195,7 @@ void BuildingViewerDdsController::createParticipant(const ParticipantManagement:
{
if (!m_baseCoordinate.isValid())
{
WARNING_LOG(m_logger) << "not calling playerPlace as there is no base coordinate set - are there no buildings in this exercise?";
WARNING_LOG() << "not calling playerPlace as there is no base coordinate set - are there no buildings in this exercise?";
return;
}
@@ -1241,8 +1240,8 @@ void BuildingViewerDdsController::createBoobyTrap(const AreaEffectSimulation::Bo
pos.lat() = trap.impactPosition().lat();
pos.lon() = trap.impactPosition().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();
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();
m_connection->playerCreate(participant.id(), participant.partyId(),
buildPlayerSymbolFilePath(participant.id()),
toRelative3D(pos),
@@ -1322,7 +1321,7 @@ void BuildingViewerDdsController::createSymbolResultWatcher(const ParticipantMan
std::shared_ptr<int> symbolWatcherDeleter(nullptr, [this, pSymbolWatcher, symbolWatcherBenchmark](int *)
{
if (symbolWatcherBenchmark && pSymbolWatcher->m_et != nullptr)
DEBUG_LOG(m_logger) << "Symbol creation took " << pSymbolWatcher->m_et->elapsed() << " ms";
DEBUG_LOG() << "Symbol creation took " << pSymbolWatcher->m_et->elapsed() << " ms";
pSymbolWatcher->deleteLater();
});
@@ -1330,7 +1329,7 @@ void BuildingViewerDdsController::createSymbolResultWatcher(const ParticipantMan
if (!pSymbolWatcher->symbolResult()->symbolImage().isValid())
{
WARNING_LOG(m_logger) << getSessionInfo() << "'slot_SymbolWatcherResultReady': Symbol creation failed -> '!symbolImage.isValid()', BgViewer might not display symbol(s)!";
WARNING_LOG() << getSessionInfo() << "'slot_SymbolWatcherResultReady': Symbol creation failed -> '!symbolImage.isValid()', BgViewer might not display symbol(s)!";
return;
}
@@ -1339,7 +1338,7 @@ void BuildingViewerDdsController::createSymbolResultWatcher(const ParticipantMan
if (writeParticipantSymbols)
if (!pSymbolWatcher->symbolResult()->symbolImage().image().save(symbolInfo.strPathToSymbolFile))
{
WARNING_LOG(m_logger) << getSessionInfo() << "Could not write symbol file for BgViewer: \"" << symbolInfo.strPathToSymbolFile << "\", BgViewer might not display symbol(s)!";
WARNING_LOG() << getSessionInfo() << "Could not write symbol file for BgViewer: \"" << symbolInfo.strPathToSymbolFile << "\", BgViewer might not display symbol(s)!";
return;
}
@@ -1389,7 +1388,7 @@ void BuildingViewerDdsController::onSynchronizeSimulationTime()
m_connection->systemSetSimulationTime(m_session->partitionTime());
}
else
WARNING_LOG(m_logger) << getSessionInfo() << "'slotSynchronizeSimulationTime': m_session is nullptr, could not query partitionTime!";
WARNING_LOG() << getSessionInfo() << "'slotSynchronizeSimulationTime': m_session is nullptr, could not query partitionTime!";
}
void BuildingViewerDdsController::updateBuildingRoomNames(const InfrastructureManagement::MainStructureElement& building)
@@ -1422,7 +1421,7 @@ void BuildingViewerDdsController::onPlayerPicked(int playerId)
if (m_ppmGuiIfc)
m_ppmGuiIfc->showParticipantInfoWindow(playerId, true);
else
INFO_LOG(m_logger) << "No m_ppmGuiIfc";
INFO_LOG() << "No m_ppmGuiIfc";
}
@@ -1431,13 +1430,13 @@ void BuildingViewerDdsController::effectGenerationUnitPicked(int structureElemen
if (m_blgGuiIfc)
m_blgGuiIfc->showEffectGenerationUnitWindow(structureElementId);
else
INFO_LOG(m_logger) << "No m_blgGuiIfc";
INFO_LOG() << "No m_blgGuiIfc";
}
void BuildingViewerDdsController::onAssetPicked(int structureElementId)
{
DEBUG_LOG(m_logger) << "User clicked on asset with structureElementId " << structureElementId << " from " << QString::number((quintptr)m_session->adr(), 16);
DEBUG_LOG() << "User clicked on asset with structureElementId " << structureElementId << " from " << QString::number((quintptr)m_session->adr(), 16);
if (m_session->isReplayPartition())
return;
@@ -1447,7 +1446,7 @@ void BuildingViewerDdsController::onAssetPicked(int structureElementId)
auto it = m_mountingPointId2AssetType.find(structureElementId);
if (it == m_mountingPointId2AssetType.end())
{
WARNING_LOG(m_logger) << "onAssetPicked: User clicked on asset mounted to structureElementId " << structureElementId << " which was not added beforehand?! Ignoring...";
WARNING_LOG() << "onAssetPicked: User clicked on asset mounted to structureElementId " << structureElementId << " which was not added beforehand?! Ignoring...";
return;
}
@@ -1455,18 +1454,18 @@ void BuildingViewerDdsController::onAssetPicked(int structureElementId)
switch (assetType)
{
case BuildingViewer::AssetTypes::AnnouncementUnit:
DEBUG_LOG(m_logger) << "Clicked asset is of type is AnnouncementUnit";
DEBUG_LOG() << "Clicked asset is of type is AnnouncementUnit";
if (m_avmIfc)
m_avmIfc->showAnnouncementUnit(structureElementId);
return;
case BuildingViewer::AssetTypes::EffectGenerationUnit:
DEBUG_LOG(m_logger) << "Clicked asset is of type is EffectGenerationUnit";
DEBUG_LOG() << "Clicked asset is of type is EffectGenerationUnit";
effectGenerationUnitPicked(structureElementId);
return;
case BuildingViewer::AssetTypes::IndoorCameraWithSpeaker:
DEBUG_LOG(m_logger) << "Clicked asset is of type is IndoorCameraWithSpeaker";
DEBUG_LOG() << "Clicked asset is of type is IndoorCameraWithSpeaker";
if (m_avmIfc)
{
m_avmIfc->showCamera(m_irreplacableWidget, structureElementId);
@@ -1475,12 +1474,12 @@ void BuildingViewerDdsController::onAssetPicked(int structureElementId)
return;
case BuildingViewer::AssetTypes::IndoorCamera:
DEBUG_LOG(m_logger) << "Clicked asset is of type is IndoorCamera";
DEBUG_LOG() << "Clicked asset is of type is IndoorCamera";
if (m_avmIfc)
m_avmIfc->showCamera(m_irreplacableWidget, structureElementId);
return;
}
WARNING_LOG(m_logger) << "onAssetPicked: BuildingViewer::AssetTypes is unknown: " << assetType;
WARNING_LOG() << "onAssetPicked: BuildingViewer::AssetTypes is unknown: " << assetType;
}
@@ -1515,12 +1514,12 @@ void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings::
{
int topidId = static_cast <int>(hli.id());
DEBUG_LOG(m_logger) << "onBuildingHitLineInfoChanged: " << hli;
DEBUG_LOG() << "onBuildingHitLineInfoChanged: " << hli;
const QString &strFeatureID = BuildingViewer::databaseId2FeatureId(hli.buildingId());
if (!m_viewerInterface->isViewOpen(strFeatureID.toStdString()))
{
DEBUG_LOG(m_logger) << "building not opened: hli.buildingId()=" << hli.buildingId() ;
DEBUG_LOG() << "building not opened: hli.buildingId()=" << hli.buildingId() ;
return;
}
@@ -1530,11 +1529,11 @@ void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings::
const bool isRemove = (modType == DataModification::eRemoved);
DEBUG_LOG(m_logger) << "isRemove=" << isRemove;
DEBUG_LOG() << "isRemove=" << isRemove;
if (isRemove)
{
DEBUG_LOG(m_logger) << "onBuildingHitLineInfoChanged: remove ";
DEBUG_LOG() << "onBuildingHitLineInfoChanged: remove ";
QVector<BuildingHit> &bhl = m_buildingHits[hli.buildingId()];
auto it = std::find_if(bhl.begin(), bhl.end(), [hli](const BuildingHit &bh)
@@ -1544,7 +1543,7 @@ void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings::
if (it != bhl.end())
{
DEBUG_LOG(m_logger) << "bhl.erase(it)";
DEBUG_LOG() << "bhl.erase(it)";
bhl.erase(it);
}
m_connection->removeRoomHit(hli.id());
@@ -1579,7 +1578,7 @@ void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings::
void BuildingViewerDdsController::onCleanupBuildingHitlines()
{
DEBUG_LOG(m_logger) << "onCleanupBuildingHitlines: ";
DEBUG_LOG() << "onCleanupBuildingHitlines: ";
const qint64 tNow = QDateTime::currentMSecsSinceEpoch();
const auto isOutdated = [tNow](const BuildingHit &bh)
{
@@ -1601,7 +1600,7 @@ void BuildingViewerDdsController::onMainStructureElementChanged(const Infrastruc
{
if (mse.modelId() != 0 && m_ismDtc->isElementAssignedToExercise(mse, m_exerciseId))
{
DEBUG_LOG(m_logger) << "m_buildingHeight.insert id=" << mse.id() << " z=" << mse.geoPosition().z();
DEBUG_LOG() << "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())
@@ -1639,7 +1638,7 @@ void BuildingViewerDdsController::onFireEventFlashTimer()
if (m_session == nullptr)
{
DEBUG_LOG(m_logger) << getSessionInfo() << "onFireEventFlashTimer: Session is not available, flashing not possible!";
DEBUG_LOG() << getSessionInfo() << "onFireEventFlashTimer: Session is not available, flashing not possible!";
return;
}
@@ -23,7 +23,7 @@
#include <Plugins/SituationReplay/srp_data_plugin_interface.h>
#include <LtsCoordTrans/lts_coord_trans.h>
#include <LtsUtilsCore/qpoint3d.h>
#include <Common/buildingviewercommon_export.h>
#include "buildingviewercommon_export.h"
#include <BuildingViewer/share/exccommands.h>
#include <LtsUtilsGuiDds/request_helper.h>
#include <viewerinterface.h>
@@ -171,7 +171,6 @@ private:
LtsCoordTrans::UtmCoordinate m_baseCoordinate;
QHash < int32_t, double > m_buildingHeight;
QWidget *m_irreplacableWidget {nullptr};
NGL::INGLLogger &m_logger;
};
}
@@ -6,7 +6,7 @@
#include <QString>
#include <QJsonObject>
#include <LtsUtilsCore/qpoint3d.h>
#include <Common/buildingviewercommon_export.h>
#include "buildingviewercommon_export.h"
namespace BuildingViewer
{
@@ -5,7 +5,7 @@
#include <memory>
#include <QObject>
#include <Common/buildingviewercommon_export.h>
#include "buildingviewercommon_export.h"
namespace AdvancedSymbology
{
@@ -4,7 +4,7 @@
#pragma once
#include <NGLLogger/INGLLogger.h>
#include <Common/buildingviewercommon_export.h>
#include "buildingviewercommon_export.h"
namespace BuildingViewer
{
@@ -20,7 +20,6 @@ BuildingEdit::BuildingEdit(QWidget *parent)
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel)
, m_requestHelper(new LtsUtils::RequestHelper(this))
, m_ui(new Ui::BuildingEdit)
, m_logger(getLogger("BuildingViewer::BuildingEdit"))
{
m_ui->setupUi(this);
@@ -176,7 +175,7 @@ bool BuildingEdit::apply()
DEBUG_LOG(m_logger) << "fortifyFactors.size()=" << fortifyFactors.size();
DEBUG_LOG() << "fortifyFactors.size()=" << fortifyFactors.size();
if (fortifyFactors.size())
{
m_requestHelper->addRequest([this, fortifyFactors]()
@@ -188,7 +187,7 @@ bool BuildingEdit::apply()
fortifyRequest.fortifyFactors().reserve(fortifyFactors.size());
for (const auto &e : fortifyFactors)
{
DEBUG_LOG(m_logger) << "push_back= databaseId=" << e.structureElementId()
DEBUG_LOG() << "push_back= databaseId=" << e.structureElementId()
<< " fortifyFactor=" << e.fortifyFactor();
fortifyRequest.fortifyFactors().push_back(Buildings::FortifyFactor(e.structureElementId(), e.fortifyFactor()));
}
@@ -306,7 +305,7 @@ bool BuildingEdit::sendBuildingStateRequest(ProjectDataManagement::Vulnerability
requestData.buildings(buildings);
requestData.vulnerabilityState(state);
DEBUG_LOG(m_logger) << LOGFUNCTION << "currentData: " << state;
DEBUG_LOG() << Q_FUNC_INFO << "currentData: " << state;
return m_bldFtc->setBuildingStatesRequest(requestData, this);
});
@@ -81,7 +81,6 @@ private:
QString m_buildingName;
int32_t m_buildingDatabaseId = 0;
int32_t m_buildingId = 0;
NGL::INGLLogger &m_logger;
};
}
@@ -27,7 +27,6 @@ BuildingEditModel::BuildingEditModel(QObject *parent,
, m_ismDtc(ismDtc)
, m_bldDtc(bldDtc)
, m_buildingName(QString())
, m_logger(getLogger("BuildingViewer::BuildingEdit"))
{}
QVariant BuildingEditModel::data(const QModelIndex &index, int role) const
@@ -77,7 +76,7 @@ QVariant BuildingEditModel::data(const QModelIndex &index, int role) const
bool BuildingEditModel::slotUpdateRow(const BuildingViewer::TreeItem &room, const bool fortifyChanged)
{
DEBUG_LOG(m_logger) << "slotUpdateRow isBuilding=" << room.isBuilding()
DEBUG_LOG() << "slotUpdateRow isBuilding=" << room.isBuilding()
<< " isFloor" << room.isFloor()
<< " isRoom" << room.isRoom();
@@ -123,7 +122,7 @@ bool BuildingEditModel::onInsertRow(int &row, const QModelIndex &parent, const B
bool BuildingEditModel::init(int32_t mseId)
{
INFO_LOG(m_logger) << "init mseId=" << mseId;
INFO_LOG() << "init mseId=" << mseId;
NGLTreeModel::resetModel();
m_mapRoomsWithChangedFortifyFactor.clear();
@@ -142,7 +141,7 @@ bool BuildingEditModel::init(int32_t mseId)
const std::vector<InfrastructureManagement::StructureElement> &vecElements = building.elements();
for (const auto &se : vecElements)
{
DEBUG_LOG(m_logger) << "se: " << se;
DEBUG_LOG() << "se: " << se;
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Building)
{
BuildingViewer::TreeItem rootItemBuilding(se);
@@ -164,7 +163,7 @@ bool BuildingEditModel::init(int32_t mseId)
for (const auto &se : vecElements)
{
DEBUG_LOG(m_logger) << "se: =" << se;
DEBUG_LOG() << "se: =" << se;
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType_def::Floor)
{
BuildingViewer::TreeItem itemRoom(se);
@@ -209,7 +208,7 @@ bool BuildingEditModel::init(int32_t mseId)
}
catch (const std::out_of_range &e)
{
WARNING_LOG(m_logger) << "Caught exception while trying to get superior id for building " << rootName << " with room with mounting point id: " << se.mountingPointId() << ": " << e.what();
WARNING_LOG() << "Caught exception while trying to get superior id for building " << rootName << " with room with mounting point id: " << se.mountingPointId() << ": " << e.what();
return false;
}
@@ -232,7 +231,7 @@ bool BuildingEditModel::init(int32_t mseId)
int parentId = item.hasSuperior() ? item.getSuperior() : rootId;
if (!parentItemIndexCache.contains(parentId))
{
ERROR_LOG(m_logger) << "Invalid building structure! Tree can not be built!";
ERROR_LOG() << "Invalid building structure! Tree can not be built!";
return false;
}
@@ -256,7 +255,7 @@ QModelIndex BuildingEditModel::modelIndexByMountingPointId(int mountingPointId)
if (privateData(mi)->data().value<TreeItem>().mountingPointId() == mountingPointId)
return mi;
}
WARNING_LOG(m_logger)<<"Could not find modelindex for given room mountig point id: " << mountingPointId;
WARNING_LOG()<<"Could not find modelindex for given room mountig point id: " << mountingPointId;
return {};
}
@@ -266,7 +265,7 @@ QModelIndex BuildingEditModel::modelIndexByStructureElementId(int structureEleme
auto it = m_mapModelIndices.find(structureElementId);
if (it == m_mapModelIndices.end())
{
WARNING_LOG(m_logger)<<"Could not find modelindex for given room structreElementId: " << structureElementId;
WARNING_LOG()<<"Could not find modelindex for given room structreElementId: " << structureElementId;
return {};
}
return it.value();
@@ -63,8 +63,6 @@ private:
std::shared_ptr<Buildings::Interface::Dtc> m_bldDtc;
QString m_buildingName;
NGL::INGLLogger &m_logger;
};
@@ -13,9 +13,8 @@ ReplayHandler::ReplayHandler(int buildingTopicStart_s, int buildingTopicEnd_s, c
, m_replayDuration_ms(0)
, m_startOffset_ms(0)
, m_replayInfo(replay)
, m_logger(getLogger("ReplayHandler"))
{
DEBUG_LOG(m_logger) << "buildingTopicStart_s = " << buildingTopicStart_s
DEBUG_LOG() << "buildingTopicStart_s = " << buildingTopicStart_s
<< ", buildingTopicEnd_s = " << buildingTopicEnd_s
<< ", replay.topicStart_s = " << replay.topicStart_s
<< ", replay.topicEnd_s = " << replay.topicEnd_s
@@ -31,7 +30,7 @@ ReplayHandler::ReplayHandler(int buildingTopicStart_s, int buildingTopicEnd_s, c
m_actualReplayStart_ms = replay.replayStart_ms + start_diff_ms;
m_startOffset_ms = 0;
DEBUG_LOG(m_logger) << "Replay starts before Building-Topic: Shift replay starting point to m_actualReplayStart_ms = " << m_actualReplayStart_ms;
DEBUG_LOG() << "Replay starts before Building-Topic: Shift replay starting point to m_actualReplayStart_ms = " << m_actualReplayStart_ms;
}
else
{
@@ -39,7 +38,7 @@ ReplayHandler::ReplayHandler(int buildingTopicStart_s, int buildingTopicEnd_s, c
m_actualReplayStart_ms = replay.replayStart_ms;
m_startOffset_ms = std::abs(start_diff_ms);
DEBUG_LOG(m_logger) << "Building-Topic starts before Replay: Starting Replay after " << m_startOffset_ms << "msec";
DEBUG_LOG() << "Building-Topic starts before Replay: Starting Replay after " << m_startOffset_ms << "msec";
}
@@ -48,12 +47,12 @@ ReplayHandler::ReplayHandler(int buildingTopicStart_s, int buildingTopicEnd_s, c
if (replay.topicEnd_s > buildingTopicEnd_s)
{
m_actualReplayEnd_ms -= (replay.topicEnd_s - buildingTopicEnd_s) * 1000;
DEBUG_LOG(m_logger) << "Replay longer than Building-Topic, cutting replay end to m_actualReplayEnd_ms = " << m_actualReplayEnd_ms;
DEBUG_LOG() << "Replay longer than Building-Topic, cutting replay end to m_actualReplayEnd_ms = " << m_actualReplayEnd_ms;
}
m_replayDuration_ms = m_actualReplayEnd_ms - m_actualReplayStart_ms;
DEBUG_LOG(m_logger) << "Replay from " << m_actualReplayStart_ms << " to " << m_actualReplayEnd_ms << " (duration = " << m_replayDuration_ms << ")";
DEBUG_LOG() << "Replay from " << m_actualReplayStart_ms << " to " << m_actualReplayEnd_ms << " (duration = " << m_replayDuration_ms << ")";
if (m_startOffset_ms == 0)
m_startOffset_ms = -1;
@@ -72,7 +71,7 @@ void ReplayHandler::tick(qint64 diffSinceLastTick)
return;
}
DEBUG_LOG(m_logger) << "ReplayHandler::tick(): Remaining: " << m_replayDuration_ms << "msec";
DEBUG_LOG() << "ReplayHandler::tick(): Remaining: " << m_replayDuration_ms << "msec";
if (m_startOffset_ms == -1)
{
@@ -31,7 +31,5 @@ private:
qint64 m_replayDuration_ms;
qint64 m_startOffset_ms;
TopicReplay::Interface::SituationReplayTime m_replayInfo;
NGL::INGLLogger &m_logger;
};
}
@@ -14,9 +14,8 @@ namespace BuildingViewer
{
VideoExporter::VideoExporter(QObject *parent)
: QObject(parent)
, m_logger(getLogger("ThreadVideoExporter"))
{
DEBUG_LOG(m_logger) << "ThreadVideoExporter has been created";
DEBUG_LOG() << "ThreadVideoExporter has been created";
}
void VideoExporter::init(const VideoInformation &videoInfo)
@@ -27,12 +26,12 @@ void VideoExporter::init(const VideoInformation &videoInfo)
void VideoExporter::sendAliveSignals()
{
DEBUG_LOG(m_logger) << "sendAliveSignals() called";
DEBUG_LOG() << "sendAliveSignals() called";
for (auto &e : std::as_const(m_vecVideosToExport))
emit e.m_pExportNotifier->stillAlive();
DEBUG_LOG(m_logger) << "\tSignals emitted, mutex unlocked";
DEBUG_LOG() << "\tSignals emitted, mutex unlocked";
}
@@ -43,17 +42,17 @@ void VideoExporter::doExport()
if (QThread::currentThread()->isInterruptionRequested())
break;
VideoInformation toExport = m_vecVideosToExport.takeFirst();
DEBUG_LOG(m_logger) << "Starting export of " << toExport.m_strFolderPath;
DEBUG_LOG() << "Starting export of " << toExport.m_strFolderPath;
const auto state = toExport.m_bgViewerState.value(QStringLiteral("arrBuildingStates"));
if (!state.isArray())
{
WARNING_LOG(m_logger) << "No opened buildings, nothing to export, skipping video!";
WARNING_LOG() << "No opened buildings, nothing to export, skipping video!";
continue;
}
DEBUG_LOG(m_logger) << "Emitting 'signalStartRecording'";
DEBUG_LOG() << "Emitting 'signalStartRecording'";
emit signalStartRecording(toExport.m_strFolderPath, state);
QSharedPointer<ReplayHandler> pHandler;
@@ -84,7 +83,7 @@ void VideoExporter::doExport()
if (diff_ms >= 1000)
{
last_tick_elapsed = elapsed_sum_ms;
DEBUG_LOG(m_logger) << "Export: " << elapsed_sum_ms / 1000 << "/" << record_duration_ms / 1000 << "[s] passed";
DEBUG_LOG() << "Export: " << elapsed_sum_ms / 1000 << "/" << record_duration_ms / 1000 << "[s] passed";
}
if (pHandler)
@@ -98,12 +97,12 @@ void VideoExporter::doExport()
if (QThread::currentThread()->isInterruptionRequested())
break;
}
DEBUG_LOG(m_logger) << "Done. Emitting 'signalStopRecording'";
DEBUG_LOG() << "Done. Emitting 'signalStopRecording'";
emit signalStopRecording();
DEBUG_LOG(m_logger) <<"Export done, emitting 'signalExportSuccessful'";
DEBUG_LOG() <<"Export done, emitting 'signalExportSuccessful'";
toExport.m_pExportNotifier->setExportSuccessful(toExport.m_strFolderPath);
DEBUG_LOG(m_logger) <<"\tsignal emitted";
DEBUG_LOG() <<"\tsignal emitted";
}
}
@@ -56,6 +56,5 @@ private:
void sendAliveSignals();
QVector<VideoInformation> m_vecVideosToExport;
NGL::INGLLogger &m_logger;
};
}
@@ -31,7 +31,6 @@ namespace BuildingViewer
TopicReplayInterface::TopicReplayInterface(BgViewerController *bgvController, LtsSession::LtsSession *session)
: m_bgvController(bgvController)
, m_session(session)
, m_logger(getLogger("TopicReplayInterface"))
{
session->getForeignGuiInterface<SituationReplay::ForeignGuiInterface>(m_replayIfc);
}
@@ -105,7 +104,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes,
const QJsonArray states = attributes[QStringLiteral("arrBuildingStates")].toArray();
if (states.isEmpty())
{
INFO_LOG(m_logger) << "Nothing to export";
INFO_LOG() << "Nothing to export";
emit pExportNotifier->exportSuccessful(QString());
return true;
}
@@ -114,7 +113,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes,
QFile f(folderPath + QLatin1Char('/') + filename);
if (!f.open(QIODevice::WriteOnly))
{
WARNING_LOG(m_logger) << "Can not open file '" << f.fileName() << "' for writing!";
WARNING_LOG() << "Can not open file '" << f.fileName() << "' for writing!";
pExportNotifier->setExportFailed();
return false;
}
@@ -137,7 +136,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes,
obj[QStringLiteral("replays")] = arr;
f.write(QJsonDocument(obj).toJson(QJsonDocument::Indented));
f.close();
DEBUG_LOG(m_logger) << "BDV filename: " << f.fileName();
DEBUG_LOG() << "BDV filename: " << f.fileName();
QVector<int> buildingIds;
buildingIds.reserve(states.size());
@@ -147,7 +146,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes,
int buildingId = featureId2DatabaseId(QString::fromStdString(vws.m_featureID));
if (buildingId <= 0)
{
WARNING_LOG(m_logger) << "Could not retrieve building id from '" << vws.m_featureID << "' - skipping";
WARNING_LOG() << "Could not retrieve building id from '" << vws.m_featureID << "' - skipping";
continue;
}
buildingIds += buildingId;
@@ -173,7 +172,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes,
if (!m_replayIfc || !m_bgvController)
{
ERROR_LOG(m_logger) << "BuildingViewer exportTopic: m_replayIfc==nullptr, can not start replay, aborting export";
ERROR_LOG() << "BuildingViewer exportTopic: m_replayIfc==nullptr, can not start replay, aborting export";
emit pExportNotifier->exportFailed();
Q_ASSERT(false);
return false;
@@ -225,7 +224,7 @@ bool TopicReplayInterface::exportBuildings(const QVector<int> &buildingIds) cons
const QString modelPath = BgViewerController::buildingModelPath();
if (modelPath.isEmpty())
{
WARNING_LOG(m_logger) << "Could not find path with building models - can not copy models";
WARNING_LOG() << "Could not find path with building models - can not copy models";
return false;
}
@@ -233,13 +232,13 @@ bool TopicReplayInterface::exportBuildings(const QVector<int> &buildingIds) cons
QDir dir(outputPath);
if (!dir.exists() && !dir.mkpath(outputPath))
{
WARNING_LOG(m_logger) << "Could not create path " << outputPath;
WARNING_LOG() << "Could not create path " << outputPath;
return false;
}
QFile f(outputPath + QStringLiteral("/buildings.json"));
if (!f.open(QIODevice::ReadWrite))
{
WARNING_LOG(m_logger) << "Could not open file " << f.fileName() << " for read/write: " << f.errorString();
WARNING_LOG() << "Could not open file " << f.fileName() << " for read/write: " << f.errorString();
return false;
}
const QJsonArray arr(QJsonDocument::fromJson(f.readAll()).array());
@@ -258,7 +257,7 @@ bool TopicReplayInterface::exportBuildings(const QVector<int> &buildingIds) cons
const auto mse = ismDtc->mainStructureElement(buildingId);
if (mse.id() != buildingId)
{
WARNING_LOG(m_logger) << "Could not find MainStructureElement for building with id " << buildingId << " - skipping";
WARNING_LOG() << "Could not find MainStructureElement for building with id " << buildingId << " - skipping";
continue;
}
const QString fnIve = QString::fromStdString(mse.name()) + QStringLiteral(".flt.ive");
@@ -295,7 +294,7 @@ bool TopicReplayInterface::exportShaders() const
{
const QString shaderPath(NGL::findFile(NGL::FileType::ConfigFile, QStringLiteral("shaders")));
const QString outputPath(m_basePath + QStringLiteral("BuildingModels/shaders/"));
DEBUG_LOG(m_logger) << "shaderPath: " << shaderPath << ", outputPath: " << outputPath;
DEBUG_LOG() << "shaderPath: " << shaderPath << ", outputPath: " << outputPath;
return NGL::copyDirContentsToDir(shaderPath, outputPath);
}
@@ -307,10 +306,10 @@ bool TopicReplayInterface::copyFile(const QString &srcFn, const QString &srcDir,
QFile f(src);
if (!f.exists() || (!QFile::exists(dst) && !f.copy(dst)))
{
WARNING_LOG(m_logger) << "Could not copy " << src << " to " << dst << ": " << f.errorString();
WARNING_LOG() << "Could not copy " << src << " to " << dst << ": " << f.errorString();
return false;
}
DEBUG_LOG(m_logger) << "Copied from " << src << " to " << dst;
DEBUG_LOG() << "Copied from " << src << " to " << dst;
return true;
}
@@ -62,6 +62,5 @@ private:
#endif
BgViewerController *m_bgvController = nullptr;
LtsSession::LtsSession *m_session = nullptr;
NGL::INGLLogger &m_logger;
};
}
@@ -12,7 +12,6 @@ namespace BuildingViewer
BgViewerDataViewDialog::BgViewerDataViewDialog(QWidget *parent)
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
, m_ui(new Ui::BgViewerDataViewDialog)
, m_logger(getLogger("BgViewerDataViewDialog"))
{
m_ui->setupUi(this);
@@ -39,6 +39,5 @@ signals:
private:
Ui::BgViewerDataViewDialog *m_ui;
NGL::INGLLogger &m_logger;
};
}
@@ -15,7 +15,6 @@ BgViewerDataView::BgViewerDataView(QWidget *parent)
: QWidget(parent)
, m_ui(new Ui::BgViewerDataView)
, m_pModel(new BgViewerDataViewModel(this))
, m_logger(getLogger("BgViewerDataView"))
{
m_ui->setupUi(this);
@@ -54,7 +54,5 @@ private:
BgViewerDataViewModel *m_pModel = nullptr;
BgViewerController *m_pBgvController = nullptr;
int m_lastSelectedRow { -1 };
NGL::INGLLogger &m_logger;
};
}
@@ -22,7 +22,6 @@ namespace BuildingViewer
BdvPluginProvider::BdvPluginProvider(LtsSession::LtsSession *session, QObject *parent)
: PluginProvider(parent)
, m_session(session)
, m_logger(getLogger("BdvPluginProvider"))
{}
bool BdvPluginProvider::init()
@@ -37,7 +36,7 @@ bool BdvPluginProvider::init()
if (!m_session->getDtc<Buildings::DataInterface>(m_bldDtc))
{
ERROR_LOG(m_logger) << "Fetching 'm_bldDtc' failed!";
ERROR_LOG() << "Fetching 'm_bldDtc' failed!";
return false;
}
m_session->getForeignGuiInterface<Buildings::ForeignInfoGuiInterface>(m_bldInfoIfc);
@@ -53,7 +52,7 @@ bool BdvPluginProvider::init()
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
ERROR_LOG(m_logger) << "Fetching 'm_ppmDtc' failed!";
ERROR_LOG() << "Fetching 'm_ppmDtc' failed!";
return false;
}
m_session->getForeignGuiInterface<ParticipantManagement::ForeignParticipantInfoGuiInterface>(m_ppmParticipantInfoIfc);
@@ -62,9 +62,7 @@ private:
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
std::shared_ptr<SituationReplay::Interface::Dtc> m_srpDtc;
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_pdmDtc;
std::shared_ptr<ParticipantManagement::ForeignParticipantInfoGuiInterface> m_ppmParticipantInfoIfc;
NGL::INGLLogger &m_logger;
std::shared_ptr<ParticipantManagement::ForeignParticipantInfoGuiInterface> m_ppmParticipantInfoIfc;
};
}