From 7d8dd64d767d2f90aee41bf8844bf35b4c642755 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 23 Nov 2015 09:08:11 +0000 Subject: [PATCH] EgtExecutor 1.6k8 : - aggiornamenti per lavorazioni - aggiunta GetTableArea e rinominata GetTableRef. --- EXE_MachMgr.cpp | 14 +++++++------- EgtExecutor.rc | Bin 11694 -> 11694 bytes LUA_MachMgr.cpp | 40 ++++++++++++++++++++++++++++++++-------- 3 files changed, 39 insertions(+), 15 deletions(-) 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 bba66f18ab579fdaf4c347558cf0f1c41a5cbea9..563aaa9ef60ea9745179642bbc8148b57f00e31e 100644 GIT binary patch delta 97 zcmZ1%y)JsgA2vpd%@@V4Gflq2na5}`Ignd-a{*Tk3sCf++-0W82LxfF21;&>n->Y| cF@rU@0x76sKgP|Iq`|@mn->Y| cF@rU@0x76sKgP|Iq`|@mWB>pF 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) ;