diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 9ed32b4..212df1e 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/Simulator.cpp b/Simulator.cpp index e1c5381..78b99ca 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -287,7 +287,7 @@ Simulator::Stop( void) //---------------------------------------------------------------------------- bool -Simulator::UpdateTool( bool bForced) +Simulator::UpdateTool( bool bFirst) { // Recupero l'utensile della lavorazione corrente Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( m_nOpId)) ; @@ -313,10 +313,10 @@ Simulator::UpdateTool( bool bForced) if ( ! OnToolDeselect( sTool, sHead, nExit, sTcPos)) return false ; } - // se cambiato oppure forzato, attivo l'utensile della lavorazione - if ( sTool != m_sTool || bForced) { - // se forzato, pulisco la testa - if ( bForced) + // se cambiato oppure prima volta, attivo l'utensile della lavorazione + if ( sTool != m_sTool || bFirst) { + // se prima volta, pulisco la testa + if ( bFirst) m_pMchMgr->ResetHeadSet( sHead) ; // carico l'utensile (e lo rendo corrente) if ( ! m_pMchMgr->SetCalcTool( sTool, sHead, nExit)) @@ -326,7 +326,7 @@ Simulator::UpdateTool( bool bForced) if ( ! UpdateAxes()) return false ; // eventuale lancio script - if ( ! OnToolSelect( m_sTool, sHead, nExit, sTcPos)) + if ( ! bFirst && ! OnToolSelect( m_sTool, sHead, nExit, sTcPos)) return false ; } return true ; @@ -351,7 +351,7 @@ Simulator::UpdateTool( bool bForced) if ( ! UpdateAxes()) return false ; // eventuale lancio script - if ( ! OnToolSelect( m_sTool, sHead, nExit, sTcPos)) + if ( ! bFirst && ! OnToolSelect( m_sTool, sHead, nExit, sTcPos)) return false ; return true ; } diff --git a/Simulator.h b/Simulator.h index 0e59384..7e50c39 100644 --- a/Simulator.h +++ b/Simulator.h @@ -37,7 +37,7 @@ class Simulator bool Stop( void) ; private : - bool UpdateTool( bool bForced = false) ; + bool UpdateTool( bool bFirst = false) ; bool UpdateAxes( void) ; bool UpdateAxesPos( void) ; bool ResetAxes( void) ;