EgtExecutor 1.6r6 :

- aggiunte GetLoadedTool e UnloadTool a Exe e Lua.
This commit is contained in:
Dario Sassi
2016-05-22 17:03:25 +00:00
parent ff9b804ea7
commit 1844d36b29
3 changed files with 60 additions and 0 deletions
+20
View File
@@ -2010,6 +2010,26 @@ ExeLoadTool( const string& sHead, int nExit, const string& sTool)
return pGseCtx->m_pMachMgr->LoadTool( sHead, nExit, sTool) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetLoadedTool( const string& sHead, int nExit, string& sTool)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupera l'utensile sulla macchina della macchinata corrente in posizione indicata
return pGseCtx->m_pMachMgr->GetLoadedTool( sHead, nExit, sTool) ;
}
//-----------------------------------------------------------------------------
bool
ExeUnloadTool( const string& sHead, int nExit)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// scaric l'utensile dalla posizione indicata della macchina della macchinata corrente
return pGseCtx->m_pMachMgr->UnloadTool( sHead, nExit) ;
}
//-----------------------------------------------------------------------------
bool
ExeResetHeadSet( const string& sHead)
BIN
View File
Binary file not shown.
+40
View File
@@ -2383,6 +2383,44 @@ LuaLoadTool( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetLoadedTool( lua_State* L)
{
// 2 parametri : sHead, nExit
string sHead ;
LuaCheckParam( L, 1, sHead)
int nExit ;
LuaCheckParam( L, 2, nExit)
LuaClearStack( L) ;
// recupero l'utensile caricato su testa e uscita indicate
string sTool ;
bool bOk = ExeGetLoadedTool( sHead, nExit, sTool) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, sTool) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaUnloadTool( lua_State* L)
{
// 2 parametri : sHead, nExit
string sHead ;
LuaCheckParam( L, 1, sHead)
int nExit ;
LuaCheckParam( L, 2, nExit)
LuaClearStack( L) ;
// scarico l'utensile
bool bOk = ExeUnloadTool( sHead, nExit) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaResetHeadSet( lua_State* L)
@@ -2545,6 +2583,8 @@ LuaInstallMachMgr( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtGetAxisHomePos", LuaGetAxisHomePos) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtResetAxisPos", LuaResetAxisPos) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtLoadTool", LuaLoadTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetLoadedTool", LuaGetLoadedTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtUnloadTool", LuaUnloadTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtResetHeadSet", LuaResetHeadSet) ;
return bOk ;