EgtExecutor 1.6k8 :

- aggiornamenti per lavorazioni
- aggiunta GetTableArea e rinominata GetTableRef.
This commit is contained in:
Dario Sassi
2015-11-23 09:08:11 +00:00
parent d86c9a9797
commit 7d8dd64d76
3 changed files with 39 additions and 15 deletions
+7 -7
View File
@@ -564,22 +564,22 @@ ExeSetTable( const std::string& sTable)
//-----------------------------------------------------------------------------
bool
ExeGetTableRef1( Point3d& ptPos)
ExeGetTableRef( int nInd, Point3d& ptPos)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il riferimento della tavola corrente della macchinata corrente
return pGseCtx->m_pMachMgr->GetTableRef1( ptPos) ;
return pGseCtx->m_pMachMgr->GetTableRef( nInd, ptPos) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetTableArea1( int& nAreaId)
ExeGetTableArea( int nInd, BBox3d& b3Area)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero l'oggetto che definisce l'area utile della tavola corrente della macchinata corrente
return pGseCtx->m_pMachMgr->GetTableArea1( nAreaId) ;
// recupero l'estensione dell'area utile della tavola corrente della macchinata corrente
return pGseCtx->m_pMachMgr->GetTableArea( nInd, b3Area) ;
}
//-----------------------------------------------------------------------------
@@ -1174,12 +1174,12 @@ ExeSimStart( void)
//-----------------------------------------------------------------------------
bool
ExeSimMove( void)
ExeSimMove( int& nStatus)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// eseguo movimento di simulazione della macchinata corrente
return pGseCtx->m_pMachMgr->SimMove() ;
return pGseCtx->m_pMachMgr->SimMove( nStatus) ;
}
//-----------------------------------------------------------------------------
BIN
View File
Binary file not shown.
+32 -8
View File
@@ -570,13 +570,15 @@ LuaSetTable( lua_State* L)
//-------------------------------------------------------------------------------
static int
LuaGetTableRef1( lua_State* L)
LuaGetTableRef( lua_State* L)
{
// nessun parametro
// 1 parametro opzionale : [nInd]
int nInd = 1 ;
LuaGetParam( L, 1, nInd) ;
LuaClearStack( L) ;
// imposto la tavola corrente
// recupero il riferimento nInd-esimo della tavola corrente
Point3d ptPos ;
bool bOk = ExeGetTableRef1( ptPos) ;
bool bOk = ExeGetTableRef( nInd, ptPos) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, ptPos) ;
@@ -585,6 +587,25 @@ LuaGetTableRef1( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetTableArea( lua_State* L)
{
// 1 parametro opzionale : [nInd]
int nInd = 1 ;
LuaGetParam( L, 1, nInd) ;
LuaClearStack( L) ;
// recupero la area utile nInd-esima della tavola corrente
BBox3d b3Area ;
bool bOk = ExeGetTableArea( nInd, b3Area) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, b3Area) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaAddFixture( lua_State* L)
@@ -1331,10 +1352,12 @@ LuaSimMove( lua_State* L)
// nessun parametro
LuaClearStack( L) ;
// eseguo movimento di simulazione
bool bOk = ExeSimMove() ;
// restituisco il risultato
int nStatus ;
bool bOk = ExeSimMove( nStatus) ;
// restituisco i risultati
LuaSetParam( L, bOk) ;
return 1 ;
LuaSetParam( L, nStatus) ;
return 2 ;
}
//-------------------------------------------------------------------------------
@@ -1710,7 +1733,8 @@ LuaInstallMachMgr( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtRotatePartInRawPart", LuaRotatePartInRawPart) ;
// Table & Fixtures
bOk = bOk && luaMgr.RegisterFunction( "EgtSetTable", LuaSetTable) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetTableRef1", LuaGetTableRef1) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetTableRef", LuaGetTableRef) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetTableArea", LuaGetTableArea) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtAddFixture", LuaAddFixture) ;
// Tools database
bOk = bOk && luaMgr.RegisterFunction( "EgtTdbGetToolNewName", LuaTdbGetToolNewName) ;