EgtMachKernel 1.6k10 :

- sistemazioni varie in grezzi, lavorazioni, ....
This commit is contained in:
Dario Sassi
2015-12-07 08:03:39 +00:00
parent 5eb5cb387f
commit 42e1a696a1
33 changed files with 1354 additions and 277 deletions
+12 -7
View File
@@ -202,6 +202,9 @@ MachMgr::RemoveOperation( int nId)
// verifico sia una Operazione
if ( GetOperationType( nId) == OPER_NULL)
return false ;
// se lavorazione corrente, resetto
if ( m_nCurrMachiningId == nId)
m_nCurrMachiningId = GDB_ID_NULL ;
// eseguo la rimozione
m_pGeomDB->Erase( nId) ;
return true ;
@@ -302,14 +305,19 @@ MachMgr::GetCurrMachining( void) const
int
MachMgr::AddMachining( const string& sName, const std::string& sMachining)
{
// 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 tipo di lavorazione
const MachiningData* pMd = pMMgr->GetMachining( sMachining) ;
if ( pMd == nullptr)
if ( pMd == nullptr) {
string sOut = "AddMachining error : " + sMachining + " not found" ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
return GDB_ID_NULL ;
}
int nMchType = pMd->GetType() ;
// recupero il gruppo delle operazioni nella macchinata corrente
int nOperGrpId = GetCurrOperId() ;
@@ -332,13 +340,10 @@ MachMgr::AddMachining( const string& sName, const std::string& sMachining)
case MT_SAWING : pMch = new( nothrow) Sawing ; break ;
case MT_MILLING : pMch = new( nothrow) Milling ; break ;
}
if ( pMch == nullptr) {
m_pGeomDB->Erase( nId) ;
return GDB_ID_NULL ;
}
m_pGeomDB->SetUserObj( nId, pMch) ;
pMch->Init( this) ;
if ( ! pMch->Prepare( sMachining)) {
if ( pMch == nullptr || ! pMch->Init( this) || ! pMch->Prepare( sMachining)) {
string sOut = "AddMachining error : " + sMachining + " on " + sName ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
m_pGeomDB->Erase( nId) ;
return GDB_ID_NULL ;
}