EgtMachKernel 1.8h1 :
- migliorata gestione oggetti utente operazioni - aggiunta SimGetOperationInfo.
This commit is contained in:
+15
-20
@@ -13,30 +13,25 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Drilling.h"
|
||||
#include "Sawing.h"
|
||||
#include "Milling.h"
|
||||
#include "Pocketing.h"
|
||||
#include "SawRoughing.h"
|
||||
#include "SawFinishing.h"
|
||||
#include "GenMachining.h"
|
||||
#include "Chiseling.h"
|
||||
#include "Machining.h"
|
||||
#include "OperationConst.h"
|
||||
#include "/EgtDev/Include/EGkUserObjFactory.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Dal tipo numerico crea una istanza della classe
|
||||
inline Machining*
|
||||
CreateMachining( int nMchType)
|
||||
{
|
||||
switch ( nMchType) {
|
||||
case MT_DRILLING : return new( std::nothrow) Drilling ;
|
||||
case MT_SAWING : return new( std::nothrow) Sawing ;
|
||||
case MT_MILLING : return new( std::nothrow) Milling ;
|
||||
case MT_POCKETING : return new( std::nothrow) Pocketing ;
|
||||
// case MT_MORTISING : return new( std::nothrow) Mortising ;
|
||||
case MT_SAWROUGHING : return new( std::nothrow) SawRoughing ;
|
||||
case MT_SAWFINISHING : return new( std::nothrow) SawFinishing ;
|
||||
case MT_GENMACHINING : return new( std::nothrow) GenMachining ;
|
||||
case MT_CHISELING : return new( std::nothrow) Chiseling ;
|
||||
}
|
||||
return nullptr ;
|
||||
// verifico sia richiesto un oggetto utente di tipo lavorazione
|
||||
if ( ! IsValidMachiningType( nMchType))
|
||||
return false ;
|
||||
// creo l'oggetto
|
||||
IUserObj* pUsrObj = USEROBJ_CREATE( GetOperationClass( nMchType)) ;
|
||||
if ( pUsrObj == nullptr)
|
||||
return false ;
|
||||
// lo converto a lavorazione
|
||||
Machining* pMch = GetMachining( pUsrObj) ;
|
||||
if ( pMch == nullptr)
|
||||
delete pUsrObj ;
|
||||
return pMch ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user