EgtMachKernel 1.6t1 :
- aggiunto a Disposizione flag di presenza movimenti manuali - portata in interfaccia funzione per rimovere movimento finale in home da operazione.
This commit is contained in:
+21
-5
@@ -460,17 +460,17 @@ MachMgr::SetAllOperationsStatus( bool bExceptFirstDisp, bool bShow)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::ChangeOperationPhase( int nId, int nNewPhase)
|
||||
MachMgr::ChangeOperationPhase( int nMchId, int nNewPhase)
|
||||
{
|
||||
// l'operazione deve esistere e non essere una disposizione
|
||||
int nType = GetOperationType( nId) ;
|
||||
int nType = GetOperationType( nMchId) ;
|
||||
if ( nType == OPER_NULL || nType == OPER_DISP)
|
||||
return false ;
|
||||
// verifico che la nuova fase esista
|
||||
if ( nNewPhase > m_nPhasesCount)
|
||||
return false ;
|
||||
// se la fase dell'operazione è già giusta, esco subito con successo
|
||||
if ( GetOperationPhase( nId) == nNewPhase)
|
||||
if ( GetOperationPhase( nMchId) == nNewPhase)
|
||||
return true ;
|
||||
// cerco l'ultima operazione della nuova fase
|
||||
int nRefId = GDB_ID_NULL ;
|
||||
@@ -486,16 +486,32 @@ MachMgr::ChangeOperationPhase( int nId, int nNewPhase)
|
||||
if ( nRefId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// recupero la lavorazione
|
||||
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nId)) ;
|
||||
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nMchId)) ;
|
||||
if ( pMch == nullptr)
|
||||
return false ;
|
||||
// sposto la lavorazione
|
||||
if ( ! m_pGeomDB->Relocate( nId, nRefId, GDB_AFTER))
|
||||
if ( ! m_pGeomDB->Relocate( nMchId, nRefId, GDB_AFTER))
|
||||
return false ;
|
||||
// assegno nuova fase
|
||||
return pMch->SetPhase( nNewPhase) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::RemoveOperationHome( int nId)
|
||||
{
|
||||
// l'operazione deve esistere
|
||||
int nType = GetOperationType( nId) ;
|
||||
if ( nType == OPER_NULL)
|
||||
return false ;
|
||||
// ne recupero il gestore
|
||||
Operation* pOper = GetOperation( m_pGeomDB->GetUserObj( nId)) ;
|
||||
if ( pOper == nullptr)
|
||||
return false ;
|
||||
// rimuovo il posizionamento finale in home
|
||||
return pOper->RemoveHome() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Dispositions
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user