diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 87cf313..2a92867 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/OutputConst.h b/OutputConst.h index 9dbf140..0fce80f 100644 --- a/OutputConst.h +++ b/OutputConst.h @@ -185,8 +185,9 @@ static const std::string GVAR_SAFEDIST = ".SAFEDIST" ; // (num) distanza static const std::string GVAR_SIMVMID = ".SIMVMID" ; // (int) identificativo grezzo Vmill in collisione static const std::string GVAR_SIMCOBIND = ".SIMCOBIND" ; // (int) indice oggetto in collisione static const std::string GVAR_MPSIM = ".MPSIM" ; // (bool) flag simulazione multiprocesso +static const std::string GVAR_MPSEST = ".MPSEST" ; // (string) path del file di stima speciale per simulazione multiprocesso static const std::string GVAR_RECORD = ".RECORD" ; // (bool) flag modalità registrazione comandi in simulazione -static const std::string GVAR_OPERID = ".OPERID" ; // (int/s) identificativi ordinati operazioni per simulazione multiprocesso +static const std::string GVAR_OPERID = ".OPERID" ; // (int/s) identificativi ordinati operazioni per simulazione multiprocesso // Funzioni generazione static const std::string ON_START = "OnStart" ; static const std::string ON_END = "OnEnd" ; diff --git a/SimulatorMP.cpp b/SimulatorMP.cpp index 854bf7c..50414a1 100644 --- a/SimulatorMP.cpp +++ b/SimulatorMP.cpp @@ -205,11 +205,24 @@ SimulatorMP::Start( bool bFirst) if ( ! VerifySetup()) bOk = false ; // Eseguo stima speciale - string sEstFile ; - ExeGetTempDir( sEstFile) ; - sEstFile += "\\Simul.sest" ; - EraseFile( sEstFile) ; - if ( ! m_pMchMgr->Estimate( sEstFile, "")) + string sTemp ; + if ( ExeGetCurrFilePath( sTemp)) { + // direttorio + string sDir = GetDirectory( sTemp) ; + ReplaceString( sDir, "/", "\\") ; + // nome + string sName = GetFileTitleEgt( sTemp) ; + // nome macchinata + string sMGrp = m_pMchMgr->GetMachGroupName( m_pMchMgr->GetCurrMachGroup()) ; + // path completa + m_sSpecEstim = sDir + "\\" + sName + "_" + sMGrp + ".sest" ; + } + else { + ExeGetTempDir( sTemp) ; + m_sSpecEstim = sTemp + "\\Simul.sest" ; + } + EraseFile( m_sSpecEstim) ; + if ( ! m_pMchMgr->Estimate( m_sSpecEstim, "")) bOk = false ; } @@ -242,6 +255,7 @@ SimulatorMP::Start( bool bFirst) m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_VER, GetEMkVer()) ; m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MACHNAME, m_pMachine->GetMachineName()) ; m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MPSIM, true) ; + m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MPSEST, m_sSpecEstim) ; // Se appena entrati in simulazione if ( m_nStatus == SIS_INITIALIZED) { diff --git a/SimulatorMP.h b/SimulatorMP.h index 22aa3ab..fea8c2d 100644 --- a/SimulatorMP.h +++ b/SimulatorMP.h @@ -162,6 +162,7 @@ class SimulatorMP : public ISimulator IGeomDB* m_pGeomDB ; // puntatore al DB geometrico Machine* m_pMachine ; // puntatore alla macchina PerformanceCounter* m_pPerfCnt ; // timer per calcolo FPS + std::string m_sSpecEstim ; // path del file con i dati della stima speciale int m_nStatus ; // stato interno del simulatore (creato, inizializzato, pronto al movimento) double m_dStep ; // lunghezza di riferimento per la velocità di simulazione int m_nUiStatus ; // stato simulazione a livello utente