EgtMachKernel :
- aggiunta gestione prima disposizione in lista operazioni - migliorato controllo dati macchina al caricamento - ora macchina deve essere disegnata e definita cinematicamente con tutti gli assi a 0, si definisce la posizione home e dopo il carico viene posta in questa posizione.
This commit is contained in:
+18
-5
@@ -26,6 +26,9 @@ using namespace std ;
|
||||
bool
|
||||
Machine::SetAxisPos( const string& sAxis, double dVal)
|
||||
{
|
||||
// controllo GeomDB
|
||||
if ( m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// recupero il gruppo dell'asse
|
||||
int nAxGrp = GetGroup( sAxis) ;
|
||||
// recupero il relativo gestore
|
||||
@@ -39,12 +42,13 @@ Machine::SetAxisPos( const string& sAxis, double dVal)
|
||||
// limiti della corsa
|
||||
STROKE Stroke = pAx->GetStroke() ;
|
||||
// recupero il vettore dell'asse
|
||||
int nV = m_pMchMgr->m_pGeomDB->GetFirstNameInGroup( nAxGrp, sAxis) ;
|
||||
const IGeoVector3d* pGV = GetGeoVector3d( m_pMchMgr->m_pGeomDB->GetGeoObj( nV)) ;
|
||||
int nV = m_pGeomDB->GetFirstNameInGroup( nAxGrp, sAxis) ;
|
||||
const IGeoVector3d* pGV = GetGeoVector3d( m_pGeomDB->GetGeoObj( nV)) ;
|
||||
if ( pGV == nullptr)
|
||||
return false ;
|
||||
Point3d ptPos = pGV->GetBase() ;
|
||||
Vector3d vtDir = pGV->GetVector() / AXIS_LEN ;
|
||||
Vector3d vtDir = pGV->GetVector() ;
|
||||
vtDir.Normalize() ;
|
||||
// limito il movimento alla corsa dell'asse
|
||||
if ( dVal > Stroke.Max)
|
||||
dVal = Stroke.Max ;
|
||||
@@ -52,9 +56,9 @@ Machine::SetAxisPos( const string& sAxis, double dVal)
|
||||
dVal = Stroke.Min ;
|
||||
// eseguo il movimento
|
||||
if ( bLinear)
|
||||
m_pMchMgr->m_pGeomDB->TranslateGroup( nAxGrp, vtDir * ( dVal - dCurrVal)) ;
|
||||
m_pGeomDB->TranslateGroup( nAxGrp, vtDir * ( dVal - dCurrVal)) ;
|
||||
else
|
||||
m_pMchMgr->m_pGeomDB->RotateGroup( nAxGrp, ptPos, vtDir, ( dVal - dCurrVal)) ;
|
||||
m_pGeomDB->RotateGroup( nAxGrp, ptPos, vtDir, ( dVal - dCurrVal)) ;
|
||||
// salvo la nuova posizione
|
||||
return pAx->SetCurrVal( dVal) ;
|
||||
}
|
||||
@@ -63,6 +67,9 @@ Machine::SetAxisPos( const string& sAxis, double dVal)
|
||||
bool
|
||||
Machine::GetAxisPos( const string& sAxis, double& dVal)
|
||||
{
|
||||
// controllo GeomDB
|
||||
if ( m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// recupero il relativo gestore
|
||||
Axis* pAx = GetAxis( GetGroup( sAxis)) ;
|
||||
if ( pAx == nullptr)
|
||||
@@ -76,6 +83,9 @@ Machine::GetAxisPos( const string& sAxis, double& dVal)
|
||||
bool
|
||||
Machine::GetAxisHomePos( const string& sAxis, double& dHomeVal)
|
||||
{
|
||||
// controllo GeomDB
|
||||
if ( m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// recupero il gestore dell'asse
|
||||
Axis* pAx = GetAxis( GetGroup( sAxis)) ;
|
||||
if ( pAx == nullptr)
|
||||
@@ -89,6 +99,9 @@ Machine::GetAxisHomePos( const string& sAxis, double& dHomeVal)
|
||||
bool
|
||||
Machine::ResetAxisPos( const string& sAxis)
|
||||
{
|
||||
// controllo GeomDB
|
||||
if ( m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// recupero la posizione home
|
||||
double dHomeVal ;
|
||||
if ( ! GetAxisHomePos( sAxis, dHomeVal))
|
||||
|
||||
Reference in New Issue
Block a user