EgtMachKernel 2.4k2 :
- migliorati log in Apply e Update di disposizioni e lavorazioni - aggiunta funzione GetName a Operation.
This commit is contained in:
Binary file not shown.
@@ -642,6 +642,9 @@ MachMgr::DispositionSpecialApply( int nId, bool bRecalc)
|
||||
Disposition* pDisp = ::GetDisposition( m_pGeomDB->GetUserObj( nId)) ;
|
||||
if ( pDisp == nullptr)
|
||||
return false ;
|
||||
// Eventuale log
|
||||
string sOut = "DispositionSpecialApply start --> " + pDisp->GetName() ;
|
||||
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
|
||||
// lancio l'azione
|
||||
return pDisp->SpecialApply( bRecalc) ;
|
||||
}
|
||||
@@ -662,6 +665,9 @@ MachMgr::DispositionSpecialUpdate( int nId)
|
||||
Disposition* pDisp = ::GetDisposition( m_pGeomDB->GetUserObj( nId)) ;
|
||||
if ( pDisp == nullptr)
|
||||
return false ;
|
||||
// Eventuale log
|
||||
string sOut = "DispositionSpecialUpdate start --> " + pDisp->GetName() ;
|
||||
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
|
||||
// lancio l'azione
|
||||
return pDisp->SpecialUpdate() ;
|
||||
}
|
||||
@@ -1041,6 +1047,9 @@ MachMgr::MachiningApply( bool bRecalc, bool bPostApply)
|
||||
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
|
||||
if ( pMch == nullptr)
|
||||
return false ;
|
||||
// Log
|
||||
string sOut = "MachiningApply start --> " + pMch->GetName() ;
|
||||
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
|
||||
// imposto fase della lavorazione come temporaneamente corrente
|
||||
SetTempPhase TmpPhase( this, pMch->GetPhase()) ;
|
||||
// imposto visualizzazione completa della macchina come temporaneamente corrente
|
||||
@@ -1069,6 +1078,9 @@ MachMgr::MachiningUpdate( bool bPostApply)
|
||||
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
|
||||
if ( pMch == nullptr)
|
||||
return false ;
|
||||
// Log
|
||||
string sOut = "MachiningUpdate start --> " + pMch->GetName() ;
|
||||
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
|
||||
// imposto fase della lavorazione come temporaneamente corrente
|
||||
SetTempPhase TmpPhase( this, pMch->GetPhase()) ;
|
||||
// imposto visualizzazione completa della macchina come temporaneamente corrente
|
||||
|
||||
+62
-3
@@ -32,6 +32,7 @@
|
||||
#include "/EgtDev/Include/EGkGeomDB.h"
|
||||
#include "/EgtDev/Include/EGkCDeBoxClosedSurfTm.h"
|
||||
#include "/EgtDev/Include/EGkCDeCylClosedSurfTm.h"
|
||||
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
||||
#include "/EgtDev/Include/EXeConst.h"
|
||||
#include "/EgtDev/Include/EgtNumUtils.h"
|
||||
#include "/EgtDev/Include/EgtPointerOwner.h"
|
||||
@@ -153,6 +154,16 @@ Operation::UpdateFollowingOperationsStatus(int nModif)
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
string
|
||||
Operation::GetName( void) const
|
||||
{
|
||||
string sName ;
|
||||
if ( m_pGeomDB == nullptr || ! m_pGeomDB->GetName( m_nOwnerId, sName))
|
||||
sName = "___" ;
|
||||
return sName ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::GetElevation( int nPhase, const Point3d& ptP,
|
||||
@@ -3025,10 +3036,20 @@ Operation::TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEn
|
||||
for ( int i = 0 ; i < COLL_STEP && ! bCollide ; ++ i) {
|
||||
// Imposto la posizione
|
||||
double dCoeff = double( i) / COLL_STEP ;
|
||||
for ( size_t j = 0 ; j < vAxStart.size() ; ++ j) {
|
||||
for ( int j = 0 ; j < int( vAxName.size()) ; ++ j) {
|
||||
double dPos = ( 1 - dCoeff) * vAxStart[j] + dCoeff * vAxEnd[j] ;
|
||||
pMch->SetAxisPos( vAxName[j], dPos) ;
|
||||
}
|
||||
// eventuale emissione Log
|
||||
if ( ExeGetDebugLevel() >= 5) {
|
||||
string sAxes = "Test Collision at " ;
|
||||
for ( int j = 0 ; j < int( vAxName.size()) ; ++ j) {
|
||||
double dPos ;
|
||||
pMch->GetAxisPos( vAxName[j], dPos) ;
|
||||
sAxes += vAxName[j] + "=" + ToString( dPos, 1) + " " ;
|
||||
}
|
||||
LOG_DBG_INFO( GetEMkLogger(), sAxes.c_str()) ;
|
||||
}
|
||||
// Determino sottobox e box della testa e degli altri oggetti da considerare per la collisione
|
||||
BOXIVECTOR vbiSH ;
|
||||
BBox3d b3Head ;
|
||||
@@ -3044,13 +3065,32 @@ Operation::TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEn
|
||||
}
|
||||
nHId = m_pGeomDB->GetNext( nHId) ;
|
||||
}
|
||||
// eventuale emissione Log
|
||||
if ( ExeGetDebugLevel() >= 5) {
|
||||
string sHead ;
|
||||
if ( ! m_pGeomDB->GetName( nCId, sHead))
|
||||
sHead = "---" ;
|
||||
string sOut = " " + sHead + " : " + ToString( b3Head, 1) ;
|
||||
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
|
||||
}
|
||||
}
|
||||
// Li confronto con i grezzi
|
||||
for ( const auto nRawId : vRawId) {
|
||||
// verifico i box
|
||||
BBox3d b3Raw ;
|
||||
int nRawSolidId = m_pGeomDB->GetFirstNameInGroup( nRawId, MACH_RAW_SOLID) ;
|
||||
if ( m_pGeomDB->GetGlobalBBox( nRawSolidId, b3Raw) && b3Head.Overlaps( b3Raw)) {
|
||||
m_pGeomDB->GetGlobalBBox( nRawSolidId, b3Raw) ;
|
||||
// eventuale emissione Log
|
||||
if ( ExeGetDebugLevel() >= 5) {
|
||||
string sBox = " Raw : " + ( b3Raw.IsEmpty() ? string( "Empty Box") : ToString( b3Raw, 1)) ;
|
||||
LOG_DBG_INFO( GetEMkLogger(), sBox.c_str()) ;
|
||||
}
|
||||
// se i box interferiscono
|
||||
if ( ! b3Raw.IsEmpty() && b3Head.Overlaps( b3Raw)) {
|
||||
// eventuale emissione Log
|
||||
if ( ExeGetDebugLevel() >= 5) {
|
||||
LOG_DBG_INFO( GetEMkLogger(), " Can collide -->") ;
|
||||
}
|
||||
// solido del grezzo
|
||||
const ISurfTriMesh* pStm = GetSurfTriMesh( m_pGeomDB->GetGeoObj( nRawSolidId)) ;
|
||||
// riferimento del grezzo
|
||||
@@ -3101,13 +3141,28 @@ Operation::TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEn
|
||||
break ;
|
||||
}
|
||||
}
|
||||
// eventuale emissione Log
|
||||
if ( ExeGetDebugLevel() >= 5) {
|
||||
LOG_DBG_INFO( GetEMkLogger(), ( bCollide ? " COLLIDE" : " avoid")) ;
|
||||
}
|
||||
// Se non trovata collisione, li confronto con i bloccaggi
|
||||
if ( ! bCollide) {
|
||||
for ( const auto nFxtId : vFxtId) {
|
||||
// verifico i box
|
||||
BBox3d b3Fxt ;
|
||||
int nFlag = BBF_ONLY_VISIBLE | BBF_IGNORE_TEXT | BBF_IGNORE_DIM ;
|
||||
if ( m_pGeomDB->GetGlobalBBox( nFxtId, b3Fxt, nFlag) && b3Head.Overlaps( b3Fxt)) {
|
||||
m_pGeomDB->GetGlobalBBox( nFxtId, b3Fxt, nFlag) ;
|
||||
// eventuale emissione Log
|
||||
if ( ExeGetDebugLevel() >= 5) {
|
||||
string sBox = " Fxt : " + ( b3Fxt.IsEmpty() ? string( "Empty Box") : ToString( b3Fxt, 1)) ;
|
||||
LOG_DBG_INFO( GetEMkLogger(), sBox.c_str()) ;
|
||||
}
|
||||
// se i box interferiscono
|
||||
if ( ! b3Fxt.IsEmpty() && b3Head.Overlaps( b3Fxt)) {
|
||||
// eventuale emissione Log
|
||||
if ( ExeGetDebugLevel() >= 5) {
|
||||
LOG_DBG_INFO( GetEMkLogger(), " Can collide -->") ;
|
||||
}
|
||||
// verifico i sottobox
|
||||
for ( const auto& biSH : vbiSH) {
|
||||
if ( biSH.first.Overlaps( b3Fxt)) {
|
||||
@@ -3119,6 +3174,10 @@ Operation::TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEn
|
||||
break ;
|
||||
}
|
||||
}
|
||||
// eventuale emissione Log
|
||||
if ( ExeGetDebugLevel() >= 5) {
|
||||
LOG_DBG_INFO( GetEMkLogger(), ( bCollide ? " COLLIDE" : " avoid")) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Riporto la macchina in home
|
||||
|
||||
@@ -43,6 +43,7 @@ class Operation : public IUserObj
|
||||
virtual int GetPhase( void) const
|
||||
{ return m_nPhase ; }
|
||||
virtual bool RemoveHome( void) ;
|
||||
std::string GetName( void) const ;
|
||||
|
||||
public :
|
||||
virtual int GetType( void) const = 0 ;
|
||||
|
||||
Reference in New Issue
Block a user