diff --git a/EXE_MachMgr.cpp b/EXE_MachMgr.cpp index 8df9aa5..c1d99ed 100644 --- a/EXE_MachMgr.cpp +++ b/EXE_MachMgr.cpp @@ -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) ; } //----------------------------------------------------------------------------- diff --git a/EgtExecutor.rc b/EgtExecutor.rc index bba66f1..563aaa9 100644 Binary files a/EgtExecutor.rc and b/EgtExecutor.rc differ diff --git a/LUA_MachMgr.cpp b/LUA_MachMgr.cpp index ef2edb4..aed795f 100644 --- a/LUA_MachMgr.cpp +++ b/LUA_MachMgr.cpp @@ -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) ;