Commit 57bf4bdb authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Add namespace and file name changes to ravennest and ravenegg

parent 733c362b
......@@ -27,8 +27,8 @@
#endif
#include "getopt.h"
#include <ITASimulationScheduler//Raven/R_RavenSimulator.h>
#include <ITASimulationScheduler//Raven/R_RavenUtils.h>
#include <ITASimulationScheduler/Raven/Simulator.h>
#include <ITASimulationScheduler/Utils.h>
#include <RG_Vector.h>
#include <ITAAudiofileWriter.h>
......@@ -107,10 +107,10 @@ int main( int argc, char* argv[] )
{
cout << "Raven data base path is set to '" << sRavenDataBasePath << "'" << endl;
auto pRavenSimulator = std::make_shared< CRavenSimulator >( sRavenDataBasePath );
auto pRavenSimulator = std::make_shared< ITASimulationScheduler::RAVEN::CRavenSimulator >( sRavenDataBasePath );
CSimulationTask oTask;
CSimulationResult oResult;
ITASimulationScheduler::CSimulationTask oTask;
ITASimulationScheduler::CSimulationResult oResult;
cout << "Loading task from file with path '" << sTaskPath << "'" << endl;
LoadTask( oTask, sTaskPath );
......@@ -147,9 +147,9 @@ int main( int argc, char* argv[] )
cout << "Exporting result to '" << sResultPath << "'" << endl;
if( bNormalize )
normalize_0dB( oResult.vcspResult[0]->psfResult );
if( oTask.iSimulationType | CSimulationTask::SIM_DS )
if( oTask.iSimulationType | ITASimulationScheduler::CSimulationTask::SIM_DS )
cout << "Direct sound was " << ( oResult.vcspResult[0]->bDirectSoundAudible ? "audible" : "inaudible" ) << endl;
if( oTask.iSimulationType != CSimulationTask::SIM_DS )
if( oTask.iSimulationType != ITASimulationScheduler::CSimulationTask::SIM_DS )
writeAudiofile( sResultPath, oResult.vcspResult[ 0 ]->psfResult, oTask.oConfig.oSimulationSettings.dSampleRate );
if( oResult.vcspResult[0]->bEntitiesInSameRoom )
......@@ -157,7 +157,7 @@ int main( int argc, char* argv[] )
else
cout << "Entities (source and receiver) were not in the same room." << endl;
ISimulationInterface::CProfiler oStatus;
ITASimulationScheduler::ISimulationInterface::CProfiler oStatus;
pRavenSimulator->GetProfilerStatus( oStatus );
cout << "Raven simulation profiler: " << oStatus << endl;
}
......
......@@ -26,9 +26,9 @@
#include <ITASimulationScheduler/Raven/RavenNetServer.h>
// Raven includes
#include <ITASimulationScheduler/Raven/R_RavenSimulator.h>
#include <ITASimulationScheduler/Raven/R_RavenLocalScheduler.h>
#include <ITASimulationScheduler/Raven/R_RavenUtils.h>
#include <ITASimulationScheduler/Raven/Simulator.h>
#include <ITASimulationScheduler/LocalScheduler.h>
#include <ITASimulationScheduler/Utils.h>
// ITA includes
#include <ITAConfigUtils.h>
......@@ -168,7 +168,7 @@ int main( int argc, char* argv[] )
for( int i=0; i<(int)viSimThreadDuties.size(); i++ )
{
std::string sSimTypeShort = viSimThreadDuties[i];
oConfig.viSimThreadDuties.push_back( ParseSimulationType( sSimTypeShort ) );
oConfig.viSimThreadDuties.push_back( ITASimulationScheduler::ParseSimulationType( sSimTypeShort ) );
}
}
......@@ -183,41 +183,41 @@ int main( int argc, char* argv[] )
if( oConfig.bQuiet ) oConfig.bVerbose = false;
// Go
IRavenNetServer* pServer = IRavenNetServer::Create();
ITASimulationScheduler::RAVEN::IRavenNetServer* pServer = ITASimulationScheduler::RAVEN::IRavenNetServer::Create();
if( oConfig.viSimThreadDuties.size() == 0 )
{
oConfig.viSimThreadDuties.push_back( CSimulationTask::SIM_DS );
oConfig.viSimThreadDuties.push_back( CSimulationTask::SIM_ER_IS );
oConfig.viSimThreadDuties.push_back( CSimulationTask::SIM_DD_RT );
oConfig.viSimThreadDuties.push_back( ITASimulationScheduler::CSimulationTask::SIM_DS );
oConfig.viSimThreadDuties.push_back( ITASimulationScheduler::CSimulationTask::SIM_ER_IS );
oConfig.viSimThreadDuties.push_back( ITASimulationScheduler::CSimulationTask::SIM_DD_RT );
}
if( oConfig.bRealtimeFlag )
{
if( oConfig.bVerbose ) std::cout << "Creating scheduler (realtime option)" << std::endl;
CLocalScheduler::CConfiguration oRLSConf;
ITASimulationScheduler::CLocalScheduler::CConfiguration oRLSConf;
oRLSConf.sRavenDataBasePath = oConfig.sRavenDataBasePath;
oRLSConf.voThreads.resize( oConfig.viSimThreadDuties.size() );
for( size_t i=0; i<oConfig.viSimThreadDuties.size(); i++ )
{
CLocalScheduler::CConfiguration::CThreadConfiguration& oSimConfig( oRLSConf.voThreads[i] );
ITASimulationScheduler::CLocalScheduler::CConfiguration::CThreadConfiguration& oSimConfig( oRLSConf.voThreads[i] );
oSimConfig.iFieldOfDuty = oConfig.viSimThreadDuties[i];
if( oSimConfig.iFieldOfDuty == CSimulationTask::SIM_DS )
if( oSimConfig.iFieldOfDuty == ITASimulationScheduler::CSimulationTask::SIM_DS )
{
oSimConfig.fUpdateRate = 120.0f;
oSimConfig.iTaskProcessingMode = CLocalScheduler::CConfiguration::CThreadConfiguration::CONTINUOUS;
oSimConfig.iTaskProcessingMode = ITASimulationScheduler::CLocalScheduler::CConfiguration::CThreadConfiguration::CONTINUOUS;
oSimConfig.sRavenDataBasePath = oConfig.sRavenDataBasePath;
}
else if( oSimConfig.iFieldOfDuty == CSimulationTask::SIM_ER_IS )
else if( oSimConfig.iFieldOfDuty == ITASimulationScheduler::CSimulationTask::SIM_ER_IS )
{
oSimConfig.fUpdateRate = 60.0f;
oSimConfig.iTaskProcessingMode = CLocalScheduler::CConfiguration::CThreadConfiguration::TIMEOUT;
oSimConfig.iTaskProcessingMode = ITASimulationScheduler::CLocalScheduler::CConfiguration::CThreadConfiguration::TIMEOUT;
oSimConfig.sRavenDataBasePath = oConfig.sRavenDataBasePath;
}
else if( oSimConfig.iFieldOfDuty == CSimulationTask::SIM_DD_RT )
else if( oSimConfig.iFieldOfDuty == ITASimulationScheduler::CSimulationTask::SIM_DD_RT )
{
oSimConfig.fUpdateRate = 1.0f;
oSimConfig.iTaskProcessingMode = CLocalScheduler::CConfiguration::CThreadConfiguration::EVENTSYNC;
oSimConfig.iTaskProcessingMode = ITASimulationScheduler::CLocalScheduler::CConfiguration::CThreadConfiguration::EVENTSYNC;
oSimConfig.sRavenDataBasePath = oConfig.sRavenDataBasePath;
}
else
......@@ -226,14 +226,14 @@ int main( int argc, char* argv[] )
}
}
CLocalScheduler* pScheduler = new CLocalScheduler( oRLSConf );
pServer->SetRavenSimulationScheduler( (ISimulationSchedulerInterface*) pScheduler );
ITASimulationScheduler::CLocalScheduler* pScheduler = new ITASimulationScheduler::CLocalScheduler( oRLSConf );
pServer->SetRavenSimulationScheduler( (ITASimulationScheduler::ISimulationSchedulerInterface*) pScheduler );
}
else
{
if( oConfig.bVerbose ) std::cout << "Creating simulator (no realtime option)" << std::endl;
CRavenSimulator* pSimulator = new CRavenSimulator( oConfig.sRavenDataBasePath );
pServer->SetRavenSimulator( (ISimulationInterface*) pSimulator );
ITASimulationScheduler::RAVEN::CRavenSimulator* pSimulator = new ITASimulationScheduler::RAVEN::CRavenSimulator( oConfig.sRavenDataBasePath );
pServer->SetRavenSimulator( (ITASimulationScheduler::ISimulationInterface*) pSimulator );
}
if( oConfig.bQuiet == false )
......@@ -249,13 +249,13 @@ int main( int argc, char* argv[] )
std::cout << "Waiting for connections ..." << std::endl;
}
IRavenNetServer::tPortList liFreePorts;
liFreePorts.push_back( IRavenNetServer::tPortRange( g_uiPort+1, g_uiPort+19 ) );
unsigned int iMode = oConfig.bRealtimeFlag == true ? IRavenNetServer::SCHEDULER : IRavenNetServer::SIMULATOR;
ITASimulationScheduler::RAVEN::IRavenNetServer::tPortList liFreePorts;
liFreePorts.push_back(ITASimulationScheduler::RAVEN::IRavenNetServer::tPortRange( g_uiPort+1, g_uiPort+19 ) );
unsigned int iMode = oConfig.bRealtimeFlag == true ? ITASimulationScheduler::RAVEN::IRavenNetServer::SCHEDULER : ITASimulationScheduler::RAVEN::IRavenNetServer::SIMULATOR;
int iErr = pServer->Initialize( g_sServerName, (int) g_uiPort, liFreePorts, iMode );
// Start
if( iErr != IRavenNetServer::RAVEN_NO_ERROR )
if( iErr != ITASimulationScheduler::RAVEN::IRavenNetServer::RAVEN_NO_ERROR )
{
std::cerr << "Could not initialize server" << std::endl;
}
......
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