EgtMachKernel 2.3d4 :
- in MachMgr aggiunta funzione AdjustOperationPhase.
This commit is contained in:
@@ -477,6 +477,35 @@ MachMgr::SetAllOperationsStatus( bool bExceptFirstDisp, bool bShow)
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::AdjustOperationPhase( int nMchId)
|
||||
{
|
||||
// l'operazione deve esistere e non essere una disposizione
|
||||
int nType = GetOperationType( nMchId) ;
|
||||
if ( nType == OPER_NULL || nType == OPER_DISP)
|
||||
return false ;
|
||||
// cerco l'ultima disposizione che la precede
|
||||
int nCurrId = GetPrevOperation( nMchId) ;
|
||||
while ( nCurrId != GDB_ID_NULL) {
|
||||
if ( GetOperationType( nCurrId) == OPER_DISP)
|
||||
break ;
|
||||
nCurrId = GetPrevOperation( nCurrId) ;
|
||||
}
|
||||
if ( nCurrId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// recupero la fase di questa disposizione e la assegno alla lavorazione
|
||||
int nDispPhase = GetOperationPhase( nCurrId) ;
|
||||
if ( nDispPhase == 0)
|
||||
return false ;
|
||||
// recupero la lavorazione
|
||||
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nMchId)) ;
|
||||
if ( pMch == nullptr)
|
||||
return false ;
|
||||
// assegno nuova fase
|
||||
return pMch->SetPhase( nDispPhase) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::ChangeOperationPhase( int nMchId, int nNewPhase)
|
||||
|
||||
Reference in New Issue
Block a user