EgtMachKernel :
- aggiunte funzioni per gestione preview utensile in lavorazione.
This commit is contained in:
+55
-2
@@ -573,6 +573,9 @@ MachMgr::DispositionSpecialUpdate( int nId)
|
||||
bool
|
||||
MachMgr::SetCurrMachining( int nId)
|
||||
{
|
||||
// se corrente esiste ed è diversa, ne eseguo il reset
|
||||
if ( m_nCurrMachiningId != GDB_ID_NULL && nId != m_nCurrMachiningId)
|
||||
ResetCurrMachining() ;
|
||||
// recupero il gruppo delle operazioni nella macchinata corrente
|
||||
int nOperGrpId = GetCurrOperId() ;
|
||||
if ( nOperGrpId == GDB_ID_NULL)
|
||||
@@ -595,6 +598,9 @@ MachMgr::SetCurrMachining( int nId)
|
||||
bool
|
||||
MachMgr::ResetCurrMachining( void)
|
||||
{
|
||||
// disabilito preview utensile
|
||||
RemovePreviewMachiningTool() ;
|
||||
// reset
|
||||
m_nCurrMachiningId = GDB_ID_NULL ;
|
||||
return true ;
|
||||
}
|
||||
@@ -619,7 +625,7 @@ int
|
||||
MachMgr::AddMachining( const string& sName, const string& sMachining)
|
||||
{
|
||||
// nessuna lavorazione corrente
|
||||
m_nCurrMachiningId = GDB_ID_NULL ;
|
||||
ResetCurrMachining() ;
|
||||
// recupero il gestore delle lavorazioni della macchina corrente
|
||||
MachiningsMgr* pMMgr = GetCurrMachiningsMgr() ;
|
||||
if ( pMMgr == nullptr)
|
||||
@@ -674,7 +680,7 @@ int
|
||||
MachMgr::AddMachining( const string& sName, int nMchType, const string& sTool)
|
||||
{
|
||||
// nessuna lavorazione corrente
|
||||
m_nCurrMachiningId = GDB_ID_NULL ;
|
||||
ResetCurrMachining() ;
|
||||
// recupero il gestore delle lavorazioni della macchina corrente
|
||||
MachiningsMgr* pMMgr = GetCurrMachiningsMgr() ;
|
||||
if ( pMMgr == nullptr)
|
||||
@@ -924,6 +930,53 @@ MachMgr::MachiningUpdate( bool bPostApply)
|
||||
return pMch->Update( bPostApply) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::PreparePreviewMachiningTool( void) const
|
||||
{
|
||||
// recupero la lavorazione corrente
|
||||
int nCurrMchId = GetCurrMachining() ;
|
||||
if ( nCurrMchId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// ne recupero il gestore
|
||||
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
|
||||
if ( pMch == nullptr)
|
||||
return false ;
|
||||
// eseguo
|
||||
return pMch->PrepareToolPreview() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::RemovePreviewMachiningTool( void) const
|
||||
{
|
||||
// verifico la lavorazione corrente (salto volutamente altri controlli)
|
||||
if ( m_nCurrMachiningId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// ne recupero il gestore
|
||||
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( m_nCurrMachiningId)) ;
|
||||
if ( pMch == nullptr)
|
||||
return false ;
|
||||
// eseguo
|
||||
return pMch->RemoveToolPreview() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
MachMgr::PreviewMachiningTool( int nEntId, int nFlag) const
|
||||
{
|
||||
// recupero la lavorazione corrente
|
||||
int nCurrMchId = GetCurrMachining() ;
|
||||
if ( nCurrMchId == GDB_ID_NULL)
|
||||
return GDB_ID_NULL ;
|
||||
// ne recupero il gestore
|
||||
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
|
||||
if ( pMch == nullptr)
|
||||
return GDB_ID_NULL ;
|
||||
// eseguo
|
||||
return pMch->ToolPreview( nEntId, nFlag) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::GetMachiningParam( int nType, bool& bVal) const
|
||||
|
||||
Reference in New Issue
Block a user