From 93c4aa3c0c5f50a369d2ecaa16bfc9592d70ab25 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Fri, 13 Nov 2020 17:18:04 -0800 Subject: [PATCH] Adding M851 to the emulator (Set XYZ Probe Offset) --- .../Drivers/Emulator/Emulator.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MatterControlLib/PrinterCommunication/Drivers/Emulator/Emulator.cs b/MatterControlLib/PrinterCommunication/Drivers/Emulator/Emulator.cs index 6e0ca45a2..ca27cd312 100644 --- a/MatterControlLib/PrinterCommunication/Drivers/Emulator/Emulator.cs +++ b/MatterControlLib/PrinterCommunication/Drivers/Emulator/Emulator.cs @@ -94,6 +94,7 @@ namespace MatterHackers.PrinterEmulator { "M20", ListSdCard }, { "M21", InitSdCard }, { "M306", SetHomeOffset }, + { "M851", SetXYZProbeOffset }, { "N", ParseChecksumLine }, { "T0", SetExtruderIndex }, { "T1", SetExtruderIndex }, @@ -242,7 +243,7 @@ namespace MatterHackers.PrinterEmulator Console.WriteLine(command); } - if(command.StartsWith("T")) + if (command.StartsWith("T")) { int a = 0; } @@ -418,6 +419,13 @@ ok return "ok\n"; } + private string SetXYZProbeOffset(string command) + { + XYZProbeOffset = Destination; + + return "ok\n"; + } + private readonly Random rand = new Random(); private string ProbePosition(string command) @@ -709,6 +717,8 @@ ok public Vector3 HomePosition { get; set; } = default(Vector3); + public Vector3 XYZProbeOffset { get; set; } = default(Vector3); + public void Close() { this.ShutDown();