EgtMachKernel :

- segnalazione extracorsa ora gestisce l'unità di misura (mm/inch).
This commit is contained in:
Dario Sassi
2017-07-05 07:52:13 +00:00
parent f82307ac0d
commit e87faa62ca
5 changed files with 50 additions and 20 deletions
+1 -1
View File
@@ -290,7 +290,7 @@ class MachMgr : public IMachMgr
bool LimitAngleToStroke( int nInd, double& dAng) const 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 ;
std::string GetOutstrokeInfo( bool bMM = true) const override ;
// Machine
int GetBaseId( const std::string& sBase) const override ;
int GetTableId( const std::string& sTable) const override ;
+3 -3
View File
@@ -630,15 +630,15 @@ MachMgr::VerifyOutstroke( double dX, double dY, double dZ, const DBLVECTOR& vAng
}
//----------------------------------------------------------------------------
const std::string&
MachMgr::GetOutstrokeInfo( void) const
std::string
MachMgr::GetOutstrokeInfo( bool bMM) const
{
Machine* pMch = GetCurrMachine() ;
if ( pMch == nullptr) {
static string sNull = "" ;
return sNull ;
}
return pMch->GetOutstrokeInfo() ;
return pMch->GetOutstrokeInfo( bMM) ;
}
//----------------------------------------------------------------------------
+2 -3
View File
@@ -122,8 +122,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, int& nStat) const ;
const std::string& GetOutstrokeInfo( void) const
{ return m_sOutstrokeInfo ; }
std::string GetOutstrokeInfo( bool bMM = true) const ;
bool SetLook( int nFlag) ;
int GetLook( void)
{ return m_nMachineLook ; }
@@ -252,7 +251,7 @@ class Machine
double m_dCalcTOvRad ; // raggio di ingombro utensile corrente per calcoli
KINAXISVECTOR m_vCalcLinAx ; // vettore assi lineari attivi per calcoli
KINAXISVECTOR m_vCalcRotAx ; // vettore assi rotanti attivi per calcoli
mutable std::string m_sOutstrokeInfo ; // informazioni su ultimo extra corsa
mutable OutStroke m_OutstrokeInfo ; // informazioni su ultima extra corsa
// stato di visualizzazione
int m_nMachineLook ; // stato di visualizzazione della macchina
+31 -13
View File
@@ -1230,41 +1230,59 @@ Machine::VerifyOutstroke( double dX, double dY, double dZ, const DBLVECTOR& vAng
{
// default tutto ok
nStat = 0 ;
m_sOutstrokeInfo.clear() ;
m_OutstrokeInfo.Clear() ;
// verifica degli assi lineari
DBLVECTOR vLin( 3) ; vLin[0] = dX ; vLin[1] = dY ; vLin[2] = dZ ;
for ( size_t i = 0 ; i < m_vCalcLinAx.size() && i < vLin.size() ; ++ i) {
if ( vLin[i] < m_vCalcLinAx[i].stroke.Min) {
nStat += ( 1 << ( 2 * i)) ;
string sAxName = GetAxis( m_vCalcLinAx[i].nGrpId)->GetName() ;
m_sOutstrokeInfo += sAxName + "=" + ToString( vLin[i] - m_vCalcLinAx[i].stroke.Min, 1) +
" (L" + ToString( int(i) + 1) + "-) " ;
m_OutstrokeInfo.sAxName = GetAxis( m_vCalcLinAx[i].nGrpId)->GetName() ;
m_OutstrokeInfo.sAxToken = GetAxis( m_vCalcLinAx[i].nGrpId)->GetToken() ;
m_OutstrokeInfo.bLinear = true ;
m_OutstrokeInfo.dExtra = vLin[i] - m_vCalcLinAx[i].stroke.Min ;
m_OutstrokeInfo.sAuxInfo = " (L" + ToString( int(i) + 1) + "-) " ;
}
else if( vLin[i] > m_vCalcLinAx[i].stroke.Max) {
nStat += ( 2 << ( 2 * i)) ;
string sAxName = GetAxis( m_vCalcLinAx[i].nGrpId)->GetName() ;
m_sOutstrokeInfo += sAxName + "=" + ToString( vLin[i] - m_vCalcLinAx[i].stroke.Max, 1) +
" (L" + ToString( int(i) + 1) + "+) " ;
m_OutstrokeInfo.sAxName = GetAxis( m_vCalcLinAx[i].nGrpId)->GetName() ;
m_OutstrokeInfo.sAxToken = GetAxis( m_vCalcLinAx[i].nGrpId)->GetToken() ;
m_OutstrokeInfo.bLinear = true ;
m_OutstrokeInfo.dExtra = vLin[i] - m_vCalcLinAx[i].stroke.Max ;
m_OutstrokeInfo.sAuxInfo = " (L" + ToString( int(i) + 1) + "+) " ;
}
}
// verifica degli assi rotanti
for ( size_t i = 0 ; i < m_vCalcRotAx.size() && i < vAng.size() ; ++ i) {
if ( vAng[i] < m_vCalcRotAx[i].stroke.Min) {
nStat += ( 64 << ( 2 * i)) ;
string sAxName = GetAxis( m_vCalcRotAx[i].nGrpId)->GetName() ;
m_sOutstrokeInfo += sAxName + "=" + ToString( vAng[i] - m_vCalcRotAx[i].stroke.Min, 1) +
" (R" + ToString( int(i) + 1) + "-) " ;
m_OutstrokeInfo.sAxName = GetAxis( m_vCalcRotAx[i].nGrpId)->GetName() ;
m_OutstrokeInfo.sAxToken = GetAxis( m_vCalcRotAx[i].nGrpId)->GetToken() ;
m_OutstrokeInfo.bLinear = false ;
m_OutstrokeInfo.dExtra = vAng[i] - m_vCalcRotAx[i].stroke.Min ;
m_OutstrokeInfo.sAuxInfo = " (R" + ToString( int(i) + 1) + "-) " ;
}
else if( vAng[i] > m_vCalcRotAx[i].stroke.Max) {
nStat += ( 128 << ( 2 * i)) ;
string sAxName = GetAxis( m_vCalcRotAx[i].nGrpId)->GetName() ;
m_sOutstrokeInfo += sAxName + "=" + ToString( vAng[i] - m_vCalcRotAx[i].stroke.Max, 1) +
" (R" + ToString( int(i) + 1) + "+) " ;
m_OutstrokeInfo.sAxName = GetAxis( m_vCalcRotAx[i].nGrpId)->GetName() ;
m_OutstrokeInfo.sAxToken = GetAxis( m_vCalcRotAx[i].nGrpId)->GetToken() ;
m_OutstrokeInfo.bLinear = false ;
m_OutstrokeInfo.dExtra = vAng[i] - m_vCalcRotAx[i].stroke.Max ;
m_OutstrokeInfo.sAuxInfo = " (R" + ToString( int(i) + 1) + "+) " ;
}
}
return true ;
}
//----------------------------------------------------------------------------
std::string
Machine::GetOutstrokeInfo( bool bMM) const
{
if ( bMM || ! m_OutstrokeInfo.bLinear)
return m_OutstrokeInfo.sAxToken + "=" + ToString( m_OutstrokeInfo.dExtra, 1) + m_OutstrokeInfo.sAuxInfo ;
else
return m_OutstrokeInfo.sAxToken + "=" + ToString( m_OutstrokeInfo.dExtra / ONEINCH, 2) + m_OutstrokeInfo.sAuxInfo ;
}
//----------------------------------------------------------------------------
int
Machine::GetCurrLinAxes( void) const
+13
View File
@@ -56,6 +56,19 @@ struct KinAxis {
} ;
typedef std::vector<KinAxis> KINAXISVECTOR ;
//----------------------------------------------------------------------------
// Dati extra corsa di un asse
struct OutStroke {
std::string sAxName ;
std::string sAxToken ;
bool bLinear ;
double dExtra ;
std::string sAuxInfo ;
OutStroke( void) : bLinear( false), dExtra( 0) {}
void Clear( void)
{ sAxName.clear() ; sAxToken.clear() ; bLinear = false ; dExtra = 0 ; sAuxInfo.clear() ; }
} ;
//----------------------------------------------------------------------------
// Tipo di tavola della macchina
enum MchTabType { MCH_TT_NONE = 0,