diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index fb12294..111203e 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/MachMgr.h b/MachMgr.h index e185394..36cf665 100644 --- a/MachMgr.h +++ b/MachMgr.h @@ -370,6 +370,7 @@ class MachMgr : public IMachMgr int GetTcPosId( const std::string& sTcPos) const override ; bool GetAxisToken( const std::string& sAxis, std::string& sToken) const override ; bool GetAxisType( const std::string& sAxis, bool& bLinear) const override ; + bool GetAxisDir( const std::string& sAxis, Vector3d& vtDir) const override ; bool GetAxisInvert( const std::string& sAxis, bool& bInvert) const override ; bool GetAxisOffset( const std::string& sAxis, double& dOffset) const override ; bool SetAxisPos( const std::string& sAxis, double dVal, double* pdNewVal = nullptr) override ; diff --git a/MachMgrMachines.cpp b/MachMgrMachines.cpp index b999471..6663561 100644 --- a/MachMgrMachines.cpp +++ b/MachMgrMachines.cpp @@ -330,6 +330,15 @@ MachMgr::GetAxisType( const string& sAxis, bool& bLinear) const return ( ( pMch != nullptr) ? pMch->GetAxisType( sAxis, bLinear) : false) ; } +//---------------------------------------------------------------------------- +bool +MachMgr::GetAxisDir( const string& sAxis, Vector3d& vtDir) const +{ + Machine* pMch = GetCurrMachine() ; + // restituisco la direzione dell'asse indicato nella macchina corrente + return ( ( pMch != nullptr) ? pMch->GetAxisDir( sAxis, vtDir) : false) ; +} + //---------------------------------------------------------------------------- bool MachMgr::GetAxisInvert( const string& sAxis, bool& bInvert) const diff --git a/Machine.h b/Machine.h index 6113d47..25eb8fa 100644 --- a/Machine.h +++ b/Machine.h @@ -85,6 +85,7 @@ class Machine bool GetAxisInvert( const std::string& sAxis, bool& bInvert) const ; bool GetAxisOffset( const std::string& sAxis, double& dOffset) const ; bool GetAxisType( const std::string& sAxis, bool& bLinear) const ; + bool GetAxisDir( const std::string& sAxis, Vector3d& vtDir) const ; bool SetAxisPos( const std::string& sAxis, double dVal, bool bInStroke = true, double* pdNewVal = nullptr) ; bool GetAxisPos( const std::string& sAxis, double& dVal) const ; bool GetAxisMin( const std::string& sAxis, double& dMin) const ; diff --git a/MachineAxes.cpp b/MachineAxes.cpp index c74522a..bdb1413 100644 --- a/MachineAxes.cpp +++ b/MachineAxes.cpp @@ -47,7 +47,7 @@ Machine::GetAxisToken( const string& sAxis, string& sToken) const if ( m_pGeomDB == nullptr) return false ; // recupero il relativo gestore - Axis* pAx = GetAxis( GetGroup( sAxis)) ; + const Axis* pAx = GetAxis( GetGroup( sAxis)) ; if ( pAx == nullptr) return false ; // recupero il token dell'asse @@ -63,7 +63,7 @@ Machine::GetAxisInvert( const string& sAxis, bool& bInvert) const if ( m_pGeomDB == nullptr) return false ; // recupero il relativo gestore - Axis* pAx = GetAxis( GetGroup( sAxis)) ; + const Axis* pAx = GetAxis( GetGroup( sAxis)) ; if ( pAx == nullptr) return false ; // recupero il flag di inversione dell'asse in visualizzazione @@ -79,7 +79,7 @@ Machine::GetAxisOffset( const string& sAxis, double& dOffset) const if ( m_pGeomDB == nullptr) return false ; // recupero il relativo gestore - Axis* pAx = GetAxis( GetGroup( sAxis)) ; + const Axis* pAx = GetAxis( GetGroup( sAxis)) ; if ( pAx == nullptr) return false ; // recupero il valore di offset dell'asse in visualizzazione @@ -95,7 +95,7 @@ Machine::GetAxisType( const string& sAxis, bool& bLinear) const if ( m_pGeomDB == nullptr) return false ; // recupero il relativo gestore - Axis* pAx = GetAxis( GetGroup( sAxis)) ; + const Axis* pAx = GetAxis( GetGroup( sAxis)) ; if ( pAx == nullptr) return false ; // recupero il tipo dell'asse @@ -103,6 +103,22 @@ Machine::GetAxisType( const string& sAxis, bool& bLinear) const return true ; } +//---------------------------------------------------------------------------- +bool +Machine::GetAxisDir( const string& sAxis, Vector3d& vtDir) const +{ + // controllo GeomDB + if ( m_pGeomDB == nullptr) + return false ; + // recupero il relativo gestore + const Axis* pAx = GetAxis( GetGroup( sAxis)) ; + if ( pAx == nullptr) + return false ; + // recupero la direzione dell'asse + vtDir = pAx->GetDir() ; + return true ; +} + //---------------------------------------------------------------------------- bool Machine::SetAxisPos( const string& sAxis, double dVal, bool bInStroke, double* pdNewVal) @@ -152,7 +168,7 @@ Machine::GetAxisPos( const string& sAxis, double& dVal) const if ( m_pGeomDB == nullptr) return false ; // recupero il relativo gestore - Axis* pAx = GetAxis( GetGroup( sAxis)) ; + const Axis* pAx = GetAxis( GetGroup( sAxis)) ; if ( pAx == nullptr) return false ; // recupero la posizione corrente @@ -168,7 +184,7 @@ Machine::GetAxisMin( const string& sAxis, double& dMin) const if ( m_pGeomDB == nullptr) return false ; // recupero il gestore dell'asse - Axis* pAx = GetAxis( GetGroup( sAxis)) ; + const Axis* pAx = GetAxis( GetGroup( sAxis)) ; if ( pAx == nullptr) return false ; // recupero il minimo @@ -184,7 +200,7 @@ Machine::GetAxisMax( const string& sAxis, double& dMax) const if ( m_pGeomDB == nullptr) return false ; // recupero il gestore dell'asse - Axis* pAx = GetAxis( GetGroup( sAxis)) ; + const Axis* pAx = GetAxis( GetGroup( sAxis)) ; if ( pAx == nullptr) return false ; // recupero il massimo @@ -200,7 +216,7 @@ Machine::GetAxisHomePos( const string& sAxis, double& dHomeVal) const if ( m_pGeomDB == nullptr) return false ; // recupero il gestore dell'asse - Axis* pAx = GetAxis( GetGroup( sAxis)) ; + const Axis* pAx = GetAxis( GetGroup( sAxis)) ; if ( pAx == nullptr) return false ; // recupero la posizione home