int main( int argc, char **argv ) { LOG_FUNCTION_START(); LogPrint( "S2Sim Started" ); GetConnectionManager(); GetMatlabManager(); GetControlManager(); GetSystemManager(); auto iterationNumber = 0; GetControlManager().WaitUntilReady(); while ( 1 ) { try { GetSystemManager().AdvanceTimeStep(); } catch ( ... ) { ErrorPrint( "System Error, Exiting" ); break; } ++iterationNumber; LogPrint( "Time: ", iterationNumber ); } LOG_FUNCTION_END(); return ( EXIT_SUCCESS ); }
bool CSystemObjectWrapper::Attach(std::string sSystemName,std::string sName,bool bTraceIfFailed) { bool bOk=false; ISystemManager *piSystemManager=GetSystemManager(); ISystem *piSystem=piSystemManager->GetSystem(sSystemName); if(piSystem){bOk=Attach(piSystem,sName,bTraceIfFailed);} REL(piSystem); REL(piSystemManager); return bOk; }
bool CSystemObjectWrapper::Create(std::string sSystem,std::string sClass,std::string sName) { ReleaseInterfaces(); bool bOk=false; ISystemObject *piObject=NULL; ISystem *piSystem=NULL; ISystemManager *piManager=GetSystemManager(); if(piManager){piSystem=piManager->GetSystem(sSystem);} if(piSystem){bOk=Create(piSystem,sClass,sName);} if(piObject){bOk=GetInterfaces(piObject);} if(!bOk) { RTTRACE("CSystemObjectWrapper::Create -> Failed to create System: %s, Class: %s, Object:%s",sSystem.c_str(),sClass.c_str(),sName.c_str()); } REL(piManager); REL(piSystem); REL(piObject); return bOk; }
void CEntityEditorClassSelector::OnInitDialog() { CGameDialogBase::OnInitDialog(); if(m_piSTTitle){m_piSTTitle->SetText(m_sTitle);} if(m_piLSClasses) { m_piGUIManager->SetFocus(m_piLSClasses); ISystemManager *piSystemManager=GetSystemManager(); ISystem *piSystem=piSystemManager?piSystemManager->GetSystem(m_sTargetSystem):NULL; if(piSystem) { std::vector<ISystemClass *> vClasses; piSystem->GetClasses(&vClasses); for(unsigned int x=0;x<vClasses.size();x++) { ISystemClass *piClass=vClasses[x]; m_piLSClasses->AddElement(piClass->GetName()); REL(piClass); } } REL(piSystem); REL(piSystemManager); } }