From 6a06ca7290c3a76bdc9bcb117bd43ce180e78620 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 18 Jul 2017 07:18:45 +0000 Subject: [PATCH] EgtMachKernel 1.8g4 : - aggiunte funzioni GetLastMachGroup e GetPrevMachGroup. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes MachMgr.h | 2 ++ MachMgrMachGroups.cpp | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 9284f86c99e7243f309f79c88af1df43a1d2e392..edcbc71a9ab2e68f8887c4f0b0afd91fcd7954d2 100644 GIT binary patch delta 97 zcmewt{V#gMFE&P#&A-`fnHfzcKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUI`BbWdH delta 97 zcmewt{V#gMFE&Qw&A-`fnHh~IKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUD-Bai?9 diff --git a/MachMgr.h b/MachMgr.h index cec5c7a..19a41ed 100644 --- a/MachMgr.h +++ b/MachMgr.h @@ -81,6 +81,8 @@ class MachMgr : public IMachMgr int GetMachGroupCount( void) const override ; int GetFirstMachGroup( void) const override ; int GetNextMachGroup( int nId) const override ; + int GetLastMachGroup( void) const override ; + int GetPrevMachGroup( int nId) const override ; bool GetMachGroupNewName( std::string& sName) const override ; int AddMachGroup( const std::string& sName, const std::string& sMachineName) override ; bool RemoveMachGroup( int nId) override ; diff --git a/MachMgrMachGroups.cpp b/MachMgrMachGroups.cpp index eb33df3..3235eca 100644 --- a/MachMgrMachGroups.cpp +++ b/MachMgrMachGroups.cpp @@ -61,6 +61,33 @@ MachMgr::GetNextMachGroup( int nId) const return nNextId ; } +//---------------------------------------------------------------------------- +int +MachMgr::GetLastMachGroup( void) const +{ + // verifica del gruppo base per le lavorazioni + if ( ! VerifyMachBase()) + return GDB_ID_NULL ; + // recupero l'ultimo sottogruppo + int nId = m_pGeomDB->GetLastGroupInGroup( m_nMachBaseId) ; + return nId ; +} + +//---------------------------------------------------------------------------- +int +MachMgr::GetPrevMachGroup( int nId) const +{ + // verifica del gruppo base per le lavorazioni + if ( ! VerifyMachBase()) + return GDB_ID_NULL ; + // verifico che il gruppo ricevuto sia corretto + if ( m_pGeomDB->GetParentId( nId) != m_nMachBaseId) + return GDB_ID_NULL ; + // recupero il precedente sottogruppo + int nNextId = m_pGeomDB->GetPrevGroup( nId) ; + return nNextId ; +} + //---------------------------------------------------------------------------- bool MachMgr::GetMachGroupNewName( string& sName) const