From 5019148f9d6436ce3378095388352fea68369468 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 15 Oct 2024 17:35:53 +0200 Subject: [PATCH] EgtExecutor 2.6j3 : - aggiunta funzione Exe e Lua GetAxisDir. --- EXE_MachMgr.cpp | 10 ++++++++++ EgtExecutor.rc | Bin 18898 -> 18898 bytes LUA_MachMgr.cpp | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/EXE_MachMgr.cpp b/EXE_MachMgr.cpp index 9efbae0..ae56f77 100644 --- a/EXE_MachMgr.cpp +++ b/EXE_MachMgr.cpp @@ -3537,6 +3537,16 @@ ExeGetAxisType( const string& sAxis, bool& bLinear) return pMachMgr->GetAxisType( sAxis, bLinear) ; } +//----------------------------------------------------------------------------- +bool +ExeGetAxisDir( const string& sAxis, Vector3d& vtDir) +{ + IMachMgr* pMachMgr = GetCurrMachMgr() ; + VERIFY_MACHMGR( pMachMgr, false) + // recupero la direzione dell'asse + return pMachMgr->GetAxisDir( sAxis, vtDir) ; +} + //----------------------------------------------------------------------------- bool ExeGetAxisInvert( const string& sAxis, bool& bInvert) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index a13875f9d2391e3fd089ef5bb7da895e0291eac8..9f1371b57db6a900add2b63727dcbe1331ad1948 100644 GIT binary patch delta 99 zcmcaKneozO#tnbi7>zey6uZte`3h$qqw(ZGZr#lVTs15}(SvfAnI<0)gozp`xiM~D fB&^2_*5C@Hpo;w%H&2oV3m=qogb5ocEm8*n;#nX* delta 99 zcmcaKneozO#tnbi7>zbx6uZte`3h$qqtWC*Zr#lVTs15}(SvfAnI<0)gozp`xiM~D fB&^2_*5C@Hpo;w%H&2oV3m=qogb5ocEm8*n;L{*B diff --git a/LUA_MachMgr.cpp b/LUA_MachMgr.cpp index 1594ccf..5d12bea 100644 --- a/LUA_MachMgr.cpp +++ b/LUA_MachMgr.cpp @@ -3889,6 +3889,25 @@ LuaGetAxisType( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaGetAxisDir( lua_State* L) +{ + // 1 parametro : sAxis + string sAxis ; + LuaCheckParam( L, 1, sAxis) + LuaClearStack( L) ; + // recupero la direzione dell'asse + Vector3d vtDir ; + bool bOk = ExeGetAxisDir( sAxis, vtDir) ; + // restituisco il risultato + if ( bOk) + LuaSetParam( L, vtDir) ; + else + LuaSetParam( L) ; + return 1 ; +} + //------------------------------------------------------------------------------- static int LuaGetAxisInvert( lua_State* L) @@ -4403,6 +4422,7 @@ LuaInstallMachMgr( LuaMgr& luaMgr) bOk = bOk && luaMgr.RegisterFunction( "EgtGetTcPosId", LuaGetTcPosId) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetAxisToken", LuaGetAxisToken) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetAxisType", LuaGetAxisType) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtGetAxisDir", LuaGetAxisDir) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetAxisInvert", LuaGetAxisInvert) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetAxisOffset", LuaGetAxisOffset) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetAllTablesNames", LuaGetAllTablesNames) ;