EgtMachKernel 1.6r1 :

- in SplitFlatRawPartW se c'è curva di kerf si splitta e si riporta nei nuovi grezzi
- in Simulator migliorata gestione Home e Stop, corretto posizione precedente degli assi al cambio utensile/testa.
This commit is contained in:
Dario Sassi
2016-05-12 15:27:25 +00:00
parent b8965da858
commit 31b4099d0f
8 changed files with 109 additions and 41 deletions
+33 -25
View File
@@ -72,6 +72,12 @@ Simulator::Start( void)
int nMachGrp = m_pMchMgr->GetCurrMachGroup() ;
if ( nMachGrp == GDB_ID_NULL)
return false ;
// reset utensile e assi correnti
m_sTool.clear() ;
m_AxesName.clear() ;
// porto la macchina in home
if ( ! GoHome())
return false ;
// imposto fase iniziale
m_pMchMgr->SetCurrPhase( 1) ;
// verifico la disposizione iniziale della macchinata
@@ -102,10 +108,6 @@ Simulator::Start( void)
if ( ! UpdateTool( true) || ! UpdateAxes())
return false ;
// porto la macchina in home
if ( ! GoHome())
return false ;
// richiamo gestione evento inizio lavorazione
++ m_nOpInd ;
if ( ! OnMachiningStart( m_nOpId, m_nOpInd))
@@ -131,7 +133,7 @@ bool
Simulator::Move( int& nStatus)
{
// Verifiche
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr) {
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr || m_pMachine == nullptr) {
nStatus = MCH_SIM_ERR ;
return false ;
}
@@ -279,7 +281,7 @@ Simulator::Move( int& nStatus)
for ( size_t i = OutAxes.size() ; i < 5 ; ++ i)
OutAxes.emplace_back( 0) ;
int nStat ;
m_pMchMgr->VerifyOutstroke( OutAxes[0], OutAxes[1], OutAxes[2], OutAxes[3], OutAxes[4], nStat) ;
m_pMachine->VerifyOutstroke( OutAxes[0], OutAxes[1], OutAxes[2], OutAxes[3], OutAxes[4], nStat) ;
nStatus = MCH_SIM_OUTSTROKE ;
return false ; }
case CamData::AS_DIR_ERR :
@@ -307,7 +309,7 @@ Simulator::Move( int& nStatus)
if ( nMoveType != 2 && nMoveType != 3) {
for ( size_t i = 0 ; i < m_AxesName.size() ; ++ i) {
double dVal = m_AxesVal[i] * ( 1 - m_dCoeff) + AxesEnd[i] * m_dCoeff ;
m_pMchMgr->SetAxisPos( m_AxesName[i], dVal) ;
m_pMachine->SetAxisPos( m_AxesName[i], dVal) ;
}
}
// Eseguo movimento su arco (per ora sempre nel piano XY)
@@ -317,12 +319,12 @@ Simulator::Move( int& nStatus)
double dAngCen = pCamData->GetAxesAngCen() ;
Vector3d vtCurr = Point3d( m_AxesVal[0], m_AxesVal[1], ptCen.z) - ptCen ;
vtCurr.Rotate( Z_AX, m_dCoeff * dAngCen) ;
m_pMchMgr->SetAxisPos( m_AxesName[0], ptCen.x + vtCurr.x) ;
m_pMchMgr->SetAxisPos( m_AxesName[1], ptCen.y + vtCurr.y) ;
m_pMachine->SetAxisPos( m_AxesName[0], ptCen.x + vtCurr.x) ;
m_pMachine->SetAxisPos( m_AxesName[1], ptCen.y + vtCurr.y) ;
// altri assi
for ( size_t i = 2 ; i < m_AxesName.size() ; ++ i) {
double dVal = m_AxesVal[i] * ( 1 - m_dCoeff) + AxesEnd[i] * m_dCoeff ;
m_pMchMgr->SetAxisPos( m_AxesName[i], dVal) ;
m_pMachine->SetAxisPos( m_AxesName[i], dVal) ;
}
}
@@ -411,12 +413,26 @@ Simulator::SetStep( double dStep)
return true ;
}
//----------------------------------------------------------------------------
bool
Simulator::GoHome( void)
{
// reset stato macchina
OnResetMachine() ;
// porto la macchina in home
m_pMchMgr->ResetAllAxesPos() ;
// assegno valori home degli assi macchina attivi
return m_pMchMgr->GetAllCalcAxesHomePos( m_AxesVal) ;
}
//----------------------------------------------------------------------------
bool
Simulator::Stop( void)
{
// reset stato macchina
OnResetMachine() ;
// porto la macchina in home
m_pMchMgr->ResetAllAxesPos() ;
// rimuovo tavola variabili globali
m_pMachine->LuaResetGlobVar( GLOB_VAR) ;
// reset dello stato
@@ -477,23 +493,14 @@ Simulator::UpdateAxes( void)
if ( pMachine == nullptr)
return false ;
// Carico i nomi degli assi macchina attivi
return pMachine->GetAllCurrAxesName( m_AxesName) ;
if ( ! pMachine->GetAllCurrAxesName( m_AxesName))
return false ;
// Aggiorno la posizione corrente degli assi macchina attivi
for ( size_t i = 0 ; i < m_AxesName.size() ; ++ i)
m_pMachine->GetAxisPos( m_AxesName[i], m_AxesVal[i]) ;
return true ;
}
//----------------------------------------------------------------------------
bool
Simulator::GoHome( void)
{
// reset stato macchina
OnResetMachine() ;
// porto la macchina in home
m_pMchMgr->ResetAllAxesPos() ;
// assegno valori home degli assi macchina attivi
return m_pMchMgr->GetAllCalcAxesHomePos( m_AxesVal) ;
}
//----------------------------------------------------------------------------
bool
Simulator::OnOperationEnd( void)
@@ -613,6 +620,7 @@ Simulator::OnMoveStart( void)
// assegno dati
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEID, m_nEntId) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEIND, m_nEntInd) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, pCamData->GetMoveType()) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FLAG, nFlag) ;
// verifico esistenza funzione
if ( ! m_pMachine->LuaExistsFunction( ON_SIMUL_MOVE_START))