EgtExecutor 1.9k1 :

- aggiunta funzione Exe e Lua SetOperationName.
This commit is contained in:
Dario Sassi
2018-11-15 18:39:07 +00:00
parent 9d8c17d6b3
commit 1301f8d445
3 changed files with 29 additions and 1 deletions
+11 -1
View File
@@ -1741,13 +1741,23 @@ ExeGetOperationPhase( int nId)
return pMachMgr->GetOperationPhase( nId) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetOperationName( int nId, const string& sName)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false)
// assegno il nuovo nome alla operazione della macchinata corrente
return pMachMgr->SetOperationName( nId, sName) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetOperationName( int nId, string& sName)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false)
// recupero la fase di appartenenza della operazione della macchinata corrente
// recupero il nome della operazione della macchinata corrente
sName = pMachMgr->GetOperationName( nId) ;
return ( ! sName.empty()) ;
}
BIN
View File
Binary file not shown.
+18
View File
@@ -1961,6 +1961,23 @@ LuaGetOperationPhase( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaSetOperationName( lua_State* L)
{
// 2 parametri : nId, sName
int nId ;
LuaCheckParam( L, 1, nId)
string sName ;
LuaCheckParam( L, 2, sName)
LuaClearStack( L) ;
// assegno il nuovo nome all'operazione indicata della macchinata corrente
bool bOk = ExeSetOperationName( nId, sName) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetOperationName( lua_State* L)
@@ -3562,6 +3579,7 @@ LuaInstallMachMgr( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtGetPrevActiveOperation", LuaGetPrevActiveOperation) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetOperationType", LuaGetOperationType) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetOperationPhase", LuaGetOperationPhase) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetOperationName", LuaSetOperationName) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetOperationName", LuaGetOperationName) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetOperationId", LuaGetOperationId) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtIsOperationEmpty", LuaIsOperationEmpty) ;