EgtMachKernel :

- aggiunta in interfaccia funzione VerifyCurrSetup.
This commit is contained in:
Dario Sassi
2017-02-06 15:30:32 +00:00
parent 823d97938e
commit 5cae4e4e2d
2 changed files with 47 additions and 0 deletions
+46
View File
@@ -75,3 +75,49 @@ MachMgr::ImportSetup( const string& sName)
// lo inserisco nel progetto
return stuMgr.Save() ;
}
//----------------------------------------------------------------------------
bool
MachMgr::VerifyCurrSetup( STRVECTOR& vsErrors)
{
// pulizia vettore degli utensili mancanti
vsErrors.clear() ;
// recupero attrezzaggio corrente
SetupMgr stuMgr ;
if ( ! stuMgr.Init( this) || ! stuMgr.Load())
return false ;
// ciclo sulle lavorazioni della macchinata corrente per ricavare gli utensili utilizzati
int nOpId = GetFirstActiveOperation() ;
while ( nOpId != GDB_ID_NULL) {
// processo l'operazione
int nType = GetOperationType( nOpId) ;
if ( IsValidMachiningType( nType)) {
// Imposto come lavorazione corrente
if ( ! SetCurrMachining( nOpId))
continue ;
// Recupero l'utensile della lavorazione corrente
string sTuuid, sTool ;
if ( ! GetMachiningParam( MPA_TUUID, sTuuid) ||
! TdbGetToolFromUUID( sTuuid, sTool)) {
string sMchName ;
m_pGeomDB->GetName( nOpId, sMchName) ;
string sToolName ;
GetMachiningParam( MPA_TOOL, sToolName) ;
string sErr = sMchName + "/" + sToolName ;
vsErrors.push_back( sErr) ;
}
// Se utensile non attrezzato
if ( ! stuMgr.FindTool( sTool)) {
// se non presente nella lista dei non attrezzati, lo aggiungo
if ( find( vsErrors.begin(), vsErrors.end(), sTool) == vsErrors.end())
vsErrors.push_back( sTool) ;
}
}
// passo alla operazione successiva
nOpId = GetNextActiveOperation( nOpId) ;
}
return vsErrors.empty() ;
}