EgtMachKernel :

- in simulazione aggiunto controllo corse su assi ausiliari.
This commit is contained in:
Dario Sassi
2018-06-28 18:59:10 +00:00
parent ca400dd8d4
commit b6657d56a5
3 changed files with 42 additions and 1 deletions
+1
View File
@@ -130,6 +130,7 @@ class Machine
bool LimitAngleToStroke( int nInd, double& dAng) const ;
bool VerifyAngleOutstroke( int nInd, double dAng) const ;
bool VerifyOutstroke( double dX, double dY, double dZ, const DBLVECTOR& vAng, bool bClear, int& nStat) const ;
bool VerifyOutstroke( const std::string& sAxName, double dVal) const ;
std::string GetOutstrokeInfo( bool bMM = true) const ;
void ResetOutstrokeInfo( void) const
{ m_OutstrokeInfo.Clear() ; }
+36
View File
@@ -1351,6 +1351,42 @@ Machine::VerifyOutstroke( double dX, double dY, double dZ, const DBLVECTOR& vAng
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::VerifyOutstroke( const string& sAxName, double dVal) const
{
// recupero l'asse
Axis* pAx = GetAxis( GetAxisId( sAxName)) ;
if ( pAx == nullptr) {
m_OutstrokeInfo.sAxName = sAxName ;
m_OutstrokeInfo.sAxToken = sAxName ;
m_OutstrokeInfo.bLinear = false ;
m_OutstrokeInfo.dExtra = 0 ;
m_OutstrokeInfo.sAuxInfo = " (Unknown) " ;
return false ;
}
// verifica con l'estremo inferiore
if ( dVal < pAx->GetStroke().Min) {
m_OutstrokeInfo.sAxName = pAx->GetName() ;
m_OutstrokeInfo.sAxToken = pAx->GetToken() ;
m_OutstrokeInfo.bLinear = ( pAx->GetType() == MCH_AT_LINEAR) ;
m_OutstrokeInfo.dExtra = dVal - pAx->GetStroke().Min ;
m_OutstrokeInfo.sAuxInfo = " (Ax-) " ;
return false ;
}
// verifica con l'estremo superiore
if ( dVal > pAx->GetStroke().Max) {
m_OutstrokeInfo.sAxName = pAx->GetName() ;
m_OutstrokeInfo.sAxToken = pAx->GetToken() ;
m_OutstrokeInfo.bLinear = ( pAx->GetType() == MCH_AT_LINEAR) ;
m_OutstrokeInfo.dExtra = dVal - pAx->GetStroke().Max ;
m_OutstrokeInfo.sAuxInfo = " (Ax+) " ;
return false ;
}
// va bene
return true ;
}
//----------------------------------------------------------------------------
string
Machine::GetOutstrokeInfo( bool bMM) const
+5 -1
View File
@@ -1500,7 +1500,11 @@ Simulator::OnMoveStart( const CamData* pCamData, int& nErr)
m_AuxAxesInvert.push_back( bInvert) ;
m_AuxAxesLinear.push_back( bLinear) ;
m_AuxAxesVal.emplace_back( dVal) ;
m_AuxAxesEnd.emplace_back( dEnd) ;
m_AuxAxesEnd.emplace_back( dEnd) ;
if ( ! m_pMachine->VerifyOutstroke( sName, dEnd)) {
nErr = 1 ;
bOk = false ;
}
}
else
bOk = false ;