EgtExecutor 2.1g4 :

- aggiunte funzioni lua EgtSetVal e EgtGetVal (imposto e leggo su stringa Key=Val)
- aggiunta funzione lua EgtSimulate (simulazione in cieco per verifica collisioni e corse)
- aggiunte funzioni ExeSetEnableUI e ExeGetEnableUI per disabilitare e riabilitare aggiornamenti interfaccia utente.
This commit is contained in:
Dario Sassi
2019-07-22 07:45:37 +00:00
parent fa333e3e57
commit 407cfaa87d
7 changed files with 264 additions and 24 deletions
+31 -5
View File
@@ -47,6 +47,7 @@ static int s_nKeyType = KEY_LOCK_TYPE_ANY ;
static int s_nKeyExpDays = 0 ;
static int s_nKeyOptExpDays = 0 ;
static string s_sIniFile ;
static bool s_bEnableUI = true ;
static pfProcEvents s_pFunProcEvents = nullptr ;
static pfOutText s_pFunOutText = nullptr ;
static HWND s_hMainWnd = nullptr ;
@@ -61,6 +62,10 @@ ExeInit( int nDebug, const string& sLogFile, const string& sLogMsg)
// cancello eventuale vecchio logger
if ( s_pGenLog != nullptr)
delete s_pGenLog ;
// cancello riferimenti a funzioni installate
s_pFunProcEvents = nullptr ;
s_pFunOutText = nullptr ;
s_bEnableUI = true ;
// assegno il livello di debug
s_nDebugLev = max( nDebug, 0) ;
@@ -154,6 +159,7 @@ ExeExit( void)
// cancello riferimenti a funzioni installate
s_pFunProcEvents = nullptr ;
s_pFunOutText = nullptr ;
s_bEnableUI = true ;
// fine programma
LOG_DATETIME( s_pGenLog, " Exit")
@@ -437,10 +443,30 @@ ExeGetMemoryInfo( string& sMem)
//-----------------------------------------------------------------------------
bool
ExeOutLog( const string& sMsg)
ExeOutLog( const string& sMsg, int nDebugLevel)
{
LOG_INFO( s_pGenLog, sMsg.c_str())
return ( s_pGenLog != nullptr) ;
if ( s_pGenLog == nullptr)
return false ;
if ( nDebugLevel == 0)
LOG_INFO( s_pGenLog, sMsg.c_str())
else if ( ExeGetDebugLevel() >= nDebugLevel)
LOG_DBG_INFO( s_pGenLog, sMsg.c_str())
return true ;
}
//-----------------------------------------------------------------------------
bool
ExeSetEnableUI( bool bEnableUI)
{
s_bEnableUI = bEnableUI ;
return true ;
}
//-----------------------------------------------------------------------------
bool
ExeGetEnableUI( void)
{
return s_bEnableUI ;
}
//-----------------------------------------------------------------------------
@@ -456,7 +482,7 @@ ExeSetProcessEvents( pfProcEvents pFun)
int
ExeProcessEvents( int nProg, int nPause)
{
if ( s_pFunProcEvents != nullptr)
if ( s_pFunProcEvents != nullptr && s_bEnableUI)
return s_pFunProcEvents( nProg, nPause) ;
else
return 0 ;
@@ -474,7 +500,7 @@ ExeSetOutText( pfOutText pFun)
bool
ExeOutText( const string& sText)
{
if ( s_pFunOutText != nullptr)
if ( s_pFunOutText != nullptr && s_bEnableUI)
return s_pFunOutText( sText) ;
else
return false ;