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
BIN
View File
Binary file not shown.
+9 -7
View File
@@ -619,14 +619,16 @@ MachMgr::RemoveRawPart( int nRawId)
bool
MachMgr::VerifyRawPart( int nRawId) const
{
// recupero il gruppo dei grezzi nella macchinata corrente
// se il grezzo fa parte del gruppo dei grezzi, va bene
int nRawGroupId = GetCurrRawGroupId() ;
if ( nRawGroupId == GDB_ID_NULL)
return false ;
// verifico che questo grezzo ne faccia parte
if ( m_pGeomDB->GetParentId( nRawId) != nRawGroupId)
return false ;
return true ;
if ( nRawGroupId != GDB_ID_NULL && m_pGeomDB->GetParentId( nRawId) == nRawGroupId)
return true ;
// se il grezzo è linkato ad un gruppo della macchina corrente, va bene
Machine* pMch = GetCurrMachine() ;
if ( pMch != nullptr && pMch->IsLinkedRawPart( nRawId))
return true ;
// altrimenti errore
return false ;
}
//----------------------------------------------------------------------------
+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) ;
+1
View File
@@ -93,6 +93,7 @@ class Machine
const std::string& GetOutstrokeInfo( void) const
{ return m_sOutstrokeInfo ; }
bool LinkRawPartToGroup( int nRawPartId, const std::string& sGroupName) ;
bool IsLinkedRawPart( int nRawId) const ;
bool UnlinkRawPartFromGroup( int nRawPartId) ;
bool UnlinkAllRawPartsFromGroups( void) ;
bool LuaExistsFunction( const std::string& sFun) ;