EgtMachKernel 1.6j4 :
- modifiche a DB utensili per gestione utensile corrente - prima versione generatore codice.
This commit is contained in:
+59
-8
@@ -258,13 +258,28 @@ Disposition::SetTable( const string& sTable)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Disposition::GetTableRef1( Point3d& ptRef1)
|
||||
Disposition::GetTable( string& sTable) const
|
||||
{
|
||||
// verifico MachMgr e GeomDB
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// verifico tavola
|
||||
if ( ! m_bTabOk && ! SetTable( m_sTabName))
|
||||
if ( ! m_bTabOk && ! const_cast<Disposition*>(this)->SetTable( m_sTabName))
|
||||
return false ;
|
||||
// recupero il nome della tavola
|
||||
sTable = m_sTabName ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Disposition::GetTableRef1( Point3d& ptRef1) const
|
||||
{
|
||||
// verifico MachMgr e GeomDB
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// verifico tavola
|
||||
if ( ! m_bTabOk && ! const_cast<Disposition*>(this)->SetTable( m_sTabName))
|
||||
return false ;
|
||||
// recupero il primo riferimento della tavola
|
||||
ptRef1 = m_ptRef1 ;
|
||||
@@ -282,9 +297,9 @@ Disposition::Apply(void)
|
||||
for ( auto& FixData : m_vFixData) {
|
||||
// se sottopezzo da caricare
|
||||
if ( FixData.nId == GDB_ID_NULL) {
|
||||
int nId = AddSubPiece( FixData.sName, FixData.ptPos, false) ;
|
||||
int nId = AddFixture( FixData.sName, FixData.ptPos, FixData.dAng, false) ;
|
||||
if ( nId == GDB_ID_NULL) {
|
||||
string sOut = "Error adding subpiece " + FixData.sName ;
|
||||
string sOut = "Error adding fixture " + FixData.sName ;
|
||||
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
|
||||
}
|
||||
else
|
||||
@@ -320,7 +335,7 @@ Disposition::Apply(void)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
Disposition::AddSubPiece( const string& sName, const Point3d& ptPos, double dAngDeg, bool bAddToList)
|
||||
Disposition::AddFixture( const string& sName, const Point3d& ptPos, double dAngDeg, bool bAddToList)
|
||||
{
|
||||
// verifico MachMgr e GeomDB
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
@@ -358,7 +373,7 @@ Disposition::AddSubPiece( const string& sName, const Point3d& ptPos, double dAng
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Disposition::MoveSubPiece( int nId, const Vector3d& vtMove)
|
||||
Disposition::MoveFixture( int nId, const Vector3d& vtMove)
|
||||
{
|
||||
// verifica validità sottopezzo
|
||||
if ( ! VerifyFixture( nId))
|
||||
@@ -380,7 +395,7 @@ Disposition::MoveSubPiece( int nId, const Vector3d& vtMove)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Disposition::RotateSubPiece( int nId, double dAngDeg)
|
||||
Disposition::RotateFixture( int nId, double dAngDeg)
|
||||
{
|
||||
// verifica validità sottopezzo
|
||||
if ( ! VerifyFixture( nId))
|
||||
@@ -402,7 +417,7 @@ Disposition::RotateSubPiece( int nId, double dAngDeg)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Disposition::RemoveSubPiece( int nId)
|
||||
Disposition::RemoveFixture( int nId)
|
||||
{
|
||||
// verifica validità sottopezzo
|
||||
if ( ! VerifyFixture( nId))
|
||||
@@ -645,3 +660,39 @@ Disposition::VerifyRawPart( int nRawId) const
|
||||
return false ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Disposition::GetFixtureData( int nInd, string& sName, int& nId, Point3d& ptPos, double& dAngDeg) const
|
||||
{
|
||||
// verifico MachMgr e GeomDB
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// verifico l'indice
|
||||
if ( nInd < 0 || nInd >= int( m_vFixData.size()))
|
||||
return false ;
|
||||
// recupero i dati
|
||||
sName = m_vFixData[nInd].sName ;
|
||||
nId = m_vFixData[nInd].nId ;
|
||||
ptPos = m_vFixData[nInd].ptPos ;
|
||||
dAngDeg = m_vFixData[nInd].dAng ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Disposition::GetMoveRawData( int nInd, int& nRawId, int& nType, Point3d& ptPos, int& nFlag) const
|
||||
{
|
||||
// verifico MachMgr e GeomDB
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// verifico l'indice
|
||||
if ( nInd < 0 || nInd >= int( m_vMvrData.size()))
|
||||
return false ;
|
||||
// recupero i dati
|
||||
nRawId = m_vMvrData[nInd].nRawId ;
|
||||
nType = m_vMvrData[nInd].nType ;
|
||||
ptPos = m_vMvrData[nInd].ptP ;
|
||||
nFlag = m_vMvrData[nInd].nFlag ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user