diff --git a/Drilling.cpp b/Drilling.cpp index 0cf476d..d65cd58 100644 --- a/Drilling.cpp +++ b/Drilling.cpp @@ -2779,8 +2779,8 @@ Drilling::GenerateHoleCl( int nInd, const SelData& nCircId, const string& sPName // assegno l'elevazione massima m_pGeomDB->SetInfo( nPathId, KEY_ELEV, hole.dLen) ; // foro normale - if ( m_Params.m_dStep < EPS_SMALL || - m_Params.m_dStep > hole.dLen - EPS_SMALL) { + if ( ( m_Params.m_dStep < EPS_SMALL || m_Params.m_dStep > hole.dLen - 10 * EPS_SMALL) && + GetDoubleLastStep() > hole.dLen - 10 * EPS_SMALL) { if ( DoStandardDrilling( hole, nCircId, nPathId, dMHOff, vtA, currToolData)) { // aggiorno numero forature ++ m_nDrillings ; @@ -3572,25 +3572,20 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId, double dMHO if ( AddRapidMove( ptP2, bSplitArcs) == GDB_ID_NULL) return false ; } - // determino se foro in doppio - bool bDouble = false ; - { int nDouble = 0 ; - if ( GetValInNotes( m_Params.m_sUserNotes, UN_DOUBLE, nDouble) && - ( nDouble == 1 || nDouble == 2 || nDouble == 3)) - bDouble = true ; - } - + // parametri per foro in doppio + bool bDouble = ( GetDoubleType( m_Params.m_sUserNotes) != 0) ; + double dDoubleLastStep = GetDoubleLastStep() ; // ciclo di affondamento a step const double MIN_STEP = 1 ; const double APPR_STEP = 1 ; const double MIN_MOVE = 1 ; double dOrigStep = max( m_Params.m_dStep, MIN_STEP) ; - double dSteppedLen = ( bDouble ? hole.dLen - dOrigStep : hole.dLen) ; + double dSteppedLen = ( bDouble ? hole.dLen - dDoubleLastStep : hole.dLen) ; int nStep = int( ceil( dSteppedLen / dOrigStep)) ; double dStep = dSteppedLen / nStep ; if ( bDouble) ++ nStep ; - double dLastStep = ( bDouble ? dOrigStep : dStep) ; + double dLastStep = ( bDouble ? dDoubleLastStep : dStep) ; if ( dReturnPos < - dStep + APPR_STEP + MIN_MOVE) dReturnPos = - dStep + APPR_STEP + MIN_MOVE ; double dCurrLen = 0 ; @@ -3723,6 +3718,22 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId, double dMHO return true ; } +//---------------------------------------------------------------------------- +double +Drilling::GetDoubleLastStep( void) +{ + // se non รจ foratura in doppio, restituisco valore molto grande + const double FALSE_LASTSTEP = 10000 ; + if ( GetDoubleType( m_Params.m_sUserNotes) == 0) + return FALSE_LASTSTEP ; + // recupero valore + const double MIN_LASTSTEP = 15 ; + double dDoubleLastStep = m_Params.m_dStep ; + if ( GetValInNotes( m_Params.m_sUserNotes, UN_LASTSTEP, dDoubleLastStep)) + dDoubleLastStep = max( dDoubleLastStep, MIN_LASTSTEP) ; + return dDoubleLastStep ; +} + //---------------------------------------------------------------------------- // Debug Functions //---------------------------------------------------------------------------- diff --git a/Drilling.h b/Drilling.h index 822f5ab..9ba2ac6 100644 --- a/Drilling.h +++ b/Drilling.h @@ -128,6 +128,7 @@ class Drilling : public Machining bool MultiHeadOrderConfig( TABMHDRILL& tabDrills, const VECTORHOLE& vHoles, const Vector3d& vtTool, const Vector3d& vtAux) ; bool MultiHeadHoleToolsConfig( const VECTORHOLE& vHoles, int nConfig, INTINTVECTOR& vConfMask) ; int VerifyMultiParallelDrills( void) ; + double GetDoubleLastStep( void) ; /* debug functions */ void PrintConfigs( const VECTORHOLE& vHoles) ; diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index dc42c73..7773a2b 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/OperUserNotesConst.h b/OperUserNotesConst.h index a86b5af..28b8239 100644 --- a/OperUserNotesConst.h +++ b/OperUserNotesConst.h @@ -26,6 +26,9 @@ static const std::string UN_DOUBLE = "DOUBLE" ; static const std::string UN_MIRRORAX = "MirrorAx" ; static const std::string UN_DELTAZ = "DeltaZ" ; +// Solo per Drilling +static const std::string UN_LASTSTEP = "LastStep" ; + // Solo per FiveAxisMilling static const std::string UN_SINGCONEANG = "SingConeAng" ;