EgtMachKernel 2.5e4 :

- negli angoli macchina suggeriti ora si tiene conto di Invert e di Offset (quindi per l'utente sono i valori che vede in simulazione e sul CN).
This commit is contained in:
DarioS
2023-05-26 08:43:48 +02:00
parent 90dbb068a9
commit 8f7fdc3a80
4 changed files with 58 additions and 1 deletions
BIN
View File
Binary file not shown.
+2
View File
@@ -125,6 +125,8 @@ class Machine
bool GetAllCurrAxesToken( STRVECTOR& vAxToken) const ;
bool GetCurrAxisMin( int nInd, double& dMin) const ;
bool GetCurrAxisMax( int nInd, double& dMax) const ;
bool GetCurrAxisOffset( int nInd, double& dOffset) const ;
bool GetCurrAxisInvert( int nInd, bool& bInvert) const ;
bool GetCurrAxisHomePos( int nInd, double& dHome) const ;
bool GetAllCurrAxesHomePos( DBLVECTOR& vAxHomeVal) const ;
const Frame3d& GetCurrLinAxesFrame( void) const
+46
View File
@@ -1827,6 +1827,52 @@ Machine::GetCurrAxisMax( int nInd, double& dMax) const
return false ;
}
//----------------------------------------------------------------------------
bool
Machine::GetCurrAxisOffset( int nInd, double& dOffset) 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 ;
dOffset = pAx->GetOffset() ;
return true ;
}
else if ( nInd >= nLinAxes && nInd < nLinAxes + nRotAxes) {
Axis* pAx = GetAxis( m_vCalcRotAx[nInd-nLinAxes].nGrpId) ;
if ( pAx == nullptr)
return false ;
dOffset = pAx->GetOffset() ;
return true ;
}
return false ;
}
//----------------------------------------------------------------------------
bool
Machine::GetCurrAxisInvert( int nInd, bool& bInvert) 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 ;
bInvert = pAx->GetInvert() ;
return true ;
}
else if ( nInd >= nLinAxes && nInd < nLinAxes + nRotAxes) {
Axis* pAx = GetAxis( m_vCalcRotAx[nInd-nLinAxes].nGrpId) ;
if ( pAx == nullptr)
return false ;
bInvert = pAx->GetInvert() ;
return true ;
}
return false ;
}
//----------------------------------------------------------------------------
bool
Machine::GetCurrAxisHomePos( int nInd, double& dHome) const
+10 -1
View File
@@ -1632,8 +1632,17 @@ Operation::CalculateAxesValues( const string& sHint, bool bRotContOnNext, bool b
if ( m_pMchMgr->GetCurrMachine()->GetCurrAxisToken( nLinAxes + i, sAxToken) &&
szKey == Trim( sAxToken)) {
double dVal ;
if ( FromString( szVal, dVal))
if ( FromString( szVal, dVal)) {
double dOffset = 0 ;
m_pMchMgr->GetCurrMachine()->GetCurrAxisOffset( nLinAxes + i, dOffset) ;
if ( abs( dOffset) > EPS_ANG_SMALL)
dVal -= dOffset ;
bool bInvert = false ;
m_pMchMgr->GetCurrMachine()->GetCurrAxisInvert( nLinAxes + i, bInvert) ;
if ( bInvert)
dVal = -dVal ;
vAxRotPrec[i] = dVal ;
}
break ;
}
}