EgtMachKernel :

- corretto calcolo angoli più vicini a quelli di lavorazione precedente.
This commit is contained in:
Dario Sassi
2016-07-06 16:05:38 +00:00
parent 6065c07c98
commit 44092243cf
4 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -246,7 +246,7 @@ class MachMgr : public IMachMgr
bool GetCalcTipFromPositions( double dX, double dY, double dZ, double dAngA, double dAngB,
bool bOverall, bool bBottom, Point3d& ptTip) override ;
bool GetCalcToolDirFromAngles( double dAngA, double dAngB, Vector3d& vtDir) override ;
bool GetNearestAngleInStroke( int nId, double dAngRef, double& dAng) override ;
bool GetNearestAngleInStroke( int nInd, double dAngRef, double& dAng) override ;
bool VerifyOutstroke( double dX, double dY, double dZ, double dAngA, double dAngB, int& nStat) override ;
bool VerifyOutstroke( double dX, double dY, double dZ, const DBLVECTOR& vAng, int& nStat) ;
const std::string& GetOutstrokeInfo( void) const override ;
+2 -2
View File
@@ -416,10 +416,10 @@ MachMgr::GetCalcToolDirFromAngles( double dAngA, double dAngB, Vector3d& vtDir)
//----------------------------------------------------------------------------
bool
MachMgr::GetNearestAngleInStroke( int nId, double dAngRef, double& dAng)
MachMgr::GetNearestAngleInStroke( int nInd, double dAngRef, double& dAng)
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetNearestAngleInStroke( nId, dAngRef, dAng) : false) ;
return ( ( pMch != nullptr) ? pMch->GetNearestAngleInStroke( nInd, dAngRef, dAng) : false) ;
}
//----------------------------------------------------------------------------
+1 -1
View File
@@ -95,7 +95,7 @@ class Machine
bool GetTipFromPositions( double dX, double dY, double dZ, double dAngA, double dAngB,
bool bBottom, bool bOverall, Point3d& ptTip) const ;
bool GetToolDirFromAngles( double dAngA, double dAngB, Vector3d& vtDir) const ;
bool GetNearestAngleInStroke( int nId, double dAngRef, double& dAng) const ;
bool GetNearestAngleInStroke( int nInd, double dAngRef, double& dAng) const ;
bool VerifyOutstroke( double dX, double dY, double dZ, const DBLVECTOR& vAng, int& nStat) const ;
const std::string& GetOutstrokeInfo( void) const
{ return m_sOutstrokeInfo ; }
+6 -6
View File
@@ -1015,18 +1015,18 @@ Machine::AdjustAngleInStroke( const STROKE& Stroke, double& dAng) const
//----------------------------------------------------------------------------
bool
Machine::GetNearestAngleInStroke( int nId, double dAngRef, double& dAng) const
Machine::GetNearestAngleInStroke( int nInd, double dAngRef, double& dAng) const
{
// se angolo fittizio (non esiste l'asse rotante corrispondente), non c'è alcunchè da fare
if ( nId <= 0 || nId > int( m_vCalcRotAx.size()))
if ( nInd < 0 || nInd >= int( m_vCalcRotAx.size()))
return true ;
// cerco l'angolo più vicino stando nella corsa
while ( dAng - dAngRef > ANG_STRAIGHT && dAng - ANG_FULL >= m_vCalcRotAx[nId-1].stroke.Min)
while ( dAng - dAngRef > ANG_STRAIGHT && dAng - ANG_FULL >= m_vCalcRotAx[nInd].stroke.Min)
dAng -= ANG_FULL ;
while ( dAng - dAngRef < - ANG_STRAIGHT && dAng + ANG_FULL <= m_vCalcRotAx[nId-1].stroke.Max)
while ( dAng - dAngRef < - ANG_STRAIGHT && dAng + ANG_FULL <= m_vCalcRotAx[nInd].stroke.Max)
dAng += ANG_FULL ;
return ( dAng >= m_vCalcRotAx[nId-1].stroke.Min &&
dAng <= m_vCalcRotAx[nId-1].stroke.Max) ;
return ( dAng >= m_vCalcRotAx[nInd].stroke.Min &&
dAng <= m_vCalcRotAx[nInd].stroke.Max) ;
}
//----------------------------------------------------------------------------