EgtMachKernel 2.2d4 :
- aggiunta gestione TcPos (posizioni di cambio utensile) da configurazione macchina - aggiunte funzioni GetToolsInCurrSetupPos, GetTcPosId e GetAllTcPosNames.
This commit is contained in:
+52
@@ -18,6 +18,7 @@
|
||||
#include "Table.h"
|
||||
#include "Axis.h"
|
||||
#include "Head.h"
|
||||
#include "TcPos.h"
|
||||
#include "Exit.h"
|
||||
#include "/EgtDev/Include/EGkGeomDB.h"
|
||||
#include "/EgtDev/Include/EGkGeoVector3d.h"
|
||||
@@ -633,6 +634,50 @@ Machine::LoadMachineSpecialHead( const string& sName, const string& sParent, con
|
||||
return m_mapGroups.emplace( sName, nLay).second ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::LoadMachineTcPos( const string& sName, const string& sParent,
|
||||
const Point3d& ptPos, const Vector3d& vtTDir, const Vector3d& vtADir,
|
||||
const string& sGeo, const STRVECTOR& vsAux)
|
||||
{
|
||||
// recupero pezzo e layer della geometria originale della posizione nel cambio utensile
|
||||
string sPart, sLay ;
|
||||
Split( sGeo, "/", true, sPart, sLay) ;
|
||||
// cerco il gruppo nella geometria originale
|
||||
int nPart = m_pGeomDB->GetFirstNameInGroup( m_nTempGroupId, sPart) ;
|
||||
int nLay = m_pGeomDB->GetFirstNameInGroup( nPart, sLay) ;
|
||||
if ( nLay == GDB_ID_NULL)
|
||||
return false ;
|
||||
// cerco il gruppo padre per spostarvelo
|
||||
int nParentId = GetGroup( sParent) ;
|
||||
if ( nParentId == GDB_ID_NULL ||
|
||||
! m_pGeomDB->RelocateGlob( nLay, nParentId, GDB_LAST_SON))
|
||||
return false ;
|
||||
// sistemo lo stato di visualizzazione
|
||||
m_pGeomDB->SetStatus( nLay, GDB_ST_ON) ;
|
||||
// gli assegno il nome
|
||||
m_pGeomDB->SetName( nLay, sName) ;
|
||||
// sistemo la geometria ausiliaria
|
||||
if ( ! AdjustAuxGeometry( vsAux, nLay))
|
||||
return false ;
|
||||
// installo e inizializzo il gestore della posizione nel cambio utensile
|
||||
TcPos* pTcPos = new(nothrow) TcPos ;
|
||||
if ( pTcPos == nullptr)
|
||||
return false ;
|
||||
pTcPos->Set( sName, vtADir) ;
|
||||
m_pGeomDB->SetUserObj( nLay, pTcPos) ;
|
||||
// sistemo il riferimento dell'uscita rispetto alla direzione ausiliaria
|
||||
MUEXITVECTOR vMuExit ;
|
||||
vMuExit.emplace_back( ptPos, vtTDir) ;
|
||||
if ( ! AdjustExitFrames( nLay, vMuExit, vtADir))
|
||||
return false ;
|
||||
// trasformazione del riferimento di uscita in gruppo di uscita
|
||||
if ( ! CreateExitGroups( nLay, vMuExit))
|
||||
return false ;
|
||||
// lo inserisco nel dizionario dei gruppi della macchina
|
||||
return m_mapGroups.emplace( sName, nLay).second ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
Machine::GetGroup( const string& sGroup) const
|
||||
@@ -688,6 +733,13 @@ Machine::GetHead( int nGroup) const
|
||||
return ( dynamic_cast<Head*>( m_pGeomDB->GetUserObj( nGroup))) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
TcPos*
|
||||
Machine::GetTcPos( int nGroup) const
|
||||
{
|
||||
return ( dynamic_cast<TcPos*>( m_pGeomDB->GetUserObj( nGroup))) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
Exit*
|
||||
Machine::GetExit( int nGroup) const
|
||||
|
||||
Reference in New Issue
Block a user