EgtExecutor 1.6j2 :
- aggiunte funzioni EXE e LUA per simulazione.
This commit is contained in:
@@ -811,3 +811,73 @@ ExeApplyMachining( void)
|
||||
// imposto la geometria alla lavorazione corrente
|
||||
return pGseCtx->m_pMachMgr->Apply() ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
int
|
||||
ExeGetFirstOperation( void)
|
||||
{
|
||||
GseContext* pGseCtx = GetCurrGseContext() ;
|
||||
VERIFY_CTX_MACHMGR( pGseCtx, false)
|
||||
// recupero la prima operazione della macchinata corrente
|
||||
return pGseCtx->m_pMachMgr->GetFirstOperation() ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
int
|
||||
ExeGetNextOperation( int nId)
|
||||
{
|
||||
GseContext* pGseCtx = GetCurrGseContext() ;
|
||||
VERIFY_CTX_MACHMGR( pGseCtx, false)
|
||||
// recupero la successiva operazione della macchinata corrente
|
||||
return pGseCtx->m_pMachMgr->GetNextOperation( nId) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
int
|
||||
ExeGetOperationType( int nId)
|
||||
{
|
||||
GseContext* pGseCtx = GetCurrGseContext() ;
|
||||
VERIFY_CTX_MACHMGR( pGseCtx, false)
|
||||
// recupero il tipo di operazione della macchinata corrente
|
||||
return pGseCtx->m_pMachMgr->GetOperationType( nId) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeSimStart( void)
|
||||
{
|
||||
GseContext* pGseCtx = GetCurrGseContext() ;
|
||||
VERIFY_CTX_MACHMGR( pGseCtx, false)
|
||||
// avvio la simulazione della macchinata corrente
|
||||
return pGseCtx->m_pMachMgr->SimStart() ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeSimMove( void)
|
||||
{
|
||||
GseContext* pGseCtx = GetCurrGseContext() ;
|
||||
VERIFY_CTX_MACHMGR( pGseCtx, false)
|
||||
// eseguo movimento di simulazione della macchinata corrente
|
||||
return pGseCtx->m_pMachMgr->SimMove() ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeSimSetStep( double dStep)
|
||||
{
|
||||
GseContext* pGseCtx = GetCurrGseContext() ;
|
||||
VERIFY_CTX_MACHMGR( pGseCtx, false)
|
||||
// imposto lo step di riferimento per la simulazione della macchinata corrente
|
||||
return pGseCtx->m_pMachMgr->SimSetStep( dStep) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeSimStop( void)
|
||||
{
|
||||
GseContext* pGseCtx = GetCurrGseContext() ;
|
||||
VERIFY_CTX_MACHMGR( pGseCtx, false)
|
||||
// termino la simulazione della macchinata corrente
|
||||
return pGseCtx->m_pMachMgr->SimStop() ;
|
||||
}
|
||||
|
||||
Binary file not shown.
+110
@@ -955,6 +955,109 @@ LuaApplyMachining( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaGetFirstOperation( lua_State* L)
|
||||
{
|
||||
// nessun parametro
|
||||
LuaClearStack( L) ;
|
||||
// recupero la prima operazione della macchinata corrente
|
||||
int nId = ExeGetFirstOperation() ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nId) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaGetNextOperation( lua_State* L)
|
||||
{
|
||||
// 1 parametro : nId
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
LuaClearStack( L) ;
|
||||
// recupero la prima operazione della macchinata corrente
|
||||
int nNextId = ExeGetNextOperation( nId) ;
|
||||
// restituisco il risultato
|
||||
if ( nNextId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nNextId) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaGetOperationType( lua_State* L)
|
||||
{
|
||||
// 1 parametro : nId
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
LuaClearStack( L) ;
|
||||
// recupero la prima operazione della macchinata corrente
|
||||
int nType = ExeGetOperationType( nId) ;
|
||||
// restituisco il risultato
|
||||
LuaSetParam( L, nType) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSimStart( lua_State* L)
|
||||
{
|
||||
// nessun parametro
|
||||
LuaClearStack( L) ;
|
||||
// avvio la simulazione
|
||||
bool bOk = ExeSimStart() ;
|
||||
// restituisco il risultato
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSimMove( lua_State* L)
|
||||
{
|
||||
// nessun parametro
|
||||
LuaClearStack( L) ;
|
||||
// eseguo movimento di simulazione
|
||||
bool bOk = ExeSimMove() ;
|
||||
// restituisco il risultato
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSimSetStep( lua_State* L)
|
||||
{
|
||||
// 1 parametro : dStep
|
||||
double dStep ;
|
||||
LuaCheckParam( L, 1, dStep)
|
||||
LuaClearStack( L) ;
|
||||
// imposto lo step di riferimento per la simulazione
|
||||
bool bOk = ExeSimSetStep( dStep) ;
|
||||
// restituisco il risultato
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSimStop( lua_State* L)
|
||||
{
|
||||
// nessun parametro
|
||||
LuaClearStack( L) ;
|
||||
// termino la simulazione
|
||||
bool bOk = ExeSimStop() ;
|
||||
// restituisco il risultato
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
LuaInstallMachMgr( LuaMgr& luaMgr)
|
||||
@@ -1009,6 +1112,13 @@ LuaInstallMachMgr( LuaMgr& luaMgr)
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSetMachiningParam", LuaSetMachiningParam) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSetMachiningGeometry", LuaSetMachiningGeometry) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtApplyMachining", LuaApplyMachining) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetFirstOperation", LuaGetFirstOperation) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetNextOperation", LuaGetNextOperation) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetOperationType", LuaGetOperationType) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSimStart", LuaSimStart) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSimMove", LuaSimMove) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSimSetStep", LuaSimSetStep) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSimStop", LuaSimStop) ;
|
||||
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user