EgtMachKernel 2.3d4 :

- in MachMgr aggiunta funzione AdjustOperationPhase.
This commit is contained in:
DarioS
2021-04-19 15:06:38 +02:00
parent 92999fd149
commit eeedb33603
3 changed files with 30 additions and 0 deletions
+29
View File
@@ -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)