EgtMachKernel 2.5b2 :
- nel calcolo spostamenti in disposizioni (movimenti di pezzi con ventose) è ora possibile fare rotazioni non minime pur di stare nelle corse.
This commit is contained in:
+22
-12
@@ -1434,7 +1434,7 @@ Operation::SetBlockedRotAxis( const string& sBlockedAxis) const
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::CalculateAxesValues( const string& sHint, bool bSolChExact)
|
||||
Operation::CalculateAxesValues( const string& sHint, bool bRotContOnNext, bool bSolChExact)
|
||||
{
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
@@ -1534,12 +1534,12 @@ Operation::CalculateAxesValues( const string& sHint, bool bSolChExact)
|
||||
DBLVECTOR vAxRotPrecOri = vAxRotPrec ;
|
||||
int nOutStrC = 0 ;
|
||||
if ( ! CalculateClPathAxesValues( nClPathId, nLinAxes, nRotAxes, dRot1W, bMaxDeltaR2OnFirst,
|
||||
dAngDeltaMinForHome, vAxRotHome, vAxRotPrec, nOutStrC)) {
|
||||
bRotContOnNext, dAngDeltaMinForHome, vAxRotHome, vAxRotPrec, nOutStrC)) {
|
||||
// se attivata scelta angolo iniziale vicino ad home ed extra corsa C, provo a rifarlo disattivando
|
||||
if ( dAngDeltaMinForHome < ANG_FULL && nOutStrC != 0) {
|
||||
m_pMchMgr->GetCurrMachine()->ResetOutstrokeInfo() ;
|
||||
CalculateClPathAxesValues( nClPathId, nLinAxes, nRotAxes, dRot1W, bMaxDeltaR2OnFirst,
|
||||
INFINITO, vAxRotHome, vAxRotPrec, nOutStrC) ;
|
||||
bRotContOnNext, INFINITO, vAxRotHome, vAxRotPrec, nOutStrC) ;
|
||||
}
|
||||
// se extracorsa dell'asse C, provo a precaricarlo al contrario
|
||||
if ( nOutStrC != 0) {
|
||||
@@ -1547,7 +1547,7 @@ Operation::CalculateAxesValues( const string& sHint, bool bSolChExact)
|
||||
vAxRotPrec[0] = vAxRotPrecOri[0] + ( nOutStrC > 0 ? - ANG_FULL : ANG_FULL) ;
|
||||
m_pMchMgr->GetCurrMachine()->ResetOutstrokeInfo() ;
|
||||
if ( ! CalculateClPathAxesValues( nClPathId, nLinAxes, nRotAxes, dRot1W, bMaxDeltaR2OnFirst,
|
||||
INFINITO, vAxRotHome, vAxRotPrec, nOutStrC))
|
||||
bRotContOnNext, INFINITO, vAxRotHome, vAxRotPrec, nOutStrC))
|
||||
bOk = false ;
|
||||
}
|
||||
else
|
||||
@@ -1561,8 +1561,9 @@ Operation::CalculateAxesValues( const string& sHint, bool bSolChExact)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes, double dRot1W, bool bMaxDeltaR2OnFirst,
|
||||
double dAngDeltaMinForHome, const DBLVECTOR& vAxRotHome, DBLVECTOR& vAxRotPrec, int& nOutStrC)
|
||||
Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes, double dRot1W,
|
||||
bool bMaxDeltaR2OnFirst, bool bRotContOnNext, double dAngDeltaMinForHome,
|
||||
const DBLVECTOR& vAxRotHome, DBLVECTOR& vAxRotPrec, int& nOutStrC)
|
||||
{
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
@@ -1625,9 +1626,12 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
|
||||
else {
|
||||
// scelgo gli angoli più vicini, per continuità non applico offset per stare nelle corse
|
||||
for ( int i = 0 ; i < int( vAng1.size()) ; ++ i) {
|
||||
vAng1[i] = AngleNearAngle( vAng1[i], vAxRotPrec[i]) ;
|
||||
if ( bRotContOnNext)
|
||||
vAng1[i] = AngleNearAngle( vAng1[i], vAxRotPrec[i]) ;
|
||||
else
|
||||
m_pMchMgr->GetNearestAngleInStroke( i, vAxRotPrec[i], vAng1[i]) ;
|
||||
if ( abs( vAng1[i] - vAxRotPrec[i]) > dAngDeltaMinForHome)
|
||||
vAng1[i] = AngleNearAngle( vAng1[i], vAxRotHome[i]) ;
|
||||
vAng1[i] = m_pMchMgr->GetNearestAngleInStroke( i, vAxRotHome[i], vAng1[i]) ;
|
||||
}
|
||||
// se sol.ne indeterminata (sempre il primo asse libero), assegno il precedente
|
||||
if ( nRStat < 0 && vAng1.size() >= 1) {
|
||||
@@ -1673,12 +1677,18 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
|
||||
else {
|
||||
// scelgo gli angoli più vicini, per continuità non applico offset per stare nelle corse
|
||||
for ( int i = 0 ; i < int( vAng1.size()) ; ++ i) {
|
||||
vAng1[i] = AngleNearAngle( vAng1[i], vAxRotPrec[i]) ;
|
||||
if ( bRotContOnNext)
|
||||
vAng1[i] = AngleNearAngle( vAng1[i], vAxRotPrec[i]) ;
|
||||
else
|
||||
m_pMchMgr->GetNearestAngleInStroke( i, vAxRotPrec[i], vAng1[i]) ;
|
||||
if ( abs( vAng1[i] - vAxRotPrec[i]) > dAngDeltaMinForHome)
|
||||
vAng1[i] = AngleNearAngle( vAng1[i], vAxRotHome[i]) ;
|
||||
vAng2[i] = AngleNearAngle( vAng2[i], vAxRotPrec[i]) ;
|
||||
vAng1[i] = m_pMchMgr->GetNearestAngleInStroke( i, vAxRotHome[i], vAng1[i]) ;
|
||||
if ( bRotContOnNext)
|
||||
vAng2[i] = AngleNearAngle( vAng2[i], vAxRotPrec[i]) ;
|
||||
else
|
||||
m_pMchMgr->GetNearestAngleInStroke( i, vAxRotPrec[i], vAng2[i]) ;
|
||||
if ( abs( vAng2[i] - vAxRotPrec[i]) > dAngDeltaMinForHome)
|
||||
vAng2[i] = AngleNearAngle( vAng2[i], vAxRotHome[i]) ;
|
||||
vAng2[i] = m_pMchMgr->GetNearestAngleInStroke( i, vAxRotHome[i], vAng2[i]) ;
|
||||
}
|
||||
// se sol.ne indeterminata (sempre il primo asse libero), assegno il precedente
|
||||
if ( nRStat < 0 && vAng1.size() >= 1) {
|
||||
|
||||
Reference in New Issue
Block a user