diff --git a/Simulator.cpp b/Simulator.cpp index 742334d..e7372bb 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -1018,6 +1018,12 @@ Simulator::ManageSingleMove( int& nStatus, double& dMove) for ( int i = 0 ; i < int( m_VmId.size()) ; ++ i) bOkI = m_pGeomDB->GetGlobFrame( m_VmId[i], vFrVzmI[i]) && bOkI ; + // Log per debug + if ( ExeGetDebugLevel() >= 10) { + string sOut = "MoveType=" + ToString( nMoveType) + " Coeff=" + ToString( m_dCoeff) ; + LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) + } + // Eseguo movimento rapido o lineare if ( nMoveType != 2 && nMoveType != 3) { // se attivo CollisionCheck approssimo movimento con pił step @@ -1298,8 +1304,8 @@ Simulator::ExecLineVmill( int nVmId, int nCurrTool, double dVmTdOffs, double dVm ptHfL += dVmTdOffs * vtHfL + dVmAdOffs * vtAfL ; // Log per debug if ( ExeGetDebugLevel() >= 10) { - string sOut = "Zmap=" + ToString( nVmId) + " CurrTool=" + ToString( nCurrTool) + - "Pi=(" + ToString( ptHiL) + ") Vi=(" + ToString( vtHiL) + ") Ai=(" + ToString( vtAiL) + + string sOut = "Zmap=" + ToString( nVmId) + " Tool=" + ToString( nCurrTool) + + " Pi=(" + ToString( ptHiL) + ") Vi=(" + ToString( vtHiL) + ") Ai=(" + ToString( vtAiL) + ") Pf=(" + ToString( ptHfL) + ") Vf=(" + ToString( vtHfL) + ") Af=(" + ToString( vtAfL) + ")" ; LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) } @@ -2132,6 +2138,7 @@ Simulator::MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt) static const int STEP_RAPID = -2 ; static const int STEP_RAPROT = -3 ; static const int STEP_COLLROT = -4 ; + bool bViewAllFrames = true ; int nStep = 1 ; for ( int i = 0 ; i < nAxCount ; ++ i) { double dMove = abs( vAxNaEpSt[i].dEndPos - vPrev[i]) ; @@ -2141,10 +2148,14 @@ Simulator::MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt) dStep = m_dStep ; else if ( abs( dStep - STEP_RAPID) < EPS_SMALL) dStep = 4 * m_dStep ; - else if ( abs( dStep - STEP_RAPROT) < EPS_SMALL) + else if ( abs( dStep - STEP_RAPROT) < EPS_SMALL) { dStep = 0.4 * m_dStep ; - else // STEP_COLLROT + bViewAllFrames = false ; + } + else { // STEP_COLLROT dStep = min( 0.4 * m_dStep, 10.) ; + bViewAllFrames = false ; + } } dStep = max( dStep, 1.) ; int nAxStep = int( dMove / dStep) + 1 ; @@ -2179,7 +2190,8 @@ Simulator::MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt) } } // Aggiorno visualizzazione - ExeDraw() ; + if ( bViewAllFrames || ( i % 2) == 0 || i == nStep) + ExeDraw() ; // Verifico collisioni int nCdInd, nObjInd ; bool bCollCheck = ExecCollisionCheck( nCdInd, nObjInd, nMoveType) ;