EgtMachKernel 1.6r5 :

- modifica per rimettere i grezzi unlinked da gruppi macchina e di fase 1 sempre all'inizio del loro gruppo.
This commit is contained in:
Dario Sassi
2016-05-19 07:07:52 +00:00
parent 7c4470b1d6
commit 086af445e5
4 changed files with 20 additions and 9 deletions
+10 -2
View File
@@ -894,6 +894,13 @@ Machine::LinkRawPartToGroup( int nRawPartId, const std::string& sGroupName)
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::IsLinkedRawPart( int nRawId) const
{
return ( find( m_vLinkedRawParts.begin(), m_vLinkedRawParts.end(), nRawId) != m_vLinkedRawParts.end()) ;
}
//----------------------------------------------------------------------------
bool
Machine::UnlinkRawPartFromGroup( int nRawPartId)
@@ -909,8 +916,9 @@ 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
if ( ! m_pGeomDB->RelocateGlob( nRawPartId, nRawGrpId))
// 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 ;
// tolgo il grezzo dall'elenco dei linkati
m_vLinkedRawParts.erase( iIter) ;