From 2c36cd98fef0faa4d65d5d336fabc7e382720f7b Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sat, 19 Nov 2016 18:27:34 +0000 Subject: [PATCH] EgtMachKernel : - in generazione anticipata dichiarazione utensile per OnDispositionStart con movimenti testa. --- Generator.cpp | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/Generator.cpp b/Generator.cpp index 62af49d..439811f 100644 --- a/Generator.cpp +++ b/Generator.cpp @@ -164,6 +164,28 @@ Generator::ProcessDisposition( int nOpId, int nOpInd) bool bEmpty = pDisp->IsEmpty() ; bool bSomeByHand = pDisp->GetSomeByHand() ; + // Se disposizione con movimenti macchina + if ( ! pDisp->IsEmpty()) { + // Recupero l'utensile della disposizione corrente + string sTool ; string sHead ; int nExit ; string sTcPos ; + if ( ! pDisp->GetToolData( sTool, sHead, nExit, sTcPos)) + return false ; + // Se utensile cambierà + if ( ! m_sTool.empty() && m_sTool != sTool) { + // emetto deselezione vecchio utensile + if ( ! OnToolDeselect( sHead, nExit, sTcPos)) + return false ; + } + // Aggiorno utensile e assi macchina + if ( ! UpdateDispTool( sTool, sHead, nExit) || ! UpdateAxes()) + return false ; + // Se utensile cambiato, emetto selezione nuovo utensile + if ( m_sTool != m_sPrevTool) { + if ( ! OnToolSelect( sTool, sHead, nExit, sTcPos)) + return false ; + } + } + // Emetto inizio disposizione if ( ! OnDispositionStart( nOpId, nOpInd, nPhase, bEmpty, bSomeByHand)) return false ; @@ -208,25 +230,6 @@ Generator::ProcessDisposition( int nOpId, int nOpInd) // Se disposizione con movimenti macchina if ( ! pDisp->IsEmpty()) { - - // Recupero l'utensile della disposizione corrente - string sTool ; string sHead ; int nExit ; string sTcPos ; - if ( ! pDisp->GetToolData( sTool, sHead, nExit, sTcPos)) - return false ; - // Se utensile cambierà - if ( ! m_sTool.empty() && m_sTool != sTool) { - // emetto deselezione vecchio utensile - if ( ! OnToolDeselect( sHead, nExit, sTcPos)) - return false ; - } - // Aggiorno utensile e assi macchina - if ( ! UpdateDispTool( sTool, sHead, nExit) || ! UpdateAxes()) - return false ; - // Se utensile cambiato, emetto selezione nuovo utensile - if ( m_sTool != m_sPrevTool) { - if ( ! OnToolSelect( sTool, sHead, nExit, sTcPos)) - return false ; - } // Ciclo su tutti i percorsi CL della disposizione int nClPathInd = 0 ; int nClId = m_pGeomDB->GetFirstNameInGroup( nOpId, MCH_CL) ;