diff --git a/EXE_MachMgr.cpp b/EXE_MachMgr.cpp index 7611214..f339dd2 100644 --- a/EXE_MachMgr.cpp +++ b/EXE_MachMgr.cpp @@ -559,7 +559,7 @@ ExeModifyRawPart( int nRawId, Point3d ptOrig, double dLength, double dWidth, dou //----------------------------------------------------------------------------- bool -ExeModifyRawPart( int nRawId, int nCrvId, double dOverMat, double dZmin, double dHeight, Color cCol) +ExeModifyRawPart( int nRawId, int nCrvId, double dOverMat, double dHeight, Color cCol) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, false) @@ -2106,42 +2106,42 @@ ExeGetPrevOperation( int nId) } //----------------------------------------------------------------------------- int -ExeGetFirstActiveOperation( void) +ExeGetFirstActiveOperation( bool bNeedMachNotEmpty) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL) // recupero la prima operazione attiva della macchinata corrente - return pMachMgr->GetFirstActiveOperation() ; + return pMachMgr->GetFirstActiveOperation( bNeedMachNotEmpty) ; } //----------------------------------------------------------------------------- int -ExeGetNextActiveOperation( int nId) +ExeGetNextActiveOperation( int nId, bool bNeedMachNotEmpty) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL) // recupero la successiva operazione attiva della macchinata corrente - return pMachMgr->GetNextActiveOperation( nId) ; + return pMachMgr->GetNextActiveOperation( nId, bNeedMachNotEmpty) ; } //----------------------------------------------------------------------------- int -ExeGetLastActiveOperation( void) +ExeGetLastActiveOperation( bool bNeedMachNotEmpty) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, false) // recupero l'ultima operazione attiva della macchinata corrente - return pMachMgr->GetLastActiveOperation() ; + return pMachMgr->GetLastActiveOperation( bNeedMachNotEmpty) ; } //----------------------------------------------------------------------------- int -ExeGetPrevActiveOperation( int nId) +ExeGetPrevActiveOperation( int nId, bool bNeedMachNotEmpty) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL) // recupero la precedente operazione attiva della macchinata corrente - return pMachMgr->GetPrevActiveOperation( nId) ; + return pMachMgr->GetPrevActiveOperation( nId, bNeedMachNotEmpty) ; } //----------------------------------------------------------------------------- @@ -2206,12 +2206,12 @@ ExeGetOperationId( const string& sName) //----------------------------------------------------------------------------- bool -ExeIsOperationEmpty( int nId) +ExeIsOperationEmpty( int nId, int nEmptyType) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, false) // recupero lo stato dell'operazione indicata della macchinata corrente - return pMachMgr->IsOperationEmpty( nId) ; + return pMachMgr->IsOperationEmpty( nId, nEmptyType) ; } //----------------------------------------------------------------------------- @@ -2840,12 +2840,12 @@ ExeGetMachiningSkippedGeometry( SELVECTOR& vIds) //----------------------------------------------------------------------------- bool -ExeIsMachiningEmpty( void) +ExeIsMachiningEmpty( int nEmptyType) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, false) // restituisco lo stato della lavorazione corrente - return pMachMgr->IsMachiningEmpty() ; + return pMachMgr->IsMachiningEmpty( nEmptyType) ; } //----------------------------------------------------------------------------- diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 6c15af5..b84fe29 100644 Binary files a/EgtExecutor.rc and b/EgtExecutor.rc differ diff --git a/LUA_MachMgr.cpp b/LUA_MachMgr.cpp index 6ab87af..14bc5aa 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/EXeConst.h" #include "/EgtDev/Include/EMkToolConst.h" #include "/EgtDev/Include/EMkMachiningConst.h" #include "/EgtDev/Include/EGkGdbConst.h" @@ -557,22 +558,20 @@ LuaAddRawPartWithPart( lua_State* L) static int LuaModifyRawPart( lua_State* L) { - // 6 parametri : nRawId, nCrvId, dOverMat, dZmin, dHeight, cCol + // 5 parametri : nRawId, nCrvId, dOverMat, dHeight, cCol int nRawId ; LuaCheckParam( L, 1, nRawId) int nCrvId ; LuaCheckParam( L, 2, nCrvId) double dOverMat ; LuaCheckParam( L, 3, dOverMat) - double dZmin ; - LuaCheckParam( L, 4, dZmin) double dHeight ; - LuaCheckParam( L, 5, dHeight) + LuaCheckParam( L, 4, dHeight) Color cCol ; - LuaCheckParam( L, 6, cCol) + LuaCheckParam( L, 5, cCol) LuaClearStack( L) ; // modifico le dimensioni del grezzo - bool bOk = ExeModifyRawPart( nRawId, nCrvId, dOverMat, dZmin, dHeight, cCol) ; + bool bOk = ExeModifyRawPart( nRawId, nCrvId, dOverMat, dHeight, cCol) ; // restituisco il risultato LuaSetParam( L, bOk) ; return 1 ; @@ -2286,10 +2285,12 @@ LuaGetPrevOperation( lua_State* L) static int LuaGetFirstActiveOperation( lua_State* L) { - // nessun parametro + // nessuno o 1 parametro : [bNeedMachNotEmpty] + bool bNeedMachNotEmpty = false ; + LuaGetParam( L, 1, bNeedMachNotEmpty) ; LuaClearStack( L) ; // recupero la prima operazione attiva della macchinata corrente - int nId = ExeGetFirstActiveOperation() ; + int nId = ExeGetFirstActiveOperation( bNeedMachNotEmpty) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetParam( L, nId) ; @@ -2302,12 +2303,14 @@ LuaGetFirstActiveOperation( lua_State* L) static int LuaGetNextActiveOperation( lua_State* L) { - // 1 parametro : nId + // 1 o 2 parametri : nId [, bNeedMachNotEmpty] int nId ; LuaCheckParam( L, 1, nId) + bool bNeedMachNotEmpty = false ; + LuaGetParam( L, 2, bNeedMachNotEmpty) ; LuaClearStack( L) ; // recupero la successiva operazione attiva della macchinata corrente - int nNextId = ExeGetNextActiveOperation( nId) ; + int nNextId = ExeGetNextActiveOperation( nId, bNeedMachNotEmpty) ; // restituisco il risultato if ( nNextId != GDB_ID_NULL) LuaSetParam( L, nNextId) ; @@ -2320,10 +2323,12 @@ LuaGetNextActiveOperation( lua_State* L) static int LuaGetLastActiveOperation( lua_State* L) { - // nessun parametro + // nessuno o 1 parametro : [bNeedMachNotEmpty] + bool bNeedMachNotEmpty = false ; + LuaGetParam( L, 1, bNeedMachNotEmpty) ; LuaClearStack( L) ; // recupero l'ultima operazione attiva della macchinata corrente - int nId = ExeGetLastActiveOperation() ; + int nId = ExeGetLastActiveOperation( bNeedMachNotEmpty) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetParam( L, nId) ; @@ -2336,12 +2341,14 @@ LuaGetLastActiveOperation( lua_State* L) static int LuaGetPrevActiveOperation( lua_State* L) { - // 1 parametro : nId + // 1 o 2 parametri : nId [, bNeedMachNotEmpty] int nId ; LuaCheckParam( L, 1, nId) + bool bNeedMachNotEmpty = false ; + LuaGetParam( L, 2, bNeedMachNotEmpty) ; LuaClearStack( L) ; // recupero la precedente operazione attiva della macchinata corrente - int nNextId = ExeGetPrevActiveOperation( nId) ; + int nNextId = ExeGetPrevActiveOperation( nId, bNeedMachNotEmpty) ; // restituisco il risultato if ( nNextId != GDB_ID_NULL) LuaSetParam( L, nNextId) ; @@ -2438,12 +2445,14 @@ LuaGetOperationId( lua_State* L) static int LuaIsOperationEmpty( lua_State* L) { - // 1 parametro : nId + // 1 o 2 parametri : nId [, nEmptyType] int nId ; LuaCheckParam( L, 1, nId) + int nEmptyType = EMP_NEED_GEOM ; + LuaGetParam( L, 2, nEmptyType) ; LuaClearStack( L) ; // recupero lo stato della operazione indicata della macchinata corrente - bool bOk = ExeIsOperationEmpty( nId) ; + bool bOk = ExeIsOperationEmpty( nId, nEmptyType) ; // restituisco il risultato LuaSetParam( L, bOk) ; return 1 ; @@ -3028,10 +3037,12 @@ LuaGetMachiningSkippedGeometry( lua_State* L) static int LuaIsMachiningEmpty( lua_State* L) { - // nessun parametro + // nessuno o 1 parametro : [nEmptyType] + int nEmptyType = EMP_NEED_GEOM ; + LuaGetParam( L, 1, nEmptyType) ; LuaClearStack( L) ; // recupero lo stato della lavorazione corrente - bool bEmpty = ExeIsMachiningEmpty() ; + bool bEmpty = ExeIsMachiningEmpty( nEmptyType) ; // restituisco il risultato LuaSetParam( L, bEmpty) ; return 1 ;