//---------------------------------------------------------------------------- // EgalTech 2015-2015 //---------------------------------------------------------------------------- // File : LUA_Nesting.cpp Data : 08.09.15 Versione : 1.6i5 // Contenuto : Funzioni Nesting per LUA. // // // // Modifiche : 08.09.15 DS Creazione modulo. // // //---------------------------------------------------------------------------- //--------------------------- Include ---------------------------------------- #include "stdafx.h" #include "LUA.h" #include "/EgtDev/Include/EXeExecutor.h" using namespace std ; //------------------------------------------------------------------------------- static int LuaPackPart( lua_State* L) { // 7 parametri : Id, dXmin, dYmin, dXmax, dYmax, dOffs, bBottomUp int nId ; LuaCheckParam( L, 1, nId) double dXmin ; LuaCheckParam( L, 2, dXmin) double dYmin ; LuaCheckParam( L, 3, dYmin) double dXmax ; LuaCheckParam( L, 4, dXmax) double dYmax ; LuaCheckParam( L, 5, dYmax) double dOffs ; LuaCheckParam( L, 6, dOffs) bool bBottomUp ; LuaCheckParam( L, 7, bBottomUp) LuaClearStack( L) ; // recupero il numero di macchinate int nTot = ExePackPart( nId, dXmin, dYmin, dXmax, dYmax, dOffs, bBottomUp) ; // restituisco il risultato LuaSetParam( L, nTot) ; return 1 ; } //------------------------------------------------------------------------------- static int LuaPackCluster( lua_State* L) { // 7 parametri : Id/s, dXmin, dYmin, dXmax, dYmax, dOffs, bBottomUp INTVECTOR vIds ; LuaCheckParam( L, 1, vIds) double dXmin ; LuaCheckParam( L, 2, dXmin) double dYmin ; LuaCheckParam( L, 3, dYmin) double dXmax ; LuaCheckParam( L, 4, dXmax) double dYmax ; LuaCheckParam( L, 5, dYmax) double dOffs ; LuaCheckParam( L, 6, dOffs) bool bBottomUp ; LuaCheckParam( L, 7, bBottomUp) LuaClearStack( L) ; // recupero il numero di macchinate int nTot = ExePackCluster( vIds, dXmin, dYmin, dXmax, dYmax, dOffs, bBottomUp) ; // restituisco il risultato LuaSetParam( L, nTot) ; return 1 ; } //------------------------------------------------------------------------------- bool LuaInstallNesting( LuaMgr& luaMgr) { bool bOk = ( &luaMgr != nullptr) ; bOk = bOk && luaMgr.RegisterFunction( "EgtPackPart", LuaPackPart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtPackCluster", LuaPackCluster) ; return bOk ; }