From 2164f2e6514ecd0256b272fc8564fb29a67dfd7c Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 19 Apr 2018 16:46:48 +0000 Subject: [PATCH] EgtMachKernel 1.9d3 : - ordine grezzi sempre ripristinato dopo Link/Unlink con parti di macchina - in KeepRawPart reset posizione grezzo se non definita fase di origine - aumentato massimo angolo di fianco per lama a 75 gradi. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes MachMgrRawParts.cpp | 5 +++++ Machine.cpp | 16 ++++++++++++---- SawingData.cpp | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 374f375f58643e9d8baf1654587553ae97323d68..30eb6f8bccc226b6ffca0212ba044ea1577fb06a 100644 GIT binary patch delta 97 zcmewt{V#gMFE&Qw&A-`fnHh~IKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUD-Bai?9 delta 97 zcmewt{V#gMFE&P_&A-`fnHh~HKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmU8!BZvS1 diff --git a/MachMgrRawParts.cpp b/MachMgrRawParts.cpp index d5d74ce..7257355 100644 --- a/MachMgrRawParts.cpp +++ b/MachMgrRawParts.cpp @@ -563,6 +563,11 @@ MachMgr::KeepRawPart( int nRawId, int nSouPhase) vPhase.emplace_back( m_nCurrPhase) ; if ( ! m_pGeomDB->SetInfo( nRawId, MACH_RAW_PHASE, vPhase)) return false ; + // annullo eventuali movimenti del grezzo (riferimento riportato a globale) + Frame3d* pfrRaw = m_pGeomDB->GetGroupFrame( nRawId) ; + if ( pfrRaw == nullptr) + return false ; + pfrRaw->Reset() ; // visualizzo il grezzo e ne attivo i pezzi if ( ! m_pGeomDB->SetStatus( nRawId, GDB_ST_ON)) return false ; diff --git a/Machine.cpp b/Machine.cpp index f82383b..76325b5 100644 --- a/Machine.cpp +++ b/Machine.cpp @@ -967,10 +967,18 @@ Machine::UnlinkRawPartFromGroup( int nRawPartId) auto iIter = find( m_vLinkedRawParts.begin(), m_vLinkedRawParts.end(), nRawPartId) ; if ( iIter == m_vLinkedRawParts.end()) return false ; - // riporto il grezzo nel gruppo dei grezzi (se appartiene alla prima fase in testa) - int nInsPos = ( m_pMchMgr->VerifyRawPartPhase( nRawPartId, 1) ? GDB_FIRST_SON : GDB_LAST_SON) ; - if ( ! m_pGeomDB->RelocateGlob( nRawPartId, nRawGrpId, nInsPos)) - return false ; + // riporto il grezzo nel gruppo dei grezzi (conservando l'ordine di definizione quindi Id crescenti) + int nCurrId = m_pGeomDB->GetFirstInGroup( nRawGrpId) ; + while ( nCurrId != GDB_ID_NULL && nCurrId < nRawPartId) + nCurrId = m_pGeomDB->GetNext( nCurrId) ; + if ( nCurrId == GDB_ID_NULL) { + if ( ! m_pGeomDB->RelocateGlob( nRawPartId, nRawGrpId, GDB_LAST_SON)) + return false ; + } + else { + if ( ! m_pGeomDB->RelocateGlob( nRawPartId, nCurrId, GDB_BEFORE)) + return false ; + } // tolgo il grezzo dall'elenco dei linkati m_vLinkedRawParts.erase( iIter) ; return true ; diff --git a/SawingData.cpp b/SawingData.cpp index 1f5a7dd..aff8d60 100644 --- a/SawingData.cpp +++ b/SawingData.cpp @@ -479,7 +479,7 @@ SawingData::VerifyCurveUse( int nVal) const bool SawingData::VerifySideAngle( double dVal) const { - const double MAX_SIDE_ANG = 67.5 + EPS_ANG_SMALL ; + const double MAX_SIDE_ANG = 75.0 + EPS_ANG_SMALL ; const double AUTO_SIDE_ANG = 99 ; return ( ( dVal > - MAX_SIDE_ANG && dVal < MAX_SIDE_ANG) || fabs( dVal - AUTO_SIDE_ANG) < EPS_ANG_SMALL) ; }