EgtMachKernel 2.1g1 :
- corretto problema lavorazioni e disposizioni che potevano non essere cancellate (specie da OmagCUT).
This commit is contained in:
+25
-1
@@ -276,6 +276,16 @@ MachMgr::IsOperationEmpty( int nId) const
|
||||
return pOpe->IsEmpty() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::InitOperation(int nId)
|
||||
{
|
||||
Operation* pOpe = GetOperation( m_pGeomDB->GetUserObj( nId)) ;
|
||||
if ( pOpe == nullptr)
|
||||
return false ;
|
||||
return pOpe->Init( this) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::RemoveOperation( int nId)
|
||||
@@ -284,6 +294,12 @@ MachMgr::RemoveOperation( int nId)
|
||||
int nType = GetOperationType( nId) ;
|
||||
if ( nType == OPER_NULL || nType == OPER_DISP)
|
||||
return false ;
|
||||
// verifico appartenga al gruppo delle operazioni della macchinata corrente
|
||||
int nOperGrpId = GetCurrOperId() ;
|
||||
if ( nOperGrpId == GDB_ID_NULL || m_pGeomDB->GetParentId( nId) != nOperGrpId)
|
||||
return false ;
|
||||
// garantisco l'inizializzazione dell'operazione
|
||||
InitOperation( nId) ;
|
||||
// se lavorazione corrente, resetto
|
||||
if ( m_nCurrMachiningId == nId)
|
||||
m_nCurrMachiningId = GDB_ID_NULL ;
|
||||
@@ -305,8 +321,12 @@ MachMgr::RemoveAllPhaseOperations( int nPhase)
|
||||
while ( nOperId != GDB_ID_NULL) {
|
||||
int nNextOperId = m_pGeomDB->GetNext( nOperId) ;
|
||||
if ( GetOperationPhase( nOperId) == nPhase) {
|
||||
// garantisco l'inizializzazione dell'operazione
|
||||
InitOperation( nOperId) ;
|
||||
// se lavorazione corrente, resetto
|
||||
if ( m_nCurrMachiningId == nOperId)
|
||||
m_nCurrMachiningId = GDB_ID_NULL ;
|
||||
// eseguo la rimozione
|
||||
m_pGeomDB->Erase( nOperId) ;
|
||||
}
|
||||
else
|
||||
@@ -325,6 +345,8 @@ MachMgr::RemoveAllOperations( void)
|
||||
// rimuovo tutte le operazioni a partire dalla fine
|
||||
int nId = GetLastOperation() ;
|
||||
while ( nId != GDB_ID_NULL && nId != nStopId) {
|
||||
// garantisco l'inizializzazione dell'operazione
|
||||
InitOperation( nId) ;
|
||||
// se disposizione, elimino la fase
|
||||
if ( GetOperationType( nId) == OPER_DISP)
|
||||
RemoveLastPhase() ;
|
||||
@@ -543,8 +565,10 @@ MachMgr::AddDisposition( const string& sName)
|
||||
m_pGeomDB->SetName( nId, sName) ;
|
||||
// installo il gestore della disposizione
|
||||
Disposition* pDisp = new(nothrow) Disposition ;
|
||||
if ( pDisp == nullptr)
|
||||
if ( pDisp == nullptr) {
|
||||
m_pGeomDB->Erase( nId) ;
|
||||
return GDB_ID_NULL ;
|
||||
}
|
||||
m_pGeomDB->SetUserObj( nId, pDisp) ;
|
||||
pDisp->Init( this) ;
|
||||
pDisp->SetPhase( m_nCurrPhase) ;
|
||||
|
||||
Reference in New Issue
Block a user