EgtMachKernel :

- in svuotature chiuse migliorata scelta lato ottimale di inizio
- altri sviluppi in SimulatorMP.
This commit is contained in:
Dario Sassi
2024-09-09 09:30:14 +02:00
parent 4b835a27be
commit 431246b472
11 changed files with 303 additions and 173 deletions
+29 -5
View File
@@ -146,6 +146,8 @@ Machine::LuaInit( const string& sMachineName)
m_LuaMgr.RegisterFunction( "EmtEnableToolsForVmill", Machine::LuaEmtEnableToolsForVmill) ;
// registro la funzione di movimento assi in simulazione
m_LuaMgr.RegisterFunction( "EmtMoveAxes", Machine::LuaEmtMoveAxes) ;
// registro la funzione di salvataggio comandi in simulazione MP
m_LuaMgr.RegisterFunction( "EmtSaveCmd", Machine::LuaEmtSaveCmd) ;
return true ;
}
@@ -345,9 +347,9 @@ Machine::LuaEmtGeneral( lua_State* L)
// lettura eventuale campo 'AngDeltaForHome' dalla tabella (default INFINITO)
double dAngDeltaMinForHome = INFINITO ;
LuaGetTabFieldParam( L, 1, FLD_ANGDELTAMINFORHOME, dAngDeltaMinForHome) ;
// lettura eventuale campo 'MultiProcess' dalla tabella (default false)
bool bMultiProcess = false ;
LuaGetTabFieldParam( L, 1, FLD_MULTIPROCESS, bMultiProcess) ;
// lettura eventuale campo 'MultiProcess' dalla tabella (0=no, 1=si, 2=si con simulazione MP)
int nMultiProcess = 0 ;
LuaGetTabFieldParam( L, 1, FLD_MULTIPROCESS, nMultiProcess) ;
LuaClearStack( L) ;
// info
@@ -398,7 +400,7 @@ Machine::LuaEmtGeneral( lua_State* L)
m_pMchLua->m_dAngDeltaMinForHome = dAngDeltaMinForHome ;
// imposto flag per macchina multiprocesso
m_pMchLua->m_bMultiProcess = bMultiProcess ;
m_pMchLua->m_nMultiProcess = nMultiProcess ;
return 0 ;
}
@@ -1512,7 +1514,7 @@ int
Machine::LuaEmtEnableToolsForVmill( lua_State* L)
{
// 1 parametro : bEnable
bool bEnable ;
bool bEnable = false ;
LuaGetParam( L, 1, bEnable) ;
LuaClearStack( L) ;
// verifico ci sia una macchina attiva
@@ -1560,3 +1562,25 @@ Machine::LuaEmtMoveAxes( lua_State* L)
}
return 2 ;
}
//----------------------------------------------------------------------------
int
Machine::LuaEmtSaveCmd( lua_State* L)
{
// parametri : nType,
int nType = 0 ;
LuaGetParam( L, 1, nType) ;
int nPar = 0 ;
LuaGetParam( L, 2, nPar) ;
string sPar ;
LuaGetParam( L, 3, sPar) ;
LuaClearStack( L) ;
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
return luaL_error( L, " Unknown Machine") ;
// salvo il comando
bool bOk = ( m_pMchLua->m_pMchMgr != nullptr && m_pMchLua->m_pMchMgr->SimSaveCmd( nType, nPar, sPar)) ;
// assegno risultato
LuaSetParam( L, bOk) ;
return 1 ;
}