EgtMachKernel :

. modifiche in simulazione per richiamo OnSelectTool all'inizio (EMT.FIRST a true).
This commit is contained in:
Dario Sassi
2017-04-20 17:19:45 +00:00
parent 035386bd0e
commit 4b4a6bb88b
3 changed files with 10 additions and 5 deletions
+8 -4
View File
@@ -326,7 +326,7 @@ Simulator::UpdateTool( bool bFirst)
if ( ! UpdateAxes())
return false ;
// eventuale lancio script
if ( ! bFirst && ! OnToolSelect( m_sTool, sHead, nExit, sTcPos))
if ( ! OnToolSelect( m_sTool, sHead, nExit, sTcPos, bFirst))
return false ;
}
return true ;
@@ -351,7 +351,7 @@ Simulator::UpdateTool( bool bFirst)
if ( ! UpdateAxes())
return false ;
// eventuale lancio script
if ( ! bFirst && ! OnToolSelect( m_sTool, sHead, nExit, sTcPos))
if ( ! OnToolSelect( m_sTool, sHead, nExit, sTcPos, bFirst))
return false ;
return true ;
}
@@ -482,7 +482,7 @@ Simulator::FindAndManageOperationStart( bool bFirst, int& nStatus)
// cambio fase
m_pMchMgr->SetCurrPhase( pDisp->GetPhase()) ;
// aggiorno utensile e assi conseguenti
if ( ! UpdateTool()) {
if ( ! UpdateTool( bFirst)) {
nStatus = MCH_SIM_ERR ;
return false ;
}
@@ -855,7 +855,8 @@ Simulator::OnDispositionEnd( void)
//----------------------------------------------------------------------------
bool
Simulator::OnToolSelect( const string& sTool, const string& sHead, int nExit, const string& sTcPos)
Simulator::OnToolSelect( const string& sTool, const string& sHead, int nExit, const string& sTcPos,
bool bFirst)
{
// assegno il nome dell'utensile, la testa e l'uscita
if ( ! m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TOOL, sTool) ||
@@ -877,6 +878,9 @@ Simulator::OnToolSelect( const string& sTool, const string& sHead, int nExit, co
return false ;
}
}
// assegno il flag di chiamata di utensile iniziale
if ( ! m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FIRST, bFirst))
return false ;
// verifico esistenza funzione
if ( ! m_pMachine->LuaExistsFunction( ON_SIMUL_TOOL_SELECT))
return true ;