EgtMachKernel 2.2j5 :

- tramite Info di testa ZEXTRA possibilità di assegnare una extra risalita in Z per evitare collisioni nel collegamento di due lavorazioni.
This commit is contained in:
Dario Sassi
2020-10-24 14:48:56 +00:00
parent 2ee6613759
commit 5dc854adb3
6 changed files with 84 additions and 3 deletions
BIN
View File
Binary file not shown.
+2
View File
@@ -113,6 +113,8 @@ class Machine
bool GetAllCurrAxesName( STRVECTOR& vAxName) const ;
bool GetCurrAxisToken( int nInd, std::string& sAxToken) const ;
bool GetAllCurrAxesToken( STRVECTOR& vAxToken) const ;
bool GetCurrAxisMin( int nInd, double& dMin) const ;
bool GetCurrAxisMax( int nInd, double& dMax) const ;
bool GetCurrAxisHomePos( int nInd, double& dHome) const ;
bool GetAllCurrAxesHomePos( DBLVECTOR& vAxHomeVal) const ;
bool GetAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
+46
View File
@@ -1632,6 +1632,52 @@ Machine::GetAllCurrAxesToken( STRVECTOR& vAxToken) const
return bOk ;
}
//----------------------------------------------------------------------------
bool
Machine::GetCurrAxisMin( int nInd, double& dMin) const
{
int nLinAxes = int( m_vCalcLinAx.size()) ;
int nRotAxes = int( m_vCalcRotAx.size()) ;
if ( nInd >= 0 && nInd < nLinAxes) {
Axis* pAx = GetAxis( m_vCalcLinAx[nInd].nGrpId) ;
if ( pAx == nullptr)
return false ;
dMin = pAx->GetStroke().Min ;
return true ;
}
else if ( nInd >= nLinAxes && nInd < nLinAxes + nRotAxes) {
Axis* pAx = GetAxis( m_vCalcRotAx[nInd-nLinAxes].nGrpId) ;
if ( pAx == nullptr)
return false ;
dMin = pAx->GetStroke().Min ;
return true ;
}
return false ;
}
//----------------------------------------------------------------------------
bool
Machine::GetCurrAxisMax( int nInd, double& dMax) const
{
int nLinAxes = int( m_vCalcLinAx.size()) ;
int nRotAxes = int( m_vCalcRotAx.size()) ;
if ( nInd >= 0 && nInd < nLinAxes) {
Axis* pAx = GetAxis( m_vCalcLinAx[nInd].nGrpId) ;
if ( pAx == nullptr)
return false ;
dMax = pAx->GetStroke().Max ;
return true ;
}
else if ( nInd >= nLinAxes && nInd < nLinAxes + nRotAxes) {
Axis* pAx = GetAxis( m_vCalcRotAx[nInd-nLinAxes].nGrpId) ;
if ( pAx == nullptr)
return false ;
dMax = pAx->GetStroke().Max ;
return true ;
}
return false ;
}
//----------------------------------------------------------------------------
bool
Machine::GetCurrAxisHomePos( int nInd, double& dHome) const
+3 -1
View File
@@ -100,8 +100,10 @@ const std::string MCH_AUX_VECT = "AV" ;
const std::string MCH_EXIT = "T" ;
//----------------------------------------------------------------------------
// Info in rinvio rotante per forzare risalita alla rotazione
// Info di testa per forzare risalita alla rotazione
const std::string MCH_ZMAXONROT = "ZMAXONROT" ;
// Info di testa per una extra risalita in Z
const std::string MCH_ZEXTRA = "ZEXTRA" ;
//----------------------------------------------------------------------------
// Dati aggregato rotante da sotto
+32 -2
View File
@@ -1642,8 +1642,18 @@ Operation::AdjustStartEndMovements( bool bVerifyPreviousLink)
if ( m_pMchMgr->GetCurrAxisHomePos( 2, dSafeZ)) {
DBLVECTOR vAxVal2 = vAxVal ; vAxVal2[2] = dSafeZ ;
DBLVECTOR vAxIni2 = vAxIni ; vAxIni2[2] = dSafeZ ;
if ( ! TestCollisionAvoid( vAxVal2, vAxIni2))
return false ;
if ( ! TestCollisionAvoid( vAxVal2, vAxIni2)) {
double dExtraZ = GetExtraZ( dSafeZ) ;
if ( dExtraZ > EPS_SMALL) {
dSafeZ += dExtraZ ;
vAxVal2[2] = dSafeZ ;
vAxIni2[2] = dSafeZ ;
if ( ! TestCollisionAvoid( vAxVal2, vAxIni2))
return false ;
}
else
return false ;
}
}
else
return false ;
@@ -2280,6 +2290,26 @@ Operation::CalcDeltaZForHeadRotation( const DBLVECTOR& vAxStart, const DBLVECTOR
return true ;
}
//----------------------------------------------------------------------------
double
Operation::GetExtraZ( double dSafeZ) const
{
double dExtraZ = 0 ;
// Recupero macchina corrente
Machine* pMch = ( m_pMchMgr != nullptr ? m_pMchMgr->GetCurrMachine() : nullptr) ;
if ( pMch == nullptr)
return 0 ;
// Se testa con Info ZEXTRA la recupero e la limito alla corsa dell'asse
int nHeadId = pMch->GetCurrHead() ;
double dVal ;
if ( m_pGeomDB->GetInfo( nHeadId, MCH_ZEXTRA, dVal) && dVal > EPS_SMALL) {
double dZmax ;
pMch->GetCurrAxisMax( 2, dZmax) ;
dExtraZ = min( dVal, dZmax - dSafeZ) ;
}
return dExtraZ ;
}
//----------------------------------------------------------------------------
bool
Operation::ForcedZmax( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const
+1
View File
@@ -109,6 +109,7 @@ class Operation : public IUserObj
bool RemoveRise( int nClPathId = GDB_ID_NULL) ;
bool AddHome( void) ;
bool CalcDeltaZForHeadRotation( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, double& dDeltaZ) const ;
double GetExtraZ( double dSafeZ) const ;
bool ForcedZmax( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const ;
bool TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const ;
bool SpecialMoveZup( Vector3d& vtTool, DBLVECTOR& vAx, bool& bModif) ;