EgtMachKernel :
- aggiunta in interfaccia funzione VerifyCurrSetup.
This commit is contained in:
@@ -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() ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user