From fe8e148d7f22cca60440fcc0efa87e5d96f8b495 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 18 Aug 2017 17:24:51 +0000 Subject: [PATCH] EgtExecutor 1.8h4 : - aggiunta a Exe e Lua SimGetOperationInfo. --- EXE_MachMgr.cpp | 10 ++++++++++ EgtExecutor.rc | Bin 15088 -> 15088 bytes LUA_MachMgr.cpp | 23 +++++++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/EXE_MachMgr.cpp b/EXE_MachMgr.cpp index c76d599..1f78341 100644 --- a/EXE_MachMgr.cpp +++ b/EXE_MachMgr.cpp @@ -2481,6 +2481,16 @@ ExeSimGetToolInfo( string& sName, double& dSpeed) return pMachMgr->SimGetToolInfo( sName, dSpeed) ; } +//----------------------------------------------------------------------------- +bool +ExeSimGetOperationInfo( string& sName, int& nType) +{ + IMachMgr* pMachMgr = GetCurrMachMgr() ; + VERIFY_MACHMGR( pMachMgr, false) + // recupero dati della operazione + return pMachMgr->SimGetOperationInfo( sName, nType) ; +} + //----------------------------------------------------------------------------- bool ExeSimGetMoveInfo( int& nGmove, double& dFeed) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 883f20d9533355e3f4aa772a4a67ba30eef729a1..68a40f266882a20097fc0b0403fd1579d6a2887c 100644 GIT binary patch delta 79 zcmexR`k{2gFE&P#&A-`PnSqoe*K!sx?>N)s4T4pSCX*exk~jAW*?>e(i-FY$N+HxV MD8kglDNT|90G!nul>h($ delta 79 zcmexR`k{2gFE&Qw&A-`PnSqoe*K!sx?>N)s4T4pS#*-bnk~jAW*?>e(i-FY$N+HxV MD8kglDNT|90Go*$jQ{`u diff --git a/LUA_MachMgr.cpp b/LUA_MachMgr.cpp index 381272f..f937665 100644 --- a/LUA_MachMgr.cpp +++ b/LUA_MachMgr.cpp @@ -2623,6 +2623,28 @@ LuaSimGetToolInfo( lua_State* L) return 2 ; } +//------------------------------------------------------------------------------- +static int +LuaSimGetOperationInfo( lua_State* L) +{ + // nessun parametro + LuaClearStack( L) ; + // recupero nome e tipo dell'operazione corrente + string sName ; + int nType ; + bool bOk = ExeSimGetOperationInfo( sName, nType) ; + // restituisco il risultato + if ( bOk) { + LuaSetParam( L, sName) ; + LuaSetParam( L, nType) ; + } + else { + LuaSetParam( L) ; + LuaSetParam( L) ; + } + return 2 ; +} + //------------------------------------------------------------------------------- static int LuaSimGetMoveInfo( lua_State* L) @@ -3442,6 +3464,7 @@ LuaInstallMachMgr( LuaMgr& luaMgr) bOk = bOk && luaMgr.RegisterFunction( "EgtSimHome", LuaSimHome) ; bOk = bOk && luaMgr.RegisterFunction( "EgtSimGetAxisInfoPos", LuaSimGetAxisInfoPos) ; bOk = bOk && luaMgr.RegisterFunction( "EgtSimGetToolInfo", LuaSimGetToolInfo) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtSimGetOperationInfo", LuaSimGetOperationInfo) ; bOk = bOk && luaMgr.RegisterFunction( "EgtSimGetMoveInfo", LuaSimGetMoveInfo) ; bOk = bOk && luaMgr.RegisterFunction( "EgtSimSetStep", LuaSimSetStep) ; bOk = bOk && luaMgr.RegisterFunction( "EgtSimStop", LuaSimStop) ;