From 0a5fd7262baf04f7d0409b2414ff288fa3bc094d Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 13 Oct 2025 08:49:01 +0200 Subject: [PATCH] EgtExecutor : - aggiunte funzioni exe e lua BeamCalcAllSolids e BeamShowAllSolids. --- EXE_BeamMgr.cpp | 38 ++++++++++++++++++++++++++++++++++++++ EXE_General.cpp | 12 ++++++------ LUA_BeamMgr.cpp | 44 +++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 85 insertions(+), 9 deletions(-) diff --git a/EXE_BeamMgr.cpp b/EXE_BeamMgr.cpp index fa69a4a..6c558f3 100644 --- a/EXE_BeamMgr.cpp +++ b/EXE_BeamMgr.cpp @@ -216,6 +216,44 @@ ExeBeamEnableProcess( int nGeomId, bool bEnable, bool bUpdate) return pBeamMgr->EnableProcess( nGeomId, bEnable, bUpdate) ; } +//----------------------------------------------------------------------------- +bool +ExeBeamCalcAllSolids( bool bShow, bool bRecalc) +{ + IBeamMgr* pBeamMgr = GetCurrBeamMgr() ; + VERIFY_BEAMMGR( pBeamMgr, false) + // disabilito possibilità di alterare il flag di modifica + bool bOldEnabModif = ExeGetEnableModified() ; + if ( bOldEnabModif) + ExeDisableModified() ; + // calcolo i solidi di tutte le travi + bool bOk = pBeamMgr->CalcAllSolids( bShow, bRecalc, ExeProcessEvents) ; + // ripristino possibilità di alterare il flag di modifica + if ( bOldEnabModif) + ExeEnableModified() ; + // risultato + return bOk ; +} + +//----------------------------------------------------------------------------- +bool +ExeBeamShowAllSolids( bool bShow) +{ + IBeamMgr* pBeamMgr = GetCurrBeamMgr() ; + VERIFY_BEAMMGR( pBeamMgr, false) + // disabilito possibilità di alterare il flag di modifica + bool bOldEnabModif = ExeGetEnableModified() ; + if ( bOldEnabModif) + ExeDisableModified() ; + // aggiorno stato di visualizzazione dei solidi di tutte le travi + bool bOk = pBeamMgr->ShowAllSolids( bShow, ExeProcessEvents) ; + // ripristino possibilità di alterare il flag di modifica + if ( bOldEnabModif) + ExeEnableModified() ; + // risultato + return bOk ; +} + //----------------------------------------------------------------------------- bool ExeBeamCalcSolid( int nPartId, bool bRecalc) diff --git a/EXE_General.cpp b/EXE_General.cpp index add0ee0..6cb84a2 100644 --- a/EXE_General.cpp +++ b/EXE_General.cpp @@ -59,9 +59,9 @@ static string s_sNestKey ; static string s_sLockId ; static string s_sIniFile ; static bool s_bEnableUI = true ; -static pfOnTerminateProcess s_pFunOnTerminateProcess = nullptr ; -static pfProcEvents s_pFunProcEvents = nullptr ; -static pfOutText s_pFunOutText = nullptr ; +static psfOnTerminateProcess s_pFunOnTerminateProcess = nullptr ; +static psfProcEvents s_pFunProcEvents = nullptr ; +static psfOutText s_pFunOutText = nullptr ; static HWND s_hMainWnd = nullptr ; static string s_sTempDir ; @@ -210,7 +210,7 @@ ExeExit( void) //----------------------------------------------------------------------------- bool -ExeSetOnTerminateProcess( pfOnTerminateProcess pFun) +ExeSetOnTerminateProcess( psfOnTerminateProcess pFun) { s_pFunOnTerminateProcess = pFun ; return ( pFun != nullptr) ; @@ -689,7 +689,7 @@ ExeMessageBox( const string& sText, const string& sTitle, int nType) //----------------------------------------------------------------------------- bool -ExeSetProcessEvents( pfProcEvents pFun) +ExeSetProcessEvents( psfProcEvents pFun) { s_pFunProcEvents = pFun ; SetEGkProcessEvents( pFun) ; @@ -708,7 +708,7 @@ ExeProcessEvents( int nProg, int nPause) //----------------------------------------------------------------------------- bool -ExeSetOutText( pfOutText pFun) +ExeSetOutText( psfOutText pFun) { s_pFunOutText = pFun ; return ( pFun != nullptr) ; diff --git a/LUA_BeamMgr.cpp b/LUA_BeamMgr.cpp index a5888ce..45c69fa 100644 --- a/LUA_BeamMgr.cpp +++ b/LUA_BeamMgr.cpp @@ -151,7 +151,7 @@ LuaBeamGetSideData( lua_State* L) int nSide ; LuaCheckParam( L, 1, nSide) LuaClearStack( L) ; - // imposto le dimensioni al pezzo corrente + // restituisce i dati della faccia indicata del pezzo corrente Frame3d frRef ; double dLength, dWidth, dHeight ; bool bOk = ExeBeamGetSideData( nSide, frRef, dLength, dWidth, dHeight) ; @@ -173,7 +173,7 @@ LuaBeamGetSideData( lua_State* L) static int LuaBeamAddProcess( lua_State* L) { - // 9 o 10 o 11 o 12 parametri : nGroup, nProc, nSide, sDes, nProcId, vdPar, sPar [, nCrv, nCrv2] [, bUpdate] + // 9 o 10 o 11 o 12 parametri : nGroup, nProc, nSide, sDes, nProcId, vdPar, sPar, vsUAtt [, nCrv] [, nCrv2] [, bUpdate] int nGroup ; LuaCheckParam( L, 1, nGroup) int nProc ; @@ -198,6 +198,8 @@ LuaBeamAddProcess( lua_State* L) if ( LuaGetParam( L, 10, nCrvId) && LuaGetParam( L, 11, nCrv2Id)) LuaGetParam( L, 12, bUpdate) ; + else if ( LuaGetParam( L, 10, nCrvId)) + LuaGetParam( L, 11, bUpdate) ; else LuaGetParam( L, 10, bUpdate) ; LuaClearStack( L) ; @@ -215,7 +217,7 @@ LuaBeamAddProcess( lua_State* L) static int LuaBeamModifyProcess( lua_State* L) { - // 10 o 11 o 12 o 13 parametri : nGeomId, nGroup, nProc, nSide, sDes, nProcId, vdPar, sPar [, nCrv, nCrv2] [, bUpdate] + // 10 o 11 o 12 o 13 parametri : nGeomId, nGroup, nProc, nSide, sDes, nProcId, vdPar, sPar, vsUAtt [, nCrv, nCrv2] [, bUpdate] int nGeomId ; LuaCheckParam( L, 1, nGeomId) int nGroup ; @@ -242,6 +244,8 @@ LuaBeamModifyProcess( lua_State* L) if ( LuaGetParam( L, 11, nCrvId) && LuaGetParam( L, 12, nCrv2Id)) LuaGetParam( L, 13, bUpdate) ; + else if ( LuaGetParam( L, 11, nCrvId)) + LuaGetParam( L, 12, bUpdate) ; else LuaGetParam( L, 11, bUpdate) ; LuaClearStack( L) ; @@ -291,6 +295,38 @@ LuaBeamEnableProcess( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaBeamCalcAllSolids( lua_State* L) +{ + // 1 o 2 parametri : bShow [,bRecalc] + bool bShow ; + LuaCheckParam( L, 1, bShow) + bool bRecalc = false ; + LuaGetParam( L, 2, bRecalc) ; + LuaClearStack( L) ; + // eseguo calcolo dei solidi di tutte le travi + bool bOk = ExeBeamCalcAllSolids( bShow, bRecalc) ; + // restituisco il risultato + LuaSetParam( L, bOk) ; + return 1 ; +} + +//------------------------------------------------------------------------------- +static int +LuaBeamShowAllSolids( lua_State* L) +{ + // 1 parametro : bShow + bool bShow ; + LuaCheckParam( L, 1, bShow) + LuaClearStack( L) ; + // aggiorno stato di visualizzazione dei solidi di tutte le travi + bool bOk = ExeBeamShowAllSolids( bShow) ; + // restituisco il risultato + LuaSetParam( L, bOk) ; + return 1 ; +} + //------------------------------------------------------------------------------- static int LuaBeamCalcSolid( lua_State* L) @@ -393,6 +429,8 @@ LuaInstallBeamMgr( LuaMgr& luaMgr) bOk = bOk && luaMgr.RegisterFunction( "EgtBeamModifyProcess", LuaBeamModifyProcess) ; bOk = bOk && luaMgr.RegisterFunction( "EgtBeamEraseProcess", LuaBeamEraseProcess) ; bOk = bOk && luaMgr.RegisterFunction( "EgtBeamEnableProcess", LuaBeamEnableProcess) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtBeamCalcAllSolids", LuaBeamCalcAllSolids) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtBeamShowAllSolids", LuaBeamShowAllSolids) ; bOk = bOk && luaMgr.RegisterFunction( "EgtBeamCalcSolid", LuaBeamCalcSolid) ; bOk = bOk && luaMgr.RegisterFunction( "EgtBeamGetSolid", LuaBeamGetSolid) ; bOk = bOk && luaMgr.RegisterFunction( "EgtBeamShowSolid", LuaBeamShowSolid) ;