From e39fbd87074311808a4d0cc6056c613ca49a38ac Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 9 Jul 2025 12:41:28 +0200 Subject: [PATCH 1/4] EgtMachKernel 2.7g2 : - ulteriori modifiche per NewLinkManager. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes Machine.h | 2 +- Operation.cpp | 129 +++++++++++++++++++++++------------------------ Operation.h | 2 +- 4 files changed, 66 insertions(+), 67 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 227f431fca4a2fe16b3fd2b9c15a72f16558bc88..430b5ead0d587c8630496ed77437fd2a2cee8f27 100644 GIT binary patch delta 97 zcmewt{V#gMFE&P_&A-`fnHh~HKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmU8!BZvS1 delta 97 zcmewt{V#gMFE&QQ&A-`fnHdcyKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmU3rBY*$^ diff --git a/Machine.h b/Machine.h index 8d1c4b1..dc23934 100644 --- a/Machine.h +++ b/Machine.h @@ -91,7 +91,7 @@ class Machine int GetLinkAxesMoveOrder( void) const { return m_nLinkAxesMoveOrder ; } bool GetNewLinkMgr( int nOpt = 1) const - { return ( m_nNewLinkMgr >= nOpt) ; } + { return ( m_nNewLinkMgr >= nOpt || m_nCalcChainType == KIN_CHAIN_ROBOT) ; } bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) ; bool GetLoadedTool( const std::string& sHead, int nExit, std::string& sTool) const ; bool UnloadTool( const std::string& sHead, int nExit) ; diff --git a/Operation.cpp b/Operation.cpp index b2dcda9..3530bca 100644 --- a/Operation.cpp +++ b/Operation.cpp @@ -2724,9 +2724,9 @@ Operation::AdjustStartEndMovements( bool bVerifyPreviousLink) if ( IsEmpty( NEED_ONE_TP_OK)) return true ; - // se nuova gestione collegamenti tra lavorazioni oppure robot - if ( m_pMchMgr->GetCurrMachine()->GetNewLinkMgr() || m_pMchMgr->GetCurrIsRobot()) - return AdjustStartEndMovementsNew( bVerifyPreviousLink) ; + // se nuova gestione collegamenti tra lavorazioni (sempre per i robot) + if ( m_pMchMgr->GetCurrMachine()->GetNewLinkMgr()) + return AdjustStartEndMovementsNew() ; // altrimenti modalità standard else return AdjustStartEndMovementsStd( bVerifyPreviousLink) ; @@ -3029,7 +3029,7 @@ Operation::AdjustStartEndMovementsStd( bool bVerifyPreviousLink) //---------------------------------------------------------------------------- bool -Operation::AdjustStartEndMovementsNew( bool bVerifyPreviousLink) +Operation::AdjustStartEndMovementsNew( void) { // recupero ultima operazione precedente non vuota o che richiede home precedente // (disposizione qui considerata non vuota anche se nella path contiene solo comandi ausiliari) @@ -3048,22 +3048,18 @@ Operation::AdjustStartEndMovementsNew( bool bVerifyPreviousLink) if ( pPrevOp != nullptr && ! pPrevOp->IsEmpty( NEED_ONE_TP_OK)) sPrevTool = pPrevOp->GetToolName() ; - // determino posizione precedente assi - bool bMaxZ = false ; - // *** Se primo utensile o richiesto, uso la posizione home if ( sPrevTool.empty() || NeedPrevHome()) { // imposto l'utensile per i calcoli macchina if ( ! m_pMchMgr->SetCalcTool( GetToolName(), GetHeadName(), GetExitNbr())) return false ; - // si parte da Z massima - bMaxZ = true ; - // eventuale collegamento speciale - if ( bVerifyPreviousLink) { - // eseguo collegamento speciale - if ( ! ManageSpecialLink( nullptr, GDB_ID_NULL, this, GDB_ID_NULL)) - return false ; - } + // sistemo approccio da Zmax + DBLVECTOR vAxVal ; + if ( ! AdjustOneStartEndMovement( GetFirstFullToolpath(), GDB_ID_NULL, nullptr, vAxVal, true)) + return false ; + // eseguo collegamento speciale + if ( ! ManageSpecialLink( nullptr, GDB_ID_NULL, this, GDB_ID_NULL)) + return false ; } // *** Se utensile non cambiato o su diversa uscita della stessa testa, uso posizione finale della lavorazione precedente @@ -3071,21 +3067,18 @@ Operation::AdjustStartEndMovementsNew( bool bVerifyPreviousLink) // imposto l'utensile per i calcoli macchina if ( ! m_pMchMgr->SetCalcTool( GetToolName(), GetHeadName(), GetExitNbr())) return false ; - // se richiesta verifica collegamento con lavorazione precedente - if ( bVerifyPreviousLink) { - // cancello eventuale risalita finale lavorazione precedente - pPrevOp->RemoveRise() ; - // recupero posizione finale lavorazione precedente - DBLVECTOR vAxVal ; - if ( ! pPrevOp->GetFinalAxesValues( false, vAxVal)) - return false ; - // sistemo collegamento con lavorazione precedente - if ( ! AdjustOneStartEndMovement( GetFirstFullToolpath(), GDB_ID_NULL, pPrevOp, vAxVal, bMaxZ)) - return false ; - // gestione collegamento speciale - if ( ! ManageSpecialLink( pPrevOp, GDB_ID_NULL, this, GDB_ID_NULL)) - return false ; - } + // cancello eventuale risalita finale lavorazione precedente + pPrevOp->RemoveRise() ; + // recupero posizione finale lavorazione precedente + DBLVECTOR vAxVal ; + if ( ! pPrevOp->GetFinalAxesValues( false, vAxVal)) + return false ; + // sistemo collegamento con lavorazione precedente + if ( ! AdjustOneStartEndMovement( GetFirstFullToolpath(), GDB_ID_NULL, pPrevOp, vAxVal, false)) + return false ; + // gestione collegamento speciale + if ( ! ManageSpecialLink( pPrevOp, GDB_ID_NULL, this, GDB_ID_NULL)) + return false ; } // *** Altrimenti aggiungo uscita per cambio utensile alla lavorazione precedente e parto da questa @@ -3101,26 +3094,22 @@ Operation::AdjustStartEndMovementsNew( bool bVerifyPreviousLink) if ( ! pPrevOp->AddRise( vAxVal)) return false ; } - // se richiesta verifica collegamento con lavorazione precedente - if ( bVerifyPreviousLink) { - // eventuale rilascio utensile speciale di lavorazione precedente - if ( ! pPrevOp->ManageSpecialLink( pPrevOp, GDB_ID_NULL, nullptr, GDB_ID_NULL)) - return false ; - } + // eventuale rilascio utensile speciale di lavorazione precedente + if ( ! pPrevOp->ManageSpecialLink( pPrevOp, GDB_ID_NULL, nullptr, GDB_ID_NULL)) + return false ; // ripristino la lavorazione corrente m_pMchMgr->SetCurrMachining( GetOwner()) ; // imposto l'utensile per i calcoli macchina if ( ! m_pMchMgr->SetCalcTool( GetToolName(), GetHeadName(), GetExitNbr())) return false ; - // si parte da Z massima - bMaxZ = true ; - // eventuale presa utensile speciale di lavorazione corrente - if ( bVerifyPreviousLink) { - // eseguo verifica - if ( ! ManageSpecialLink( nullptr, GDB_ID_NULL, this, GDB_ID_NULL)) - return false ; - } + // sistemo approccio da Zmax + DBLVECTOR vAxVal ; + if ( ! AdjustOneStartEndMovement( GetFirstFullToolpath(), GDB_ID_NULL, nullptr, vAxVal, true)) + return false ; + // eseguo verifica + if ( ! ManageSpecialLink( nullptr, GDB_ID_NULL, this, GDB_ID_NULL)) + return false ; } // aggiusto il collegamento iniziale di ogni percorso di lavoro successivo al primo @@ -3128,21 +3117,17 @@ Operation::AdjustStartEndMovementsNew( bool bVerifyPreviousLink) int nPrevClPathId = GetFirstFullToolpath() ; int nClPathId = GetNextFullToolpath( nPrevClPathId) ; while ( bOk && nClPathId != GDB_ID_NULL) { - // se richiesta verifica collegamento con lavorazione precedente - if ( bVerifyPreviousLink) { - // recupero nuovi finali senza risalite - RemoveRise( nPrevClPathId) ; - DBLVECTOR vAxVal ; - if ( ! GetClPathFinalAxesValues( nPrevClPathId, false, vAxVal)) - bOk = false ; - // sistemo collegamento con precedente - if ( ! AdjustOneStartEndMovement( nClPathId, nPrevClPathId, nullptr, vAxVal, bMaxZ)) - bOk = false ; - // gestione collegamento speciale ( tra due percorsi della stessa lavorazione) - if ( ! ManageSpecialLink( this, nPrevClPathId, this, nClPathId)) - return false ; - } - bMaxZ = false ; + // recupero nuovi finali senza risalite + RemoveRise( nPrevClPathId) ; + DBLVECTOR vAxVal ; + if ( ! GetClPathFinalAxesValues( nPrevClPathId, false, vAxVal)) + bOk = false ; + // sistemo collegamento con precedente + if ( ! AdjustOneStartEndMovement( nClPathId, nPrevClPathId, nullptr, vAxVal, false)) + bOk = false ; + // gestione collegamento speciale ( tra due percorsi della stessa lavorazione) + if ( ! ManageSpecialLink( this, nPrevClPathId, this, nClPathId)) + return false ; // passo al successivo nPrevClPathId = nClPathId ; nClPathId = GetNextFullToolpath( nClPathId) ; @@ -3153,10 +3138,8 @@ Operation::AdjustStartEndMovementsNew( bool bVerifyPreviousLink) DBLVECTOR vAxVal ; bOk = bOk && AddRise( vAxVal) ; // nuova verifica aree protette alla fine - if ( bVerifyPreviousLink) { - if ( ! ManageSpecialLink( this, GDB_ID_NULL, nullptr, GDB_ID_NULL)) - return false ; - } + if ( ! ManageSpecialLink( this, GDB_ID_NULL, nullptr, GDB_ID_NULL)) + return false ; // se ultima operazione o la successiva lo richiede, vado in home int nNextOpId = m_pMchMgr->GetNextActiveOperation( m_nOwnerId) ; @@ -4245,6 +4228,12 @@ Operation::GetExtraZ( const DBLVECTOR& vAx1, const Vector3d& vtTool1, if ( pMch == nullptr) return false ; + // Se nuova gestione collegamenti, non fa niente + if ( m_pMchMgr->GetCurrMachine()->GetNewLinkMgr()) { + dExtraZ = 0 ; + return true ; + } + // Flag per posizione sicura in alto o in basso int nHeadId = pMch->GetCurrHead() ; bool bZHomeDown ; @@ -4378,6 +4367,11 @@ Operation::GetRotationAtZmax( void) const Machine* pMch = ( m_pMchMgr != nullptr ? m_pMchMgr->GetCurrMachine() : nullptr) ; if ( pMch == nullptr) return false ; + + // Se nuova gestione collegamenti, non fa niente + if ( m_pMchMgr->GetCurrMachine()->GetNewLinkMgr()) + return false ; + // Se testa con Info ROTATZMAX la recupero e restituisco abilitazione rotazione a Zmax int nHeadId = pMch->GetCurrHead() ; int nVal = 0 ; @@ -4392,6 +4386,11 @@ Operation::ForcedZmax( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, const Machine* pMch = ( m_pMchMgr != nullptr ? m_pMchMgr->GetCurrMachine() : nullptr) ; if ( pMch == nullptr) return true ; + + // Se nuova gestione collegamenti, non fa niente + if ( m_pMchMgr->GetCurrMachine()->GetNewLinkMgr()) + return false ; + // Recupero numero assi e ne verifico la costanza int nLinAxes = m_pMchMgr->GetCurrLinAxes() ; int nRotAxes = m_pMchMgr->GetCurrRotAxes() ; @@ -4945,8 +4944,8 @@ Operation::SpecialMoveZup( DBLVECTOR& vAx, Vector3d& vtTool, int& nFlag, int& nF static const string EVAR_MODIF = ".MODIF" ; // OUT (bool) flag di modifica effettuata static const string ON_SPECIAL_MOVEZUP = "OnSpecialMoveZup" ; - // se funzione non implementata - if ( ! pMch->LuaExistsFunction( ON_SPECIAL_MOVEZUP)) { + // se nuova gestione collegamenti o funzione non implementata + if ( m_pMchMgr->GetCurrMachine()->GetNewLinkMgr() || ! pMch->LuaExistsFunction( ON_SPECIAL_MOVEZUP)) { bModif = false ; return true ; } diff --git a/Operation.h b/Operation.h index 9aa21ed..69191fa 100644 --- a/Operation.h +++ b/Operation.h @@ -233,7 +233,7 @@ class Operation : public IUserObj Machine* pMch, const INTVECTOR& vRawId, const INTVECTOR& vFxtId) const ; bool AdjustStartEndMovementsStd( bool bVerifyPreviousLink) ; bool AdjustOneStartEndMovement( int nClPathId, int nPrevClPathId, Operation* pPrevOpe, const DBLVECTOR& vAxPrev, bool bMaxZ) ; - bool AdjustStartEndMovementsNew( bool bVerifyPreviousLink) ; + bool AdjustStartEndMovementsNew( void) ; bool ManageSpecialLink( Operation* pPrevOpe, int nPrevClPathId, Operation* pNextOpe, int nNextClPathId) ; bool ToolChangeNeeded( const Operation& Ope1, const Operation& Ope2) const ; bool AddSpecialClimb( const DBLVECTOR& vAxVal, bool bOk = true, int nClPathId = GDB_ID_NULL, From dbbbfb67fc1e683cdd4ea4bf6e5b4fb3194b3807 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 9 Jul 2025 18:33:36 +0200 Subject: [PATCH 2/4] EgtMachKernel : - piccola modifica per NewLinkManager. --- Operation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Operation.cpp b/Operation.cpp index 3530bca..8ac7150 100644 --- a/Operation.cpp +++ b/Operation.cpp @@ -5070,7 +5070,7 @@ Operation::SpecialLink( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, int // se la funzione non è definita, esco if ( ! pMch->LuaExistsFunction( ON_SPECIAL_LINK)) - return false ; + return true ; // eseguo bool bOk = true ; From ff4df06a3a15a1a23f7d0f6716de9d8d696da485 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 10 Jul 2025 09:34:33 +0200 Subject: [PATCH 3/4] EgtMachKernel : - in sgrossature superfici correzione per esplosione archi. --- SurfRoughing.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/SurfRoughing.cpp b/SurfRoughing.cpp index 0d925de..8cde5e4 100644 --- a/SurfRoughing.cpp +++ b/SurfRoughing.cpp @@ -2632,21 +2632,16 @@ SurfRoughing::AddPocket( const INTINTVECTOR& vPocket, const Vector3d& vtTool, do DrawFeed( pLine, dCoeffFeed * GetRightFeed( vtMove, vtTool)) ; #endif SetFeed( dCoeffFeed * GetRightFeed( vtMove, vtTool)) ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) return false ; } else if ( pCurve->GetType() == CRV_ARC) { ICurveArc* pArc = GetCurveArc( pCurve) ; - Point3d ptCen = pArc->GetCenter() ; - double dAngCen = pArc->GetAngCenter() ; - Vector3d vtN = pArc->GetNormVersor() ; - Point3d ptP3 ; - pArc->GetEndPoint( ptP3) ; #if ENABLE_DEBUG_FEEDS DrawFeed( pArc, dCoeffFeed * GetFeed()) ; #endif SetFeed( dCoeffFeed * GetFeed()) ; - if ( AddArcMove( ptP3, ptCen, dAngCen, vtN) == GDB_ID_NULL) + if ( AddCurveMove( pArc, bSplitArcs) == GDB_ID_NULL) return false ; } @@ -2721,9 +2716,9 @@ SurfRoughing::AddPocket( const INTINTVECTOR& vPocket, const Vector3d& vtTool, do } // tratto lineare sopra al punto corrente SetFeed( GetEndFeed()) ; - AddLinearMove( ptEnd + vtTool * dCurrElev) ; + AddLinearMove( ptEnd + vtTool * dCurrElev, bSplitArcs) ; // tratto lineare sopra a ptDest - AddLinearMove( ptDest + vtTool * dNextElev) ; + AddLinearMove( ptDest + vtTool * dNextElev, bSplitArcs) ; // aggiorno le elevazioni dCurrElev = dNextElev ; } From c6903e1cadb19b2b05d5a29e8d08fbd82d0d1332 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 10 Jul 2025 10:33:02 +0200 Subject: [PATCH 4/4] EgtMachKernel : - in finitura superfici correzioni per esplosione archi. --- SurfFinishing.cpp | 47 +++++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/SurfFinishing.cpp b/SurfFinishing.cpp index 4c15ab6..e8870df 100644 --- a/SurfFinishing.cpp +++ b/SurfFinishing.cpp @@ -1,4 +1,5 @@ //---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- // EgalTech 2019-2019 //---------------------------------------------------------------------------- // File : SurfFinishing.cpp Data : 28.05.19 Versione : 2.1e5 @@ -3320,17 +3321,14 @@ SurfFinishing::AddZConst( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR& vSrf Point3d ptP3 = pLine->GetEnd() ; Vector3d vtMove ; pLine->GetStartDir( vtMove) ; SetFeed( GetRightFeed( vtMove, vtTool)) ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) return false ; } else if ( pCurve->GetType() == CRV_ARC) { ICurveArc* pArc = GetCurveArc( pCurve) ; - Point3d ptCen = pArc->GetCenter() ; - double dAngCen = pArc->GetAngCenter() ; - Vector3d vtN = pArc->GetNormVersor() ; - Point3d ptP3 ; pArc->GetEndPoint( ptP3) ; - SetFeed( GetFeed()) ; - if ( AddArcMove( ptP3, ptCen, dAngCen, vtN) == GDB_ID_NULL) + Vector3d vtMove ; pArc->GetStartDir( vtMove) ; + SetFeed( GetRightFeed( vtMove, vtTool)) ; + if ( AddCurveMove( pArc, bSplitArcs) == GDB_ID_NULL) return false ; } // se ultima entità @@ -5721,25 +5719,22 @@ SurfFinishing::AddOptimal( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR& vSr return false ; } } - // elaborazioni sulla curva corrente (sempre un segmento di retta) - if ( pCurve->GetType() == CRV_LINE) { - ICurveLine* pLine = GetCurveLine( pCurve) ; - Point3d ptP3 = pLine->GetEnd() ; - Vector3d vtMove ; pLine->GetStartDir( vtMove) ; - SetFeed( GetRightFeed( vtMove, vtTool)) ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) - return false ; - } - else if ( pCurve->GetType() == CRV_ARC) { - ICurveArc* pArc = GetCurveArc( pCurve) ; - Point3d ptCen = pArc->GetCenter() ; - double dAngCen = pArc->GetAngCenter() ; - Vector3d vtN = pArc->GetNormVersor() ; - Point3d ptP3 ; pArc->GetEndPoint( ptP3) ; - SetFeed( GetFeed()) ; - if ( AddArcMove( ptP3, ptCen, dAngCen, vtN) == GDB_ID_NULL) - return false ; - } + // elaborazioni sulla curva corrente (segmento di retta o arco) + if ( pCurve->GetType() == CRV_LINE) { + ICurveLine* pLine = GetCurveLine( pCurve) ; + Point3d ptP3 = pLine->GetEnd() ; + Vector3d vtMove ; pLine->GetStartDir( vtMove) ; + SetFeed( GetRightFeed( vtMove, vtTool)) ; + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) + return false ; + } + else if ( pCurve->GetType() == CRV_ARC) { + ICurveArc* pArc = GetCurveArc( pCurve) ; + Vector3d vtMove ; pArc->GetStartDir( vtMove) ; + SetFeed( GetRightFeed( vtMove, vtTool)) ; + if ( AddCurveMove( pArc, bSplitArcs) == GDB_ID_NULL) + return false ; + } // se ultima entità if ( i == nMaxInd) { // dati fine entità