EgtMachKernel :
- aggiunta CopyMachining di MachMgr - ora SetCurrMachining imposta la fase della lavorazione.
This commit is contained in:
@@ -589,6 +589,8 @@ MachMgr::SetCurrMachining( int nId)
|
||||
return false ;
|
||||
// gli imposto il manager generale delle lavorazioni
|
||||
pMch->Init( this) ;
|
||||
// imposto la fase della lavorazione come corrente
|
||||
SetCurrPhase( pMch->GetPhase()) ;
|
||||
// imposto la lavorazione corrente
|
||||
m_nCurrMachiningId = nId ;
|
||||
return true ;
|
||||
@@ -722,6 +724,43 @@ MachMgr::AddMachining( const string& sName, int nMchType, const string& sTool)
|
||||
return nId ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
MachMgr::CopyMachining( const string& sName, const string& sSouName)
|
||||
{
|
||||
// recupero la lavorazione sorgente e la imposto come corrente
|
||||
int nSouId = GetOperationId( sSouName) ;
|
||||
if ( ! SetCurrMachining( nSouId))
|
||||
return GDB_ID_NULL ;
|
||||
// nessuna lavorazione corrente
|
||||
ResetCurrMachining() ;
|
||||
// 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 della lavorazione alla fine della fase corrente
|
||||
int nRefId = GetPhaseLastOperation( m_nCurrPhase) ;
|
||||
if ( nRefId == GDB_ID_NULL)
|
||||
return GDB_ID_NULL ;
|
||||
int nId = m_pGeomDB->Copy( nSouId, GDB_ID_NULL, nRefId, GDB_AFTER) ;
|
||||
if ( nId == GDB_ID_NULL)
|
||||
return GDB_ID_NULL ;
|
||||
// assegno il nome
|
||||
if ( ! m_pGeomDB->SetName( nId, sNewName)) {
|
||||
string sOut = "CopyMachining error : " + sNewName + " invalid name " ;
|
||||
LOG_INFO( GetEMkLogger(), sOut.c_str())
|
||||
m_pGeomDB->Erase( nId) ;
|
||||
return GDB_ID_NULL ;
|
||||
}
|
||||
// la dichiaro lavorazione corrente
|
||||
m_nCurrMachiningId = nId ;
|
||||
return nId ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::SetMachiningParam( int nType, bool bVal, bool* pbChanged)
|
||||
|
||||
Reference in New Issue
Block a user