Commit e1fb0ed7 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Merge branch 'ma2020_palenda' into develop

parents 361e087c 9fe4b1f3
......@@ -195,7 +195,7 @@ namespace ITA
#define PROFILER_EVENT_COUNT( ... )
#define PROFILER_VALUE( ... )
#define PROFILER_SECTION( ... )
#define PROFILER_SECTION( )
#define PROFILER_FUNCTION( )
#define PROFILER_END_SECTION()
#define PROFILER_NAME_THREAD( ... )
#define PROFILER_NAME_THREAD_MAIN( )
......
......@@ -146,7 +146,7 @@ namespace ITA
///
/// We need this to later reference the task when creating the result.
///
ITAAtomicPtr<CSimulationTask> m_pCurrentTask = nullptr;
std::unique_ptr<CSimulationTask> m_pCurrentTask;
///
/// \{
......@@ -159,6 +159,9 @@ namespace ITA
ITAAtomicBool m_bResetIndicated = false;
/// \}
//! \brief Indicates whether worker is busy or not
ITAAtomicBool m_bBusy = false;
#ifdef WITH_PROFILER
static std::size_t iWorkerMaxID;
#endif
......
......@@ -6,6 +6,7 @@
// simulation scheduler include
#include <ITA/SimulationScheduler/Utils/utils.h>
#include "../src/ITA/SimulationScheduler/serialization_helper.h"
// Vista include
#include <VistaAspects/VistaSerializer.h>
......@@ -59,15 +60,9 @@ namespace ITA
int C3DObject::Serialize ( IVistaSerializer& pSerializer ) const
{
int returnVal = 0;
returnVal += pSerializer.WriteFloat32 ( m_v3Position [0] );
returnVal += pSerializer.WriteFloat32 ( m_v3Position [1] );
returnVal += pSerializer.WriteFloat32 ( m_v3Position [2] );
returnVal += pSerializer.WriteFloat32 ( m_v3Position [3] );
returnVal += SerializationHelper::WriteVistaVector3D ( pSerializer, m_v3Position );
returnVal += pSerializer.WriteFloat32 ( m_qOrientation [0] );
returnVal += pSerializer.WriteFloat32 ( m_qOrientation [1] );
returnVal += pSerializer.WriteFloat32 ( m_qOrientation [2] );
returnVal += pSerializer.WriteFloat32 ( m_qOrientation [3] );
returnVal += SerializationHelper::WriteVistaQuaternion ( pSerializer, m_qOrientation );
returnVal += pSerializer.WriteInt32 ( m_iID );
......@@ -79,15 +74,9 @@ namespace ITA
{
int returnVal = 0;
int tmp;
returnVal += pDeserializer.ReadFloat32 ( m_v3Position [0] );
returnVal += pDeserializer.ReadFloat32 ( m_v3Position [1] );
returnVal += pDeserializer.ReadFloat32 ( m_v3Position [2] );
returnVal += pDeserializer.ReadFloat32 ( m_v3Position [3] );
returnVal += SerializationHelper::ReadVistaVector3D ( pDeserializer, m_v3Position );
returnVal += pDeserializer.ReadFloat32 ( m_qOrientation [0] );
returnVal += pDeserializer.ReadFloat32 ( m_qOrientation [1] );
returnVal += pDeserializer.ReadFloat32 ( m_qOrientation [2] );
returnVal += pDeserializer.ReadFloat32 ( m_qOrientation [3] );
returnVal += SerializationHelper::ReadVistaQuaternion ( pDeserializer, m_qOrientation );
returnVal += pDeserializer.ReadInt32 ( m_iID );
......
......@@ -24,12 +24,13 @@
#include <libjson.h>
#include <VistaBase/VistaTimeUtils.h>
#ifdef WITH_PROFILER
namespace ITA
{
namespace SimulationScheduler
{
#ifdef WITH_PROFILER
namespace Profiler
{
class ProfilerInstance;
......@@ -675,6 +676,8 @@ namespace ITA
}
} // namespace Profiler
#endif
void StoreProfilerData ( const std::string& sProfilerFileName )
{
#ifdef WITH_PROFILER
......@@ -689,6 +692,4 @@ namespace ITA
} // namespace SimulationScheduler
} // namespace ITA
#endif
......@@ -165,17 +165,17 @@ namespace ITA
{
ITA_EXCEPT_INVALID_PARAMETER ( "The channel count does not match." );
}
auto returnResult = std::make_unique<CRIRSimulationResult> ( );
returnResult->eResultType = pTask->eSimulationType;
returnResult->iReferenceID = pTask->uiReferenceID;
returnResult->bZerosStripped = soundPath->bZerosStripped;
returnResult->iLeadingZeros = soundPath->iLeadingZeros;
returnResult->iTrailingZeros = soundPath->iTailingZeros;
returnResult->bSameRoom = soundPath->bEntitiesInSameRoom;
returnResult->sfResult = *soundPath->psfResult.release ( );
returnResult->sfResult = *soundPath->psfResult;
if ( pTask->oScene.GetSourceMap ( ).size ( ) != 1 )
{
ITA_EXCEPT_INVALID_PARAMETER ( "Task has more than one source." );
......
......@@ -82,7 +82,8 @@ namespace ITA
assert ( m_eFieldOfDuty == pTask->eSimulationType );
// Assume ownership of the task.
m_pCurrentTask = pTask.release ( );
m_pCurrentTask = std::move(pTask);
m_bBusy = true;
// Stop if reset is running.
if ( m_bResetIndicated )
......@@ -93,6 +94,8 @@ namespace ITA
m_pCurrentTask = nullptr;
m_bBusy = false;
return;
}
......@@ -135,7 +138,7 @@ namespace ITA
std::string CWorkerThread::GetType ( )
{
return "WorkerThread";
return "RavenWorkerThread";
}
void CWorkerThread::SetSimulator ( std::unique_ptr<ISimulatorInterface> pSimulator )
......@@ -202,6 +205,8 @@ namespace ITA
// release the current task
m_pCurrentTask = nullptr;
m_bBusy = false;
return true;
}
......
......@@ -117,3 +117,29 @@ int ITA::SimulationScheduler::SerializationHelper::ReadVistaVector3D(IVistaDeSer
return returnVal;
}
int ITA::SimulationScheduler::SerializationHelper::WriteVistaQuaternion(IVistaSerializer& pSerializer,
const VistaQuaternion& qQuaternion)
{
int returnVal = 0;
returnVal += pSerializer.WriteFloat32 ( qQuaternion [Vista::X] );
returnVal += pSerializer.WriteFloat32 ( qQuaternion [Vista::Y] );
returnVal += pSerializer.WriteFloat32 ( qQuaternion [Vista::Z] );
returnVal += pSerializer.WriteFloat32 ( qQuaternion [Vista::W] );
return returnVal;
}
int ITA::SimulationScheduler::SerializationHelper::ReadVistaQuaternion(IVistaDeSerializer& pDeserializer,
VistaQuaternion& qQuaternion)
{
int returnVal = 0;
returnVal += pDeserializer.ReadFloat32 ( qQuaternion [Vista::X] );
returnVal += pDeserializer.ReadFloat32 ( qQuaternion [Vista::Y] );
returnVal += pDeserializer.ReadFloat32 ( qQuaternion [Vista::Z] );
returnVal += pDeserializer.ReadFloat32 ( qQuaternion [Vista::W] );
return returnVal;
}
......@@ -8,6 +8,7 @@
// Vista
#include <VistaBase/VistaVector3D.h>
#include <VistaBase/VistaQuaternion.h>
#include <VistaAspects/VistaSerializer.h>
#include <VistaAspects/VistaDeSerializer.h>
......@@ -58,6 +59,9 @@ namespace ITA
static int WriteVistaVector3D(IVistaSerializer& pSerializer, const VistaVector3D& v3Vector);
static int ReadVistaVector3D(IVistaDeSerializer& pDeserializer, VistaVector3D& v3Vector);
static int WriteVistaQuaternion ( IVistaSerializer& pSerializer, const VistaQuaternion& qQuaternion );
static int ReadVistaQuaternion ( IVistaDeSerializer& pDeserializer, VistaQuaternion& qQuaternion );
};
} // namespace SimulationScheduler
} // namespace ITA
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment