- 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>
162 lines
4.7 KiB
C++
Executable File
162 lines
4.7 KiB
C++
Executable File
// **************************************************************************
|
|
//
|
|
// (C) Copyright 2009 Swiss SIMTEC AG
|
|
//
|
|
// **************************************************************************
|
|
//
|
|
// $HeadURL$
|
|
// $LastChangedBy$
|
|
// $LastChangedDate$
|
|
// $LastChangedRevision$
|
|
//
|
|
// **************************************************************************
|
|
|
|
// manual class headers
|
|
#include "GeoPairingImplAirTargetCache.hpp"
|
|
#include <GBL_ConfigSystem/geoconfig.h>
|
|
|
|
// from cpp_includes
|
|
#include "GeoPairingImplAirTargetCacheData.hpp"
|
|
|
|
namespace N_GeoPairingImpl
|
|
{
|
|
|
|
// ---------------------------------------------------------------
|
|
// Constructor
|
|
// ---------------------------------------------------------------
|
|
GeoPairingImplAirTargetCache::GeoPairingImplAirTargetCache(SInt32 a_player, CacheType *a_cacheData)
|
|
: m_CacheData(a_cacheData),
|
|
m_PlayerID(a_player),
|
|
m_Timeout(0),
|
|
m_logger(CesGeoPairing::getLogger("Plugin.GeoPairing.GeoPairingImplAirTargetCache"))
|
|
{
|
|
auto l_config = N_ConfigSystem::GeoConfig::getInstance();
|
|
m_Timeout = l_config->getInteger(QStringLiteral("IGLA"), QStringLiteral("CacheTimeout"), 5);
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
// retrieves the last cached tracking state
|
|
// ---------------------------------------------------------------
|
|
bool GeoPairingImplAirTargetCache::getLatestTrackState(SInt32 a_targetID) const
|
|
{
|
|
GeoPairingImplAirTargetCacheData *l_Cache = getLatestCacheData(a_targetID);
|
|
if (l_Cache == nullptr)
|
|
return false;
|
|
|
|
return l_Cache->m_TrackState;
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
// retrieves the last cached tracking time
|
|
// ---------------------------------------------------------------
|
|
UInt32 GeoPairingImplAirTargetCache::getLatestTrackTime(SInt32 a_targetID) const
|
|
{
|
|
GeoPairingImplAirTargetCacheData *l_Cache = getLatestCacheData(a_targetID);
|
|
if (l_Cache == nullptr)
|
|
return 0;
|
|
|
|
return l_Cache->m_TrackTime;
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
GeoPairingImplAirTargetCacheData *GeoPairingImplAirTargetCache::getLatestCacheData(SInt32 a_targetID) const
|
|
{
|
|
if (m_CacheData == nullptr)
|
|
{
|
|
ERROR_LOG() << "No global Cache pointer present!";
|
|
return nullptr;
|
|
}
|
|
|
|
if (m_CacheData->empty())
|
|
{
|
|
INFO_LOG() << "Global Cache empty";
|
|
return nullptr;
|
|
}
|
|
|
|
CacheType::iterator it = m_CacheData->find(m_PlayerID);
|
|
if (it == m_CacheData->end())
|
|
{
|
|
INFO_LOG() << "No Cache present for Player " << m_PlayerID
|
|
<< " tracking Target " << a_targetID;
|
|
return nullptr;
|
|
}
|
|
|
|
CacheDataType *l_Cache = (it->second);
|
|
|
|
if (l_Cache->empty())
|
|
{
|
|
INFO_LOG() << "Cache for Player " << m_PlayerID << " is empty";
|
|
return nullptr;
|
|
}
|
|
|
|
CacheDataType::iterator itC = l_Cache->find(a_targetID);
|
|
if (itC == l_Cache->end())
|
|
{
|
|
INFO_LOG() << "Target " << a_targetID
|
|
<< " not found in Cache of Player "
|
|
<< m_PlayerID;
|
|
return nullptr;
|
|
}
|
|
|
|
return itC->second;
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
// store latest state
|
|
// ---------------------------------------------------------------
|
|
bool GeoPairingImplAirTargetCache::storeLatestTrackState(SInt32 a_targetID, UInt32 a_trackingTime, bool a_trackingState)
|
|
{
|
|
if (m_CacheData == nullptr)
|
|
{
|
|
ERROR_LOG() << "No global Cache pointer present!";
|
|
return false;
|
|
}
|
|
|
|
CacheType::iterator it = m_CacheData->find(m_PlayerID);
|
|
if (it == m_CacheData->end())
|
|
{
|
|
(*m_CacheData)[m_PlayerID] = new CacheDataType();
|
|
INFO_LOG() << "Create new Cache for Player " << m_PlayerID;
|
|
}
|
|
|
|
CacheDataType *l_Cache = (*m_CacheData)[m_PlayerID];
|
|
|
|
GeoPairingImplAirTargetCacheData *l_CacheData = nullptr;
|
|
CacheDataType::iterator itC = l_Cache->find(a_targetID);
|
|
if (itC == l_Cache->end())
|
|
{
|
|
l_CacheData = new GeoPairingImplAirTargetCacheData();
|
|
(*l_Cache)[a_targetID] = l_CacheData;
|
|
INFO_LOG() << "Create new CacheObject for Target "
|
|
<< a_targetID << " in Cache of Player "
|
|
<< m_PlayerID;
|
|
}
|
|
else
|
|
l_CacheData = (*l_Cache)[a_targetID];
|
|
|
|
l_CacheData->m_TrackTime = a_trackingTime;
|
|
l_CacheData->m_TrackState = a_trackingState;
|
|
|
|
INFO_LOG() << "Stored Tracking Time and State for Target "
|
|
<< a_targetID << " in Cache of Player "
|
|
<< m_PlayerID;
|
|
INFO_LOG() << "-> Cached Time : " << a_trackingTime
|
|
<< " State : " << a_trackingState;
|
|
return true;
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
// get cache timeout
|
|
// ---------------------------------------------------------------
|
|
UInt32 GeoPairingImplAirTargetCache::getCacheTimeout() const
|
|
{
|
|
return m_Timeout;
|
|
}
|
|
|
|
} // namespace N_GeoPairingImpl;
|