EgtExecutor 1.6f4 :

- ApproxCurve con nuove opzioni
- aggiunta funzione ExeSetMachiningParam.
This commit is contained in:
Dario Sassi
2015-06-30 14:00:47 +00:00
parent ff53dcb8e3
commit 57d69257f1
5 changed files with 84 additions and 2 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
#include "stdafx.h"
#include "AuxTools.h"
#include "/EgtDev/Include/EGkExtText.h"
#include "/EgtDev/Include/EMkMachMgr.h"
#include "/EgtDev/Include/EMkDispositionConst.h"
#include "/EgtDev/Include/EXeConst.h"
#include "/EgtDev/Include/EGnStringUtils.h"
+3 -1
View File
@@ -781,7 +781,9 @@ ExeApproxCurve( int nId, int nApprType, double dLinTol)
const double ANG_TOL_MAX_DEG = 90 ;
PtrOwner<ICurveComposite> pCC( CreateCurveComposite()) ;
bOk = bOk && ! IsNull( pCC) ;
if ( nApprType == APP_LINES || nApprType == APP_LEFT_LINES || nApprType == APP_RIGHT_LINES) {
if ( nApprType == APP_LINES ||
nApprType == APP_LEFT_LINES || nApprType == APP_LEFT_CONVEX_LINES ||
nApprType == APP_RIGHT_LINES || nApprType == APP_RIGHT_CONVEX_LINES) {
PolyLine PL ;
bOk = bOk && pCurve->ApproxWithLines( dLinTol, ANG_TOL_MAX_DEG, nApprType, PL) && pCC->FromPolyLine( PL) ;
}
+40
View File
@@ -660,6 +660,46 @@ ExeAddMachining( const string& sName, const std::string& sMachining)
return pGseCtx->m_pMachMgr->AddMachining( sName, sMachining) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetMachiningParam( int nType, bool bVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto un parametro alla lavorazione corrente
return pGseCtx->m_pMachMgr->SetMachiningParam( nType, bVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetMachiningParam( int nType, int nVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto un parametro alla lavorazione corrente
return pGseCtx->m_pMachMgr->SetMachiningParam( nType, nVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetMachiningParam( int nType, double dVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto un parametro alla lavorazione corrente
return pGseCtx->m_pMachMgr->SetMachiningParam( nType, dVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetMachiningParam( int nType, const string& sVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto un parametro alla lavorazione corrente
return pGseCtx->m_pMachMgr->SetMachiningParam( nType, sVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetMachiningGeometry( const SELVECTOR& vIds)
BIN
View File
Binary file not shown.
+40
View File
@@ -15,6 +15,7 @@
#include "stdafx.h"
#include "LUA.h"
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EMkMachiningConst.h"
#include "/EgtDev/Include/EGkGdbConst.h"
#include "/EgtDev/Include/EGkLuaAux.h"
@@ -791,6 +792,44 @@ LuaAddMachining( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaSetMachiningParam( lua_State* L)
{
// 2 parametri : nType, xVal
int nType ;
LuaCheckParam( L, 1, nType)
bool bOk = false ;
if ( ( nType & MPA_BOOL) != 0) {
bool bVal ;
LuaCheckParam( L, 2, bVal)
// imposto il parametro alla lavorazione corrente
bOk = ExeSetMachiningParam( nType, bVal) ;
}
else if ( ( nType & MPA_INT) != 0) {
int nVal ;
LuaCheckParam( L, 2, nVal)
// imposto il parametro alla lavorazione corrente
bOk = ExeSetMachiningParam( nType, nVal) ;
}
else if ( ( nType & MPA_DOU) != 0) {
double dVal ;
LuaCheckParam( L, 2, dVal)
// imposto il parametro alla lavorazione corrente
bOk = ExeSetMachiningParam( nType, dVal) ;
}
else if ( ( nType & MPA_STR) != 0) {
string sVal ;
LuaCheckParam( L, 2, sVal)
// imposto il parametro alla lavorazione corrente
bOk = ExeSetMachiningParam( nType, sVal) ;
}
LuaClearStack( L) ;
// restituisco il risultato
LuaSetReturn( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaSetMachiningGeometry( lua_State* L)
@@ -866,6 +905,7 @@ LuaInstallMachMgr( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtGetCalcPositions", LuaGetCalcPositions) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVerifyOutOfStroke", LuaVerifyOutOfStroke) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtAddMachining", LuaAddMachining) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetMachiningParam", LuaSetMachiningParam) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetMachiningGeometry", LuaSetMachiningGeometry) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtApplyMachining", LuaApplyMachining) ;