diff --git a/EXE_MachMgr.cpp b/EXE_MachMgr.cpp index 75c4fbe..ca8470d 100644 --- a/EXE_MachMgr.cpp +++ b/EXE_MachMgr.cpp @@ -120,6 +120,16 @@ ExeGetNextMachGroup( int nId) return pMachMgr->GetNextMachGroup( nId) ; } +//----------------------------------------------------------------------------- +bool +ExeGetMachGroupNewName( string& sName) +{ + GseContext* pGseCtx = GetCurrGseContext() ; + VERIFY_CTX_MACHMGR( pGseCtx, false) + // recupero un nuovo nome a partire da quello passato + return pGseCtx->m_pMachMgr->GetMachGroupNewName( sName) ; +} + //----------------------------------------------------------------------------- int ExeAddMachGroup( const string& sName, const string& sMachineName) diff --git a/LUA_MachMgr.cpp b/LUA_MachMgr.cpp index 4d357ff..8eaeed6 100644 --- a/LUA_MachMgr.cpp +++ b/LUA_MachMgr.cpp @@ -105,6 +105,23 @@ LuaGetNextMachGroup( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaGetMachGroupNewName( lua_State* L) +{ + // 1 parametro : sName + string sName ; + LuaCheckParam( L, 1, sName) + LuaClearStack( L) ; + // verifico nome e se necessario lo modifico per renderlo nuovo + bool bOk = ExeGetMachGroupNewName( sName) ; + if ( bOk) + LuaSetParam( L, sName) ; + else + LuaSetParam( L) ; + return 1 ; +} + //------------------------------------------------------------------------------- static int LuaAddMachGroup( lua_State* L) @@ -2651,6 +2668,7 @@ LuaInstallMachMgr( LuaMgr& luaMgr) bOk = bOk && luaMgr.RegisterFunction( "EgtGetMachGroupCount", LuaGetMachGroupCount) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetFirstMachGroup", LuaGetFirstMachGroup) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetNextMachGroup", LuaGetNextMachGroup) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtGetMachGroupNewName", LuaGetMachGroupNewName) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAddMachGroup", LuaAddMachGroup) ; bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveMachGroup", LuaRemoveMachGroup) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetMachGroupName", LuaGetMachGroupName) ;