b1fcb75e4f
- aggiunte funzioni di striping per trimming dei termoformati
310 lines
10 KiB
C++
310 lines
10 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2014-2014
|
|
//----------------------------------------------------------------------------
|
|
// File : LUA_Base.cpp Data : 27.09.14 Versione : 1.5i5
|
|
// Contenuto : Funzioni di base per LUA.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 27.09.14 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
//--------------------------- Include ----------------------------------------
|
|
#include "stdafx.h"
|
|
#include "EXE.h"
|
|
#include "LUA.h"
|
|
#include "LUA_Base.h"
|
|
#include "/EgtDev/Include/EXeExecutor.h"
|
|
#include "/EgtDev/Include/EGkLuaAux.h"
|
|
#include "/EgtDev/Include/EGnLuaMgr.h"
|
|
|
|
using namespace std ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
LuaInstallEgtFunctions( LuaMgr& LuaMgr)
|
|
{
|
|
if ( ! LuaInstallGeneral( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGeneral (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallUiUnits( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallUiUnits (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGeoBase( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGeoBase (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGeomDB( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGeomDB (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbCreate( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbCreate (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbCreateCurve( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbCreateCurve (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbCreateSurf( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbCreateSurf (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbCreateVol( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbCreateVol (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbModify( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbModify (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbModifyCurve( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbModifyCurve (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbModifySurf( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbModifySurf (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbModifyVol( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbModifyVol (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbGet( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbGet (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbGetPocketing( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbGetPocketing (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbGetCurve( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbGetCurve (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbGetSurf( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbGetSurf (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbGetVol( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbGetVol (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbPartLayer( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbPartLayer (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbObjects( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbObjects (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbObjSelection( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbObjSelection (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGdbObjAttribs( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGdbObjAttribs (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGeoSnap( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGeoSnap (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGeoTransform( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGeoTransform (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGeoDist( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGeoDist (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallGeoInters( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallGeoInters (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallCDeObjSolid( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallCDeObjSolid (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallTestObjSurface( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallTestObjSurface (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallMachMgr( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallMachMgr (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallMaxFiller( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallMaxFiller (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallNesting( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallNesting (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallScene( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallScene (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallPhoto( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallPhoto (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallPicture( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallPicture (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallImage( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallImage (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallExchange( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallExchange (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallBeamMgr( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallBeamMgr (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallPolynomialRoots( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallPolynomialRoots (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallShortestPath( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallShortestPath (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallMachiningOptimization( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallMachiningOptimization (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallCAvTool( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallCAvTool (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallRedis( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallRedis (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallBase64( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallBase64 (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
if ( ! LuaInstallTrimming( LuaMgr)) {
|
|
LOG_ERROR( GetLogger(), "Error in LuaInstallTrimming (LuaInstallEgtFunctions)")
|
|
return false ;
|
|
}
|
|
|
|
return true ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
// Static LuaMgr per EgtExecutor
|
|
//----------------------------------------------------------------------------
|
|
static LuaMgr s_LuaMgr ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
LuaInit( void)
|
|
{
|
|
// inizializzo l'interprete lua
|
|
if ( ! s_LuaMgr.Init())
|
|
return false ;
|
|
|
|
// carico le funzioni speciali
|
|
if ( ! LuaInstallEgtFunctions( s_LuaMgr))
|
|
return false ;
|
|
|
|
// recupero la versione di Lua
|
|
string sLua ;
|
|
if ( s_LuaMgr.GetVersion( sLua))
|
|
sLua += " interpreter started" ;
|
|
else
|
|
sLua = "Lua *.* interpreter started" ;
|
|
LOG_INFO( GetLogger(), sLua.c_str())
|
|
return true ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
LuaExit( void)
|
|
{
|
|
s_LuaMgr.Exit() ;
|
|
LOG_INFO( GetLogger(), "Lua interpreter closed")
|
|
return true ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
LuaMgr&
|
|
LuaGetLuaMgr( void)
|
|
{
|
|
return s_LuaMgr ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
LuaSetLuaLibsDir( const string& sDir)
|
|
{
|
|
return s_LuaMgr.SetLuaLibsDir( sDir) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
LuaRequire( const string& sFile)
|
|
{
|
|
return s_LuaMgr.Require( sFile) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
LuaResetGlobVar( const string& sVar)
|
|
{
|
|
return LuaResetGlobVar( s_LuaMgr.GetLuaState(), sVar) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
LuaCreateGlobTable( const string& sVar)
|
|
{
|
|
return LuaCreateGlobTable( s_LuaMgr.GetLuaState(), sVar) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
LuaExecLine( const string& sLine)
|
|
{
|
|
return s_LuaMgr.ExecLine( sLine) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
LuaExecFile( const string& sFile)
|
|
{
|
|
return s_LuaMgr.ExecFile( sFile) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
const string&
|
|
LuaGetLastError( void)
|
|
{
|
|
return s_LuaMgr.GetLastError() ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
const string&
|
|
LuaGetLuaLibsDir( void)
|
|
{
|
|
return s_LuaMgr.GetLuaLibsDir() ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
const string&
|
|
LuaGetLastRequire( void)
|
|
{
|
|
return s_LuaMgr.GetLastRequire() ;
|
|
}
|