From c191d6d8318259cbc896997d6733ee949fbb7ce2 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 29 Apr 2024 08:43:10 +0200 Subject: [PATCH] EgtMachKernel : - in simulazione sistemato richiamo OnEndMove dopo errore di collisione alla fine del movimento. --- MachMgrBasic.cpp | 6 +++++- Simulator.cpp | 13 +++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/MachMgrBasic.cpp b/MachMgrBasic.cpp index 02624f3..457ab9a 100644 --- a/MachMgrBasic.cpp +++ b/MachMgrBasic.cpp @@ -311,7 +311,11 @@ MachMgr::SetLastError( int nErr, const string& sErr) { m_nLastError = nErr ; m_sLastError = sErr ; - string sInfo = m_sLastError + " (" + ToString( nErr) + ")" ; + string sInfo ; + if ( sErr._Starts_with( "Error")) + sInfo = m_sLastError + " (" + ToString( nErr) + ")" ; + else + sInfo = "Error " + ToString( nErr) + " : " + m_sLastError ; LOG_ERROR( GetEMkLogger(), sInfo.c_str()) ; return true ; } diff --git a/Simulator.cpp b/Simulator.cpp index 9e46d80..dd4c47f 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -1278,10 +1278,15 @@ Simulator::ManageSingleMove( int& nStatus, double& dMove) int nErr ; if ( ! OnCollision( nCdInd, nObjInd, nErr)) { nStatus = CalcStatusOnError( nErr) ; - // Se arrivato a fine interpolazione movimento, salvo posizioni - if ( m_dCoeff > COEFF_LIM && m_bEnabAxes) { - for ( size_t i = 0 ; i < m_AxesName.size() ; ++ i) - m_AxesVal[i] = AxesEnd[i] ; + // Se arrivato a fine interpolazione movimento, salvo posizioni e segnalo + if ( m_dCoeff > COEFF_LIM) { + if ( m_bEnabAxes) { + for ( size_t i = 0 ; i < m_AxesName.size() ; ++ i) + m_AxesVal[i] = AxesEnd[i] ; + } + // richiamo gestione evento fine entità, senza gestirne eventuali errori + int nErr ; + OnMoveEnd( nErr) ; } return false ; }