EgtMachKernel 1.8d3 :
- al salvataggio DB utensili si scaricano tutti gli utensili dalle teste della macchina (se necessari verranno ricaricati con le eventuali nuove geometrie).
This commit is contained in:
+52
-21
@@ -173,10 +173,10 @@ Machine::LoadTools( const string& sHead)
|
||||
if ( ! m_pMchMgr->GetCurrSetupMgr().Exists())
|
||||
return true ;
|
||||
// recupero la testa
|
||||
Head* pHead = GetHead( GetGroup( sHead)) ;
|
||||
int nHdGrp = GetGroup( sHead) ;
|
||||
Head* pHead = GetHead( nHdGrp) ;
|
||||
if ( pHead == nullptr)
|
||||
return false ;
|
||||
int nHdGrp = pHead->GetOwner() ;
|
||||
// ciclo su tutte le uscite
|
||||
for ( int nExit = 1 ; nExit <= pHead->GetExitCount() ; ++ nExit) {
|
||||
// recupero l'uscita
|
||||
@@ -201,6 +201,51 @@ Machine::LoadTools( const string& sHead)
|
||||
return EnableHeadInSet( sHead) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::UnloadTools( const string& sHead)
|
||||
{
|
||||
// controllo GeomDB
|
||||
if ( m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// recupero la testa
|
||||
int nHdGrp = GetGroup( sHead) ;
|
||||
Head* pHead = GetHead( nHdGrp) ;
|
||||
if ( pHead == nullptr)
|
||||
return false ;
|
||||
// ciclo su tutte le uscite
|
||||
for ( int nExit = 1 ; nExit <= pHead->GetExitCount() ; ++ nExit) {
|
||||
// recupero l'uscita
|
||||
string sExit = MCH_EXIT + ToString( nExit) ;
|
||||
int nExGrp = m_pGeomDB->GetFirstNameInGroup( nHdGrp, sExit) ;
|
||||
Exit* pExit = GetExit( nExGrp) ;
|
||||
if ( pExit == nullptr)
|
||||
continue ;
|
||||
// pulisco il gruppo dell'uscita
|
||||
m_pGeomDB->EmptyGroup( nExGrp) ;
|
||||
pExit->SetTool( "") ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::UnloadAllTools( void)
|
||||
{
|
||||
// controllo GeomDB
|
||||
if ( m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// ciclo su tutte le teste
|
||||
bool bOk = true ;
|
||||
for each ( const auto& snGro in m_mapGroups) {
|
||||
if ( IsHeadGroup( snGro.second)) {
|
||||
if ( ! UnloadTools( snGro.first))
|
||||
bOk = false ;
|
||||
}
|
||||
}
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::ResetHeadSet( const string& sHead)
|
||||
@@ -213,26 +258,12 @@ Machine::ResetHeadSet( const string& sHead)
|
||||
if ( vsHSet.empty())
|
||||
return false ;
|
||||
// ciclo su tutte le teste dell'insieme per svuotarle
|
||||
bool bOk = true ;
|
||||
for ( size_t i = 0 ; i < vsHSet.size() ; ++ i) {
|
||||
// recupero il gruppo della testa
|
||||
int nHdGrp = GetGroup( vsHSet[i]) ;
|
||||
if ( ! IsHeadGroup( nHdGrp))
|
||||
return false ;
|
||||
// ciclo sulle sue uscite
|
||||
for ( int j = 1 ; true ; ++ j) {
|
||||
// recupero il gruppo dell'uscita
|
||||
string sExit = MCH_EXIT + ToString( j) ;
|
||||
int nExGrp = m_pGeomDB->GetFirstNameInGroup( nHdGrp, sExit) ;
|
||||
// recupero l'oggetto uscita
|
||||
Exit* pExit = GetExit( nExGrp) ;
|
||||
if ( pExit == nullptr)
|
||||
break ;
|
||||
// pulisco il gruppo dell'uscita
|
||||
m_pGeomDB->EmptyGroup( nExGrp) ;
|
||||
pExit->SetTool( "") ;
|
||||
}
|
||||
if ( ! UnloadTools( vsHSet[i]))
|
||||
bOk = false ;
|
||||
// visualizzo solo la prima testa
|
||||
m_pGeomDB->SetMode( nHdGrp, ( i == 0 ? GDB_MD_STD : GDB_MD_HIDDEN)) ;
|
||||
m_pGeomDB->SetMode( GetGroup( sHead), ( i == 0 ? GDB_MD_STD : GDB_MD_HIDDEN)) ;
|
||||
}
|
||||
return true ;
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user