diff --git a/EXE_MachMgr.cpp b/EXE_MachMgr.cpp index b533ff8..0516196 100644 --- a/EXE_MachMgr.cpp +++ b/EXE_MachMgr.cpp @@ -455,16 +455,17 @@ ExeModifyRawPartHeight( int nRawId, double dHeight) //----------------------------------------------------------------------------- bool -ExeKeepRawPart( int nRawId) +ExeKeepRawPart( int nRawId, int nSouPhase) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // confermo il grezzo nella fase corrente della macchinata corrente - bool bOk = pGseCtx->m_pMachMgr->KeepRawPart( nRawId) ; + bool bOk = pGseCtx->m_pMachMgr->KeepRawPart( nRawId, nSouPhase) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { - string sLua = "EgtKeepRawPart(" + ToString( nRawId) + ")" + + string sLua = "EgtKeepRawPart(" + ToString( nRawId) + "," + + ToString( nSouPhase) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } @@ -829,6 +830,26 @@ ExeAddFixture( const string& sName, const Point3d& ptPos, double dAngRotDeg, dou return nId ; } +//----------------------------------------------------------------------------- +bool +ExeKeepFixture( int nFxtId, int nSouPhase) +{ + GseContext* pGseCtx = GetCurrGseContext() ; + VERIFY_CTX_MACHMGR( pGseCtx, false) + // confermo il bloccaggio nella fase corrente della macchinata corrente + bool bOk = pGseCtx->m_pMachMgr->KeepFixture( nFxtId, nSouPhase) ; + ExeSetModified() ; + // se richiesto, salvo il comando Lua equivalente + if ( IsCmdLog()) { + string sLua = "EgtKeepFixture(" + ToString( nFxtId) + "," + + ToString( nSouPhase) + ")" + + " -- Ok=" + ToString( bOk) ; + LOG_INFO( GetCmdLogger(), sLua.c_str()) ; + } + // restituisco il risultato + return bOk ; +} + //----------------------------------------------------------------------------- bool ExeRemoveFixture( int nFxtId) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 63c894c..ae4e384 100644 Binary files a/EgtExecutor.rc and b/EgtExecutor.rc differ diff --git a/LUA_MachMgr.cpp b/LUA_MachMgr.cpp index 4c654d1..4d9a0ab 100644 --- a/LUA_MachMgr.cpp +++ b/LUA_MachMgr.cpp @@ -453,12 +453,14 @@ LuaModifyRawPartHeight( lua_State* L) static int LuaKeepRawPart( lua_State* L) { - // 1 parametro : nRawId + // 1 o 2 parametri : nRawId [, nSouPhase] int nRawId ; LuaCheckParam( L, 1, nRawId) + int nSouPhase = 0 ; + LuaGetParam( L, 2, nSouPhase) ; LuaClearStack( L) ; // confermo il grezzo nella fase corrente della macchinata corrente - bool bOk = ExeKeepRawPart( nRawId) ; + bool bOk = ExeKeepRawPart( nRawId, nSouPhase) ; // restituisco il risultato LuaSetParam( L, bOk) ; return 1 ; @@ -840,6 +842,23 @@ LuaAddFixture( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaKeepFixture( lua_State* L) +{ + // 1 o 2 parametri : nFxtId [, nSouPhase] + int nFxtId ; + LuaCheckParam( L, 1, nFxtId) + int nSouPhase = 0 ; + LuaGetParam( L, 2, nSouPhase) ; + LuaClearStack( L) ; + // confermo il bloccaggio nella fase corrente della macchinata corrente + bool bOk = ExeKeepFixture( nFxtId, nSouPhase) ; + // restituisco il risultato + LuaSetParam( L, bOk) ; + return 1 ; +} + //------------------------------------------------------------------------------- static int LuaRemoveFixture( lua_State* L) @@ -2799,6 +2818,7 @@ LuaInstallMachMgr( LuaMgr& luaMgr) bOk = bOk && luaMgr.RegisterFunction( "EgtGetTableRef", LuaGetTableRef) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetTableArea", LuaGetTableArea) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAddFixture", LuaAddFixture) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtKeepFixture", LuaKeepFixture) ; bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveFixture", LuaRemoveFixture) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetFirstFixture", LuaGetFirstFixture) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetNextFixture", LuaGetNextFixture) ;