Merge commit '5801b85a31cd6ba0ca8330acbce443d5ad45e45a'

This commit is contained in:
Riccardo Elitropi
2026-03-03 17:13:21 +01:00
4 changed files with 804 additions and 110 deletions
+57 -6
View File
@@ -31,6 +31,7 @@
#include "/EgtDev/Include/EGnStringKeyVal.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
#include "/EgtDev/Include/EGkGeoFrame3d.h"
#include "/EgtDev/Include/EgtIniFile.h"
using namespace std ;
@@ -3575,6 +3576,28 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId, double dMHO
// parametri per foro in doppio
bool bDouble = ( GetDoubleType( m_Params.m_sUserNotes) != 0) ;
double dDoubleLastStep = GetDoubleLastStep() ;
bool dDoubleParallel = false ;
if ( bDouble) {
// nel caso di lavorazione in doppio con flag nel file .ini abilitato, prima della risalita finale, risalgo dell'ultimo step compiuto
// se il piano di mirror presenta una normale circa parallela alla direzione del foro ( da BTL 1 grado di tolleranza)
Machine* pMch = m_pMchMgr->GetCurrMachine() ;
if ( pMch != nullptr) {
string sMachIni = pMch->GetMachineDir() + "\\" + pMch->GetMachineName() + ".ini" ;
const char* SEC_MACH = "Customizations" ;
const char* KEY_DRILLING_DOUBLE = "DrillingDoubleNT" ;
int nDrillingDouble = GetPrivateProfileInt( SEC_MACH, KEY_DRILLING_DOUBLE, 0, sMachIni.c_str()) ;
if ( nDrillingDouble == 1) {
int nDouble = GetDoubleType( m_Params.m_sUserNotes) ;
Vector3d vtNorm = V_INVALID ;
switch ( nDouble) {
case 1 : vtNorm = X_AX ; break ;
case 2 : vtNorm = Y_AX ; break ;
case 3 : vtNorm = Z_AX ; break ;
}
dDoubleParallel = ( vtNorm.IsValid() && hole.vtDir * vtNorm > cos( 1. * DEGTORAD)) ;
}
}
}
// ciclo di affondamento a step
const double MIN_STEP = 1 ;
const double APPR_STEP = 1 ;
@@ -3625,8 +3648,14 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId, double dMHO
Point3d ptP3 = hole.ptIni - hole.vtDir * dLen ;
if ( bHoleEnd)
ptP3 -= hole.vtDir * dAddLen ;
if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL)
return false ;
if ( dDoubleParallel && i == nStep) {
if ( AddLinearMove( ptP3, bSplitArcs, MCH_CL_DBP) == GDB_ID_NULL)
return false ;
}
else {
if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL)
return false ;
}
// aggiorno posizione e verifico se step completato
dCurrLen = dLen ;
if ( bHoleEnd || bStepEnd)
@@ -3650,8 +3679,14 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId, double dMHO
Point3d ptP4 = hole.ptIni - hole.vtDir * dLen ;
if ( bHoleEnd)
ptP4 -= hole.vtDir * dAddLen ;
if ( AddLinearMove( ptP4, bSplitArcs) == GDB_ID_NULL)
return false ;
if ( dDoubleParallel && i == nStep) {
if ( AddLinearMove( ptP4, bSplitArcs, MCH_CL_DBP) == GDB_ID_NULL)
return false ;
}
else {
if ( AddLinearMove( ptP4, bSplitArcs) == GDB_ID_NULL)
return false ;
}
// aggiorno posizione e verifico se step completato
dCurrLen = dLen ;
if ( bHoleEnd || bStepEnd)
@@ -3674,8 +3709,14 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId, double dMHO
Point3d ptP5 = hole.ptIni - hole.vtDir * dLen ;
if ( bHoleEnd)
ptP5 -= hole.vtDir * dAddLen ;
if ( AddLinearMove( ptP5, bSplitArcs) == GDB_ID_NULL)
return false ;
if ( dDoubleParallel && i == nStep) {
if ( AddLinearMove( ptP5, bSplitArcs, MCH_CL_DBP) == GDB_ID_NULL)
return false ;
}
else {
if ( AddLinearMove( ptP5, bSplitArcs) == GDB_ID_NULL)
return false ;
}
// aggiorno posizione
dCurrLen = dLen ;
}
@@ -3684,6 +3725,16 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId, double dMHO
// 6 -> ritorno all'approccio del foro
SetFeed( GetEndFeed()) ;
SetFlag( 104) ; // risalita sopra il foro
if ( dDoubleParallel) {
// aggiungo risalita aggiuntiva per lavorazione in doppio pari a due volte il LastStep
Point3d ptEnd ; GetCurrPos( ptEnd) ;
if ( AddLinearMove( ptEnd + min( 2. * dLastStep, dCurrLen) * hole.vtDir, bSplitArcs, MCH_CL_DBP) == GDB_ID_NULL)
return false ;
// aggiungo discensa di LastStep per simmetria con secondo utensile
GetCurrPos( ptEnd) ;
if ( AddLinearMove( ptEnd - dLastStep * hole.vtDir, bSplitArcs, MCH_CL_DBP) == GDB_ID_NULL)
return false ;
}
if ( AddLinearMove( ptP1, bSplitArcs) == GDB_ID_NULL)
return false ;
+1 -1
View File
@@ -100,6 +100,7 @@ class Machine
bool LoadAllTools( void) ;
bool UnloadAllTools( void) ;
bool ResetHeadSet( const std::string& sHead) ;
const STRVECTOR& GetHSet( const std::string& sHead) const ;
bool GetAxisToken( const std::string& sAxis, std::string& sToken) const ;
bool GetAxisInvert( const std::string& sAxis, bool& bInvert) const ;
bool GetAxisOffset( const std::string& sAxis, double& dOffset) const ;
@@ -267,7 +268,6 @@ class Machine
TcPos* GetTcPos( int nGroup) const ;
Exit* GetExit( int nGroup) const ;
bool AddHeadToSet( const std::string& sHSet, const std::string& sName) ;
const STRVECTOR& GetHSet( const std::string& sHead) const ;
bool EnableHeadInSet( const std::string& sHead) ;
bool LoadTool( Exit* pExit, const std::string& sTool) ;
bool ModifyMachineHeadAuxDirection( const std::string& sHead, const Vector3d& vtADir) ;
+726 -100
View File
File diff suppressed because it is too large Load Diff
+20 -3
View File
@@ -8,6 +8,7 @@
//
//
// Modifiche : 07.06.15 DS Creazione modulo.
// 24.02.26 RE Aggiunta Gestione Preview per Utensile e Testa
//
//
//----------------------------------------------------------------------------
@@ -49,23 +50,39 @@ class Machining : public Operation
public :
bool GetStartPoint( Point3d& ptStart) const ;
bool GetEndPoint( Point3d& ptEnd) const ;
bool PrepareToolPreview( void) const ;
bool RemoveToolPreview( void) const ;
bool ChangeToolPreviewShow( int nFlag) ;
bool PrepareToolPreview( void) ;
bool RemoveToolPreview( void) ;
int GetToolPreviewStepCount( void) const ;
int ToolPreview( int nEntId, int nStep) const ;
protected :
Machining( void) ;
~Machining( void) ;
bool SpecialApply( std::string& sErr) ;
bool PostApply( std::string& sErr) ;
int GetDoubleType( const std::string& sUserNotes) ;
bool GetDoubleToolData( std::string& sDblTool, std::string& sDblHead, int& nDblExit) ;
bool GetDoubleToolData( std::string& sDblTool, std::string& sDblHead, int& nDblExit) const ;
bool CalcMirrorByDouble( int nClId, const std::string& sUserNotes) ;
bool ActivateDrillingUnit( int nHeadId, const INTVECTOR& vActExit) const ;
private :
int GetToolPreviewNext( int nEntId, int nParentId, int nStId) const ;
int GetToolPreviewPrev( int nEntId, int nParentId, int nStId) const ;
bool MyPrepareToolPreview( bool bDouble) ;
bool MyChangeToolPreviewShow( int nLookFlag, bool bDouble) ;
bool MyToolPreview( int nEntId, bool bDouble) const ;
private :
int m_nLookFlag ; // flag di Visualizzazione per Preview
// lavorazione singola
int m_nPreviewHeadId ; // Id del gruppo testa di Preview
int m_nPreviewToolTip ; // Id del gruppo contenente il punto ToolTip
INTVECTOR m_vPreviewAxisIds ; // indici degli assi di Preview
// lavorazione in doppio
int m_nPreviewHeadIdDBL ; // Id della testa di Preview
int m_nPreviewToolTipDBL ; // Id del gruppo contenente il punto di ToolTip
INTVECTOR m_vPreviewAxisIdsBBL ; // indici degli assi di Preview
} ;
//----------------------------------------------------------------------------