EgtExecutor 1.8g3 :

- aggiunte a Exe e Lua funzioni GetLastMachGroup e GetPrevMachGroup.
This commit is contained in:
Dario Sassi
2017-07-18 07:16:41 +00:00
parent 96acc77e5c
commit 2cd3a34901
3 changed files with 58 additions and 2 deletions
+20
View File
@@ -162,6 +162,26 @@ ExeGetNextMachGroup( int nId)
return pMachMgr->GetNextMachGroup( nId) ;
}
//-----------------------------------------------------------------------------
int
ExeGetLastMachGroup( void)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL)
// recupero l'ultima macchinata
return pMachMgr->GetLastMachGroup() ;
}
//-----------------------------------------------------------------------------
int
ExeGetPrevMachGroup( int nId)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL)
// recupero la precedente macchinata
return pMachMgr->GetPrevMachGroup( nId) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetMachGroupNewName( string& sName)
BIN
View File
Binary file not shown.
+38 -2
View File
@@ -139,6 +139,40 @@ LuaGetNextMachGroup( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetLastMachGroup( lua_State* L)
{
// nessun parametro
LuaClearStack( L) ;
// recupero l'identificativo dell'ultima macchinata
int nId = ExeGetLastMachGroup() ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetPrevMachGroup( lua_State* L)
{
// 1 parametro : identificativo di una macchinata
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// recupero l'identificativo della precedente macchinata
int nNextId = ExeGetPrevMachGroup( nId) ;
// restituisco il risultato
if ( nNextId != GDB_ID_NULL)
LuaSetParam( L, nNextId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetMachGroupNewName( lua_State* L)
@@ -2916,12 +2950,12 @@ LuaVerifyOutstroke( lua_State* L)
bool bOk = ExeVerifyOutstroke( dX, dY, dZ, dAngA, dAngB, nStat) ;
// restituisco il risultato
if ( bOk) {
LuaSetParam( L, bOk) ;
LuaSetParam( L, ( nStat == 0)) ;
LuaSetParam( L, nStat) ;
return 2 ;
}
else {
LuaSetParam( L, bOk) ;
LuaSetParam( L, false) ;
return 1 ;
}
}
@@ -3260,6 +3294,8 @@ 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( "EgtGetLastMachGroup", LuaGetLastMachGroup) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetPrevMachGroup", LuaGetPrevMachGroup) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetMachGroupNewName", LuaGetMachGroupNewName) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtAddMachGroup", LuaAddMachGroup) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveMachGroup", LuaRemoveMachGroup) ;