EgtMachKernel 1.6o4 :

- aggiunte lavorazioni di sgrossatura e finitura con lama di cornici lineari
- al caricamento, se gruppo macchinata errato, lo sposto in un gruppo di errore anzichè cancellarlo
- aggiunta GetRawGlobBox.
This commit is contained in:
Dario Sassi
2016-04-06 06:30:52 +00:00
parent f1b037db13
commit 2c8c8457a2
21 changed files with 4072 additions and 25 deletions
+46 -10
View File
@@ -17,9 +17,7 @@
#include "MachMgr.h"
#include "MachConst.h"
#include "Disposition.h"
#include "Drilling.h"
#include "Sawing.h"
#include "Milling.h"
#include "MachiningCreate.h"
#include "/EgtDev/Include/EMkOperationConst.h"
#include "/EgtDev/Include/EGkUserObjFactory.h"
#include "/EgtDev/Include/EGkGdbIterator.h"
@@ -172,6 +170,10 @@ MachMgr::GetOperationType( int nId) const
return OPER_SAWING ;
else if ( sUserObj == USEROBJ_GETNAME( Milling))
return OPER_MILLING ;
else if ( sUserObj == USEROBJ_GETNAME( SawRoughing))
return OPER_SAWROUGHING ;
else if ( sUserObj == USEROBJ_GETNAME( SawFinishing))
return OPER_SAWFINISHING ;
else
return OPER_NULL ;
}
@@ -562,7 +564,7 @@ MachMgr::GetCurrMachining( void) const
//----------------------------------------------------------------------------
int
MachMgr::AddMachining( const string& sName, const std::string& sMachining)
MachMgr::AddMachining( const string& sName, const string& sMachining)
{
// nessuna lavorazione corrente
m_nCurrMachiningId = GDB_ID_NULL ;
@@ -593,12 +595,7 @@ MachMgr::AddMachining( const string& sName, const std::string& sMachining)
// assegno il nome
m_pGeomDB->SetName( nId, sNewName) ;
// installo il gestore della lavorazione
Machining* pMch = nullptr ;
switch ( nMchType) {
case MT_DRILLING : pMch = new( nothrow) Drilling ; break ;
case MT_SAWING : pMch = new( nothrow) Sawing ; break ;
case MT_MILLING : pMch = new( nothrow) Milling ; break ;
}
Machining* pMch = CreateMachining( nMchType) ;
m_pGeomDB->SetUserObj( nId, pMch) ;
if ( pMch == nullptr || ! pMch->Init( this) ||
! pMch->SetPhase( m_nCurrPhase) || ! pMch->Prepare( sMachining)) {
@@ -612,6 +609,45 @@ MachMgr::AddMachining( const string& sName, const std::string& sMachining)
return nId ;
}
//----------------------------------------------------------------------------
int
MachMgr::AddMachining( const string& sName, int nMchType, const string& sTool)
{
// nessuna lavorazione corrente
m_nCurrMachiningId = GDB_ID_NULL ;
// recupero il gestore delle lavorazioni della macchina corrente
MachiningsMgr* pMMgr = GetCurrMachiningsMgr() ;
if ( pMMgr == nullptr)
return GDB_ID_NULL ;
// 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
Machining* pMch = CreateMachining( nMchType) ;
m_pGeomDB->SetUserObj( nId, pMch) ;
if ( pMch == nullptr || ! pMch->Init( this) ||
! pMch->SetPhase( m_nCurrPhase) || ! pMch->SetParam( MPA_TOOL, sTool)) {
string sOut = "AddMachining error : " + GetMachiningTitle( nMchType) + "/" + sTool + " on " + sName ;
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)