EgtMachKernel 1.6p4 :

- ampliata Disposizione con gestione movimenti di pezzi con la testa tramite SpecialApply (che richiama script)
- modifiche a Simulatore per gestire queste disposizioni e aggiunti richiami script su diversi eventi
- modifiche a Generatore per gestire queste disposizioni
- varie altre modifiche e migliorie.
This commit is contained in:
Dario Sassi
2016-05-05 07:31:35 +00:00
parent 06a8b15d99
commit b8965da858
37 changed files with 3234 additions and 1898 deletions
+75 -2
View File
@@ -272,6 +272,37 @@ MachMgr::GetOperationId( const string& sName) const
return GDB_ID_NULL ;
}
//----------------------------------------------------------------------------
bool
MachMgr::IsOperationEmpty( int nId) const
{
// recupero l'operazione
PtrOwner<IGdbIterator> pIter( CreateGdbIterator( m_pGeomDB)) ;
if ( IsNull( pIter) || ! pIter->GoTo( nId))
return true ;
// verifico che il gruppo ricevuto sia corretto
if ( pIter->GetParentId() != GetCurrOperId())
return true ;
// recupero user object
IUserObj* pUserObj = pIter->GetUserObj() ;
if ( pUserObj == nullptr)
return true ;
// se disposizione
if ( pUserObj->GetClassName() == USEROBJ_GETNAME( Disposition)) {
const Disposition* pDisp = ::GetDisposition( pUserObj) ;
if ( pDisp != nullptr)
return pDisp->IsEmpty() ;
}
// altrimenti lavorazione
else {
const Machining* pMch = GetMachining( pUserObj) ;
if ( pMch != nullptr)
return pMch->IsEmpty() ;
}
// errore
return true ;
}
//----------------------------------------------------------------------------
bool
MachMgr::RemoveOperation( int nId)
@@ -515,6 +546,18 @@ MachMgr::GetPhaseDisposition( int nPhase) const
return GDB_ID_NULL ;
}
//----------------------------------------------------------------------------
bool
MachMgr::DispositionSpecialApply( int nId, bool bRecalc)
{
// recupero la disposizione
Disposition* pDisp = ::GetDisposition( m_pGeomDB->GetUserObj( nId)) ;
if ( pDisp == nullptr)
return false ;
// lancio l'azione
return pDisp->SpecialApply( bRecalc) ;
}
//----------------------------------------------------------------------------
// Machinings
//----------------------------------------------------------------------------
@@ -744,6 +787,36 @@ MachMgr::MachiningPreview( bool bRecalc)
return pMch->Preview( bRecalc) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::ExistsMachiningPreview( void)
{
// recupero la lavorazione corrente (verifica anche GeomDB)
int nCurrMchId = GetCurrMachining() ;
if ( nCurrMchId == GDB_ID_NULL)
return false ;
// se esiste gruppo di preview, lo svuoto
int nPvId = m_pGeomDB->GetFirstNameInGroup( nCurrMchId, MCH_PV) ;
if ( nPvId == GDB_ID_NULL)
return false ;
return ( m_pGeomDB->GetGroupObjs( nPvId) > 0) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::RemoveMachiningPreview( void)
{
// recupero la lavorazione corrente (verifica anche GeomDB)
int nCurrMchId = GetCurrMachining() ;
if ( nCurrMchId == GDB_ID_NULL)
return false ;
// se esiste gruppo di preview, lo svuoto
int nPvId = m_pGeomDB->GetFirstNameInGroup( nCurrMchId, MCH_PV) ;
if ( nPvId == GDB_ID_NULL)
return true ;
return m_pGeomDB->EmptyGroup( nPvId) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::MachiningApply( bool bRecalc)
@@ -863,11 +936,11 @@ MachMgr::IsMachiningEmpty( void) const
// recupero la lavorazione corrente
int nCurrMchId = GetCurrMachining() ;
if ( nCurrMchId == GDB_ID_NULL)
return false ;
return true ;
// ne recupero il gestore
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
if ( pMch == nullptr)
return false ;
return true ;
// restituisco lo stato
return pMch->IsEmpty() ;
}