EgtMachKernel :

- migliorati test su tolleranza fori
- piccole correzioni per lavorazioni vuote o disabilitate.
This commit is contained in:
Dario Sassi
2016-02-01 07:44:24 +00:00
parent 5558e368f3
commit da24353a11
6 changed files with 52 additions and 14 deletions
+18 -4
View File
@@ -68,10 +68,16 @@ Simulator::Start( void)
int nOpId = m_pMchMgr->GetFirstActiveOperation() ;
if ( m_pMchMgr->GetOperationType( nOpId) != OPER_DISP)
return false ;
// cerco la prima lavorazione
// cerco la prima lavorazione valida
nOpId = m_pMchMgr->GetNextActiveOperation( nOpId) ;
while ( nOpId != GDB_ID_NULL && ! IsValidMachiningType( m_pMchMgr->GetOperationType( nOpId)))
nOpId = m_pMchMgr->GetNextActiveOperation( nOpId) ;
Machining* pMch = dynamic_cast<Machining*>( m_pGeomDB->GetUserObj( nOpId)) ;
while ( nOpId != GDB_ID_NULL) {
if ( IsValidMachiningType( m_pMchMgr->GetOperationType( nOpId)) &&
pMch != nullptr && pMch->IsNotEmpty())
break ;
nOpId = m_pMchMgr->GetNextActiveOperation( m_nOpId) ;
pMch = dynamic_cast<Machining*>( m_pGeomDB->GetUserObj( nOpId)) ;
}
if ( nOpId == GDB_ID_NULL)
return false ;
m_nOpId = nOpId ;
@@ -116,9 +122,17 @@ Simulator::Move( int& nStatus)
m_nEntId = m_pGeomDB->GetFirstInGroup( m_nCLPathId) ;
m_dCoeff = 0 ;
}
// Se arrivato alla fine di una lavorazione, recupero la successiva
// Se arrivato alla fine di una lavorazione, recupero la successiva valida
while ( m_nCLPathId == GDB_ID_NULL) {
m_nOpId = m_pMchMgr->GetNextActiveOperation( m_nOpId) ;
Machining* pMch = dynamic_cast<Machining*>( m_pGeomDB->GetUserObj( m_nOpId)) ;
while ( m_nOpId != GDB_ID_NULL) {
if ( IsValidMachiningType( m_pMchMgr->GetOperationType( m_nOpId)) &&
pMch != nullptr && pMch->IsNotEmpty())
break ;
m_nOpId = m_pMchMgr->GetNextActiveOperation( m_nOpId) ;
pMch = dynamic_cast<Machining*>( m_pGeomDB->GetUserObj( m_nOpId)) ;
}
// se non ce ne sono altre, sono alla fine
if ( m_nOpId == GDB_ID_NULL) {
nStatus = MCH_SIM_END ;