EgtMachKernel :

- aggiunta funzione SetParam alle diverse lavorazioni
- aggiunto calcolo elevazione da grezzo
- estesa lavorazione di taglio con lama.
This commit is contained in:
Dario Sassi
2015-06-30 14:06:31 +00:00
parent cbf728b458
commit c5795df8d0
22 changed files with 890 additions and 161 deletions
+95 -27
View File
@@ -135,6 +135,37 @@ MachMgr::GetOperationId( const string& sName) const
return GDB_ID_NULL ;
}
//----------------------------------------------------------------------------
// Dispositions
//----------------------------------------------------------------------------
int
MachMgr::AddDisposition( const string& sName)
{
// recupero il gruppo delle operazioni nella macchinata corrente
int nOperGrpId = GetCurrOperId() ;
if ( nOperGrpId == GDB_ID_NULL)
return GDB_ID_NULL ;
// recupero nome originale, partendo da quello proposto
string sNewName = sName ;
if ( ! GetOperationNewName( sNewName))
return GDB_ID_NULL ;
// inserisco il gruppo
int nId = m_pGeomDB->AddGroup( GDB_ID_NULL, nOperGrpId, GLOB_FRM) ;
if ( nId == GDB_ID_NULL)
return GDB_ID_NULL ;
// assegno il nome
m_pGeomDB->SetName( nId, sNewName) ;
// installo il gestore della disposizione
Disposition* pDisp = new(nothrow) Disposition ;
if ( pDisp == nullptr)
return GDB_ID_NULL ;
m_pGeomDB->SetUserObj( nId, pDisp) ;
pDisp->Init( this) ;
return nId ;
}
//----------------------------------------------------------------------------
// Machinings
//----------------------------------------------------------------------------
bool
MachMgr::SetCurrMachining( int nId)
@@ -179,33 +210,6 @@ MachMgr::GetCurrMachining( void) const
return GDB_ID_NULL ;
}
//----------------------------------------------------------------------------
int
MachMgr::AddDisposition( const string& sName)
{
// recupero il gruppo delle operazioni nella macchinata corrente
int nOperGrpId = GetCurrOperId() ;
if ( nOperGrpId == GDB_ID_NULL)
return GDB_ID_NULL ;
// recupero nome originale, partendo da quello proposto
string sNewName = sName ;
if ( ! GetOperationNewName( sNewName))
return GDB_ID_NULL ;
// inserisco il gruppo
int nId = m_pGeomDB->AddGroup( GDB_ID_NULL, nOperGrpId, GLOB_FRM) ;
if ( nId == GDB_ID_NULL)
return GDB_ID_NULL ;
// assegno il nome
m_pGeomDB->SetName( nId, sNewName) ;
// installo il gestore della lavorazione
Disposition* pDisp = new(nothrow) Disposition ;
if ( pDisp == nullptr)
return GDB_ID_NULL ;
m_pGeomDB->SetUserObj( nId, pDisp) ;
pDisp->Init( this) ;
return nId ;
}
//----------------------------------------------------------------------------
int
MachMgr::AddMachining( const string& sName, const std::string& sMachining)
@@ -255,6 +259,70 @@ MachMgr::AddMachining( const string& sName, const std::string& sMachining)
return nId ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetMachiningParam( int nType, bool bVal)
{
// recupero la lavorazione corrente
int nCurrMchId = GetCurrMachining() ;
if ( nCurrMchId == GDB_ID_NULL)
return false ;
// ne recupero il gestore
Machining* pMch = dynamic_cast<Machining*>( m_pGeomDB->GetUserObj( nCurrMchId)) ;
if ( pMch == nullptr)
return false ;
// imposto il parametro
return pMch->SetParam( nType, bVal) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetMachiningParam( int nType, int nVal)
{
// recupero la lavorazione corrente
int nCurrMchId = GetCurrMachining() ;
if ( nCurrMchId == GDB_ID_NULL)
return false ;
// ne recupero il gestore
Machining* pMch = dynamic_cast<Machining*>( m_pGeomDB->GetUserObj( nCurrMchId)) ;
if ( pMch == nullptr)
return false ;
// imposto il parametro
return pMch->SetParam( nType, nVal) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetMachiningParam( int nType, double dVal)
{
// recupero la lavorazione corrente
int nCurrMchId = GetCurrMachining() ;
if ( nCurrMchId == GDB_ID_NULL)
return false ;
// ne recupero il gestore
Machining* pMch = dynamic_cast<Machining*>( m_pGeomDB->GetUserObj( nCurrMchId)) ;
if ( pMch == nullptr)
return false ;
// imposto il parametro
return pMch->SetParam( nType, dVal) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetMachiningParam( int nType, const string& sVal)
{
// recupero la lavorazione corrente
int nCurrMchId = GetCurrMachining() ;
if ( nCurrMchId == GDB_ID_NULL)
return false ;
// ne recupero il gestore
Machining* pMch = dynamic_cast<Machining*>( m_pGeomDB->GetUserObj( nCurrMchId)) ;
if ( pMch == nullptr)
return false ;
// imposto il parametro
return pMch->SetParam( nType, sVal) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetMachiningGeometry( const SELVECTOR& vIds)