EgtMachKernel :
- razionalizzazione simulatore - in caricamento macchina, generazione e simulazione non viene impostata modifica progetto.
This commit is contained in:
+17
-3
@@ -16,6 +16,7 @@
|
||||
#include "MachMgr.h"
|
||||
#include "DllMain.h"
|
||||
#include "/EgtDev/Include/EXeExecutor.h"
|
||||
#include "/EgtDev/Include/EXeSetModifiedOff.h"
|
||||
#include "/EgtDev/Include/EGkGeomDB.h"
|
||||
#include "/EgtDev/Include/EGkLuaAux.h"
|
||||
#include "/EgtDev/Include/EGnStringUtils.h"
|
||||
@@ -138,21 +139,30 @@ Machine::LuaExistsFunction( const string& sFun)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::LuaCallFunction( const string& sFun)
|
||||
Machine::LuaCallFunction( const string& sFun, bool bSetModifiedOff)
|
||||
{
|
||||
// imposto contesto corretto
|
||||
int nOldCtx = ExeGetCurrentContext() ;
|
||||
if ( nOldCtx != m_pMchMgr->GetContextId())
|
||||
ExeSetCurrentContext( m_pMchMgr->GetContextId()) ;
|
||||
// se richiesto, disabilito gestione segnalazione modifiche progetto
|
||||
bool bOldMod = false ;
|
||||
if ( bSetModifiedOff) {
|
||||
bOldMod = ExeGetEnableModified() ;
|
||||
ExeDisableModified() ;
|
||||
}
|
||||
// imposto l'oggetto corrente per Lua
|
||||
m_pMchLua = this ;
|
||||
// eseguo la funzione
|
||||
bool bOk = m_LuaMgr.CallFunction( sFun, 0) ;
|
||||
// reset dell'oggetto corrente per Lua
|
||||
m_pMchLua = nullptr ;
|
||||
// ripristino gestione segnalazione modifiche progetto
|
||||
if ( bSetModifiedOff && bOldMod)
|
||||
ExeEnableModified() ;
|
||||
// ripristino contesto originale
|
||||
if ( nOldCtx != m_pMchMgr->GetContextId())
|
||||
ExeSetCurrentContext( nOldCtx) ;
|
||||
// reset dell'oggetto corrente per Lua
|
||||
m_pMchLua = nullptr ;
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
@@ -207,10 +217,14 @@ Machine::LuaLoadMachine( const string& sFile)
|
||||
int nOldCtx = ExeGetCurrentContext() ;
|
||||
if ( nOldCtx != m_pMchMgr->GetContextId())
|
||||
ExeSetCurrentContext( m_pMchMgr->GetContextId()) ;
|
||||
// disabilito gestione segnalazione modifiche progetto
|
||||
SetModifiedOff modOff ;
|
||||
// imposto l'oggetto corrente per Lua
|
||||
m_pMchLua = this ;
|
||||
// carico la macchina
|
||||
bool bOk = m_LuaMgr.ExecFile( sFile) ;
|
||||
// ripristino gestione segnalazione modifiche progetto
|
||||
modOff.Reset() ;
|
||||
// ripristino contesto originale
|
||||
if ( nOldCtx != m_pMchMgr->GetContextId())
|
||||
ExeSetCurrentContext( nOldCtx) ;
|
||||
|
||||
Reference in New Issue
Block a user