EgtMachKernel 2.6j2 :

- aggiunta gestione assi ausiliari di tavola da comandi Disp (MoveDispAxis e RemoveDispAxis)
- aggiunta funzione per avere dati eventuali utensile, testa e uscita associato a disposizione.
This commit is contained in:
Dario Sassi
2024-10-10 15:45:05 +02:00
parent 2d2f44f9aa
commit d2bf6a4cec
7 changed files with 225 additions and 29 deletions
+24 -6
View File
@@ -2310,6 +2310,10 @@ Operation::VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec,
bAxError = false ;
Machine* pMachine = m_pMchMgr->GetCurrMachine() ;
// se disposizione non vanno fatti controlli
if ( GetType() == OPER_DISP)
return true ;
// se superato il limite di ricursioni, non devo fare alcunché
const int MAX_RECURSION = 6 ;
if ( nCnt > MAX_RECURSION)
@@ -2352,14 +2356,27 @@ Operation::VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec,
// Va inserito il punto medio
Point3d ptMid = Media( ptPrec, ptP) ;
Vector3d vtDirMid = Media( vtDirPrec, vtDir) ;
if ( ! vtDirMid.Normalize())
return ( nMoveType == 0) ;
if ( ! vtDirMid.Normalize()) {
if ( ! pMachine->GetBackToolDirFromAngles( vAxRotMid, vtDirMid))
return ( nMoveType == 0) ;
}
Vector3d vtAuxMid = Media( vtAuxPrec, vtAux) ;
if ( ! vtAuxPrec.IsSmall() && ! vtAux.IsSmall() && ! vtAuxMid.Normalize())
return ( nMoveType == 0) ;
if ( ! vtAuxPrec.IsSmall() && ! vtAux.IsSmall() && ! vtAuxMid.Normalize()) {
if ( ! pMachine->GetBackAuxDirFromAngles( vAxRotMid, vtAuxMid))
return ( nMoveType == 0) ;
}
Vector3d vtCorrMid = Media( vtCorrPrec, vtCorr) ;
if ( ! vtCorrPrec.IsSmall() && ! vtCorr.IsSmall() && ! vtCorrMid.Normalize())
return ( nMoveType == 0) ;
if ( ! vtCorrPrec.IsSmall() && ! vtCorr.IsSmall() && ! vtCorrMid.Normalize()) {
// riferimenti precedente e sul medio da direzioni fresa (Z) e ausiliaria (X)
Frame3d refPrec, refMid ;
if ( ! refPrec.Set( ORIG, vtDirPrec, vtAuxPrec) ||
! refMid.Set( ORIG, vtDirMid, vtAuxMid))
return ( nMoveType == 0) ;
// versore correzione in locale al precente coincide con quello in locale al corrente
vtCorrMid = vtCorrPrec ;
vtCorrMid.ToLoc( refPrec) ;
vtCorrMid.ToGlob( refMid) ;
}
// inserisco nuova entità e modifico vecchia
int nMidEntId = m_pGeomDB->Copy( nEntId, GDB_ID_NULL, nEntId, GDB_BEFORE) ;
if ( nMidEntId == GDB_ID_NULL)
@@ -2376,6 +2393,7 @@ Operation::VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec,
pMidCamData->SetEndPoint( ptMid) ;
pMidCamData->SetToolDir( vtDirMid) ;
pMidCamData->SetAuxDir( vtAuxMid) ;
pMidCamData->SetCorrDir( vtCorrMid) ;
pMidCamData->SetFlag2( -1) ;
// calcolo gli assi rotanti per il punto medio
DBLVECTOR vAxRotHome( int( vAxVal.size() - 3)) ;