EgtExecutor :
- aggiunte funzioni exe/lua SetCalcSolCh e GetCalcSolCh.
This commit is contained in:
@@ -3416,6 +3416,16 @@ ExeSetCalcTool( const string& sTool, const string& sHead, int nExit)
|
||||
return pMachMgr->SetCalcTool( sTool, sHead, nExit) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeSetCalcSolCh( int nScc, bool bExact)
|
||||
{
|
||||
IMachMgr* pMachMgr = GetCurrMachMgr() ;
|
||||
VERIFY_MACHMGR( pMachMgr, false)
|
||||
// imposto il criterio di scelta della soluzione e se deve essere rispettato esattamente
|
||||
return pMachMgr->SetCalcSolCh( nScc, bExact) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeSetRotAxisBlock( const string& sAxis, double dVal)
|
||||
@@ -3446,6 +3456,16 @@ ExeGetCalcTool( string& sTool, string& sHead, int& nExit)
|
||||
return ( pMachMgr->GetCalcTool( sTool) && pMachMgr->GetCalcHead( sHead) && pMachMgr->GetCalcExit( nExit)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeGetCalcSolCh( int& nScc, bool& bExact)
|
||||
{
|
||||
IMachMgr* pMachMgr = GetCurrMachMgr() ;
|
||||
VERIFY_MACHMGR( pMachMgr, false)
|
||||
// recupero il criterio di scelta della soluzione e se deve essere rispettato esattamente
|
||||
return pMachMgr->GetCalcSolCh( nScc, bExact) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeGetAllCurrAxesNames( STRVECTOR& vAxName)
|
||||
|
||||
@@ -3591,6 +3591,23 @@ LuaSetCalcTool( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSetCalcSolCh( lua_State* L)
|
||||
{
|
||||
// 1 o 2 parametri : nScc [, bExact]
|
||||
int nScc ;
|
||||
LuaCheckParam( L, 1, nScc)
|
||||
bool bExact = false ;
|
||||
LuaGetParam( L, 2, bExact) ;
|
||||
LuaClearStack( L) ;
|
||||
// imposto il criterio di scelta della soluzione e se deve essere rispettato esattamente
|
||||
bool bOk = ExeSetCalcSolCh( nScc, bExact) ;
|
||||
// restituisco il risultato
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSetRotAxisBlock( lua_State* L)
|
||||
@@ -3650,6 +3667,28 @@ LuaGetCalcTool( lua_State* L)
|
||||
return 3 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaGetCalcSolCh( lua_State* L)
|
||||
{
|
||||
// nessun parametro
|
||||
LuaClearStack( L) ;
|
||||
// recupero il criterio di scelta della soluzione e se deve essere rispettato esattamente
|
||||
int nScc ;
|
||||
bool bExact ;
|
||||
bool bOk = ExeGetCalcSolCh( nScc, bExact) ;
|
||||
// restituisco il risultato
|
||||
if ( bOk) {
|
||||
LuaSetParam( L, nScc) ;
|
||||
LuaSetParam( L, bExact) ;
|
||||
}
|
||||
else {
|
||||
LuaSetParam( L) ;
|
||||
LuaSetParam( L) ;
|
||||
}
|
||||
return 2 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaGetAllCurrAxesNames( lua_State* L)
|
||||
@@ -4630,9 +4669,11 @@ LuaInstallMachMgr( LuaMgr& luaMgr)
|
||||
// Machine Calc
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSetCalcTable", LuaSetCalcTable) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSetCalcTool", LuaSetCalcTool) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSetCalcSolCh", LuaSetCalcSolCh) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSetRotAxisBlock", LuaSetRotAxisBlock) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetCalcTable", LuaGetCalcTable) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetCalcTool", LuaGetCalcTool) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetCalcSolCh", LuaGetCalcSolCh) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetAllCurrAxesNames", LuaGetAllCurrAxesNames) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetRotAxisBlocked", LuaGetRotAxisBlocked) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetCalcAngles", LuaGetCalcAngles) ;
|
||||
|
||||
Reference in New Issue
Block a user