From 91005b36ba3d98e3c0011f2356e13a5d0c8f9836 Mon Sep 17 00:00:00 2001 From: DarioS Date: Wed, 13 Jul 2022 18:29:36 +0200 Subject: [PATCH] EgtMachKernel 2.4g2 : - correzione calcolo angolo di asse rotante con corsa nulla. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes MachineCalc.cpp | 14 +++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 775a56e05ebe5ddc162757e2dde6538c5859db5f..5d5c08f52b47b69b2a4dbef8efe4cc57f08909d9 100644 GIT binary patch delta 97 zcmewt{V#gMFE&P_&A-`fnHh~HKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmU8!BZvS1 delta 97 zcmewt{V#gMFE&QQ&A-`fnHdcyKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmU3rBY*$^ diff --git a/MachineCalc.cpp b/MachineCalc.cpp index 30660d1..36f0733 100644 --- a/MachineCalc.cpp +++ b/MachineCalc.cpp @@ -1423,7 +1423,19 @@ Machine::AdjustAngleInStroke( const STROKE& Stroke, double& dAng) const dAng += ANG_FULL ; while ( dAng > Stroke.Max) dAng -= ANG_FULL ; - return ( dAng >= Stroke.Min && dAng <= Stroke.Max) ; + // se asse rotante a corsa nulla + if ( Stroke.Max - Stroke.Min < EPS_ANG_SMALL) { + double dStrokeMid = ( Stroke.Min + Stroke.Max) / 2 ; + if ( abs( dAng - dStrokeMid) < EPS_ANG_SMALL) { + dAng = dStrokeMid ; + return true ; + } + else + return false ; + } + // altrimenti assi rotante vero + else + return ( dAng >= Stroke.Min && dAng <= Stroke.Max) ; } //----------------------------------------------------------------------------