Merge commit 'c6903e1cadb19b2b05d5a29e8d08fbd82d0d1332' into feature/Svuotature

This commit is contained in:
Riccardo Elitropi
2025-07-10 10:53:39 +02:00
6 changed files with 92 additions and 103 deletions
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -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) ;
+65 -66
View File
@@ -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 ;
}
@@ -5071,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 ;
+1 -1
View File
@@ -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,
+21 -26
View File
@@ -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à
+4 -9
View File
@@ -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 ;
}