EgtMachKernel :

- in calcolo angoli macchina aggiunta segnalazione di direzione utensile irraggiungibile
- in disposizione aggiunti controlli di sottopezzo e grezzo in tavola
- in simulazione la Move ora restituisce uno stato
- migliorato calcolo elevazione per lavorazioni con lama
- la tavola macchina conserva l'area utile.
This commit is contained in:
Dario Sassi
2015-11-23 09:06:44 +00:00
parent 8dd67afcb7
commit 2f016585bb
15 changed files with 134 additions and 49 deletions
+27 -5
View File
@@ -95,11 +95,13 @@ Simulator::Start( void)
//----------------------------------------------------------------------------
bool
Simulator::Move( void)
Simulator::Move( int& nStatus)
{
// Verifiche
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr) {
nStatus = MCH_SIM_ERR ;
return false ;
}
// Se arrivato alla fine dell'interpolazione, recupero una nuova entità
if ( m_dCoeff > 0.999) {
m_nEntId = m_pGeomDB->GetNext( m_nEntId) ;
@@ -115,22 +117,41 @@ Simulator::Move( void)
if ( m_nCLPathId == GDB_ID_NULL) {
m_nOpId = m_pMchMgr->GetNextOperation( m_nOpId) ;
// se non ce ne sono altre, sono alla fine
if ( m_nOpId == GDB_ID_NULL)
if ( m_nOpId == GDB_ID_NULL) {
nStatus = MCH_SIM_END ;
return false ;
}
// aggiorno gli altri dati
int nClId = m_pGeomDB->GetFirstNameInGroup( m_nOpId, MCH_CL) ;
m_nCLPathId = m_pGeomDB->GetFirstGroupInGroup( nClId) ;
m_nEntId = m_pGeomDB->GetFirstInGroup( m_nCLPathId) ;
m_dCoeff = 0 ;
// aggiorno utensile e assi conseguenti
if ( ! UpdateTool() || ! UpdateAxes())
if ( ! UpdateTool() || ! UpdateAxes()) {
nStatus = MCH_SIM_ERR ;
return false ;
}
}
// Cerco prossima posizione su interpolazione corrente
CamData* pCamData = dynamic_cast<CamData*>( m_pGeomDB->GetUserObj( m_nEntId)) ;
if ( pCamData == nullptr || pCamData->GetAxesStatus() != CamData::AS_OK)
if ( pCamData == nullptr) {
nStatus = MCH_SIM_ERR ;
return false ;
}
switch ( pCamData->GetAxesStatus()) {
case CamData::AS_OK :
break ;
case CamData::AS_OUTSTROKE :
nStatus = MCH_SIM_OUTSTROKE ;
return false ;
case CamData::AS_DIR_ERR :
nStatus = MCH_SIM_DIR_ERR ;
return false ;
default :
nStatus = MCH_SIM_ERR ;
return false ;
}
const DBLVECTOR& AxesEnd = pCamData->GetAxisVal() ;
// Verifico se movimento in rapido
bool bRapid = ( pCamData->GetFeed() < EPS_SMALL) ;
@@ -152,6 +173,7 @@ Simulator::Move( void)
if ( m_dCoeff > 0.999)
m_AxesVal = AxesEnd ;
nStatus = MCH_SIM_OK ;
return true ;
}