Merge commit '1179ad7e84b5d7bca253c3219b8ba01e10082a08' into Svuotature_LeadIn/Out
This commit is contained in:
+44
-16
@@ -718,22 +718,50 @@ Drilling::Update( bool bPostApply)
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Drilling::VerifyMultiParallelFixedDrills( void)
|
||||
{
|
||||
// se aggregato da sotto, sicuramente con una sola punta
|
||||
bool bAggrBottom = IsAggrBottom( m_TParams.m_sHead) ;
|
||||
if ( bAggrBottom)
|
||||
return false ;
|
||||
// se una sola uscita, inutile continuare
|
||||
int nExitCnt = m_pMchMgr->GetCurrMachine()->GetHeadExitCount( m_TParams.m_sHead) ;
|
||||
if ( nExitCnt == 1)
|
||||
return false ;
|
||||
// verifico che le uscite siano fisse
|
||||
int nSelectType = m_pMchMgr->GetCurrMachine()->GetHeadSelectType( m_TParams.m_sHead) ;
|
||||
if ( nSelectType != MCH_SLT_FIXEDEXITS)
|
||||
return false ;
|
||||
// recupero la direzione dell'utensile principale
|
||||
Point3d ptMainExit ; Vector3d vtMainTool, vtMainAux ;
|
||||
m_pMchMgr->GetCurrMachine()->GetHeadExitPosDirAux( m_TParams.m_sHead, m_TParams.m_nExit, ptMainExit, vtMainTool, vtMainAux) ;
|
||||
// verifico ci sia almeno un'altra uscita attrezzata parallela a quella principale
|
||||
for ( int nT = 0 ; nT < nExitCnt ; ++ nT) {
|
||||
if ( nT + 1 == m_TParams.m_nExit)
|
||||
continue ;
|
||||
string sToolName ;
|
||||
if ( m_pMchMgr->GetLoadedTool( m_TParams.m_sHead, nT + 1, sToolName) && ! sToolName.empty()) {
|
||||
Point3d ptExit ; Vector3d vtTool, vtAux ;
|
||||
if ( m_pMchMgr->GetCurrMachine()->GetHeadExitPosDirAux(m_TParams.m_sHead, nT + 1, ptExit, vtTool, vtAux) &&
|
||||
AreSameVectorApprox( vtTool, vtMainTool))
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
// non è stato trovato niente
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Drilling::StandardProcess( bool bRecalc, int nPvId, int nClId)
|
||||
{
|
||||
// controllo se ho più uscite
|
||||
string sCurrHead ;
|
||||
if ( ! m_pMchMgr->GetCurrMachine()->GetCurrHead( sCurrHead))
|
||||
return false ;
|
||||
int nExitCnt = m_pMchMgr->GetCurrMachine()->GetHeadExitCount( sCurrHead) ;
|
||||
int nSelectType = m_pMchMgr->GetCurrMachine()->GetHeadSelectType( sCurrHead) ;
|
||||
bool bAggrBottom = IsAggrBottom( sCurrHead) ;
|
||||
// se ho più uscite fisse e non è aggregato da sotto ...
|
||||
if ( nExitCnt > 1 && nSelectType == MCH_SLT_FIXEDEXITS && ! bAggrBottom) {
|
||||
// se ho almeno un'altra punta fissa parallela alla principale ...
|
||||
if ( VerifyMultiParallelFixedDrills()) {
|
||||
TABMHDRILL tabDrills ;
|
||||
double dMHOff = 0 ;
|
||||
if ( ! MultiHeadDrilling( nExitCnt, m_vId, nClId, tabDrills, dMHOff))
|
||||
if ( ! MultiHeadDrilling( m_vId, nClId, tabDrills, dMHOff))
|
||||
return false ;
|
||||
if ( tabDrills.empty())
|
||||
return true ;
|
||||
@@ -777,29 +805,29 @@ Drilling::StandardProcess( bool bRecalc, int nPvId, int nClId)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Drilling::MultiHeadDrilling( int nExitCnt, const SELVECTOR& vId, int nClId, TABMHDRILL& tabDrills, double& dMHOff, bool bOrd)
|
||||
Drilling::MultiHeadDrilling( const SELVECTOR& vId, int nClId, TABMHDRILL& tabDrills, double& dMHOff, bool bOrd)
|
||||
{
|
||||
// controllo parametri
|
||||
tabDrills.clear() ;
|
||||
if ( vId.empty())
|
||||
return true ;
|
||||
|
||||
// recupero il nome della testa
|
||||
string sHead ;
|
||||
m_pMchMgr->GetCurrMachine()->GetCurrHead( sHead) ;
|
||||
|
||||
// gestore degli utensili
|
||||
ToolsMgr* pTMgr = m_pMchMgr->GetCurrToolsMgr() ;
|
||||
if ( pTMgr == nullptr)
|
||||
return false ;
|
||||
|
||||
// recupero il nome della testa e il numero di uscite
|
||||
string sHead ;
|
||||
m_pMchMgr->GetCurrMachine()->GetCurrHead( sHead) ;
|
||||
int nExitCnt = m_pMchMgr->GetCurrMachine()->GetHeadExitCount( sHead) ;
|
||||
|
||||
// Recupero i dati degli utensili montati sulla testa
|
||||
int nMainToolInd = -1 ;
|
||||
VECTORTOOL vTools ; vTools.reserve( nExitCnt) ;
|
||||
// ricavo gli utensili presenti sulle uscite
|
||||
for ( int nT = 0 ; nT < nExitCnt ; ++ nT) {
|
||||
string sToolName ;
|
||||
ToolInfo TInf ;
|
||||
if ( ! m_pMchMgr->GetLoadedTool( sHead, nT + 1, sToolName) || sToolName.empty()) {
|
||||
// non c'è utensile
|
||||
vTools.emplace_back( nullptr) ;
|
||||
|
||||
+2
-1
@@ -86,11 +86,12 @@ class Drilling : public Machining
|
||||
bool VerifyHoleFromBottom( const Hole& hole, SelData Id) ;
|
||||
bool DoStandardDrilling( const Hole& hole, SelData Id, int nPathId, double nMHOff, Vector3d vtA) ;
|
||||
bool DoPeckDrilling( const Hole& hole, SelData Id, int nPathId) ;
|
||||
bool MultiHeadDrilling( int nExitCnt, const SELVECTOR& vId, int nClId, TABMHDRILL& vDrills, double& dMHOff, bool bOrd = true) ;
|
||||
bool MultiHeadDrilling( const SELVECTOR& vId, int nClId, TABMHDRILL& vDrills, double& dMHOff, bool bOrd = true) ;
|
||||
bool CalcMask( VECTORHOLE& vHoles, const VECTORTOOL& vTools, int nIndMT, const Vector3d& vtTool, const Vector3d& vtAux) ;
|
||||
bool CheckOtherHolesWithTools( VECTORHOLE& vHoles, const VECTORTOOL& vTools, int nIndTM, int nIndHTM, Hole holeICP,
|
||||
const Frame3d& frHTM, const Frame3d& frHMTOP, double dDiamToler, int& nDrills) ;
|
||||
bool MultiHeadVerifyHole( Hole& hole, const ToolData* Tool, double dDiamToler, SelData Id) ;
|
||||
bool VerifyMultiParallelFixedDrills( void) ;
|
||||
|
||||
private :
|
||||
double GetSpeed() const
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user