From 0045d186b325fccb8242b1989de2aab2444c1172 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 25 Jan 2021 08:06:32 +0000 Subject: [PATCH] EgtMachKernel : - in mortasature aggiunta gestione info di testa ZSAFEDELTA per variare la ZSafe standard - in simulazione corretta gestione riferimento speciale per mortasatrici in verifica collisioni. --- MachMgr.h | 1 + MachMgrMachines.cpp | 15 ++++++++++++++- MachineStruConst.h | 4 ++++ Mortising.cpp | 2 +- Simulator.cpp | 3 ++- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/MachMgr.h b/MachMgr.h index 3a2d732..58d6740 100644 --- a/MachMgr.h +++ b/MachMgr.h @@ -441,6 +441,7 @@ class MachMgr : public IMachMgr bool SimOnCollision( int nCdInd, int nObjInd, int& nErr) ; // Machine bool GetHeadAbove( const std::string& sHead) const ; + double GetDeltaSafeZ( const std::string& sHead) const ; double GetAngDeltaMinForHome( void) const ; private : diff --git a/MachMgrMachines.cpp b/MachMgrMachines.cpp index 03a6aec..cb87327 100644 --- a/MachMgrMachines.cpp +++ b/MachMgrMachines.cpp @@ -247,8 +247,21 @@ MachMgr::GetHeadAbove( const string& sHead) const { if ( m_pGeomDB == nullptr) return false ; + // Leggo da testa Info ABOVE bool bAbove = true ; - return ( ! m_pGeomDB->GetInfo( GetHeadId( sHead), "ABOVE", bAbove) || bAbove) ; + return ( ! m_pGeomDB->GetInfo( GetHeadId( sHead), MCH_ABOVE, bAbove) || bAbove) ; +} + +//---------------------------------------------------------------------------- +double +MachMgr::GetDeltaSafeZ( const string& sHead) const +{ + if ( m_pGeomDB == nullptr) + return 0 ; + // Leggo da testa Info ZASAFEDELTA + double dDeltaSafeZ = 0 ; + m_pGeomDB->GetInfo( GetHeadId( sHead), MCH_ZSAFEDELTA, dDeltaSafeZ) ; + return dDeltaSafeZ ; } //---------------------------------------------------------------------------- diff --git a/MachineStruConst.h b/MachineStruConst.h index 92b21d6..d84a63d 100644 --- a/MachineStruConst.h +++ b/MachineStruConst.h @@ -106,6 +106,10 @@ const std::string MCH_ZMAXONROT = "ZMAXONROT" ; const std::string MCH_ZEXTRA = "ZEXTRA" ; // Info di testa per dichiarazione Home Z in basso const std::string MCH_ZHOMEDOWN = "ZHOMEDOWN" ; +// Info di testa per dichiarazione Da Sopra +const std::string MCH_ABOVE = "ABOVE" ; +// Info di testa per una variazione alla Z di sicurezza globale +const std::string MCH_ZSAFEDELTA = "ZSAFEDELTA" ; //---------------------------------------------------------------------------- // Dati aggregato rotante da sotto diff --git a/Mortising.cpp b/Mortising.cpp index 1490cca..2caa9db 100644 --- a/Mortising.cpp +++ b/Mortising.cpp @@ -1480,7 +1480,7 @@ Mortising::GenerateMortisingCl( const ICurveComposite* pCompo, const Vector3d& v // 1 -> punto approccio SetFlag( 1) ; - double dAppr = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ; + double dAppr = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() + m_pMchMgr->GetDeltaSafeZ( m_TParams.m_sHead) ; Point3d ptP1 = ptStart + vtTool * ( dDelta + dStartElev + dAppr) ; if ( AddRapidStart( ptP1) == GDB_ID_NULL) return false ; diff --git a/Simulator.cpp b/Simulator.cpp index 69c1d90..980e1cb 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -1200,7 +1200,8 @@ Simulator::ExecCollisionCheck( int& nCdInd, int& nObjInd) // verifico se è l'utensile attivo string sHead ; m_pGeomDB->GetName( m_pGeomDB->GetParentId( m_CollObj[j].nFrameId), sHead) ; string sExit ; m_pGeomDB->GetName( m_CollObj[j].nFrameId, sExit) ; - bool bIsTool = ( sHead == m_sHead && sExit == string( "_T") + ToString( m_nExit)) ; + bool bIsTool = ( sHead == m_sHead && + ( sExit == string( "_T") + ToString( m_nExit) || sExit == string( "_TT") + ToString( m_nExit))) ; // se utensile attivo su grezzo in lavoro, salto if ( bIsTool && bIsRaw) continue ;