EgtMachKernel :

- aggiunta CopyMachining di MachMgr
- ora SetCurrMachining imposta la fase della lavorazione.
This commit is contained in:
Dario Sassi
2018-10-05 08:52:24 +00:00
parent 8c512a3527
commit 50ff73a757
10 changed files with 57 additions and 1 deletions
+39
View File
@@ -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)