EgtMachKernel 1.8c7 :
- modifiche per gestione unificata dell'attrezzaggio - caricamento degli utensili di tutte le uscite di una testa al caricamento di un utensile qualunque della stessa.
This commit is contained in:
+58
-5
@@ -64,9 +64,23 @@ Machine::LoadTool( const string& sHead, int nExit, const string& sTool)
|
||||
Exit* pExit = GetExit( nExGrp) ;
|
||||
if ( pExit == nullptr)
|
||||
return false ;
|
||||
// se utensile già montato, abilito ed esco
|
||||
// inserisco l'utensile nell'uscita
|
||||
if ( ! LoadTool( pExit, sTool))
|
||||
return false ;
|
||||
// abilito la testa
|
||||
return EnableHeadInSet( sHead) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::LoadTool( Exit* pExit, const string& sTool)
|
||||
{
|
||||
// controllo GeomDB e Exit
|
||||
if ( m_pGeomDB == nullptr || pExit == nullptr)
|
||||
return false ;
|
||||
// se utensile già montato, esco
|
||||
if ( sTool == pExit->GetTool())
|
||||
return EnableHeadInSet( sHead) ;
|
||||
return true ;
|
||||
// verifico esistenza file utensile
|
||||
string sDraw ;
|
||||
if ( ! m_pMchMgr->TdbSetCurrTool( sTool) || ! m_pMchMgr->TdbGetCurrToolParam( TPA_DRAW, sDraw))
|
||||
@@ -78,6 +92,7 @@ Machine::LoadTool( const string& sHead, int nExit, const string& sTool)
|
||||
return false ;
|
||||
}
|
||||
// pulisco il gruppo dell'uscita
|
||||
int nExGrp = pExit->GetOwner() ;
|
||||
m_pGeomDB->EmptyGroup( nExGrp) ;
|
||||
// inserisco l'utensile nel gruppo
|
||||
if ( ! m_pGeomDB->Load( sToolFile, nExGrp))
|
||||
@@ -99,7 +114,7 @@ Machine::LoadTool( const string& sHead, int nExit, const string& sTool)
|
||||
return false ;
|
||||
m_pGeomDB->Rotate( nT, ORIG, X_AX, 90) ;
|
||||
pExit->SetTool( sTool) ;
|
||||
return EnableHeadInSet( sHead) ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -147,6 +162,45 @@ Machine::UnloadTool( const string& sHead, int nExit)
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::LoadTools( const string& sHead)
|
||||
{
|
||||
// controllo GeomDB e MachMgr
|
||||
if ( m_pGeomDB == nullptr || m_pMchMgr == nullptr)
|
||||
return false ;
|
||||
// verifico che l'attrezzaggio contenga qualcosa
|
||||
if ( ! m_pMchMgr->GetCurrSetupMgr().Exists())
|
||||
return true ;
|
||||
// recupero la testa
|
||||
Head* pHead = GetHead( GetGroup( sHead)) ;
|
||||
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
|
||||
string sExit = MCH_EXIT + ToString( nExit) ;
|
||||
int nExGrp = m_pGeomDB->GetFirstNameInGroup( nHdGrp, sExit) ;
|
||||
Exit* pExit = GetExit( nExGrp) ;
|
||||
if ( pExit == nullptr)
|
||||
continue ;
|
||||
// recupero l'utensile da attrezzare sull'uscita
|
||||
string sTool ;
|
||||
if ( m_pMchMgr->GetCurrSetupMgr().GetToolName( sHead, nExit, sTool) && ! sTool.empty()) {
|
||||
LoadTool( pExit, sTool) ;
|
||||
}
|
||||
// se nessun utensile, allora pulisco il gruppo dell'uscita
|
||||
else {
|
||||
m_pGeomDB->EmptyGroup( nExGrp) ;
|
||||
pExit->SetTool( "") ;
|
||||
}
|
||||
}
|
||||
|
||||
// abilito la testa
|
||||
return EnableHeadInSet( sHead) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::ResetHeadSet( const string& sHead)
|
||||
@@ -179,7 +233,6 @@ Machine::ResetHeadSet( const string& sHead)
|
||||
}
|
||||
// visualizzo solo la prima testa
|
||||
m_pGeomDB->SetMode( nHdGrp, ( i == 0 ? GDB_MD_STD : GDB_MD_HIDDEN)) ;
|
||||
//m_pGeomDB->SetStatus( nHdGrp, ( i == 0 ? GDB_ST_ON : GDB_ST_OFF)) ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user