From 37b53074cb99ef7d646ff687adb9716ab9ecc53e Mon Sep 17 00:00:00 2001 From: arkypita Date: Fri, 5 Jul 2024 20:47:20 +0200 Subject: [PATCH] fix issue with jogging --- LaserGRBL/AssemblyInfo.cs | 2 +- LaserGRBL/Core/GrblCore.cs | 38 +++++++++++++++++++++++--------------- setup.iss | 2 +- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/LaserGRBL/AssemblyInfo.cs b/LaserGRBL/AssemblyInfo.cs index 6e9a1790..f1f5d030 100644 --- a/LaserGRBL/AssemblyInfo.cs +++ b/LaserGRBL/AssemblyInfo.cs @@ -31,5 +31,5 @@ // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build // utilizzando l'asterisco (*) come descritto di seguito: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion ("7.10.0")] +[assembly: AssemblyVersion ("7.11.0")] [assembly: NeutralResourcesLanguage("en")] diff --git a/LaserGRBL/Core/GrblCore.cs b/LaserGRBL/Core/GrblCore.cs index 502bd540..2495fe85 100644 --- a/LaserGRBL/Core/GrblCore.cs +++ b/LaserGRBL/Core/GrblCore.cs @@ -1753,22 +1753,30 @@ private void EnqueueJogV11(PointF target, float speed) private void EnqueueJogV11(JogDirection dir, decimal step, float speed) { - string cmd = "$J=G91"; - if (dir == JogDirection.NE || dir == JogDirection.E || dir == JogDirection.SE) - cmd += $"X{step.ToString("0.0", NumberFormatInfo.InvariantInfo)}"; - if (dir == JogDirection.NW || dir == JogDirection.W || dir == JogDirection.SW) - cmd += $"X-{step.ToString("0.0", NumberFormatInfo.InvariantInfo)}"; - if (dir == JogDirection.NW || dir == JogDirection.N || dir == JogDirection.NE) - cmd += $"Y{step.ToString("0.0", NumberFormatInfo.InvariantInfo)}"; - if (dir == JogDirection.SW || dir == JogDirection.S || dir == JogDirection.SE) - cmd += $"Y-{step.ToString("0.0", NumberFormatInfo.InvariantInfo)}"; - if (dir == JogDirection.Zdown) - cmd += $"Z-{step.ToString("0.0", NumberFormatInfo.InvariantInfo)}"; - if (dir == JogDirection.Zup) - cmd += $"Z{step.ToString("0.0", NumberFormatInfo.InvariantInfo)}"; + if (dir == JogDirection.Home) + { + EnqueueCommand(new GrblCommand(string.Format("$J=G90X0Y0F{0}", speed))); + } + else + { + string cmd = "$J=G91"; + if (dir == JogDirection.NE || dir == JogDirection.E || dir == JogDirection.SE) + cmd += $"X{step.ToString("0.0", NumberFormatInfo.InvariantInfo)}"; + if (dir == JogDirection.NW || dir == JogDirection.W || dir == JogDirection.SW) + cmd += $"X-{step.ToString("0.0", NumberFormatInfo.InvariantInfo)}"; + if (dir == JogDirection.NW || dir == JogDirection.N || dir == JogDirection.NE) + cmd += $"Y{step.ToString("0.0", NumberFormatInfo.InvariantInfo)}"; + if (dir == JogDirection.SW || dir == JogDirection.S || dir == JogDirection.SE) + cmd += $"Y-{step.ToString("0.0", NumberFormatInfo.InvariantInfo)}"; + if (dir == JogDirection.Zdown) + cmd += $"Z-{step.ToString("0.0", NumberFormatInfo.InvariantInfo)}"; + if (dir == JogDirection.Zup) + cmd += $"Z{step.ToString("0.0", NumberFormatInfo.InvariantInfo)}"; + + cmd += $"F{speed}"; + EnqueueCommand(new GrblCommand(cmd)); + } - cmd += $"F{speed}"; - EnqueueCommand(new GrblCommand(cmd)); } //private void DoJogV11(JogDirection dir, decimal step) diff --git a/setup.iss b/setup.iss index 2d9c67ef..0d70a1b6 100644 --- a/setup.iss +++ b/setup.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "LaserGRBL" -#define MyAppVersion "7.10.0" +#define MyAppVersion "7.11.0" #define MyAppVersionName "Rhydon" #define MyAppPublisher "LaserGRBL" #define MyAppURL "https://lasergrbl.com"