From d117d268c41f927aa7a92c9a0460465ddbc493bd Mon Sep 17 00:00:00 2001 From: DarioS Date: Wed, 6 Jul 2022 17:45:16 +0200 Subject: [PATCH] EgtExecutor 2.4g1 : - aggiunta funzione Exe e Lua BeamGetSideData. --- EXE_BeamMgr.cpp | 11 +++++++++++ EgtExecutor.rc | Bin 18890 -> 18890 bytes LUA_BeamMgr.cpp | 27 +++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/EXE_BeamMgr.cpp b/EXE_BeamMgr.cpp index 6ef518f..2faa8a0 100644 --- a/EXE_BeamMgr.cpp +++ b/EXE_BeamMgr.cpp @@ -137,6 +137,17 @@ ExeBeamSetPartBox( double dLength, double dHeight, double dWidth, bool bUpdate) return pBeamMgr->SetPartBox( dLength, dHeight, dWidth, bUpdate) ; } +//----------------------------------------------------------------------------- +bool +ExeBeamGetSideData( int nSide, Frame3d& frRef, double& dLength, double& dWidth, double& dHeight) +{ + IBeamMgr* pBeamMgr = GetCurrBeamMgr() ; + VERIFY_BEAMMGR( pBeamMgr, false) + // recupero i dati della faccia indicata del pezzo corrente + ExeSetModified() ; + return pBeamMgr->GetSideData( nSide, frRef, dLength, dWidth, dHeight) ; +} + //----------------------------------------------------------------------------- int ExeBeamAddProcess( int nGroup, int nProc, int nSide, const string& sDes, int nProcId, diff --git a/EgtExecutor.rc b/EgtExecutor.rc index b3451d785ce88d2e8d9763a14f40857cd37c0d3c..e0ebc65fa8fe5d6e7a0b01d05f5adebbdee86aca 100644 GIT binary patch delta 97 zcmX>#neo(Q#tq-tSj`!97z{W6W^-m{Oy6wJwUh-ea-3=M2Ehu(^vU*Ishj(REMPLH U#lUL$rBKy2D8kgnDdngG0MgGLv;Y7A delta 97 zcmX>#neo(Q#tq-tSj`x87>qXmW^-m{OxtYFwUh-ea-3=M2Ehu(w8{2dshj(REMPLH U#lUL$rBKy2D8kgnDdngG0MZj3umAu6 diff --git a/LUA_BeamMgr.cpp b/LUA_BeamMgr.cpp index cc11cac..7ff6df6 100644 --- a/LUA_BeamMgr.cpp +++ b/LUA_BeamMgr.cpp @@ -143,6 +143,32 @@ LuaBeamSetPartBox( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaBeamGetSideData( lua_State* L) +{ + // 1 parametro : nSide + int nSide ; + LuaCheckParam( L, 1, nSide) + LuaClearStack( L) ; + // imposto le dimensioni al pezzo corrente + Frame3d frRef ; + double dLength, dWidth, dHeight ; + bool bOk = ExeBeamGetSideData( nSide, frRef, dLength, dWidth, dHeight) ; + // restituisco il risultato + if ( bOk) { + LuaSetParam( L, frRef) ; + LuaSetParam( L, dLength) ; + LuaSetParam( L, dWidth) ; + LuaSetParam( L, dHeight) ; + return 4 ; + } + else { + LuaSetParam( L) ; + return 1 ; + } +} + //------------------------------------------------------------------------------- static int LuaBeamAddProcess( lua_State* L) @@ -358,6 +384,7 @@ LuaInstallBeamMgr( LuaMgr& luaMgr) bOk = bOk && luaMgr.RegisterFunction( "EgtBeamSetPartName", LuaBeamSetPartName) ; bOk = bOk && luaMgr.RegisterFunction( "EgtBeamSetPartCount", LuaBeamSetPartCount) ; bOk = bOk && luaMgr.RegisterFunction( "EgtBeamSetPartBox", LuaBeamSetPartBox) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtBeamGetSideData", LuaBeamGetSideData) ; bOk = bOk && luaMgr.RegisterFunction( "EgtBeamAddProcess", LuaBeamAddProcess) ; bOk = bOk && luaMgr.RegisterFunction( "EgtBeamModifyProcess", LuaBeamModifyProcess) ; bOk = bOk && luaMgr.RegisterFunction( "EgtBeamEraseProcess", LuaBeamEraseProcess) ;