From 57d69257f1fdb777d84633d2c4d5f2bd34f2c215 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 30 Jun 2015 14:00:47 +0000 Subject: [PATCH] EgtExecutor 1.6f4 : - ApproxCurve con nuove opzioni - aggiunta funzione ExeSetMachiningParam. --- AuxTools.cpp | 2 +- EXE_GdbModifyCurve.cpp | 4 +++- EXE_MachMgr.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ EgtExecutor.rc | Bin 11686 -> 11686 bytes LUA_MachMgr.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 84 insertions(+), 2 deletions(-) diff --git a/AuxTools.cpp b/AuxTools.cpp index 3311a2e..17e1a66 100644 --- a/AuxTools.cpp +++ b/AuxTools.cpp @@ -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" diff --git a/EXE_GdbModifyCurve.cpp b/EXE_GdbModifyCurve.cpp index bf19286..eab13b3 100644 --- a/EXE_GdbModifyCurve.cpp +++ b/EXE_GdbModifyCurve.cpp @@ -781,7 +781,9 @@ ExeApproxCurve( int nId, int nApprType, double dLinTol) const double ANG_TOL_MAX_DEG = 90 ; PtrOwner 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) ; } diff --git a/EXE_MachMgr.cpp b/EXE_MachMgr.cpp index 300f40c..4c41a45 100644 --- a/EXE_MachMgr.cpp +++ b/EXE_MachMgr.cpp @@ -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) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 4d870a31c98bf02ce016840648a004bc97313535..a6218602f610a7eeabe69fe82ea70a30bbf3a188 100644 GIT binary patch delta 79 zcmZ1$y)1geFE&P#&A-`PnSqoe*K!sx?>N)s4T4pSCX*exk~jAW*?>e(i-FY$N+HxV MD8kglDS2=M0AF|-b^rhX delta 79 zcmZ1$y)1geFE&Qw&A-`PnSqoe*K!sx?>N)s4T4pS#*-bnk~jAW*?>e(i-FY$N+HxV MD8kglDS2=M0A4H_ZU6uP diff --git a/LUA_MachMgr.cpp b/LUA_MachMgr.cpp index 6f6ec9d..c5ce73b 100644 --- a/LUA_MachMgr.cpp +++ b/LUA_MachMgr.cpp @@ -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) ;