From 5cdae9806ebee6afa7bad24b844db95a8113125b Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 2 Mar 2017 19:18:29 +0000 Subject: [PATCH] EgtMachKernel : - piccole modifiche per gestione movimenti teste in Disposizione. --- Disposition.cpp | 2 +- Generator.cpp | 10 +++++----- MachineCalc.cpp | 2 +- Simulator.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Disposition.cpp b/Disposition.cpp index 06c1dc0..89dd679 100644 --- a/Disposition.cpp +++ b/Disposition.cpp @@ -1098,7 +1098,7 @@ Disposition::SpecialApply( bool bRecalc) bool Disposition::GetToolData( string& sName, string& sHead, int& nExit, string& sTcPos) const { - sName = "*" + m_sHead ; + sName = "" ; sHead = m_sHead ; nExit = m_nExit ; sTcPos = m_sTcPos ; diff --git a/Generator.cpp b/Generator.cpp index b5dc8d7..9e23126 100644 --- a/Generator.cpp +++ b/Generator.cpp @@ -174,7 +174,7 @@ Generator::ProcessDisposition( int nOpId, int nOpInd) string sTool ; string sHead ; int nExit ; string sTcPos ; if ( ! pDisp->GetToolData( sTool, sHead, nExit, sTcPos)) return false ; - // Se utensile cambierà + // Se esiste utensile corrente e cambierà, lo scarico if ( ! m_sTool.empty() && m_sTool != sTool) { // emetto deselezione vecchio utensile if ( ! OnToolDeselect( sTool, sHead, nExit, sTcPos)) @@ -183,8 +183,8 @@ Generator::ProcessDisposition( int nOpId, int nOpInd) // 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) { + // Se utensile non definito o cambiato, emetto selezione nuovo utensile + if ( m_sTool.empty() || m_sTool != m_sPrevTool) { if ( ! OnToolSelect( sTool, sHead, nExit, sTcPos)) return false ; } @@ -462,8 +462,8 @@ Generator::UpdateDispTool( const string& sTool, const string& sHead, int nExit) { // Salvo l'utensile attuale come precedente m_sPrevTool = m_sTool ; - // Se cambiato ... - if ( sTool != m_sTool) { + // Se non definito o cambiato ... + if ( sTool.empty() || sTool != m_sTool) { // lo carico in macchina if ( ! m_pMchMgr->SetCalcTool( sTool, sHead, nExit)) return false ; diff --git a/MachineCalc.cpp b/MachineCalc.cpp index a3a6a11..a4e1f0f 100644 --- a/MachineCalc.cpp +++ b/MachineCalc.cpp @@ -210,7 +210,7 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit) double dTOvLen = 0 ; double dTOvDiam = 0 ; // se definito - if ( ! sTool.empty() && sTool.front() != '*') { + if ( ! sTool.empty()) { if ( ! LoadTool( sHead, nExit, sTool)) { string sOut = "Missing tool " + sTool ; LOG_INFO( GetEMkLogger(), sOut.c_str()) diff --git a/Simulator.cpp b/Simulator.cpp index d5c94d5..7bf36e4 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -344,8 +344,8 @@ Simulator::UpdateTool( bool bForced) // recupero i dati string sTool ; string sHead ; int nExit ; string sTcPos ; pDisp->GetToolData( sTool, sHead, nExit, sTcPos) ; - // se cambierà ed esiste il corrente, lo scarico - if ( sTool != m_sTool && ! m_sTool.empty()) { + // se esiste utensile corrente e cambierà, lo scarico + if ( ! m_sTool.empty() && sTool != m_sTool) { // eventuale lancio script per scarico utensile if ( ! OnToolDeselect( sTool, sHead, nExit, sTcPos)) return false ;