EgtMachKernel :

- migliorata gestione angoli indeterminati con SCC e DirAux.
This commit is contained in:
Dario Sassi
2017-01-23 07:30:30 +00:00
parent 868559c293
commit 43ee7ed105
4 changed files with 28 additions and 7 deletions
+1 -1
View File
@@ -94,7 +94,7 @@ GetRotationComponent( const Vector3d& vtDir1, double dComp, const Vector3d& vtDi
if ( dDenom * dNumer > 0)
dAng1Deg = dOffsAngRad * RADTODEG ;
else
dAng1Deg = dOffsAngRad * RADTODEG + ANG_STRAIGHT ;
dAng1Deg = dOffsAngRad * RADTODEG + ( dOffsAngRad < 0 ? ANG_STRAIGHT : - ANG_STRAIGHT) ;
bDet = true ;
return 1 ;
}
+1
View File
@@ -187,6 +187,7 @@ class Machine
int nNumRotAx, const KinAxis& RotAx1, const KinAxis& RotAx2,
int& nStat, double& dAngA1, double& dAngB1, double& dAngA2, double& dAngB2) const ;
bool GetDirection( const Vector3d& vtDir, const DBLVECTOR& vAng, Vector3d& vtNew) const ;
bool GetSccDir( int nSolCh, const Vector3d& vtDirA, Vector3d& vtDirScc) const ;
bool VerifyScc( const Vector3d& vtDirI, const Vector3d& vtDirA, int nSolCh) const ;
bool AdjustAngleInStroke( const STROKE& Stroke, double& dAng) const ;
bool LuaInit( const std::string& sMachineName) ;
+26 -4
View File
@@ -754,9 +754,11 @@ Machine::GetMyAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
// se indeterminato, provo a determinarlo con la direzione ausiliaria
if ( ! bDet2) {
bool bDetX ;
vtDirI2.GetRotation( vtDirAn, vtAx1, dAngA2, bDetX) ;
Vector3d vtSccDir ;
bool bSccDir = GetSccDir( m_nCalcSolCh, vtDirAn, vtSccDir) ;
vtDirI2.GetRotation( vtSccDir, vtAx1, dAngA2, bDetX) ;
if ( bDetX)
bDet2 = true ;
bDet2 = bSccDir ;
else
dAngA2 = 0 ;
}
@@ -775,9 +777,11 @@ Machine::GetMyAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
// se indeterminato, provo a determinarlo con la direzione ausiliaria
if ( ! bDet1) {
bool bDetX ;
vtDirI1.GetRotation( vtDirAn, vtAx1, dAngA1, bDetX) ;
Vector3d vtSccDir ;
bool bSccDir = GetSccDir( m_nCalcSolCh, vtDirAn, vtSccDir) ;
vtDirI1.GetRotation( vtSccDir, vtAx1, dAngA1, bDetX) ;
if ( bDetX)
bDet1 = true ;
bDet1 = bSccDir ;
else
dAngA1 = 0 ;
}
@@ -1012,6 +1016,24 @@ Machine::GetToolDirFromAngles( double dAngA, double dAngB, Vector3d& vtDir) cons
return GetDirection( m_vtCalcDir, vAng, vtDir) ;
}
//----------------------------------------------------------------------------
bool
Machine::GetSccDir( int nSolCh, const Vector3d& vtDirA, Vector3d& vtDirScc) const
{
switch ( nSolCh) {
case MCH_SCC_ADIR_XP : vtDirScc = X_AX ; return true ;
case MCH_SCC_ADIR_XM : vtDirScc = - X_AX ; return true ;
case MCH_SCC_ADIR_YP : vtDirScc = Y_AX ; return true ;
case MCH_SCC_ADIR_YM : vtDirScc = - Y_AX ; return true ;
case MCH_SCC_ADIR_ZP : vtDirScc = Z_AX ; return true ;
case MCH_SCC_ADIR_ZM : vtDirScc = - Z_AX ; return true ;
case MCH_SCC_ADIR_NEAR : vtDirScc = vtDirA ; return true ;
case MCH_SCC_ADIR_FAR : vtDirScc = - vtDirA ; return true ;
}
vtDirScc = vtDirA ;
return false ;
}
//----------------------------------------------------------------------------
bool
Machine::VerifyScc( const Vector3d& vtDirI, const Vector3d& vtDirA, int nSolCh) const
-2
View File
@@ -509,8 +509,6 @@ Operation::CalculateAxesValues( const string& sHint)
DBLVECTOR vAxRotPrec( nRotAxes, 0.) ;
DBLVECTOR vAxVal ;
// se utensile non cambiato, uso gli angoli finali della lavorazione precedente
// ! ToolChangeNeeded( *pPrevOp, *this)
// GetToolName() == sPrevTool
if ( ! sPrevTool.empty() && ! ToolChangeNeeded( *pPrevOp, *this) &&
pPrevOp->GetFinalAxesValues( vAxVal)) {
for ( int i = 0 ; i < nRotAxes ; ++ i)