EgtMachKernel 2.3d4 :
- in MachMgr aggiunta funzione AdjustOperationPhase.
This commit is contained in:
Binary file not shown.
@@ -255,6 +255,7 @@ class MachMgr : public IMachMgr
|
||||
bool SetOperationStatus( int nId, bool bShow) override ;
|
||||
bool GetOperationStatus( int nId, bool& bShow) const override ;
|
||||
bool SetAllOperationsStatus(bool bExceptFirstDisp, bool bShow) override ;
|
||||
bool AdjustOperationPhase( int nMchId) override ;
|
||||
bool ChangeOperationPhase( int nMchId, int nNewPhase) override ;
|
||||
int GetPhaseLastOperation( int nPhase) const override ;
|
||||
bool RemoveOperationHome( int nId) override ;
|
||||
|
||||
@@ -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