EgtMachKernel 1.6v8 :

- gestita posizione Tavola Home diversa da posizione 0 Macchina in disposizione
- in generazione si assegna il nome macchina
- nel confronto attrezzaggio utensili si tiene conto della posizione in ToolChanger
- se angoli indeterminati ma si determinano con asse ausiliario, li rendo tali direttamente
- aggiunto comando per ricaricare DB utensili e lavorazioni
- aggiunta funzione GetPhaseLastOperation
- ora inserimento lavorazione avviene alla fine della fase corrente
- migliorato split di grezzo con lavorazioni
- in taglio di lama e fresatura irrobustito allungamenti/accorciamenti percorso.
This commit is contained in:
Dario Sassi
2016-10-24 08:27:58 +00:00
parent 1a862d9758
commit d4e4ea3871
17 changed files with 229 additions and 108 deletions
+33 -15
View File
@@ -470,22 +470,13 @@ MachMgr::ChangeOperationPhase( int nMchId, int nNewPhase)
if ( nType == OPER_NULL || nType == OPER_DISP)
return false ;
// verifico che la nuova fase esista
if ( nNewPhase > m_nPhasesCount)
if ( nNewPhase <= 0 || nNewPhase > m_nPhasesCount)
return false ;
// se la fase dell'operazione è già giusta, esco subito con successo
if ( GetOperationPhase( nMchId) == nNewPhase)
return true ;
// cerco l'ultima operazione della nuova fase
int nRefId = GDB_ID_NULL ;
int nCurrId = GetFirstOperation() ;
while ( nCurrId != GDB_ID_NULL) {
int nPhase = GetOperationPhase( nCurrId) ;
if ( nPhase == nNewPhase)
nRefId = nCurrId ;
else if ( nPhase > nNewPhase)
break ;
nCurrId = GetNextOperation( nCurrId) ;
}
int nRefId = GetPhaseLastOperation( nNewPhase) ;
if ( nRefId == GDB_ID_NULL)
return false ;
// recupero la lavorazione
@@ -499,6 +490,27 @@ MachMgr::ChangeOperationPhase( int nMchId, int nNewPhase)
return pMch->SetPhase( nNewPhase) ;
}
//----------------------------------------------------------------------------
int
MachMgr::GetPhaseLastOperation( int nPhase) const
{
// verifico esistenza fase
if ( nPhase <= 0 || nPhase > m_nPhasesCount)
return GDB_ID_NULL ;
// cerco l'ultima operazione della fase
int nOperId = GDB_ID_NULL ;
int nCurrId = GetFirstOperation() ;
while ( nCurrId != GDB_ID_NULL) {
int nOperPhase = GetOperationPhase( nCurrId) ;
if ( nPhase == nOperPhase)
nOperId = nCurrId ;
else if ( nPhase < nOperPhase)
break ;
nCurrId = GetNextOperation( nCurrId) ;
}
return nOperId ;
}
//----------------------------------------------------------------------------
bool
MachMgr::RemoveOperationHome( int nId)
@@ -652,8 +664,11 @@ MachMgr::AddMachining( const string& sName, const string& sMachining)
string sNewName = sName ;
if ( ! GetOperationNewName( sNewName))
return GDB_ID_NULL ;
// inserisco il gruppo
int nId = m_pGeomDB->AddGroup( GDB_ID_NULL, nOperGrpId, GLOB_FRM) ;
// inserisco il gruppo della lavorazione alla fine della fase corrente
int nRefId = GetPhaseLastOperation( m_nCurrPhase) ;
if ( nRefId == GDB_ID_NULL)
return GDB_ID_NULL ;
int nId = m_pGeomDB->InsertGroup( GDB_ID_NULL, nRefId, GDB_AFTER, GLOB_FRM) ;
if ( nId == GDB_ID_NULL)
return GDB_ID_NULL ;
// assegno il nome
@@ -696,8 +711,11 @@ MachMgr::AddMachining( const string& sName, int nMchType, const string& sTool)
string sNewName = sName ;
if ( ! GetOperationNewName( sNewName))
return GDB_ID_NULL ;
// inserisco il gruppo
int nId = m_pGeomDB->AddGroup( GDB_ID_NULL, nOperGrpId, GLOB_FRM) ;
// inserisco il gruppo della lavorazione alla fine della fase corrente
int nRefId = GetPhaseLastOperation( m_nCurrPhase) ;
if ( nRefId == GDB_ID_NULL)
return GDB_ID_NULL ;
int nId = m_pGeomDB->InsertGroup( GDB_ID_NULL, nRefId, GDB_AFTER, GLOB_FRM) ;
if ( nId == GDB_ID_NULL)
return GDB_ID_NULL ;
// assegno il nome