EgtMachKernel 1.8h1 :
- migliorata gestione oggetti utente operazioni - aggiunta SimGetOperationInfo.
This commit is contained in:
+58
-81
@@ -17,11 +17,10 @@
|
||||
#include "MachMgr.h"
|
||||
#include "MachConst.h"
|
||||
#include "Disposition.h"
|
||||
#include "Machining.h"
|
||||
#include "MachiningCreate.h"
|
||||
#include "SetTempPhase.h"
|
||||
#include "SetTempMachLook.h"
|
||||
#include "/EgtDev/Include/EMkOperationConst.h"
|
||||
#include "/EgtDev/Include/EGkUserObjFactory.h"
|
||||
#include "/EgtDev/Include/EGkGdbIterator.h"
|
||||
#include "/EgtDev/Include/EGnStringKeyVal.h"
|
||||
#include "/EgtDev/Include/EGnFileUtils.h"
|
||||
@@ -151,72 +150,66 @@ MachMgr::GetPrevActiveOperation( int nId) const
|
||||
int
|
||||
MachMgr::GetOperationType( int nId) const
|
||||
{
|
||||
// verifiche
|
||||
if ( m_pGeomDB == nullptr || m_pGeomDB->GetParentId( nId) != GetCurrOperId())
|
||||
return 0 ;
|
||||
// recupero l'operazione
|
||||
PtrOwner<IGdbIterator> pIter( CreateGdbIterator( m_pGeomDB)) ;
|
||||
if ( IsNull( pIter) || ! pIter->GoTo( nId))
|
||||
return OPER_NULL ;
|
||||
// verifico che il gruppo ricevuto sia corretto
|
||||
if ( pIter->GetParentId() != GetCurrOperId())
|
||||
return OPER_NULL ;
|
||||
// recupero user object
|
||||
IUserObj* pUserObj = pIter->GetUserObj() ;
|
||||
if ( pUserObj == nullptr)
|
||||
return OPER_NULL ;
|
||||
// recupero il tipo di UserObj
|
||||
const string& sUserObj = pUserObj->GetClassName() ;
|
||||
if ( sUserObj == USEROBJ_GETNAME( Disposition))
|
||||
return OPER_DISP ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( Drilling))
|
||||
return OPER_DRILLING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( Sawing))
|
||||
return OPER_SAWING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( Milling))
|
||||
return OPER_MILLING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( Pocketing))
|
||||
return OPER_POCKETING ;
|
||||
//else if ( sUserObj == USEROBJ_GETNAME( Mortising))
|
||||
// return OPER_MORTISING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( SawRoughing))
|
||||
return OPER_SAWROUGHING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( SawFinishing))
|
||||
return OPER_SAWFINISHING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( GenMachining))
|
||||
return OPER_GENMACHINING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( Chiseling))
|
||||
return OPER_CHISELING ;
|
||||
else
|
||||
const Operation* pOpe = GetOperation( m_pGeomDB->GetUserObj( nId)) ;
|
||||
if ( pOpe == nullptr)
|
||||
return OPER_NULL ;
|
||||
// restituisco il tipo
|
||||
return pOpe->GetType() ;
|
||||
|
||||
//// recupero l'operazione
|
||||
// PtrOwner<IGdbIterator> pIter( CreateGdbIterator( m_pGeomDB)) ;
|
||||
// if ( IsNull( pIter) || ! pIter->GoTo( nId))
|
||||
// return OPER_NULL ;
|
||||
//// verifico che il gruppo ricevuto sia corretto
|
||||
// if ( pIter->GetParentId() != GetCurrOperId())
|
||||
// return OPER_NULL ;
|
||||
//// recupero user object
|
||||
// IUserObj* pUserObj = pIter->GetUserObj() ;
|
||||
// if ( pUserObj == nullptr)
|
||||
// return OPER_NULL ;
|
||||
//// recupero il tipo di UserObj
|
||||
// const string& sUserObj = pUserObj->GetClassName() ;
|
||||
// if ( sUserObj == USEROBJ_GETNAME( Disposition))
|
||||
// return OPER_DISP ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( Drilling))
|
||||
// return OPER_DRILLING ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( Sawing))
|
||||
// return OPER_SAWING ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( Milling))
|
||||
// return OPER_MILLING ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( Pocketing))
|
||||
// return OPER_POCKETING ;
|
||||
// //else if ( sUserObj == USEROBJ_GETNAME( Mortising))
|
||||
// // return OPER_MORTISING ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( SawRoughing))
|
||||
// return OPER_SAWROUGHING ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( SawFinishing))
|
||||
// return OPER_SAWFINISHING ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( GenMachining))
|
||||
// return OPER_GENMACHINING ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( Chiseling))
|
||||
// return OPER_CHISELING ;
|
||||
// else
|
||||
// return OPER_NULL ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
MachMgr::GetOperationPhase( int nId) const
|
||||
{
|
||||
// recupero l'operazione
|
||||
PtrOwner<IGdbIterator> pIter( CreateGdbIterator( m_pGeomDB)) ;
|
||||
if ( IsNull( pIter) || ! pIter->GoTo( nId))
|
||||
// verifiche
|
||||
if ( m_pGeomDB == nullptr || m_pGeomDB->GetParentId( nId) != GetCurrOperId())
|
||||
return 0 ;
|
||||
// verifico che il gruppo ricevuto sia corretto
|
||||
if ( pIter->GetParentId() != GetCurrOperId())
|
||||
// recupero operazione
|
||||
const Operation* pOpe = GetOperation( m_pGeomDB->GetUserObj( nId)) ;
|
||||
if ( pOpe == nullptr)
|
||||
return 0 ;
|
||||
// recupero user object
|
||||
IUserObj* pUserObj = pIter->GetUserObj() ;
|
||||
if ( pUserObj == nullptr)
|
||||
return 0 ;
|
||||
// se disposizione
|
||||
if ( pUserObj->GetClassName() == USEROBJ_GETNAME( Disposition)) {
|
||||
const Disposition* pDisp = ::GetDisposition( pUserObj) ;
|
||||
if ( pDisp != nullptr)
|
||||
return pDisp->GetPhase() ;
|
||||
}
|
||||
// altrimenti lavorazione
|
||||
else {
|
||||
const Machining* pMch = GetMachining( pUserObj) ;
|
||||
if ( pMch != nullptr)
|
||||
return pMch->GetPhase() ;
|
||||
}
|
||||
// errore
|
||||
return 0 ;
|
||||
// restituisco la fase
|
||||
return pOpe->GetPhase() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -290,31 +283,15 @@ MachMgr::GetOperationId( const string& sName) const
|
||||
bool
|
||||
MachMgr::IsOperationEmpty( int nId) const
|
||||
{
|
||||
// recupero l'operazione
|
||||
PtrOwner<IGdbIterator> pIter( CreateGdbIterator( m_pGeomDB)) ;
|
||||
if ( IsNull( pIter) || ! pIter->GoTo( nId))
|
||||
// verifiche
|
||||
if ( m_pGeomDB == nullptr || m_pGeomDB->GetParentId( nId) != GetCurrOperId())
|
||||
return true ;
|
||||
// verifico che il gruppo ricevuto sia corretto
|
||||
if ( pIter->GetParentId() != GetCurrOperId())
|
||||
// recupero operazione
|
||||
const Operation* pOpe = GetOperation( m_pGeomDB->GetUserObj( nId)) ;
|
||||
if ( pOpe == nullptr)
|
||||
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 ;
|
||||
// restituisco se vuota
|
||||
return pOpe->IsEmpty() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user