diff --git a/EXE_MachMgr.cpp b/EXE_MachMgr.cpp index 30d67e7..507a370 100644 --- a/EXE_MachMgr.cpp +++ b/EXE_MachMgr.cpp @@ -3140,6 +3140,36 @@ ExeGetClEntAxesVal( int nEntId, DBLVECTOR& vAxes) return pMachMgr->GetClEntAxesVal( nEntId, vAxes) ; } +//----------------------------------------------------------------------------- +bool +ExeGetClEntTDir( int nEntId, Vector3d& vTDir) +{ + IMachMgr* pMachMgr = GetCurrMachMgr() ; + VERIFY_MACHMGR( pMachMgr, false) ; + // recupero vTDir + return pMachMgr->GetClEntTDir( nEntId, vTDir) ; +} + +//----------------------------------------------------------------------------- +bool +ExeGetClEntCDir( int nEntId, Vector3d& vtCDir) +{ + IMachMgr* pMachMgr = GetCurrMachMgr() ; + VERIFY_MACHMGR( pMachMgr, false) ; + // recupero CDir + return pMachMgr->GetClEntCDir( nEntId, vtCDir) ; +} + +//----------------------------------------------------------------------------- +bool +ExeGetClEntADir( int nEntId, Vector3d& vADir) +{ + IMachMgr* pMachMgr = GetCurrMachMgr() ; + VERIFY_MACHMGR( pMachMgr, false) ; + // recupero ADir + return pMachMgr->GetClEntADir( nEntId, vADir) ; +} + //----------------------------------------------------------------------------- // Simulazione //----------------------------------------------------------------------------- diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 430b1ae..a7c0e5e 100644 Binary files a/EgtExecutor.rc and b/EgtExecutor.rc differ diff --git a/LUA_MachMgr.cpp b/LUA_MachMgr.cpp index 704d215..133a0d9 100644 --- a/LUA_MachMgr.cpp +++ b/LUA_MachMgr.cpp @@ -1462,7 +1462,7 @@ LuaTdbIsCurrToolModified( lua_State* L) { // nessun parametro LuaClearStack( L) ; - // verifico se l'utensile corrente è stato modificato + // verifico se l'utensile corrente � stato modificato bool bOk = ExeTdbIsCurrToolModified() ; LuaSetParam( L, bOk) ; return 1 ; @@ -2037,7 +2037,7 @@ LuaMdbIsCurrMachiningModified( lua_State* L) { // nessun parametro LuaClearStack( L) ; - // verifico se la lavorazione corrente è stata modificata + // verifico se la lavorazione corrente � stata modificata bool bOk = ExeMdbIsCurrMachiningModified() ; LuaSetParam( L, bOk) ; return 1 ; @@ -3309,6 +3309,60 @@ LuaGetClEntAxesVal( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaGetClEntTDir( lua_State* L) +{ + // 1 parametro : nEntId + int nEntId ; + LuaGetParam( L, 1, nEntId) ; + LuaClearStack( L) ; + // recupero vTDir + Vector3d vTDir ; + bool bOk = ExeGetClEntTDir( nEntId, vTDir) ; + if ( bOk) + LuaSetParam( L, vTDir) ; + else + LuaSetParam( L) ; + return 1 ; +} + +//------------------------------------------------------------------------------- +static int +LuaGetClEntCDir( lua_State* L) +{ + // 1 parametro : nEntId + int nEntId ; + LuaGetParam( L, 1, nEntId) ; + LuaClearStack( L) ; + // recupero vCDir + Vector3d vCDir ; + bool bOk = ExeGetClEntCDir( nEntId, vCDir) ; + if ( bOk) + LuaSetParam( L, vCDir) ; + else + LuaSetParam( L) ; + return 1 ; +} + +//------------------------------------------------------------------------------- +static int +LuaGetClEntADir( lua_State* L) +{ + // 1 parametro : nEntId + int nEntId ; + LuaGetParam( L, 1, nEntId) ; + LuaClearStack( L) ; + // recupero vADir + Vector3d vADir ; + bool bOk = ExeGetClEntADir( nEntId, vADir) ; + if ( bOk) + LuaSetParam( L, vADir) ; + else + LuaSetParam( L) ; + return 1 ; +} + //------------------------------------------------------------------------------- // Simulation //------------------------------------------------------------------------------- @@ -3492,7 +3546,7 @@ LuaSimGetMoveInfo( lua_State* L) { // nessun parametro LuaClearStack( L) ; - // recupero tipo e veolcità del movimento corrente + // recupero tipo e veolcit� del movimento corrente int nGmove ; double dFeed ; bool bOk = ExeSimGetMoveInfo( nGmove, dFeed) ; @@ -3800,7 +3854,7 @@ LuaGetCalcPositions( lua_State* L) // restituisco il risultato if ( bOk) { LuaSetParam( L, bOk) ; - LuaSetParam( L, 0) ; // assegnato per compatibilità + LuaSetParam( L, 0) ; // assegnato per compatibilit� LuaSetParam( L, dX) ; LuaSetParam( L, dY) ; LuaSetParam( L, dZ) ; @@ -4647,11 +4701,14 @@ LuaInstallMachMgr( LuaMgr& luaMgr) // CL Entities Interrogations bOk = bOk && luaMgr.RegisterFunction( "EgtGetClEntMove", LuaGetClEntMove) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetClEntFlag", LuaGetClEntFlag) ; - bOk = bOk && luaMgr.RegisterFunction( "EgtGetClEntIndex", LuaGetClEntIndex) ; - bOk = bOk && luaMgr.RegisterFunction( "EgtGetClEntFeed", LuaGetClEntFeed) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtGetClEntIndex", LuaGetClEntIndex) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtGetClEntFeed", LuaGetClEntFeed) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetClEntAxesStatus", LuaGetClEntAxesStatus) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetClEntAxesMask", LuaGetClEntAxesMask) ; - bOk = bOk && luaMgr.RegisterFunction( "EgtGetClEntAxesVal", LuaGetClEntAxesVal) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtGetClEntAxesVal", LuaGetClEntAxesVal) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtGetClEntTDir", LuaGetClEntTDir) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtGetClEntCDir", LuaGetClEntCDir) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtGetClEntADir", LuaGetClEntADir) ; // Simulation bOk = bOk && luaMgr.RegisterFunction( "EgtSimInit", LuaSimInit) ; bOk = bOk && luaMgr.RegisterFunction( "EgtSimStart", LuaSimStart) ;