EgtInterface 1.6e2 :
- esecutore e lua scorporato in EgtExecutor.
This commit is contained in:
+4
-76
@@ -14,17 +14,9 @@
|
||||
//--------------------------- Include ----------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include "API.h"
|
||||
#include "API_Macro.h"
|
||||
#include "DllGraphics.h"
|
||||
#include "DllExchange.h"
|
||||
#include "/EgtDev/Include/EInAPI.h"
|
||||
#include "/EgtDev/Include/EGkGdbExecutor.h"
|
||||
#include "/EgtDev/Include/EExExcExecutor.h"
|
||||
#include "/EgtDev/Include/EGrSceExecutor.h"
|
||||
#include "/EgtDev/Include/EGnStringUtils.h"
|
||||
#include "/EgtDev/Include/EXeExecutor.h"
|
||||
#include "/EgtDev/Include/EGnStringConverter.h"
|
||||
#include "/EgtDev/Include/EgtPointerOwner.h"
|
||||
#include <string>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
@@ -32,83 +24,19 @@ using namespace std ;
|
||||
BOOL
|
||||
__stdcall EgtInitTscExec( void)
|
||||
{
|
||||
GseContext* pGseCtx = GetCurrGseContext() ;
|
||||
VERIFY_CTX_GEOMDB( pGseCtx, FALSE)
|
||||
|
||||
// eventuale pulizia esecutore e suoi oggetti
|
||||
if ( pGseCtx->m_pTscExec != nullptr) {
|
||||
delete pGseCtx->m_pTscExec ;
|
||||
pGseCtx->m_pTscExec = nullptr ;
|
||||
}
|
||||
|
||||
// creo esecutore
|
||||
PtrOwner<ICmdParser> pCmdParser( CreateCmdParser()) ;
|
||||
VERIFY_NULL( Get( pCmdParser), "Error in CreateCmdParser", FALSE)
|
||||
|
||||
// creo oggetto per esecuzione funzioni di GeomKernel
|
||||
PtrOwner<IGdbExecutor> pGdbExec( CreateGdbExecutor()) ;
|
||||
VERIFY_NULL( Get( pGdbExec), "Error in CreateGdbExecutor", FALSE)
|
||||
pGdbExec->SetGeomDB( pGseCtx->m_pGeomDB) ;
|
||||
pCmdParser->SetExecutor( Release( pGdbExec)) ;
|
||||
|
||||
// eventuale creazione oggetto per esecuzione funzioni di Scene
|
||||
if ( pGseCtx->m_pScene != nullptr && IsLoadedGraphicsDll()) {
|
||||
PtrOwner<ISceExecutor> pSceExec( MyCreateSceExecutor()) ;
|
||||
VERIFY_NULL( Get( pSceExec), "Error in CreateSceExecutor", FALSE)
|
||||
pSceExec->SetScene( pGseCtx->m_pScene) ;
|
||||
pCmdParser->AddExecutor( Release( pSceExec)) ;
|
||||
}
|
||||
|
||||
// eventuale creazione oggetto per esecuzione funzioni di Exchange
|
||||
if ( IsLoadedExchangeDll()) {
|
||||
PtrOwner<IExcExecutor> pExcExec( MyCreateExcExecutor()) ;
|
||||
VERIFY_NULL( Get( pExcExec), "Error in CreateExcExecutor", FALSE)
|
||||
pExcExec->SetGeomDB( pGseCtx->m_pGeomDB) ;
|
||||
pCmdParser->AddExecutor( Release( pExcExec)) ;
|
||||
}
|
||||
|
||||
// completo inizializzazioni
|
||||
pCmdParser->Init() ;
|
||||
pGseCtx->m_pTscExec = Release( pCmdParser) ;
|
||||
|
||||
return TRUE ;
|
||||
return ( ExeInitTscExec() ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtTscExecFile( const wchar_t* wsFilePath)
|
||||
{
|
||||
// converto nome file
|
||||
string sFilePath = wstrztoA( wsFilePath) ;
|
||||
// emetto info
|
||||
string sInfo = "Exec File = " + sFilePath ;
|
||||
LOG_INFO( GetLogger(), sInfo.c_str())
|
||||
// eseguo
|
||||
return ( EgtTscExecFile( sFilePath) ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
EgtTscExecFile( const string& sFilePath)
|
||||
{
|
||||
ICmdParser* pTscExec = GetCurrTscExecutor() ;
|
||||
VERIFY_TSCEXEC( pTscExec, FALSE)
|
||||
|
||||
// imposto il direttorio dello script
|
||||
string sFileDir, sFileName ;
|
||||
SplitLast( sFilePath, "\\", sFileDir, sFileName) ;
|
||||
pTscExec->SetDirReplace( "<TSCDIR>", sFileDir) ;
|
||||
|
||||
// esecuzione script
|
||||
return pTscExec->Run( sFilePath) ;
|
||||
return ( ExeTscExecFile( wstrztoA( wsFilePath)) ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtTscExecLine( const wchar_t* wsLine)
|
||||
{
|
||||
ICmdParser* pTscExec = GetCurrTscExecutor() ;
|
||||
VERIFY_TSCEXEC( pTscExec, FALSE)
|
||||
// eseguo il comando
|
||||
return ( pTscExec->ExecLine( wstrztoA( wsLine)) ? TRUE : FALSE) ;
|
||||
return ( ExeTscExecLine( wstrztoA( wsLine)) ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user