EgtMachKernel :

- modifiche e correzioni per flag di fine passata (301) in fresatura con lama a ZigZag e OneWay.
This commit is contained in:
Dario Sassi
2024-02-27 10:36:52 +01:00
parent a79d9c9fe8
commit c3729befbb
4 changed files with 34 additions and 30 deletions
+8 -3
View File
@@ -4019,12 +4019,14 @@ Milling::AddSawZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtT
// aggiungo uscita
Point3d ptP1 ;
Vector3d vtDir1 ;
SetFlag( 301, false) ;
SetFeed( GetEndFeed()) ;
if ( ! AddLeadOut( ptEnd, vtEnd, vtTool, dEndElev, bInvert, pMyCompo, bSplitArcs, ptP1, vtDir1)) {
m_pMchMgr->SetLastError( 2311, "Error in Milling : LeadOut not computable") ;
return false ;
}
// imposto flag fine passata sull'ultima entità emessa
if ( ! SetFlagOnLastMove( 301))
return false ;
// per lame retrazione non è necessaria
}
}
@@ -4212,12 +4214,15 @@ Milling::AddSawOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtT
Point3d ptP1 ;
Vector3d vtDir1 ;
SetFeed( GetEndFeed()) ;
if ( ! bReturn)
SetFlag( 301, false) ;
if ( ! AddLeadOut( ptEnd, vtEnd, vtTool, dEndElev, bReturn, pMyCompo, bSplitArcs, ptP1, vtDir1)) {
m_pMchMgr->SetLastError( 2311, "Error in Milling : LeadOut not computable") ;
return false ;
}
// se non è return, imposto flag fine passata sull'ultima entità emessa
if ( ! bReturn) {
if ( ! SetFlagOnLastMove( 301))
return false ;
}
// per lame retrazione non è necessaria
}
}
+1 -1
View File
@@ -134,7 +134,7 @@ Operation::Init( MachMgr* pMchMgr)
Operation::Operation( void)
: m_nOwnerId( GDB_ID_NULL), m_pGeomDB( nullptr), m_pMchMgr( nullptr), m_nPhase( 1),
m_nPathId( GDB_ID_NULL), m_bCurr( false), m_ptCurr(), m_vtTool(), m_vtCorr(), m_vtAux(),
m_dFeed( 0), m_nFlag( 0), m_bFlagModal( true), m_nFlag2( 0), m_bFlag2Modal( true), m_nIndex( 0)
m_dFeed( 0), m_nFlag( 0), m_nFlag2( 0), m_nIndex( 0)
{
}
+3 -12
View File
@@ -182,8 +182,9 @@ class Operation : public IUserObj
bool SetAuxDir( const Vector3d& vtDir) ;
bool SetCorrAuxDir( const Vector3d& vtDir) ;
bool SetFeed( double dFeed) ;
bool SetFlag( int nFlag, bool bModal = true) ;
bool SetFlag2( int nFlag2, bool bModal = true) ;
bool SetFlag( int nFlag) ;
bool SetFlagOnLastMove( int nFlag) ;
bool SetFlag2( int nFlag2) ;
bool SetIndex( int nIndex) ;
bool GetCurrPos( Point3d& ptCurr) const
{ if ( ! m_bCurr) return false ; ptCurr = m_ptCurr ; return true ; }
@@ -214,18 +215,8 @@ class Operation : public IUserObj
Vector3d m_vtAux ; // direzione ausiliaria corrente
double m_dFeed ; // feed corrente
int m_nFlag ; // flag corrente
bool m_bFlagModal ; // valore persistente del flag
int m_nFlag2 ; // secondo flag corrente
bool m_bFlag2Modal ; // valore persistente del flag2
int m_nIndex ; // indice corrente
private :
int UseFlag( void)
{ if ( m_bFlagModal) return m_nFlag ;
int nTemp = m_nFlag ; m_nFlag = 0 ; m_bFlagModal = true ; return nTemp ; }
int UseFlag2( void)
{ if ( m_bFlag2Modal) return m_nFlag2 ;
int nTemp = m_nFlag2 ; m_nFlag2 = 0 ; m_bFlag2Modal = true ; return nTemp ; }
} ;
//----------------------------------------------------------------------------
+22 -14
View File
@@ -76,19 +76,29 @@ Operation::SetFeed( double dFeed)
//----------------------------------------------------------------------------
bool
Operation::SetFlag( int nFlag, bool bModal)
Operation::SetFlag( int nFlag)
{
m_nFlag = nFlag ;
m_bFlagModal = bModal ;
return true ;
}
//----------------------------------------------------------------------------
bool
Operation::SetFlag2( int nFlag2, bool bModal)
Operation::SetFlagOnLastMove( int nFlag)
{
int nLastEntId = m_pGeomDB->GetLastInGroup( m_nPathId) ;
CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nLastEntId)) ;
if ( pCamData == nullptr)
return false ;
pCamData->SetFlag( nFlag) ;
return true ;
}
//----------------------------------------------------------------------------
bool
Operation::SetFlag2( int nFlag2)
{
m_nFlag2 = nFlag2 ;
m_bFlag2Modal = bModal ;
return true ;
}
@@ -130,8 +140,8 @@ Operation::AddRapidStart( const Point3d& ptP)
pCam->SetAuxDir( m_vtAux) ;
pCam->SetEndPoint( ptP) ;
pCam->SetFeed( 0) ;
pCam->SetFlag( UseFlag()) ;
pCam->SetFlag2( UseFlag2()) ;
pCam->SetFlag( m_nFlag) ;
pCam->SetFlag2( m_nFlag2) ;
pCam->SetIndex( m_nIndex) ;
// associo questo oggetto a quello geometrico
m_pGeomDB->SetUserObj( nId, Release( pCam)) ;
@@ -182,8 +192,8 @@ Operation::AddRapidMove( const Point3d& ptP)
pCam->SetAuxDir( m_vtAux) ;
pCam->SetEndPoint( ptP) ;
pCam->SetFeed( 0) ;
pCam->SetFlag( UseFlag()) ;
pCam->SetFlag2( UseFlag2()) ;
pCam->SetFlag( m_nFlag) ;
pCam->SetFlag2( m_nFlag2) ;
pCam->SetIndex( m_nIndex) ;
// associo questo oggetto a quello geometrico
m_pGeomDB->SetUserObj( nId, Release( pCam)) ;
@@ -240,8 +250,8 @@ Operation::AddLinearMove( const Point3d& ptP)
pCam->SetAuxDir( m_vtAux) ;
pCam->SetEndPoint( ptP) ;
pCam->SetFeed( m_dFeed) ;
pCam->SetFlag( UseFlag()) ;
pCam->SetFlag2( UseFlag2()) ;
pCam->SetFlag( m_nFlag) ;
pCam->SetFlag2( m_nFlag2) ;
pCam->SetIndex( m_nIndex) ;
// associo questo oggetto a quello geometrico
m_pGeomDB->SetUserObj( nId, Release( pCam)) ;
@@ -314,8 +324,8 @@ Operation::AddArcMove( const Point3d& ptP, const Point3d& ptCen, double dAngCen,
pCam->SetDeltaN( dDeltaZ) ;
pCam->SetNormDir( vtMyN) ;
pCam->SetFeed( m_dFeed) ;
pCam->SetFlag( UseFlag()) ;
pCam->SetFlag2( UseFlag2()) ;
pCam->SetFlag( m_nFlag) ;
pCam->SetFlag2( m_nFlag2) ;
pCam->SetIndex( m_nIndex) ;
// associo questo oggetto a quello geometrico
m_pGeomDB->SetUserObj( nId, Release( pCam)) ;
@@ -426,9 +436,7 @@ Operation::ResetMoveData( void)
m_vtAux = V_NULL ;
m_dFeed = 0 ;
m_nFlag = 0 ;
m_bFlagModal = true ;
m_nFlag2 = 0 ;
m_bFlag2Modal = true ;
m_nIndex = 0 ;
return true ;
}