EgtMachKernel 1.6n3 :
- prima versione della gestione delle fasi di lavorazione.
This commit is contained in:
+33
-24
@@ -130,18 +130,16 @@ MachMgr::AddMachGroup( const string& sName, const string& sMachineName)
|
||||
// creo il sottogruppo per le operazioni
|
||||
int nOperGroupId = m_pGeomDB->AddGroup( GDB_ID_NULL, nNewId, GLOB_FRM) ;
|
||||
m_pGeomDB->SetName( nOperGroupId, MACH_OPER_GROUP) ;
|
||||
// rendo corrente il gruppo
|
||||
if ( ! SetCurrMachGroup( nNewId)) {
|
||||
// predispongo e verifico impostazioni e aggiungo prima fase
|
||||
if ( ! PrepareCurrMachGroup( nNewId) || AddPhase() == 0) {
|
||||
m_pGeomDB->Erase( nNewId) ;
|
||||
return GDB_ID_NULL ;
|
||||
}
|
||||
// inserisco la prima operazione, sempre disposizione iniziale
|
||||
if ( ! AddDisposition( "Disp")) {
|
||||
m_pGeomDB->Erase( nNewId) ;
|
||||
return GDB_ID_NULL ;
|
||||
}
|
||||
// reset lavorazione corrente
|
||||
m_nCurrMachiningId = GDB_ID_NULL ;
|
||||
// nascondo i pezzi rimasti sotto la radice
|
||||
ShowRootParts( false) ;
|
||||
// rendo visibile il nuovo gruppo corrente e la relativa macchina
|
||||
m_pGeomDB->SetStatus( m_nCurrMGrpId, GDB_ST_ON) ;
|
||||
m_pGeomDB->SetStatus( GetCurrMGeoId(), GDB_ST_ON) ;
|
||||
// restituisco l'identificativo del gruppo
|
||||
return nNewId ;
|
||||
}
|
||||
@@ -269,6 +267,24 @@ MachMgr::GetMachGroupId( const string& sName) const
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::SetCurrMachGroup( int nId)
|
||||
{
|
||||
// predispongo e verifico impostazioni
|
||||
if ( ! PrepareCurrMachGroup( nId))
|
||||
return false ;
|
||||
// imposto la prima fase come corrente
|
||||
if ( ! SetCurrPhase( 1))
|
||||
return false ;
|
||||
// nascondo i pezzi rimasti sotto la radice
|
||||
ShowRootParts( false) ;
|
||||
// rendo visibile il nuovo gruppo corrente e la relativa macchina
|
||||
m_pGeomDB->SetStatus( m_nCurrMGrpId, GDB_ST_ON) ;
|
||||
m_pGeomDB->SetStatus( GetCurrMGeoId(), GDB_ST_ON) ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::PrepareCurrMachGroup( int nId)
|
||||
{
|
||||
// verifica del gruppo base per le lavorazioni
|
||||
if ( ! VerifyMachBase())
|
||||
@@ -297,22 +313,15 @@ MachMgr::SetCurrMachGroup( int nId)
|
||||
m_nCurrMGrpId = nId ;
|
||||
m_cCurrMGrp = mgData ;
|
||||
m_nCurrMch = GetMachine( m_cCurrMGrp.MGeoName) ;
|
||||
// porto i pezzi dalla loro posizione standard nei grezzi nuovi
|
||||
SwapParts( true) ;
|
||||
// nascondo i pezzi rimasti sotto la radice
|
||||
ShowRootParts( false) ;
|
||||
// rendo visibile il nuovo gruppo corrente e la relativa macchina
|
||||
m_pGeomDB->SetStatus( m_nCurrMGrpId, GDB_ST_ON) ;
|
||||
m_pGeomDB->SetStatus( GetCurrMGeoId(), GDB_ST_ON) ;
|
||||
// eseguo la prima operazione di disposizione
|
||||
int nDispId = GetFirstOperation() ;
|
||||
Disposition* pDisp = dynamic_cast<Disposition*>( m_pGeomDB->GetUserObj( nDispId)) ;
|
||||
if ( pDisp != nullptr) {
|
||||
pDisp->Init( this) ;
|
||||
return pDisp->Apply() ;
|
||||
m_nPhasesCount = CalcPhaseCount() ;
|
||||
m_nCurrPhase = 0 ;
|
||||
m_nCurrDispId = GDB_ID_NULL ;
|
||||
m_nCurrMachiningId = GDB_ID_NULL ;
|
||||
if ( m_pSimul != nullptr) {
|
||||
delete m_pSimul ;
|
||||
m_pSimul = nullptr ;
|
||||
}
|
||||
else
|
||||
return true ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user