EgtExecutor 1.8b1 :

- aggiunte ExeGetLastMachMgrErrorId e ExeGetLastMachMgrErrorString
- aggiunta in Lua EgtGetLastMachMgrError.
This commit is contained in:
Dario Sassi
2017-02-04 18:42:14 +00:00
parent 841816e3ce
commit 79a076aa52
3 changed files with 41 additions and 0 deletions
+22
View File
@@ -66,6 +66,28 @@ ExeInsertMachMgr( int nInsGrp)
return pMachMgr->Insert( nInsGrp) ;
}
//-----------------------------------------------------------------------------
// Errors
//-----------------------------------------------------------------------------
int
ExeGetLastMachMgrErrorId( void)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, 1)
// restituisco l'errore
return pMachMgr->GetLastErrorId() ;
}
//-----------------------------------------------------------------------------
string
ExeGetLastMachMgrErrorString( void)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, "MachMgr invalid")
// restituisco l'errore
return pMachMgr->GetLastErrorString() ;
}
//-----------------------------------------------------------------------------
// Machines
//-----------------------------------------------------------------------------
BIN
View File
Binary file not shown.
+19
View File
@@ -22,6 +22,23 @@
using namespace std ;
//-------------------------------------------------------------------------------
// Errors
//-------------------------------------------------------------------------------
static int
LuaGetLastMachMgrError( lua_State* L)
{
// nessun parametro
LuaClearStack( L) ;
// recupero identificativo e stringa dell'errore
int nErr = ExeGetLastMachMgrErrorId() ;
string sErr = ( nErr != 0 ? ExeGetLastMachMgrErrorString() : "") ;
// restituisco il risultato
LuaSetParam( L, nErr) ;
LuaSetParam( L, sErr) ;
return 2 ;
}
//-------------------------------------------------------------------------------
// Machines
//-------------------------------------------------------------------------------
@@ -2964,6 +2981,8 @@ bool
LuaInstallMachMgr( LuaMgr& luaMgr)
{
bool bOk = ( &luaMgr != nullptr) ;
// Errors
bOk = bOk && luaMgr.RegisterFunction( "EgtGetLastMachMgrError", LuaGetLastMachMgrError) ;
// Machines
bOk = bOk && luaMgr.RegisterFunction( "EgtSetCurrMachine", LuaSetCurrMachine) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetCurrMachineName", LuaGetCurrMachineName) ;