EgtMachKernel :

- in MachConst aggiunte Key per lettura da file .ini della macchina per Drilling in doppio in parallelo e per calcolo Feeds in PocketingNT
- in Drilling migliorate le considerazioni per lavorazioni in Doppio con possibilità di movimenti in parallelo per gli utensili
- in Preview Utensile corretta la posizione del secondo Tool in caso di lavorazioni in doppio con utensili di lunghezza differente
- in Machining aggiunta la funzione per calcolare il piano di Mirroring
- in PocketingNT aggiunta la lettura dal file .ini della macchina per calcolo delle Feeds.
This commit is contained in:
Riccardo Elitropi
2026-04-22 13:16:17 +02:00
parent 8648a2c61b
commit e1ef39ad72
6 changed files with 130 additions and 61 deletions
+49 -23
View File
@@ -326,13 +326,15 @@ Machining::MyPrepareToolPreview( bool bDouble)
// se necessario, imposto l'utensile corrente
string sTool, sTcPos, sHead ;
double dTLen ;
int nExitDBLId ;
if ( ! bDouble) {
sTool = GetToolName() ;
sHead = GetHeadName() ;
dTLen = GetToolData().m_dLen ;
}
else {
if ( ! GetDoubleToolData( sTool, sTcPos, sHead, nExitDBLId))
if ( ! GetDoubleToolData( sTool, sTcPos, sHead, nExitDBLId, dTLen))
return false ;
}
@@ -584,7 +586,7 @@ Machining::MyPrepareToolPreview( bool bDouble)
bOk = bOk && ( nFrId != GDB_ID_NULL) ;
const IGeoFrame3d* frExit = ( bOk ? GetGeoFrame3d( m_pGeomDB->GetGeoObj( nFrId)) : nullptr) ;
bOk = bOk && ( frExit != nullptr) ;
Point3d ptToolTip = ( bOk ? ( frExit->GetFrame()).Orig() - GetToolData().m_dLen * ( frExit->GetFrame()).VersZ() : P_INVALID) ;
Point3d ptToolTip = ( bOk ? ( frExit->GetFrame()).Orig() - dTLen * ( frExit->GetFrame()).VersZ() : P_INVALID) ;
bOk = bOk && ptToolTip.IsValid() ;
if ( bOk) {
PtrOwner<IGeoPoint3d> ptGToolTip( CreateGeoPoint3d()) ;
@@ -1043,7 +1045,7 @@ Machining::ToolPreview( int nEntId, int nStep) const
//----------------------------------------------------------------------------
int
Machining::GetDoubleType( const string& sUserNotes)
Machining::GetDoubleType( const string& sUserNotes) const
{
int nDouble ;
if ( ! GetValInNotes( sUserNotes, UN_DOUBLE, nDouble) ||
@@ -1056,6 +1058,14 @@ Machining::GetDoubleType( const string& sUserNotes)
//----------------------------------------------------------------------------
bool
Machining::GetDoubleToolData( string& sDblTool, string& sDblTcPos, string& sDblHead, int& nDblExit) const
{
double dDummy ;
return GetDoubleToolData( sDblTool, sDblTcPos, sDblHead, nDblExit, dDummy) ;
}
//----------------------------------------------------------------------------
bool
Machining::GetDoubleToolData( string& sDblTool, string& sDblTcPos, string& sDblHead, int& nDblExit, double& dDblLen) const
{
if ( m_pGeomDB == nullptr || m_pMchMgr == nullptr)
return false ;
@@ -1066,10 +1076,11 @@ Machining::GetDoubleToolData( string& sDblTool, string& sDblTcPos, string& sDblH
// recupero dati utensile in doppio
if ( ! GetValInNotes( GetToolData().m_sUserNotes, TUN_DOUBLE, sDblTool))
return false ;
const ToolData* pTdata = pTMgr->GetTool( sDblTool) ;
if ( pTdata == nullptr)
return false ;
dDblLen = pTdata->m_dLen ;
if ( ! m_pMchMgr->GetCurrSetupMgr().GetToolData( sDblTool, sDblTcPos, sDblHead, nDblExit)) {
const ToolData* pTdata = pTMgr->GetTool( sDblTool) ;
if ( pTdata == nullptr)
return false ;
sDblHead = pTdata->m_sHead ;
nDblExit = pTdata->m_nExit ;
}
@@ -1078,7 +1089,32 @@ Machining::GetDoubleToolData( string& sDblTool, string& sDblTcPos, string& sDblH
//----------------------------------------------------------------------------
bool
Machining::CalcMirrorByDouble( int nClId, const string& sUserNotes)
Machining::CalcMirrorPlaneByDouble( int nDouble, const string& sUserNotes, Point3d& ptOn, Vector3d& vtNorm) const
{
// verifico parametro per lavorazione in doppio
if ( nDouble != 1 && nDouble != 2 && nDouble != 3)
return false ;
// determino posizione del piano di mirroring mediante centro del Box del grezzo
BBox3d b3Raw ;
if ( ! GetCurrRawsGlobBox( b3Raw) || ! b3Raw.GetCenter( ptOn))
return false ;
switch ( nDouble) {
case 1 : vtNorm = X_AX ; break ;
case 2 : vtNorm = Y_AX ; break ;
case 3 : vtNorm = Z_AX ; break ;
}
// se presente nota utente con posizione del piano, allora dal punto più basso salgo di tale valore per individuare la quota
double dPlanePos ;
if ( GetValInNotes( sUserNotes, UN_MIRRORAX, dPlanePos))
ptOn = b3Raw.GetMin() + dPlanePos * vtNorm ;
return true ;
}
//----------------------------------------------------------------------------
bool
Machining::CalcMirrorByDouble( int nClId, const string& sUserNotes) const
{
if ( m_pGeomDB == nullptr || m_pMchMgr == nullptr)
return false ;
@@ -1128,20 +1164,10 @@ Machining::CalcMirrorByDouble( int nClId, const string& sUserNotes)
nPathId = m_pGeomDB->GetNextName( nPathId, MCH_PATH + "*") ;
}
// determino posizione del piano di mirroring
BBox3d b3Raw ;
Point3d ptOn ;
if ( ! GetCurrRawsGlobBox( b3Raw) || ! b3Raw.GetCenter( ptOn))
// calcolo il piano di Mirroring
Point3d ptOn ; Vector3d vtNorm ;
if ( ! CalcMirrorPlaneByDouble( nDouble, sUserNotes, ptOn, vtNorm))
return false ;
Vector3d vtNorm ;
switch ( nDouble) {
case 1 : vtNorm = X_AX ; break ;
case 2 : vtNorm = Y_AX ; break ;
case 3 : vtNorm = Z_AX ; break ;
}
double dPlanePos ;
if ( GetValInNotes( sUserNotes, UN_MIRRORAX, dPlanePos))
ptOn = b3Raw.GetMin() + dPlanePos * vtNorm ;
// eseguo mirroring rispetto a piano opportuno
nPathId = m_pGeomDB->GetFirstNameInGroup( nDblId, MCH_PATH + "*") ;
@@ -1149,15 +1175,15 @@ Machining::CalcMirrorByDouble( int nClId, const string& sUserNotes)
int nEntId = m_pGeomDB->GetFirstInGroup( nPathId) ;
while ( nEntId != GDB_ID_NULL) {
string sName ; m_pGeomDB->GetName( nEntId, sName) ;
// nel caso di fuorature in doppio, il movimento deve essere sincronizzato
if ( sName == MCH_CL_DBP) {
// nel caso di forature in doppio, il movimento deve essere sincronizzato
if ( sName == MCH_CL_PARALLEL_DBL) {
INTVECTOR vSyncEntId ;
do {
vSyncEntId.push_back( nEntId) ;
nEntId = m_pGeomDB->GetNext( nEntId) ;
sName.clear() ;
m_pGeomDB->GetName( nEntId, sName) ;
} while ( sName == MCH_CL_DBP) ;
} while ( sName == MCH_CL_PARALLEL_DBL) ;
Vector3d vtRef ;
bool bOk = true ;
for ( int i = 0 ; bOk && i < ssize( vSyncEntId) ; ++ i) {