//---------------------------------------------------------------------------- // EgalTech 2015-2015 //---------------------------------------------------------------------------- // File : EXE_MachMgr.cpp Data : 05.05.15 Versione : 1.6e1 // Contenuto : Funzioni Machining Manager per EXE. // // // // Modifiche : 23.03.15 DS Creazione modulo. // // //---------------------------------------------------------------------------- //--------------------------- Include ---------------------------------------- #include "stdafx.h" #include "EXE.h" #include "EXE_Macro.h" #include "Lua_Base.h" #include "AuxTools.h" #include "DllMachKernel.h" #include "/EgtDev/Include/EXeExecutor.h" #include "/EgtDev/Include/EGkStringUtils3d.h" #include "/EgtDev/Include/EgtStringConverter.h" #include "/EgtDev/Include/EgtPointerOwner.h" using namespace std ; //----------------------------------------------------------------------------- bool ExeInitMachMgr( const string& sMachinesDir) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_GEOMDB( pGseCtx, false) // inizializzazione gestore lavorazioni PtrOwner pMachMgr( MyCreateMachMgr()) ; VERIFY_NULL( Get( pMachMgr), "Error in CreateMachMgr", false) bool bOk = pMachMgr->Init( sMachinesDir, pGseCtx->m_pGeomDB, GetIndCurrGseContext(), LuaGetLuaLibsDir(), LuaGetLastRequire()) ; // assegno il gestore al contesto pGseCtx->m_pMachMgr = ( bOk ? Release( pMachMgr) : nullptr) ; // log avvio Machining Manager string sLog = "MachMgr" ; sLog += ( bOk ? " started" : " error") ; sLog += " (" + sMachinesDir + ")" ; LOG_INFO( GetLogger(), sLog.c_str()) return bOk ; } //----------------------------------------------------------------------------- bool ExeUpdateMachMgr( void) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, false) // aggiornamento gestore lavorazioni return pMachMgr->Update() ; } //----------------------------------------------------------------------------- bool ExeInsertMachMgr( int nInsGrp) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, false) // sposto le macchinate dal gruppo di inserimento alla base macchinate return pMachMgr->Insert( nInsGrp) ; } //----------------------------------------------------------------------------- // Machines //----------------------------------------------------------------------------- bool ExeSetCurrMachine( const string& sMachineName) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, false) // imposto la macchina corrente return pMachMgr->SetCurrMachine( sMachineName) ; } //----------------------------------------------------------------------------- bool ExeGetCurrMachineName( string& sMachineName) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, false) // recupero il nome della macchina corrente return pMachMgr->GetCurrMachineName( sMachineName) ; } //----------------------------------------------------------------------------- // Machining Groups //----------------------------------------------------------------------------- int ExeGetMachGroupCount( void) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, 0) // recupero il numero di macchinate return pMachMgr->GetMachGroupCount() ; } //----------------------------------------------------------------------------- int ExeGetFirstMachGroup( void) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL) // recupero la prima macchinata return pMachMgr->GetFirstMachGroup() ; } //----------------------------------------------------------------------------- int ExeGetNextMachGroup( int nId) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL) // recupero la successiva macchinata return pMachMgr->GetNextMachGroup( nId) ; } //----------------------------------------------------------------------------- int ExeAddMachGroup( const string& sName, const string& sMachineName) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, GDB_ID_NULL) // aggiungo la macchinata (gruppo di lavorazione) int nId = pGseCtx->m_pMachMgr->AddMachGroup( sName, sMachineName) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtAddMachGroup('" + sName + "','" + sMachineName + "')" + " -- Id=" + ToString( nId) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return nId ; } //----------------------------------------------------------------------------- bool ExeRemoveMachGroup( int nMGroupId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // rimuovo la macchinata (gruppo di lavorazione) bool bOk = pGseCtx->m_pMachMgr->RemoveMachGroup( nMGroupId) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtRemoveMachGroup(" + ToString( nMGroupId) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeGetMachGroupName( int nId, string& sName) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, false) // recupero il nome della macchinata sName = pMachMgr->GetMachGroupName( nId) ; return ( ! sName.empty()) ; } //----------------------------------------------------------------------------- int ExeGetMachGroupId( const string& sName) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, false) // recupero l'indice della macchinata return pMachMgr->GetMachGroupId( sName) ; } //----------------------------------------------------------------------------- bool ExeSetCurrMachGroup( int nMGroupId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto la macchinata corrente bool bOk = pGseCtx->m_pMachMgr->SetCurrMachGroup( nMGroupId) ; // non cambia lo stato di modificato del progetto // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtSetCurrMachGroup(" + ToString( nMGroupId) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeResetCurrMachGroup( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // reset macchinata corrente bool bOk = pGseCtx->m_pMachMgr->ResetCurrMachGroup() ; // non cambia lo stato di modificato del progetto // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtResetCurrMachGroup()" " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- int ExeGetCurrMachGroup( void) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL) // restituisco identificativo macchinata corrente return pMachMgr->GetCurrMachGroup() ; } //----------------------------------------------------------------------------- // Phases //----------------------------------------------------------------------------- int ExeAddPhase( void) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, 0) // aggiungo una nuova fase di lavorazione alla macchinata corrente return pMachMgr->AddPhase() ; } //----------------------------------------------------------------------------- bool ExeSetCurrPhase( int nPhase, bool bForced) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, false) // imposto la fase di lavorazione corrente nella macchinata corrente return pMachMgr->SetCurrPhase( nPhase, bForced) ; } //----------------------------------------------------------------------------- int ExeGetCurrPhase( void) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, false) // recupero la fase di lavorazione corrente nella macchinata corrente return pMachMgr->GetCurrPhase() ; } //----------------------------------------------------------------------------- bool ExeRemoveLastPhase( void) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, false) // elimina l'ultima fase di lavorazione dalla macchinata corrente return pMachMgr->RemoveLastPhase() ; } //----------------------------------------------------------------------------- int ExeGetPhaseCount( void) { IMachMgr* pMachMgr = GetCurrMachMgr() ; VERIFY_MACHMGR( pMachMgr, 0) // recupero il numero totale di fasi di lavorazione della macchinata corrente return pMachMgr->GetPhaseCount() ; } //----------------------------------------------------------------------------- // Raw Parts & Parts //----------------------------------------------------------------------------- int ExeGetRawPartCount( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero il numero di grezzi nella macchinata corrente return pGseCtx->m_pMachMgr->GetRawPartCount() ; } //----------------------------------------------------------------------------- int ExeGetFirstRawPart( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero identificativo primo grezzo nella macchinata corrente return pGseCtx->m_pMachMgr->GetFirstRawPart() ; } //----------------------------------------------------------------------------- int ExeGetNextRawPart( int nRawId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero identificativo successivo grezzo nella macchinata corrente return pGseCtx->m_pMachMgr->GetNextRawPart( nRawId) ; } //----------------------------------------------------------------------------- int ExeAddRawPart( Point3d ptOrig, double dLength, double dWidth, double dHeight, Color cCol) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, GDB_ID_NULL) // inserisco grezzo nella macchinata corrente int nId = pGseCtx->m_pMachMgr->AddRawPart( ptOrig, dLength, dWidth, dHeight, cCol) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtAddRawPart({" + ToString( ptOrig) + "}," + ToString( dLength) + "," + ToString( dWidth) + "," + ToString( dHeight) + ",{" + ToString( cCol) + "})" + " -- Id=" + ToString( nId) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return nId ; } //----------------------------------------------------------------------------- int ExeAddRawPartWithPart( int nPartId, int nCrvId, double dOverMat, Color cCol) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, GDB_ID_NULL) // inserisco grezzo con pezzo nella macchinata corrente int nId = pGseCtx->m_pMachMgr->AddRawPartWithPart( nPartId, nCrvId, dOverMat, cCol) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtAddRawPartWithPart(" + ToString( nPartId) + "," + ToString( nCrvId) + "," + ToString( dOverMat) + ",{" + ToString( cCol) + "})" + " -- Id=" + ToString( nId) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return nId ; } //----------------------------------------------------------------------------- bool ExeModifyRawPart( int nRawId, Point3d ptOrig, double dLength, double dWidth, double dHeight, Color cCol) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, GDB_ID_NULL) // modifico grezzo indicato nella macchinata corrente bool bOk = pGseCtx->m_pMachMgr->ModifyRawPart( nRawId, ptOrig, dLength, dWidth, dHeight, cCol) ; ExeSetModified() ; // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeModifyRawPart( int nRawId, int nCrvId, double dOverMat, double dZmin, double dHeight, Color cCol) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, GDB_ID_NULL) // modifico grezzo indicato nella macchinata corrente bool bOk = pGseCtx->m_pMachMgr->ModifyRawPart( nRawId, nCrvId, dOverMat, dZmin, dHeight, cCol) ; ExeSetModified() ; // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeModifyRawPartSize( int nRawId, double dLength, double dWidth, double dHeight) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // modifico la lunghezza del grezzo bool bOk = pGseCtx->m_pMachMgr->ModifyRawPartSize( nRawId, dLength, dWidth, dHeight) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtModifyRawPartSize(" + ToString( nRawId) + "," + ToString( dLength) + "," + ToString( dWidth) + "," + ToString( dHeight) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeModifyRawPartHeight( int nRawId, double dHeight) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // modifico lo spessore del grezzo bool bOk = pGseCtx->m_pMachMgr->ModifyRawPartHeight( nRawId, dHeight) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtModifyRawPartHeight(" + ToString( nRawId) + "," + ToString( dHeight) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeKeepRawPart( int nRawId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // confermo il grezzo nella fase corrente della macchinata corrente bool bOk = pGseCtx->m_pMachMgr->KeepRawPart( nRawId) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtKeepRawPart(" + ToString( nRawId) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeVerifyRawPartPhase( int nRawId, int nPhase) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // verifico che il grezzo sia valido ed appartenga alla fase di lavorazione indicata bool bOk = pGseCtx->m_pMachMgr->VerifyRawPartPhase( nRawId, nPhase) ; // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeRemoveRawPartFromCurrPhase( int nRawId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // elimino grezzo dalla fase corrente della macchinata corrente bool bOk = pGseCtx->m_pMachMgr->RemoveRawPartFromCurrPhase( nRawId) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtRemoveRawPartFromCurrPhase(" + ToString( nRawId) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeRemoveRawPart( int nRawId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // elimino grezzo dalla macchinata corrente bool bOk = pGseCtx->m_pMachMgr->RemoveRawPart( nRawId) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtRemoveRawPart(" + ToString( nRawId) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeRotateRawPart( int nRawId, const Vector3d& vtAx, double dAngRotDeg) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // ruoto il grezzo bool bOk = pGseCtx->m_pMachMgr->RotateRawPart( nRawId, vtAx, dAngRotDeg) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtRotateRawPart(" + ToString( nRawId) + ",{" + ToString( vtAx) + "}," + ToString( dAngRotDeg) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeMoveToCornerRawPart( int nRawId, const Point3d& ptCorner, int nFlag) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // mando il grezzo nel corner bool bOk = pGseCtx->m_pMachMgr->MoveToCornerRawPart( nRawId, ptCorner, nFlag) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtMoveToCornerRawPart(" + ToString( nRawId) + ",{" + ToString( ptCorner) + "}," + RawPartCornerPosToString( nFlag) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeMoveToCenterRawPart( int nRawId, const Point3d& ptCenter, int nFlag) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // mando il grezzo nel corner bool bOk = pGseCtx->m_pMachMgr->MoveToCenterRawPart( nRawId, ptCenter, nFlag) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtMoveToCenterRawPart(" + ToString( nRawId) + ",{" + ToString( ptCenter) + "}," + RawPartCenterPosToString( nFlag) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeMoveRawPart( int nRawId, const Vector3d& vtMove) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // traslo il grezzo bool bOk = pGseCtx->m_pMachMgr->MoveRawPart( nRawId, vtMove) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtMoveRawPart(" + ToString( nRawId) + ",{" + ToString( vtMove) + "})" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- int ExeSplitFlatRawPartWithMachinings( int nRawId, const INTVECTOR& vMchId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // divido il grezzo in nuove parti in base alle lavorazioni int nId = pGseCtx->m_pMachMgr->SplitFlatRawPartWithMachinings( nRawId, vMchId) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtSplitFlatRawPartWithMachinings(" + ToString( nRawId) + ",{" + IdListToString( vMchId) + "})" + " -- FirstId=" + ToString( nId) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return nId ; } //----------------------------------------------------------------------------- int ExeGetPartInRawPartCount( int nRawId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero il numero di pezzi nel grezzo return pGseCtx->m_pMachMgr->GetPartInRawPartCount( nRawId) ; } //----------------------------------------------------------------------------- int ExeGetFirstPartInRawPart( int nRawId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero identificativo primo pezzo nel grezzo return pGseCtx->m_pMachMgr->GetFirstPartInRawPart( nRawId) ; } //----------------------------------------------------------------------------- int ExeGetNextPartInRawPart( int nPartId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero identificativo successivo pezzo nello stesso grezzo return pGseCtx->m_pMachMgr->GetNextPartInRawPart( nPartId) ; } //----------------------------------------------------------------------------- bool ExeAddPartToRawPart( int nPartId, const Point3d& ptPos, int nRawId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // inserisco pezzo in un grezzo della macchinata corrente bool bOk = pGseCtx->m_pMachMgr->AddPartToRawPart( nPartId, ptPos, nRawId) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtAddPartToRawPart(" + ToString( nPartId) + ",{" + ToString( ptPos) + "}," + ToString( nRawId) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeRemovePartFromRawPart( int nPartId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // elimino pezzo da grezzo della macchinata corrente bool bOk = pGseCtx->m_pMachMgr->RemovePartFromRawPart( nPartId) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtRemovePartFromRawPart(" + ToString( nPartId) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeTranslatePartInRawPart( int nPartId, const Vector3d& vtMove) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // traslo il pezzo nel grezzo bool bOk = pGseCtx->m_pMachMgr->TranslatePartInRawPart( nPartId, vtMove) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtMovePartInRawPart(" + ToString( nPartId) + ",{" + ToString( vtMove) + "})" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- bool ExeRotatePartInRawPart( int nPartId, const Vector3d& vtAx, double dAngRotDeg) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // ruoto il pezzo nel grezzo bool bOk = pGseCtx->m_pMachMgr->RotatePartInRawPart( nPartId, vtAx, dAngRotDeg) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtRotatePartInRawPart(" + ToString( nPartId) + ",{" + ToString( vtAx) + "}," + ToString( dAngRotDeg) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco il risultato return bOk ; } //----------------------------------------------------------------------------- // Table & Fixtures //----------------------------------------------------------------------------- bool ExeSetTable( const string& sTable) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto la tavola corrente della macchinata corrente return pGseCtx->m_pMachMgr->SetTable( sTable) ; } //----------------------------------------------------------------------------- bool ExeGetTable( string& sTable) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero il nome della tavola corrente della macchinata corrente return pGseCtx->m_pMachMgr->GetTable( sTable) ; } //----------------------------------------------------------------------------- bool ExeGetTableRef( int nInd, Point3d& ptPos) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero il riferimento della tavola corrente della macchinata corrente return pGseCtx->m_pMachMgr->GetTableRef( nInd, ptPos) ; } //----------------------------------------------------------------------------- bool ExeGetTableArea( int nInd, BBox3d& b3Area) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero l'estensione dell'area utile della tavola corrente della macchinata corrente return pGseCtx->m_pMachMgr->GetTableArea( nInd, b3Area) ; } //----------------------------------------------------------------------------- bool ExeShowOnlyTable( bool bVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // visualizzo solo la tavola corrente della macchinata corrente return pGseCtx->m_pMachMgr->ShowOnlyTable( bVal) ; } //----------------------------------------------------------------------------- int ExeAddFixture( const string& sName, const Point3d& ptPos, double dAngRotDeg) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // inserisco il dispositivo di presa nella posizione indicata return pGseCtx->m_pMachMgr->AddFixture( sName, ptPos, dAngRotDeg) ; } //----------------------------------------------------------------------------- int ExeGetFirstFixture( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // cerca il primo bloccaggio return pGseCtx->m_pMachMgr->GetFirstFixture() ; } //----------------------------------------------------------------------------- int ExeGetNextFixture( int nFxtId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // cerca il successivo bloccaggio return pGseCtx->m_pMachMgr->GetNextFixture( nFxtId) ; } //----------------------------------------------------------------------------- // DB utensili //----------------------------------------------------------------------------- bool ExeTdbGetToolNewName( string& sName) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero un nuovo nome a partire da quello passato return pGseCtx->m_pMachMgr->TdbGetToolNewName( sName) ; } //----------------------------------------------------------------------------- bool ExeTdbAddTool( const string& sName, int nType) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // aggiungo l'utensile return pGseCtx->m_pMachMgr->TdbAddTool( sName, nType) ; } //----------------------------------------------------------------------------- bool ExeTdbCopyTool( const string& sSource, const string& sName) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // copio l'utensile return pGseCtx->m_pMachMgr->TdbCopyTool( sSource, sName) ; } //----------------------------------------------------------------------------- bool ExeTdbRemoveTool( const string& sName) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // rimuovo l'utensile return pGseCtx->m_pMachMgr->TdbRemoveTool( sName) ; } //---------------------------------------------------------------------------- bool ExeTdbGetFirstTool( int nFamily, string& sName, int& nType) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // restituisce nome e tipo del primo utensile della famiglia return pGseCtx->m_pMachMgr->TdbGetFirstTool( nFamily, sName, nType) ; } //---------------------------------------------------------------------------- bool ExeTdbGetNextTool( int nFamily, string& sName, int& nType) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // restituisce nome e tipo del successivo utensile della famiglia return pGseCtx->m_pMachMgr->TdbGetNextTool( nFamily, sName, nType) ; } //---------------------------------------------------------------------------- bool ExeTdbGetToolFromUUID( const string& sTuuid, string& sName) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // restituisce nome dell'utensile di dato UUID return pGseCtx->m_pMachMgr->TdbGetToolFromUUID( sTuuid, sName) ; } //----------------------------------------------------------------------------- bool ExeTdbSetCurrTool( const string& sName) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposta l'utensile corrente return pGseCtx->m_pMachMgr->TdbSetCurrTool( sName) ; } //----------------------------------------------------------------------------- bool ExeTdbSaveCurrTool( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // salva l'utensile corrente return pGseCtx->m_pMachMgr->TdbSaveCurrTool() ; } //----------------------------------------------------------------------------- bool ExeTdbIsCurrToolModified( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // verifico se utensile corrente modificato return pGseCtx->m_pMachMgr->TdbIsCurrToolModified() ; } //----------------------------------------------------------------------------- bool ExeTdbSetCurrToolParam( int nType, bool bVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposta il parametro dell'utensile return pGseCtx->m_pMachMgr->TdbSetCurrToolParam( nType, bVal) ; } //----------------------------------------------------------------------------- bool ExeTdbSetCurrToolParam( int nType, int nVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposta il parametro dell'utensile return pGseCtx->m_pMachMgr->TdbSetCurrToolParam( nType, nVal) ; } //----------------------------------------------------------------------------- bool ExeTdbSetCurrToolParam( int nType, double dVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto il parametro dell'utensile return pGseCtx->m_pMachMgr->TdbSetCurrToolParam( nType, dVal) ; } //----------------------------------------------------------------------------- bool ExeTdbSetCurrToolParam( int nType, const string& sVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto il parametro dell'utensile return pGseCtx->m_pMachMgr->TdbSetCurrToolParam( nType, sVal) ; } //----------------------------------------------------------------------------- bool ExeTdbGetCurrToolParam( int nType, bool& bVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero il parametro dell'utensile return pGseCtx->m_pMachMgr->TdbGetCurrToolParam( nType, bVal) ; } //----------------------------------------------------------------------------- bool ExeTdbGetCurrToolParam( int nType, int& nVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero il parametro dell'utensile return pGseCtx->m_pMachMgr->TdbGetCurrToolParam( nType, nVal) ; } //----------------------------------------------------------------------------- bool ExeTdbGetCurrToolParam( int nType, double& dVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero il parametro dell'utensile return pGseCtx->m_pMachMgr->TdbGetCurrToolParam( nType, dVal) ; } //----------------------------------------------------------------------------- bool ExeTdbGetCurrToolParam( int nType, string& sVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero il parametro dell'utensile return pGseCtx->m_pMachMgr->TdbGetCurrToolParam( nType, sVal) ; } //----------------------------------------------------------------------------- bool ExeTdbSave( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // eseguo il salvataggio del DB utensili return pGseCtx->m_pMachMgr->TdbSave() ; } //----------------------------------------------------------------------------- bool ExeTdbGetToolDir( string& sToolDir) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero il direttorio degli utensili return pGseCtx->m_pMachMgr->TdbGetToolDir( sToolDir) ; } //----------------------------------------------------------------------------- bool ExeTdbGetToolHolderDir( string& sTHolderDir) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero il direttorio dei porta utensili return pGseCtx->m_pMachMgr->TdbGetToolHolderDir( sTHolderDir) ; } //----------------------------------------------------------------------------- // DB lavorazioni //----------------------------------------------------------------------------- bool ExeMdbGetMachiningNewName( string& sName) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero un nuovo nome a partire da quello passato return pGseCtx->m_pMachMgr->MdbGetMachiningNewName( sName) ; } //----------------------------------------------------------------------------- bool ExeMdbAddMachining( const string& sName, int nType) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // aggiungo la lavorazione return pGseCtx->m_pMachMgr->MdbAddMachining( sName, nType) ; } //----------------------------------------------------------------------------- bool ExeMdbCopyMachining( const string& sSource, const string& sName) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // copio la lavorazione return pGseCtx->m_pMachMgr->MdbCopyMachining( sSource, sName) ; } //----------------------------------------------------------------------------- bool ExeMdbRemoveMachining( const string& sName) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // rimuovo la lavorazione return pGseCtx->m_pMachMgr->MdbRemoveMachining( sName) ; } //----------------------------------------------------------------------------- bool ExeMdbGetFirstMachining( int nType, string& sName) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // rimuovo la lavorazione return pGseCtx->m_pMachMgr->MdbGetFirstMachining( nType, sName) ; } //----------------------------------------------------------------------------- bool ExeMdbGetNextMachining( int nType, string& sName) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // rimuovo la lavorazione return pGseCtx->m_pMachMgr->MdbGetNextMachining( nType, sName) ; } //----------------------------------------------------------------------------- bool ExeMdbSetCurrMachining( const string& sName) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto la lavorazione corrente return pGseCtx->m_pMachMgr->MdbSetCurrMachining( sName) ; } //----------------------------------------------------------------------------- bool ExeMdbSaveCurrMachining( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // salvo la lavorazione corrente return pGseCtx->m_pMachMgr->MdbSaveCurrMachining() ; } //----------------------------------------------------------------------------- bool ExeMdbIsCurrMachiningModified( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // verifico se la lavorazione corrente è stata modificata return pGseCtx->m_pMachMgr->MdbIsCurrMachiningModified() ; } //----------------------------------------------------------------------------- bool ExeMdbSetCurrMachiningParam( int nType, bool bVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposta il parametro della lavorazione return pGseCtx->m_pMachMgr->MdbSetCurrMachiningParam( nType, bVal) ; } //----------------------------------------------------------------------------- bool ExeMdbSetCurrMachiningParam( int nType, int nVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposta il parametro della lavorazione return pGseCtx->m_pMachMgr->MdbSetCurrMachiningParam( nType, nVal) ; } //----------------------------------------------------------------------------- bool ExeMdbSetCurrMachiningParam( int nType, double dVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposta il parametro della lavorazione return pGseCtx->m_pMachMgr->MdbSetCurrMachiningParam( nType, dVal) ; } //----------------------------------------------------------------------------- bool ExeMdbSetCurrMachiningParam( int nType, const string& sVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposta il parametro della lavorazione return pGseCtx->m_pMachMgr->MdbSetCurrMachiningParam( nType, sVal) ; } //----------------------------------------------------------------------------- bool ExeMdbGetCurrMachiningParam( int nType, bool& bVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposta il parametro della lavorazione return pGseCtx->m_pMachMgr->MdbGetCurrMachiningParam( nType, bVal) ; } //----------------------------------------------------------------------------- bool ExeMdbGetCurrMachiningParam( int nType, int& nVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposta il parametro della lavorazione return pGseCtx->m_pMachMgr->MdbGetCurrMachiningParam( nType, nVal) ; } //----------------------------------------------------------------------------- bool ExeMdbGetCurrMachiningParam( int nType, double& dVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposta il parametro della lavorazione return pGseCtx->m_pMachMgr->MdbGetCurrMachiningParam( nType, dVal) ; } //----------------------------------------------------------------------------- bool ExeMdbGetCurrMachiningParam( int nType, string& sVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposta il parametro della lavorazione return pGseCtx->m_pMachMgr->MdbGetCurrMachiningParam( nType, sVal) ; } //----------------------------------------------------------------------------- bool ExeMdbSetGeneralParam( int nType, double dVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto il parametro generale delle lavorazioni return pGseCtx->m_pMachMgr->MdbSetGeneralParam( nType, dVal) ; } //----------------------------------------------------------------------------- bool ExeMdbGetGeneralParam( int nType, double& dVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero il parametro generale dele lavorazioni return pGseCtx->m_pMachMgr->MdbGetGeneralParam( nType, dVal) ; } //----------------------------------------------------------------------------- bool ExeMdbSave( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // eseguo il salvataggio del DB lavorazioni return pGseCtx->m_pMachMgr->MdbSave() ; } //----------------------------------------------------------------------------- bool ExeMdbGetMachiningDir( string& sMchDir) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero il direttorio delle lavorazioni return pGseCtx->m_pMachMgr->MdbGetMachiningDir( sMchDir) ; } //----------------------------------------------------------------------------- // Operazioni //----------------------------------------------------------------------------- int ExeGetFirstOperation( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero la prima operazione della macchinata corrente return pGseCtx->m_pMachMgr->GetFirstOperation() ; } //----------------------------------------------------------------------------- int ExeGetNextOperation( int nId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero la successiva operazione della macchinata corrente return pGseCtx->m_pMachMgr->GetNextOperation( nId) ; } //----------------------------------------------------------------------------- int ExeGetOperationType( int nId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero il tipo della operazione della macchinata corrente return pGseCtx->m_pMachMgr->GetOperationType( nId) ; } //----------------------------------------------------------------------------- int ExeGetOperationPhase( int nId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero la fase di appartenenza della operazione della macchinata corrente return pGseCtx->m_pMachMgr->GetOperationPhase( nId) ; } //----------------------------------------------------------------------------- bool ExeGetOperationName( int nId, string& sName) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero la fase di appartenenza della operazione della macchinata corrente sName = pGseCtx->m_pMachMgr->GetOperationName( nId) ; return ( ! sName.empty()) ; } //----------------------------------------------------------------------------- int ExeGetOperationId( const string& sName) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero l'identificativo dell'operazione con il nome indicato della macchinata corrente return pGseCtx->m_pMachMgr->GetOperationId( sName) ; } //----------------------------------------------------------------------------- bool ExeIsOperationEmpty( int nId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero lo stato dell'operazione indicata della macchinata corrente return pGseCtx->m_pMachMgr->IsOperationEmpty( nId) ; } //----------------------------------------------------------------------------- bool ExeRemoveOperation( int nId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // elimino l'operazione indicata della macchinata corrente bool bOk = pGseCtx->m_pMachMgr->RemoveOperation( nId) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtRemoveOperation(" + ToString( nId) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExeRemoveAllPhaseOperations( int nPhase) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // elimino tutte le operazioni (tranne la disposizione) della fase indicata della macchinata corrente bool bOk = pGseCtx->m_pMachMgr->RemoveAllPhaseOperations( nPhase) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtRemoveAllPhaseOperations(" + ToString( nPhase) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExeRemoveAllOperations( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // elimino tutte le operazioni e le fasi della macchinata corrente tranne la prima disposizione bool bOk = pGseCtx->m_pMachMgr->RemoveAllOperations() ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtRemoveAllOperations()" " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExeSetOperationMode( int nId, bool bActive) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto lo stato dell'operazione bool bOk = pGseCtx->m_pMachMgr->SetOperationMode( nId, bActive) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtSetOperationMode(" + ToString( nId) + "," + ( bActive ? "true" : "false") + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExeGetOperationMode( int nId, bool& bActive) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero lo stato dell'operazione return pGseCtx->m_pMachMgr->GetOperationMode( nId, bActive) ; } //----------------------------------------------------------------------------- bool ExeSetAllOperationsMode( bool bActive) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto lo stato di tutte le operazioni bool bOk = pGseCtx->m_pMachMgr->SetAllOperationsMode( true, bActive) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtSetAllOperationsMode(" + string( bActive ? "true" : "false") + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExeSetOperationStatus( int nId, bool bShow) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto lo stato di visualizzazione dell'operazione bool bOk = pGseCtx->m_pMachMgr->SetOperationStatus( nId, bShow) ; // non cambia lo stato di modificato del progetto // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtSetOperationStatus(" + ToString( nId) + "," + ( bShow ? "true" : "false") + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExeGetOperationStatus( int nId, bool& bShow) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero lo stato di visualizzazione dell'operazione return pGseCtx->m_pMachMgr->GetOperationStatus( nId, bShow) ; } //----------------------------------------------------------------------------- bool ExeSetAllOperationsStatus( bool bShow) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto lo stato di visualizzazione di tutte le operazioni bool bOk = pGseCtx->m_pMachMgr->SetAllOperationsStatus( true, bShow) ; // non cambia lo stato di modificato del progetto // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtSetAllOperationsStatus(" + string( bShow ? "true" : "false") + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExeChangeOperationPhase( int nId, int nNewPhase) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // cambio la fase dell'operazione e la sposto in fondo alle lavorazioni della stessa fase bool bOk = pGseCtx->m_pMachMgr->ChangeOperationPhase( nId, nNewPhase) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtChangeOperationPhase(" + ToString( nId) + "," + ToString( nNewPhase) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- // Disposizioni //----------------------------------------------------------------------------- int ExeGetPhaseDisposition( int nPhase) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero la disposizione della fase indicata return pGseCtx->m_pMachMgr->GetPhaseDisposition( nPhase) ; } //----------------------------------------------------------------------------- bool ExeSpecialApplyDisposition( int nId, bool bRecalc) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // eseguo azione speciale su disposizione indicata return pGseCtx->m_pMachMgr->DispositionSpecialApply( nId, bRecalc) ; } //----------------------------------------------------------------------------- // Lavorazioni //----------------------------------------------------------------------------- int ExeAddMachining( const string& sName, const string& sMachining) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // aggiunge una lavorazione, prendendo i dati dalla libreria int nId = pGseCtx->m_pMachMgr->AddMachining( sName, sMachining) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtAddMachining(" + sName + "," + sMachining + ")" + " -- Id=" + ToString( nId) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return nId ; } //----------------------------------------------------------------------------- int ExeAddMachining( const string& sName, int nMchType, const string& sTool) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // aggiunge una lavorazione dati tipo e nome utensile int nId = pGseCtx->m_pMachMgr->AddMachining( sName, nMchType, sTool) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtCreateMachining(" + sName + "," + ToString( nMchType) + "," + sTool + ")" + " -- Id=" + ToString( nId) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return nId ; } //----------------------------------------------------------------------------- bool ExeSetCurrMachining( int nId) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto la lavorazione di identificativo Id come corrente bool bOk = pGseCtx->m_pMachMgr->SetCurrMachining( nId) ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtSetCurrMachining(" + ToString( nId) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExeResetCurrMachining( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // reset della lavorazione corrente bool bOk = pGseCtx->m_pMachMgr->ResetCurrMachining() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtResetCurrMachining()" " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- int ExeGetCurrMachining( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // restituisco l'identificativo della lavorazione corrente return pGseCtx->m_pMachMgr->GetCurrMachining() ; } //----------------------------------------------------------------------------- bool ExeSetMachiningParam( int nType, bool bVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto un parametro alla lavorazione corrente bool bOk = pGseCtx->m_pMachMgr->SetMachiningParam( nType, bVal) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtSetMachiningParam(" + ToString( nType) + "," + ( bVal ? "true" : "false") + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExeSetMachiningParam( int nType, int nVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto un parametro alla lavorazione corrente bool bOk = pGseCtx->m_pMachMgr->SetMachiningParam( nType, nVal) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtSetMachiningParam(" + ToString( nType) + "," + ToString( nVal) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExeSetMachiningParam( int nType, double dVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto un parametro alla lavorazione corrente bool bOk = pGseCtx->m_pMachMgr->SetMachiningParam( nType, dVal) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtSetMachiningParam(" + ToString( nType) + "," + ToString( dVal) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExeSetMachiningParam( int nType, const string& sVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto un parametro alla lavorazione corrente bool bOk = pGseCtx->m_pMachMgr->SetMachiningParam( nType, sVal) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtSetMachiningParam(" + ToString( nType) + "," + sVal + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExeSetMachiningGeometry( const SELVECTOR& vIds) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto la geometria alla lavorazione corrente ExeSetModified() ; bool bOk = pGseCtx->m_pMachMgr->SetMachiningGeometry( vIds) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtSetMachiningGeometry({" + SelListToString( vIds) + "})" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExePreviewMachining( bool bRecalc) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto la geometria alla lavorazione corrente bool bOk = pGseCtx->m_pMachMgr->MachiningPreview( bRecalc) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtPreviewMachining(" + ToString( bRecalc) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExeApplyMachining( bool bRecalc) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto la geometria alla lavorazione corrente bool bOk = pGseCtx->m_pMachMgr->MachiningApply( bRecalc) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtApplyMachining(" + ToString( bRecalc) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } return bOk ; } //----------------------------------------------------------------------------- bool ExeGetMachiningParam( int nType, bool& bVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero un parametro alla lavorazione corrente return pGseCtx->m_pMachMgr->GetMachiningParam( nType, bVal) ; } //----------------------------------------------------------------------------- bool ExeGetMachiningParam( int nType, int& nVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero un parametro alla lavorazione corrente return pGseCtx->m_pMachMgr->GetMachiningParam( nType, nVal) ; } //----------------------------------------------------------------------------- bool ExeGetMachiningParam( int nType, double& dVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero un parametro alla lavorazione corrente return pGseCtx->m_pMachMgr->GetMachiningParam( nType, dVal) ; } //----------------------------------------------------------------------------- bool ExeGetMachiningParam( int nType, string& sVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero un parametro alla lavorazione corrente return pGseCtx->m_pMachMgr->GetMachiningParam( nType, sVal) ; } //----------------------------------------------------------------------------- bool ExeGetMachiningGeometry( SELVECTOR& vIds) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero la geometria di origine della lavorazione corrente return pGseCtx->m_pMachMgr->GetMachiningGeometry( vIds) ; } //----------------------------------------------------------------------------- bool ExeIsMachiningEmpty( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // restituisco lo stato della lavorazione corrente return pGseCtx->m_pMachMgr->IsMachiningEmpty() ; } //----------------------------------------------------------------------------- // Simulazione //----------------------------------------------------------------------------- bool ExeSimStart( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // avvio la simulazione della macchinata corrente return pGseCtx->m_pMachMgr->SimStart() ; } //----------------------------------------------------------------------------- bool ExeSimMove( int& nStatus) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // eseguo movimento di simulazione della macchinata corrente return pGseCtx->m_pMachMgr->SimMove( nStatus) ; } //----------------------------------------------------------------------------- bool ExeSimHome( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // eseguo movimento in home return pGseCtx->m_pMachMgr->SimGoHome() ; } //----------------------------------------------------------------------------- bool ExeSimGetAxisInfoPos( int nI, string& sName, double& dVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero stringa con quote degli assi attivi return pGseCtx->m_pMachMgr->SimGetAxisInfoPos( nI, sName, dVal) ; } //----------------------------------------------------------------------------- bool ExeSimGetToolInfo( string& sName, double& dSpeed) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero dati dell'utensile return pGseCtx->m_pMachMgr->SimGetToolInfo( sName, dSpeed) ; } //----------------------------------------------------------------------------- bool ExeSimGetMoveInfo( int& nGmove, double& dFeed) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero dati sul movimento corrente return pGseCtx->m_pMachMgr->SimGetMoveInfo( nGmove, dFeed) ; } //----------------------------------------------------------------------------- bool ExeSimSetStep( double dStep) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto lo step di riferimento per la simulazione della macchinata corrente return pGseCtx->m_pMachMgr->SimSetStep( dStep) ; } //----------------------------------------------------------------------------- bool ExeSimStop( void) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // termino la simulazione della macchinata corrente return pGseCtx->m_pMachMgr->SimStop() ; } //----------------------------------------------------------------------------- // Generazione //----------------------------------------------------------------------------- bool ExeGenerate( const string& sCncFile, const string& sInfo) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // eseguo la generazione del part-program della macchinata corrente return pGseCtx->m_pMachMgr->Generate( sCncFile, sInfo) ; } //----------------------------------------------------------------------------- // Machine Calc //----------------------------------------------------------------------------- bool ExeSetCalcTable( const string& sTable) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto la tavola corrente della macchinata corrente per i calcoli return pGseCtx->m_pMachMgr->SetCalcTable( sTable) ; } //----------------------------------------------------------------------------- bool ExeSetCalcTool( const string& sTool, const string& sHead, int nExit) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto l'utensile corrente per il calcolo sulla macchina della macchinata corrente return pGseCtx->m_pMachMgr->SetCalcTool( sTool, sHead, nExit) ; } //---------------------------------------------------------------------------- bool ExeSetRotAxisBlock( const string& sAxis, double dVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto asse da bloccare con il suo valore return pGseCtx->m_pMachMgr->SetRotAxisBlock( sAxis, dVal) ; } //----------------------------------------------------------------------------- bool ExeGetCalcTool( string& sTool) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // restituisco il nome dell'utensile corrente per il calcolo sulla macchina della macchinata corrente return pGseCtx->m_pMachMgr->GetCalcTool( sTool) ; } //----------------------------------------------------------------------------- bool ExeGetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA, int& nStat, double& dAngA1, double& dAngB1, double& dAngA2, double& dAngB2) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // calcolo gli angoli macchina dalle direzioni fresa e ausiliaria passate return pGseCtx->m_pMachMgr->GetCalcAngles( vtDirT, vtDirA, nStat, dAngA1, dAngB1, dAngA2, dAngB2) ; } //----------------------------------------------------------------------------- bool ExeGetCalcPositions( const Point3d& ptP, double dAngA, double dAngB, int& nStat, double& dX, double& dY, double& dZ) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // calcolo gli angoli macchina dalla direzione fresa passata return pGseCtx->m_pMachMgr->GetCalcPositions( ptP, dAngA, dAngB, nStat, dX, dY, dZ) ; } //----------------------------------------------------------------------------- bool ExeGetCalcTipFromPositions( double dX, double dY, double dZ, double dAngA, double dAngB, bool bBottom, Point3d& ptTip) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // calcolo il tip utensile dagli assi macchina return pGseCtx->m_pMachMgr->GetCalcTipFromPositions( dX, dY, dZ, dAngA, dAngB, false, bBottom, ptTip) ; } //----------------------------------------------------------------------------- bool ExeGetCalcToolDirFromAngles( double dAngA, double dAngB, Vector3d& vtDir) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // calcolo il tip utensile dagli assi macchina return pGseCtx->m_pMachMgr->GetCalcToolDirFromAngles( dAngA, dAngB, vtDir) ; } //----------------------------------------------------------------------------- bool ExeVerifyOutstroke( double dX, double dY, double dZ, double dAngA, double dAngB, int& nStat) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // verifica l'extracorsa degli assi return pGseCtx->m_pMachMgr->VerifyOutstroke( dX, dY, dZ, dAngA, dAngB, nStat) ; } //----------------------------------------------------------------------------- bool ExeGetOutstrokeInfo( string& sInfo) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupero informazioni su extracorsa degli assi sInfo = pGseCtx->m_pMachMgr->GetOutstrokeInfo() ; return ( ! sInfo.empty()) ; } //----------------------------------------------------------------------------- // Machine //----------------------------------------------------------------------------- int ExeGetBaseId( const string& sBase) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, GDB_ID_NULL) // restituisco identificativo della base indicata nella macchina della macchinata corrente return pGseCtx->m_pMachMgr->GetBaseId( sBase) ; } //----------------------------------------------------------------------------- int ExeGetTableId( const string& sTable) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, GDB_ID_NULL) // restituisco identificativo della tavola indicata nella macchina della macchinata corrente return pGseCtx->m_pMachMgr->GetTableId( sTable) ; } //----------------------------------------------------------------------------- int ExeGetAxisId( const string& sAxis) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, GDB_ID_NULL) // restituisco identificativo dell'asse indicato nella macchina della macchinata corrente return pGseCtx->m_pMachMgr->GetAxisId( sAxis) ; } //----------------------------------------------------------------------------- int ExeGetHeadId( const string& sHead) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, GDB_ID_NULL) // restituisco identificativo della testa indicata nella macchina della macchinata corrente return pGseCtx->m_pMachMgr->GetHeadId( sHead) ; } //----------------------------------------------------------------------------- bool ExeSetAxisPos( const string& sAxis, double dVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // metto l'asse nella nuova posizione return pGseCtx->m_pMachMgr->SetAxisPos( sAxis, dVal) ; } //----------------------------------------------------------------------------- bool ExeGetAxisPos( const string& sAxis, double* pdVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // verifico il parametro di ritorno if ( pdVal == nullptr) return false ; // metto l'asse nella nuova posizione return pGseCtx->m_pMachMgr->GetAxisPos( sAxis, *pdVal) ; } //----------------------------------------------------------------------------- bool ExeGetAxisHomePos( const string& sAxis, double* pdHomeVal) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // verifico il parametro di ritorno if ( pdHomeVal == nullptr) return false ; // metto l'asse nella nuova posizione return pGseCtx->m_pMachMgr->GetAxisHomePos( sAxis, *pdHomeVal) ; } //----------------------------------------------------------------------------- bool ExeResetAxisPos( const string& sAxis) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // metto l'asse nella posizione home return pGseCtx->m_pMachMgr->ResetAxisPos( sAxis) ; } //----------------------------------------------------------------------------- bool ExeLoadTool( const string& sHead, int nExit, const string& sTool) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // carico l'utensile sulla macchina della macchinata corrente in posizione indicata return pGseCtx->m_pMachMgr->LoadTool( sHead, nExit, sTool) ; } //----------------------------------------------------------------------------- bool ExeGetLoadedTool( const string& sHead, int nExit, string& sTool) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // recupera l'utensile sulla macchina della macchinata corrente in posizione indicata return pGseCtx->m_pMachMgr->GetLoadedTool( sHead, nExit, sTool) ; } //----------------------------------------------------------------------------- bool ExeUnloadTool( const string& sHead, int nExit) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // scaric l'utensile dalla posizione indicata della macchina della macchinata corrente return pGseCtx->m_pMachMgr->UnloadTool( sHead, nExit) ; } //----------------------------------------------------------------------------- bool ExeResetHeadSet( const string& sHead) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // reset dell'insieme di teste corrente sulla macchina della macchinata corrente return pGseCtx->m_pMachMgr->ResetHeadSet( sHead) ; } //----------------------------------------------------------------------------- bool ExeSetMachineLook( int nFlag) { GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_MACHMGR( pGseCtx, false) // imposto l'aspetto della macchina della macchinata corrente return pGseCtx->m_pMachMgr->SetMachineLook( nFlag) ; }