EgtExecutor :

- aggiunte funzioni Exe e Lua GetAxisMin e GetAxisMax.
This commit is contained in:
Dario Sassi
2020-08-17 15:53:26 +00:00
parent 8dbf0057f0
commit 3329d092f0
2 changed files with 69 additions and 3 deletions
+28 -2
View File
@@ -3248,10 +3248,36 @@ ExeGetAxisPos( const string& sAxis, double* pdVal)
// verifico il parametro di ritorno
if ( pdVal == nullptr)
return false ;
// metto l'asse nella nuova posizione
// restituisco la posizione corrente dell'asse
return pMachMgr->GetAxisPos( sAxis, *pdVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetAxisMin( const string& sAxis, double* pdMin)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false)
// verifico il parametro di ritorno
if ( pdMin == nullptr)
return false ;
// restituisco il valore minimo dell'asse
return pMachMgr->GetAxisMin( sAxis, *pdMin) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetAxisMax( const string& sAxis, double* pdMax)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false)
// verifico il parametro di ritorno
if ( pdMax == nullptr)
return false ;
// restituisco il valore massimo dell'asse
return pMachMgr->GetAxisMax( sAxis, *pdMax) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetAxisHomePos( const string& sAxis, double* pdHomeVal)
@@ -3261,7 +3287,7 @@ ExeGetAxisHomePos( const string& sAxis, double* pdHomeVal)
// verifico il parametro di ritorno
if ( pdHomeVal == nullptr)
return false ;
// metto l'asse nella nuova posizione
// restituisco la posizione home
return pMachMgr->GetAxisHomePos( sAxis, *pdHomeVal) ;
}
+41 -1
View File
@@ -3724,6 +3724,44 @@ LuaGetAxisPos( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetAxisMin( lua_State* L)
{
// 1 parametro : sAxis
string sAxis ;
LuaCheckParam( L, 1, sAxis)
LuaClearStack( L) ;
// recupero il minimo dell'asse
double dMin ;
bool bOk = ExeGetAxisMin( sAxis, &dMin) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, dMin) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetAxisMax( lua_State* L)
{
// 1 parametro : sAxis
string sAxis ;
LuaCheckParam( L, 1, sAxis)
LuaClearStack( L) ;
// recupero il massimo dell'asse
double dMax ;
bool bOk = ExeGetAxisMax( sAxis, &dMax) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, dMax) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetAxisHomePos( lua_State* L)
@@ -3732,7 +3770,7 @@ LuaGetAxisHomePos( lua_State* L)
string sAxis ;
LuaCheckParam( L, 1, sAxis)
LuaClearStack( L) ;
// recupero la posizione dell'asse
// recupero la posizione home dell'asse
double dHomeVal ;
bool bOk = ExeGetAxisHomePos( sAxis, &dHomeVal) ;
// restituisco il risultato
@@ -4064,6 +4102,8 @@ LuaInstallMachMgr( LuaMgr& luaMgr)
// Machine Move
bOk = bOk && luaMgr.RegisterFunction( "EgtSetAxisPos", LuaSetAxisPos) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetAxisPos", LuaGetAxisPos) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetAxisMin", LuaGetAxisMin) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetAxisMax", LuaGetAxisMax) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetAxisHomePos", LuaGetAxisHomePos) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtResetAxisPos", LuaResetAxisPos) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtLoadTool", LuaLoadTool) ;