From 68d52c82a7146ced2abd1b188e3fcb0872e75909 Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 5 Jul 2021 08:35:12 +0200 Subject: [PATCH] =?UTF-8?q?EgtMachKernel=202.3f1=20:=20-=20migliorata=20ve?= =?UTF-8?q?locit=C3=A0=20di=20simulazione=20con=20verifica=20di=20collisio?= =?UTF-8?q?ne=20in=20rapidi=20lunghi.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes EgtMachKernel.vcxproj | 2 ++ Simulator.cpp | 9 ++++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 33d20b1a734862831ffd2d19e6239b09bc7a5cb4..860990580556409696d8d0cd8719f54124fcc432 100644 GIT binary patch delta 121 zcmewt{V#gMH#Syt1|0^&&A-{KnVHiW3@1O7)ZLuM)x!c8zsNNCgkT;*P6$a3MUMyL R=2g-z%(yjz6ex#q0RVBoCa3@a delta 121 zcmewt{V#gMH#Sx?1|0_D&A-{KnVHiVj3+;o)ZLuM)x!c8zsNNCgkT;*P6$a3MUMyL R=2g-z%(yjz6ex#q0RVHUCa?ei diff --git a/EgtMachKernel.vcxproj b/EgtMachKernel.vcxproj index 9463bdc..91caa32 100644 --- a/EgtMachKernel.vcxproj +++ b/EgtMachKernel.vcxproj @@ -131,6 +131,7 @@ copy $(TargetPath) \EgtProg\DllD32 true Use CompileAsCpp + stdcpp17 true @@ -198,6 +199,7 @@ copy $(TargetPath) \EgtProg\Dll32 true true false + stdcpp17 false diff --git a/Simulator.cpp b/Simulator.cpp index 09a9528..6c6ab40 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -948,6 +948,7 @@ Simulator::ManageSingleMove( int& nStatus, double& dMove) int nCdInd, nObjInd ; bool bCollCheck = true ; + // Eseguo movimento assi principali ed eventuali ausiliari if ( m_bEnabAxes) { // Calcolo distanza di movimento double dSqDist = 0 ; @@ -981,8 +982,8 @@ Simulator::ManageSingleMove( int& nStatus, double& dMove) // se attivo CollisionCheck approssimo movimento con pił step int nStep = 1 ; if ( NeedCollisionCheck()) { - const double LEN_STEP = 20. ; - nStep = max( int( dDist / LEN_STEP), 1) ; + const double LEN_COLL_STEP = 10. ; + nStep = max( int( dMove / LEN_COLL_STEP), 1) ; } for ( int i = 1 ; i <= nStep ; ++ i) { double dCurrCoeff = dPrevCoeff + ( m_dCoeff - dPrevCoeff) / nStep * i ; @@ -1067,6 +1068,8 @@ Simulator::ManageSingleMove( int& nStatus, double& dMove) } } } + + // altrimenti eseguo movimento soli eventuali assi ausiliari else { // Calcolo distanza di movimento double dSqDist = 0 ; @@ -1078,7 +1081,7 @@ Simulator::ManageSingleMove( int& nStatus, double& dMove) double dPrevCoeff = m_dCoeff ; double dDist = sqrt( dSqDist) ; if ( dDist > EPS_SMALL) { - int nStep = int( max( dDist / ( ( nMoveType == 0 ? 4 : 1) * m_dStep), 1.)) ; + int nStep = int( max( dDist / ( ( nMoveType == 0 ? 2 : 1) * m_dStep), 1.)) ; m_dCoeff += 1. / nStep ; if ( m_dCoeff > 1) m_dCoeff = 1 ;