4bb71f5578
- EgtGraphics, EgtExchange ed EgtMachKernel sono caricabili opzionalmente.
59 lines
2.0 KiB
C++
59 lines
2.0 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2015-2015
|
|
//----------------------------------------------------------------------------
|
|
// File : API_MachMgr.cpp Data : 23.03.15 Versione : 1.6c8
|
|
// Contenuto : Funzioni Machining Manager per API.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 23.03.15 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
//--------------------------- Include ----------------------------------------
|
|
#include "stdafx.h"
|
|
#include "API.h"
|
|
#include "API_Macro.h"
|
|
#include "DllMachKernel.h"
|
|
#include "/EgtDev/Include/EInAPI.h"
|
|
#include "/EgtDev/Include/EGnStringConverter.h"
|
|
#include "/EgtDev/Include/EgtPointerOwner.h"
|
|
|
|
using namespace std ;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtInitMachMgr( void)
|
|
{
|
|
GseContext* pGseCtx = GetCurrGseContext() ;
|
|
VERIFY_CTX( pGseCtx, FALSE)
|
|
// inizializzazione gestore lavorazioni
|
|
PtrOwner<IMachMgr> pMachMgr( MyCreateMachMgr()) ;
|
|
VERIFY_NULL( Get( pMachMgr), "Error in CreateMachMgr", FALSE)
|
|
pMachMgr->Init( pGseCtx->m_pGeomDB) ;
|
|
// assegno il gestore al contesto
|
|
pGseCtx->m_pMachMgr = Release( pMachMgr) ;
|
|
// log avvio Machining Manager
|
|
string sLog = "MachMgr started " ;
|
|
LOG_INFO( GetLogger(), sLog.c_str())
|
|
return TRUE ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtAddMachGroup( const wchar_t* wsName, const wchar_t* wsMachineName)
|
|
{
|
|
return EgtAddMachGroup( wstrztoA( wsName), wstrztoA( wsMachineName)) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
int
|
|
EgtAddMachGroup( const string& sName, const string& sMachineName)
|
|
{
|
|
IMachMgr* pMachMgr = GetCurrMachMgr() ;
|
|
VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL)
|
|
// aggiungo la macchinata (gruppo di lavorazione)
|
|
return pMachMgr->AddMachGroup( sName, sMachineName) ;
|
|
}
|