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:
+20
-8
@@ -29,6 +29,9 @@ using namespace std ;
|
||||
bool
|
||||
Machine::SetCurrTable( const string& sTable)
|
||||
{
|
||||
// controllo GeomDB
|
||||
if ( m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// recupero il gruppo della tavola
|
||||
m_nCalcTabId = GetGroup( sTable) ;
|
||||
if ( m_nCalcTabId == GDB_ID_NULL || ! IsTableGroup( m_nCalcTabId)) {
|
||||
@@ -42,6 +45,9 @@ Machine::SetCurrTable( const string& sTable)
|
||||
bool
|
||||
Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
|
||||
{
|
||||
// controllo GeomDB
|
||||
if ( m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// azzero tutto
|
||||
m_nCalcHeadId = GDB_ID_NULL ;
|
||||
m_nCalcExitId = GDB_ID_NULL ;
|
||||
@@ -55,7 +61,7 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
|
||||
return false ;
|
||||
// recupero il gruppo dell'uscita
|
||||
string sExit = MCH_EXIT + ToString( nExit) ;
|
||||
int nExitId = m_pMchMgr->m_pGeomDB->GetFirstNameInGroup( nHeadId, sExit) ;
|
||||
int nExitId = m_pGeomDB->GetFirstNameInGroup( nHeadId, sExit) ;
|
||||
// recupero i dati dell'uscita
|
||||
Exit* pExit = GetExit( nExitId) ;
|
||||
if ( pExit == nullptr)
|
||||
@@ -63,11 +69,11 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
|
||||
// recupero i dati dell'utensile
|
||||
if ( ! LoadTool( sHead, nExit, sTool))
|
||||
return false ;
|
||||
int nToolId = m_pMchMgr->m_pGeomDB->GetFirstNameInGroup( nExitId, sTool) ;
|
||||
if ( nToolId == GDB_ID_NULL || m_pMchMgr->m_pGeomDB->GetGdbType( nToolId) != GDB_TY_GROUP)
|
||||
int nToolId = m_pGeomDB->GetFirstNameInGroup( nExitId, sTool) ;
|
||||
if ( nToolId == GDB_ID_NULL || m_pGeomDB->GetGdbType( nToolId) != GDB_TY_GROUP)
|
||||
return false ;
|
||||
double dTLen ;
|
||||
if ( ! m_pMchMgr->m_pGeomDB->GetInfo( nToolId, "L", dTLen))
|
||||
if ( ! m_pGeomDB->GetInfo( nToolId, "L", dTLen))
|
||||
return false ;
|
||||
// assegno tutti i dati
|
||||
m_nCalcHeadId = nHeadId ;
|
||||
@@ -85,30 +91,33 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
|
||||
bool
|
||||
Machine::CalculateKinematicChain( void)
|
||||
{
|
||||
// controllo GeomDB
|
||||
if ( m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// azzero tutti gli assi della catena cinematica
|
||||
m_vCalcLinAx.clear() ;
|
||||
m_vCalcRotAx.clear() ;
|
||||
// recupero gli assi di tavola
|
||||
if ( m_nCalcTabId == GDB_ID_NULL)
|
||||
return false ;
|
||||
int nTParId = m_pMchMgr->m_pGeomDB->GetParentId( m_nCalcTabId) ;
|
||||
int nTParId = m_pGeomDB->GetParentId( m_nCalcTabId) ;
|
||||
if ( nTParId == GDB_ID_NULL)
|
||||
return false ;
|
||||
while ( IsAxisGroup( nTParId)) {
|
||||
if ( ! AddKinematicAxis( false, nTParId))
|
||||
return false ;
|
||||
nTParId = m_pMchMgr->m_pGeomDB->GetParentId( nTParId) ;
|
||||
nTParId = m_pGeomDB->GetParentId( nTParId) ;
|
||||
}
|
||||
// recupero gli assi di testa
|
||||
if ( m_nCalcHeadId == GDB_ID_NULL)
|
||||
return false ;
|
||||
int nHParId = m_pMchMgr->m_pGeomDB->GetParentId( m_nCalcHeadId) ;
|
||||
int nHParId = m_pGeomDB->GetParentId( m_nCalcHeadId) ;
|
||||
if ( nHParId == GDB_ID_NULL)
|
||||
return false ;
|
||||
while ( IsAxisGroup( nHParId)) {
|
||||
if ( ! AddKinematicAxis( true, nHParId))
|
||||
return false ;
|
||||
nHParId = m_pMchMgr->m_pGeomDB->GetParentId( nHParId) ;
|
||||
nHParId = m_pGeomDB->GetParentId( nHParId) ;
|
||||
}
|
||||
// verifiche sugli assi lineari :
|
||||
// devono essere 3
|
||||
@@ -148,6 +157,9 @@ Machine::CalculateKinematicChain( void)
|
||||
bool
|
||||
Machine::AddKinematicAxis( bool bOnHead, int nId)
|
||||
{
|
||||
// controllo GeomDB
|
||||
if ( m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// recupero il gestore dell'asse
|
||||
Axis* pAx = GetAxis( nId) ;
|
||||
if ( pAx == nullptr)
|
||||
|
||||
Reference in New Issue
Block a user