From 226640baeedce4e0d57325414efe50b82f250fb2 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 17 Jun 2019 15:39:18 +0000 Subject: [PATCH] EgtMachKernel : - aggiornato a 1007 versione DB lavorazioni per aggiunta Finitura Superficie - aggiunta gestione portautensili per utensili di tipo TT_MILL_NOTIP con specifica :MILL_NOTIP in dichiarazione file INI - si imposta ricalcolo anche alla cancellazione delle lavorazioni. --- MachMgrDBTools.cpp | 6 +++++- MachiningsMgr.cpp | 7 ++++--- Operation.cpp | 36 +++++++++++++++++++++++++++++++++--- Operation.h | 5 +++-- 4 files changed, 45 insertions(+), 9 deletions(-) diff --git a/MachMgrDBTools.cpp b/MachMgrDBTools.cpp index 178e6d6..f88e545 100644 --- a/MachMgrDBTools.cpp +++ b/MachMgrDBTools.cpp @@ -642,10 +642,14 @@ MachMgr::GetToolHolderPath( const string& sHeadName, int nExit, int nType) const string sKey2 = sKey + ":SAW_STD" ; sToolHolder = GetPrivateProfileStringUtf8( TOOLHOLDER_SEC.c_str(), sKey2.c_str(), "", sMachIni.c_str()) ; } - else if(nType == TT_SAW_FLAT) { + else if ( nType == TT_SAW_FLAT) { string sKey2 = sKey + ":SAW_FLAT" ; sToolHolder = GetPrivateProfileStringUtf8( TOOLHOLDER_SEC.c_str(), sKey2.c_str(), "", sMachIni.c_str()) ; } + else if ( nType == TT_MILL_NOTIP) { + string sKey2 = sKey + ":MILL_NOTIP" ; + sToolHolder = GetPrivateProfileStringUtf8( TOOLHOLDER_SEC.c_str(), sKey2.c_str(), "", sMachIni.c_str()) ; + } if ( sToolHolder.empty()) sToolHolder = GetPrivateProfileStringUtf8( TOOLHOLDER_SEC.c_str(), sKey.c_str(), "", sMachIni.c_str()) ; // Se non trovato, provo da sezione Tools di Ini di macchina diff --git a/MachiningsMgr.cpp b/MachiningsMgr.cpp index 5849a4e..264bda2 100644 --- a/MachiningsMgr.cpp +++ b/MachiningsMgr.cpp @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2015-2017 +// EgalTech 2015-2019 //---------------------------------------------------------------------------- -// File : MachiningsMgr.cpp Data : 17.05.17 Versione : 1.8e1 +// File : MachiningsMgr.cpp Data : 17.06.19 Versione : 2.1f2 // Contenuto : Implementazione gestore database lavorazioni. // // @@ -10,6 +10,7 @@ // 13.07.16 DS Agg. gestione SplitArcs (MF_CURR_VER = 1005). // 02.03.17 DS Aggiunto controllo nome. // 17.05.17 DS Agg. gestione IntSawArcMaxSideAng (MF_CURR_VER = 1006). +// 17.06.19 DS Agg. lavorazione finitura superficie (MF_CURR_VER = 1007). // //---------------------------------------------------------------------------- @@ -37,7 +38,7 @@ const string MF_HEADER = "[HEADER]" ; const string MF_VERSION = "VERSION" ; const string MF_TOTAL = "TOTAL" ; const string MF_SIZE = "SIZE" ; -const int MF_CURR_VER = 1006 ; +const int MF_CURR_VER = 1007 ; const string MF_GENERAL = "[GENERAL]" ; const string MF_3AXCOMP = "3AXCOMP" ; const bool MF_CURR_3AXCOMP = false ; diff --git a/Operation.cpp b/Operation.cpp index 2a2cea7..129ffc6 100644 --- a/Operation.cpp +++ b/Operation.cpp @@ -61,6 +61,38 @@ Operation::GetGeomDB( void) const return m_pGeomDB ; } +//---------------------------------------------------------------------------- +static bool +IsActiveOperation( int nId, IGeomDB* pGDB) +{ + int nMode ; + return ( pGDB != nullptr && pGDB->GetCalcMode( nId, nMode) && nMode == GDB_MD_STD) ; +} + +//---------------------------------------------------------------------------- +bool +Operation::Removing(int nParentId, int nNextId) +{ + if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr) + return false ; + // imposto da verificare operazione attiva successiva + int nActId = nNextId ; + while ( nActId != GDB_ID_NULL && ! IsActiveOperation( nActId, m_pGeomDB)) + nActId = m_pGeomDB->GetNextGroup( nActId) ; + // se non trovata, imposto da verificare operazione attiva precedente + if ( nActId == GDB_ID_NULL) { + nActId = m_pGeomDB->GetPrevGroup( m_nOwnerId) ; + while ( nActId != GDB_ID_NULL && ! IsActiveOperation( nActId, m_pGeomDB)) + nActId = m_pGeomDB->GetPrevGroup( nActId) ; + } + // imposto stato operazione + Operation* pOpe = GetOperation( m_pGeomDB->GetUserObj( nActId)) ; + if ( pOpe != nullptr) + pOpe->UpdateStatus( MCH_ST_TO_VERIFY) ; + + return true ; +} + //---------------------------------------------------------------------------- bool Operation::Relocate( int nOrigParentId, int nOrigNextId, int nRefId, int nSonBeforeAfter, bool bGlob) @@ -70,9 +102,7 @@ Operation::Relocate( int nOrigParentId, int nOrigNextId, int nRefId, int nSonBef // imposto da verificare operazione UpdateStatus( MCH_ST_TO_VERIFY) ; // imposto da verificare operazione attiva successiva in posizione originale - int nMode ; - while ( nOrigNextId != GDB_ID_NULL && - m_pGeomDB->GetCalcMode( nOrigNextId, nMode) && nMode == GDB_MD_HIDDEN) + while ( nOrigNextId != GDB_ID_NULL && ! IsActiveOperation( nOrigNextId, m_pGeomDB)) nOrigNextId = m_pGeomDB->GetNextGroup( nOrigNextId) ; Operation* pOpe = GetOperation( m_pGeomDB->GetUserObj( nOrigNextId)) ; if ( pOpe != nullptr) diff --git a/Operation.h b/Operation.h index 7ff5135..919c33d 100644 --- a/Operation.h +++ b/Operation.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2016-2016 +// EgalTech 2016-2019 //---------------------------------------------------------------------------- -// File : Operation.h Data : 29.04.16 Versione : 1.6p4 +// File : Operation.h Data : 17.06.19 Versione : 2.1f2 // Contenuto : Dichiarazione della classe Operation da cui derivano // Disposition e Machining. // @@ -33,6 +33,7 @@ class Operation : public IUserObj bool SetOwner( int nId, IGeomDB* pGDB) override ; int GetOwner( void) const override ; IGeomDB* GetGeomDB( void) const override ; + bool Removing( int nParentId, int nNextId) override ; bool Relocate( int nOrigParentId, int nOrigNextId, int nRefId, int nSonBeforeAfter, bool bGlob) override ; public :