diff --git a/EXE_Lua.cpp b/EXE_Lua.cpp index b01132a..711cc9d 100644 --- a/EXE_Lua.cpp +++ b/EXE_Lua.cpp @@ -18,7 +18,8 @@ #include "AuxTools.h" #include "/EgtDev/Include/EXeExecutor.h" #include "/EgtDev/Include/EXeCmdLogOff.h" -#include "/EgtDev/Include/EGnStringUtils.h" +#include "/EgtDev/Include/EGkLuaAux.h" +#include "/EgtDev/Include/EGkStringUtils3d.h" #include "/EgtDev/Include/EgtStringConverter.h" using namespace std ; @@ -95,6 +96,38 @@ ExeLuaSetGlobStringVar( const string& sVar, const string& sVal) return bOk ; } +//----------------------------------------------------------------------------- +bool +ExeLuaSetGlobVectorVar( const string& sVar, const Vector3d& vtVal) +{ + // assegno il valore della variabile + bool bOk = LuaSetGlobVar( sVar, vtVal) ; + // se richiesto, salvo il comando Lua + if ( IsCmdLog()) { + string sLua = sVar + "='" + ToString( vtVal) + "'" + + " -- Ok=" + ToString( bOk) ; + LOG_INFO( GetCmdLogger(), sLua.c_str()) ; + } + // restituisco il risultato + return bOk ; +} + +//----------------------------------------------------------------------------- +bool +ExeLuaSetGlobPointVar( const string& sVar, const Point3d& ptVal) +{ + // assegno il valore della variabile + bool bOk = LuaSetGlobVar( sVar, ptVal) ; + // se richiesto, salvo il comando Lua + if ( IsCmdLog()) { + string sLua = sVar + "='" + ToString( ptVal) + "'" + + " -- Ok=" + ToString( bOk) ; + LOG_INFO( GetCmdLogger(), sLua.c_str()) ; + } + // restituisco il risultato + return bOk ; +} + //----------------------------------------------------------------------------- bool ExeLuaGetGlobBoolVar( const string& sVar, bool* pbVal) @@ -139,6 +172,28 @@ ExeLuaGetGlobStringVar( const string& sVar, string& sVal) return LuaGetGlobVar( sVar, sVal) ; } +//----------------------------------------------------------------------------- +bool +ExeLuaGetGlobVectorVar( const string& sVar, Vector3d& vtVal) +{ + // verifico parametro di ritorno + if ( &vtVal == nullptr) + return false ; + // recupero il valore della variabile + return LuaGetGlobVar( sVar, vtVal) ; +} + +//----------------------------------------------------------------------------- +bool +ExeLuaGetGlobPointVar( const string& sVar, Point3d& ptVal) +{ + // verifico parametro di ritorno + if ( &ptVal == nullptr) + return false ; + // recupero il valore della variabile + return LuaGetGlobVar( sVar, ptVal) ; +} + //----------------------------------------------------------------------------- bool ExeLuaResetGlobVar( const string& sVar) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 7ef3c8c..1e47122 100644 Binary files a/EgtExecutor.rc and b/EgtExecutor.rc differ