EgtMachKernel 2.4g2 :

- correzione calcolo angolo di asse rotante con corsa nulla.
This commit is contained in:
DarioS
2022-07-13 18:29:36 +02:00
parent 8f224a6b61
commit 91005b36ba
2 changed files with 13 additions and 1 deletions
+13 -1
View File
@@ -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) ;
}
//----------------------------------------------------------------------------