EgtExecutor :
- aggiunte funzioni exe e lua BeamCalcAllSolids e BeamShowAllSolids.
This commit is contained in:
@@ -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)
|
||||
|
||||
+6
-6
@@ -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) ;
|
||||
|
||||
+41
-3
@@ -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) ;
|
||||
|
||||
Reference in New Issue
Block a user