diff --git a/EXE_MachMgr.cpp b/EXE_MachMgr.cpp index 0516196..4d7e2c5 100644 --- a/EXE_MachMgr.cpp +++ b/EXE_MachMgr.cpp @@ -1131,6 +1131,16 @@ ExeTdbGetCurrToolParam( int nType, string& sVal) return pGseCtx->m_pMachMgr->TdbGetCurrToolParam( nType, sVal) ; } +//----------------------------------------------------------------------------- +bool +ExeTdbReload( void) +{ + GseContext* pGseCtx = GetCurrGseContext() ; + VERIFY_CTX_MACHMGR( pGseCtx, false) + // ricarico il DB utensili (eventuali modifiche dopo l'ultimo salvataggio vengono perse) + return pGseCtx->m_pMachMgr->TdbReload() ; +} + //----------------------------------------------------------------------------- bool ExeTdbSave( void) @@ -1363,6 +1373,16 @@ ExeMdbGetGeneralParam( int nType, double& dVal) return pGseCtx->m_pMachMgr->MdbGetGeneralParam( nType, dVal) ; } +//----------------------------------------------------------------------------- +bool +ExeMdbReload( void) +{ + GseContext* pGseCtx = GetCurrGseContext() ; + VERIFY_CTX_MACHMGR( pGseCtx, false) + // ricarico il DB lavorazioni (eventuali modifiche dopo l'ultimo salvataggio vengono perse) + return pGseCtx->m_pMachMgr->MdbReload() ; +} + //----------------------------------------------------------------------------- bool ExeMdbSave( void) @@ -1682,6 +1702,16 @@ ExeChangeOperationPhase( int nId, int nNewPhase) return bOk ; } +//----------------------------------------------------------------------------- +int +ExeGetPhaseLastOperation( int nPhase) +{ + GseContext* pGseCtx = GetCurrGseContext() ; + VERIFY_CTX_MACHMGR( pGseCtx, false) + // recupero l'ultima operazione della fase indicata + return pGseCtx->m_pMachMgr->GetPhaseLastOperation( nPhase) ; +} + //----------------------------------------------------------------------------- bool ExeRemoveOperationHome( int nId) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 0fc7f19..450fe8b 100644 Binary files a/EgtExecutor.rc and b/EgtExecutor.rc differ diff --git a/LUA_MachMgr.cpp b/LUA_MachMgr.cpp index 4d9a0ab..5a0cc51 100644 --- a/LUA_MachMgr.cpp +++ b/LUA_MachMgr.cpp @@ -1213,13 +1213,25 @@ LuaTdbGetCurrToolParam( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaTdbReload( lua_State* L) +{ + // nessun parametro + LuaClearStack( L) ; + // ricarico il DB utensili (eventuali modifiche dopo l'ultimo salvataggio vengono perse) + bool bOk = ExeTdbReload() ; + LuaSetParam( L, bOk) ; + return 1 ; +} + //------------------------------------------------------------------------------- static int LuaTdbSave( lua_State* L) { // nessun parametro LuaClearStack( L) ; - // lancio salvataggio + // lancio salvataggio DB utensili bool bOk = ExeTdbSave() ; LuaSetParam( L, bOk) ; return 1 ; @@ -1503,6 +1515,18 @@ LuaMdbGetGeneralParam( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaMdbReload( lua_State* L) +{ + // nessun parametro + LuaClearStack( L) ; + // ricarico il DB lavorazioni (eventuali modifiche dopo l'ultimo salvataggio vengono perse) + bool bOk = ExeMdbReload() ; + LuaSetParam( L, bOk) ; + return 1 ; +} + //------------------------------------------------------------------------------- static int LuaMdbSave( lua_State* L) @@ -2838,6 +2862,7 @@ LuaInstallMachMgr( LuaMgr& luaMgr) bOk = bOk && luaMgr.RegisterFunction( "EgtTdbIsCurrToolModified", LuaTdbIsCurrToolModified) ; bOk = bOk && luaMgr.RegisterFunction( "EgtTdbSetCurrToolParam", LuaTdbSetCurrToolParam) ; bOk = bOk && luaMgr.RegisterFunction( "EgtTdbGetCurrToolParam", LuaTdbGetCurrToolParam) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtTdbReload", LuaTdbReload) ; bOk = bOk && luaMgr.RegisterFunction( "EgtTdbSave", LuaTdbSave) ; // Machinings database bOk = bOk && luaMgr.RegisterFunction( "EgtMdbGetMachiningNewName", LuaMdbGetMachiningNewName) ; @@ -2854,6 +2879,7 @@ LuaInstallMachMgr( LuaMgr& luaMgr) bOk = bOk && luaMgr.RegisterFunction( "EgtMdbGetCurrMachiningParam", LuaMdbGetCurrMachiningParam) ; bOk = bOk && luaMgr.RegisterFunction( "EgtMdbSetGeneralParam", LuaMdbSetGeneralParam) ; bOk = bOk && luaMgr.RegisterFunction( "EgtMdbGetGeneralParam", LuaMdbGetGeneralParam) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtMdbReload", LuaMdbReload) ; bOk = bOk && luaMgr.RegisterFunction( "EgtMdbSave", LuaMdbSave) ; // Operations bOk = bOk && luaMgr.RegisterFunction( "EgtGetFirstOperation", LuaGetFirstOperation) ;