From 1f57693da82f2780302f2f8057b82fec42b1cc7c Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sat, 13 Apr 2024 17:44:30 +0200 Subject: [PATCH] EgtMachKernel : - in foratura corretta segnalazione di errore fuorviante - in fresatura sistemata gestione direzioni inizio e fine con percorrenze in direzione inversa - in link tra percorsi di lavorazione per robot aggiunta posizione iniziale a Zmax dopo inserimento di risalita a Zmax in percorso immediatamente precedente. --- Drilling.cpp | 3 ++- Milling.cpp | 18 ++++++------------ Operation.cpp | 7 +++++-- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Drilling.cpp b/Drilling.cpp index 2656da9..46314d2 100644 --- a/Drilling.cpp +++ b/Drilling.cpp @@ -51,6 +51,7 @@ using namespace std ; // 2115 = "Error in Drilling : Mirror for Double calculation failed" // 2116 = "Error in Drilling : multi drilling head without valid tools" // 2117 = "Error in Drilling : incorrect multi drilling head" +// 2118 = "Error in Drilling : Tool loading failed" // 2151 = "Warning in Drilling : Skipped entity (xx)" // 2152 = "Warning in Drilling : No machinable path" // 2153 = "Warning in Drilling : Tool name changed (xx)" @@ -617,7 +618,7 @@ Drilling::Apply( bool bRecalc, bool bPostApply) // rendo corrente l'utensile usato nella lavorazione if ( ! m_pMchMgr->SetCalcTool( m_TParams.m_sName, m_TParams.m_sHead, m_TParams.m_nExit)) { - m_pMchMgr->SetLastError( 2322, "Error in Milling : Tool loading failed") ; + m_pMchMgr->SetLastError( 2118, "Error in Drilling : Tool loading failed") ; return false ; } diff --git a/Milling.cpp b/Milling.cpp index 8812c79..fcf9ada 100644 --- a/Milling.cpp +++ b/Milling.cpp @@ -2659,8 +2659,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool // dati inizio entità Point3d ptStart ; pCurve->GetStartPoint( ptStart) ; - Vector3d vtStart = m_vtStartDir ; - // pCurve->GetStartDir( vtStart) ; + Vector3d vtStart = ( ! bInvert ? m_vtStartDir : -m_vtEndDir) ; // determino elevazione su inizio attacco double dStElev ; if ( ! GetElevation( m_nPhase, ptStart, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev)) @@ -2866,8 +2865,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool // dati fine entità Point3d ptEnd ; pCurve->GetEndPoint( ptEnd) ; - Vector3d vtEnd = m_vtEndDir ; - // pCurve->GetEndDir( vtEnd) ; + Vector3d vtEnd = ( ! bInvert ? m_vtEndDir : -m_vtStartDir) ; // elevazione sul punto finale double dEndElev ; if ( ! GetElevation( m_nPhase, ptEnd, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev)) @@ -3951,8 +3949,7 @@ Milling::AddSawZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtT // dati inizio entità Point3d ptStart ; pCurve->GetStartPoint( ptStart) ; - Vector3d vtStart = m_vtStartDir ; - // pCurve->GetStartDir( vtStart) ; + Vector3d vtStart = ( ! bInvert ? m_vtStartDir : -m_vtEndDir) ; // determino elevazione su inizio attacco double dStElev ; if ( j == 1) { @@ -4030,8 +4027,7 @@ Milling::AddSawZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtT // dati fine entità Point3d ptEnd ; pCurve->GetEndPoint( ptEnd) ; - Vector3d vtEnd = m_vtEndDir ; - // pCurve->GetEndDir( vtEnd) ; + Vector3d vtEnd = ( ! bInvert ? m_vtEndDir : -m_vtStartDir) ; // elevazione sul punto finale double dEndElev ; if ( j == nStep) { @@ -4137,8 +4133,7 @@ Milling::AddSawOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtT // dati inizio entità Point3d ptStart ; pCurve->GetStartPoint( ptStart) ; - Vector3d vtStart = m_vtStartDir ; - // pCurve->GetStartDir( vtStart) ; + Vector3d vtStart = ( ! bReturn ? m_vtStartDir : -m_vtEndDir) ; // determino elevazione su inizio attacco double dStElev ; if ( k == 1) { @@ -4224,8 +4219,7 @@ Milling::AddSawOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtT // dati fine entità Point3d ptEnd ; pCurve->GetEndPoint( ptEnd) ; - Vector3d vtEnd = m_vtEndDir ; - // pCurve->GetEndDir( vtEnd) ; + Vector3d vtEnd = ( ! bReturn ? m_vtEndDir : -m_vtStartDir) ; // elevazione sul punto finale double dEndElev ; if ( j == nStep) { diff --git a/Operation.cpp b/Operation.cpp index 317cef4..3c04180 100644 --- a/Operation.cpp +++ b/Operation.cpp @@ -2983,7 +2983,7 @@ Operation::AdjustOneStartMovement( int nClPathId, int nPrevClPathId, Operation* // elimino eventuali risalite finali if ( pPrevOp == nullptr || ! pPrevOp->RemoveRise()) return false ; - // aggiungo risalita a Z max alla fine del percorso precedente + // aggiungo risalita a Z max alla fine della lavorazione precedente DBLVECTOR vAxNew = vAxPrev ; if ( ! pPrevOp->AddRise( vAxNew)) return false ; @@ -2991,11 +2991,14 @@ Operation::AdjustOneStartMovement( int nClPathId, int nPrevClPathId, Operation* // altrimenti precedente appartiene alla stessa operazione else { // eventuali risalite finali già eliminate dal chiamante - // aggiungo risalita a Z opportuna alla fine del percorso precedente + // aggiungo risalita a Z max alla fine del percorso precedente DBLVECTOR vAxNew = vAxPrev ; if ( ! AddRise( vAxNew, -1, nPrevClPathId)) return false ; } + // inserisco la posizione iniziale a Zmax in questo percorso + if ( ! AddRobotClimb( nEntId, -1)) + return false ; } } }