EgtMachKernel :

- aggiunto controllo che gli assi mossi in Disposition siano assi dipendenti dalla tavola (MachMgr::IsDispositionAxis).
This commit is contained in:
Dario Sassi
2024-10-16 17:11:50 +02:00
parent e39426da0a
commit ab63e1908c
4 changed files with 47 additions and 18 deletions
+29
View File
@@ -405,6 +405,35 @@ MachMgr::ResetAxisPos( const string& sAxis)
return ( ( pMch != nullptr) ? pMch->ResetAxisPos( sAxis) : false) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::IsDispositionAxis( const string& sAxis, const string& sTable) const
{
Machine* pMch = GetCurrMachine() ;
if ( m_pGeomDB == nullptr || pMch == nullptr)
return false ;
// recupero Id asse
int nAxId = pMch->GetAxisId( sAxis) ;
if ( nAxId == GDB_ID_NULL)
return false ;
// recupero eventuale Id tavola
int nTabId = GDB_ID_NULL ;
if ( ! sTable.empty()) {
nTabId = pMch->GetTableId( sTable) ;
if ( nTabId == GDB_ID_NULL)
return false ;
}
// se direttamente dipendente dalla tavola
int nParentId = m_pGeomDB->GetParentId( nAxId) ;
if ( ( nTabId != GDB_ID_NULL && nParentId == nTabId) || pMch->IsTableGroup( nParentId))
return true ;
// altrimenti deve dipendere da asse dipendente dalla tavola
if ( ! pMch->IsAxisGroup( nParentId))
return false ;
int nGrParId = m_pGeomDB->GetParentId( nParentId) ;
return ( ( nTabId != GDB_ID_NULL && nGrParId == nTabId) || pMch->IsTableGroup( nGrParId)) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::ResetAllAxesPos( void)