EgtMachKernel :
- aggiunta CopyMachining di MachMgr - ora SetCurrMachining imposta la fase della lavorazione.
This commit is contained in:
@@ -79,6 +79,8 @@ Chiseling::Clone( void) const
|
||||
// eseguo copia dei dati
|
||||
if ( pChisel != nullptr) {
|
||||
try {
|
||||
pChisel->m_pMchMgr = m_pMchMgr ;
|
||||
pChisel->m_nPhase = m_nPhase ;
|
||||
pChisel->m_Params = m_Params ;
|
||||
pChisel->m_TParams = m_TParams ;
|
||||
}
|
||||
|
||||
@@ -79,6 +79,8 @@ Drilling::Clone( void) const
|
||||
// eseguo copia dei dati
|
||||
if ( pDri != nullptr) {
|
||||
try {
|
||||
pDri->m_pMchMgr = m_pMchMgr ;
|
||||
pDri->m_nPhase = m_nPhase ;
|
||||
pDri->m_Params = m_Params ;
|
||||
pDri->m_TParams = m_TParams ;
|
||||
}
|
||||
|
||||
@@ -238,6 +238,7 @@ class MachMgr : public IMachMgr
|
||||
// Operations : machinings
|
||||
int AddMachining( const std::string& sName, const std::string& sMachining) override ;
|
||||
int AddMachining( const std::string& sName, int nMchType, const std::string& sTool) override ;
|
||||
int CopyMachining( const std::string& sName, const std::string& sSouName) override ;
|
||||
bool SetCurrMachining( int nId) override ;
|
||||
bool ResetCurrMachining( void) override ;
|
||||
int GetCurrMachining( void) const override ;
|
||||
@@ -255,7 +256,7 @@ class MachMgr : public IMachMgr
|
||||
bool RemovePreviewMachiningTool( void) const override ;
|
||||
int PreviewMachiningTool( int nEntId, int nFlag) const override ;
|
||||
bool GetMachiningParam( int nType, bool& bVal) const override ;
|
||||
bool GetMachiningParam( int nType, int& dVal) const override ;
|
||||
bool GetMachiningParam( int nType, int& nVal) const override ;
|
||||
bool GetMachiningParam( int nType, double& dVal) const override ;
|
||||
bool GetMachiningParam( int nType, std::string& sVal) const override ;
|
||||
bool GetMachiningGeometry( SELVECTOR& vIds) const override ;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -77,6 +77,8 @@ Milling::Clone( void) const
|
||||
// eseguo copia dei dati
|
||||
if ( pMill != nullptr) {
|
||||
try {
|
||||
pMill->m_pMchMgr = m_pMchMgr ;
|
||||
pMill->m_nPhase = m_nPhase ;
|
||||
pMill->m_Params = m_Params ;
|
||||
pMill->m_TParams = m_TParams ;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,8 @@ Mortising::Clone( void) const
|
||||
// eseguo copia dei dati
|
||||
if ( pMort != nullptr) {
|
||||
try {
|
||||
pMort->m_pMchMgr = m_pMchMgr ;
|
||||
pMort->m_nPhase = m_nPhase ;
|
||||
pMort->m_Params = m_Params ;
|
||||
pMort->m_TParams = m_TParams ;
|
||||
}
|
||||
|
||||
@@ -86,6 +86,8 @@ Pocketing::Clone( void) const
|
||||
// eseguo copia dei dati
|
||||
if ( pPock != nullptr) {
|
||||
try {
|
||||
pPock->m_pMchMgr = m_pMchMgr ;
|
||||
pPock->m_nPhase = m_nPhase ;
|
||||
pPock->m_Params = m_Params ;
|
||||
pPock->m_TParams = m_TParams ;
|
||||
}
|
||||
|
||||
@@ -80,6 +80,8 @@ SawFinishing::Clone( void) const
|
||||
// eseguo copia dei dati
|
||||
if ( pSaw != nullptr) {
|
||||
try {
|
||||
pSaw->m_pMchMgr = m_pMchMgr ;
|
||||
pSaw->m_nPhase = m_nPhase ;
|
||||
pSaw->m_Params = m_Params ;
|
||||
pSaw->m_TParams = m_TParams ;
|
||||
}
|
||||
|
||||
@@ -73,6 +73,8 @@ SawRoughing::Clone( void) const
|
||||
// eseguo copia dei dati
|
||||
if ( pSaw != nullptr) {
|
||||
try {
|
||||
pSaw->m_pMchMgr = m_pMchMgr ;
|
||||
pSaw->m_nPhase = m_nPhase ;
|
||||
pSaw->m_Params = m_Params ;
|
||||
pSaw->m_TParams = m_TParams ;
|
||||
}
|
||||
|
||||
@@ -84,6 +84,8 @@ Sawing::Clone( void) const
|
||||
// eseguo copia dei dati
|
||||
if ( pSaw != nullptr) {
|
||||
try {
|
||||
pSaw->m_pMchMgr = m_pMchMgr ;
|
||||
pSaw->m_nPhase = m_nPhase ;
|
||||
pSaw->m_Params = m_Params ;
|
||||
pSaw->m_TParams = m_TParams ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user