public CNCDeviceTester() { CNCInterface iface = new SerialGRBLInterface(GeneralTestInformations.PortName, GeneralTestInformations.BaudRate); CNCProtokoll potokoll = new GRBLProtokoll(); device = new CNC_Device(iface, potokoll); }
public void GetHomingMessage_IsEqual() { GRBLProtokoll protokoll = new GRBLProtokoll(); CNCMessage cNCMessage = protokoll.GetHomingMessage(); Assert.Equal("$H", cNCMessage.Message); }
public void GetSetZeroMessage_IsEqual() { GRBLProtokoll protokoll = new GRBLProtokoll(); CNCMessage output = protokoll.GetSetZeroMessage(); Assert.Equal("G10 P1 L20 X0 Y0 Z0", output.Message); }
public void GetKillAlarmMessage_IsEqual() { GRBLProtokoll protokoll = new GRBLProtokoll(); CNCMessage cNCMessage = protokoll.GetKillAlarmMessage(); Assert.Equal("$X", cNCMessage.Message.Trim()); }
public void GetMoveByZMessage_IsEqual() { // Arrange GRBLProtokoll protokoll = new GRBLProtokoll(); // Act CNCMessage output = protokoll.GetMoveByZMessage(12, 100); // Assert Assert.Equal("Z12 F100", output.Message.Trim()); }
public void GetCurrentXYZMessage_IsEqual() { // Arrange GRBLProtokoll protokoll = new GRBLProtokoll(); // Act CNCMessage output = protokoll.GetCurrentXYZMessage(); // Assert Assert.Equal("?", output.Message); }
public void GetRelativeJogByXYZMessage_IsEqual() { // Arrange GRBLProtokoll protokoll = new GRBLProtokoll(); // Act CNCMessage output = protokoll.GetRelativeJogByXYZMessage(12, 12, 12, 100); // Assert Assert.Equal("$J=G21 G91 X12 Y12 Z12 F100", output.Message.Trim()); }
public void GetSpindelSetRPMMessage_IsEqual() { GRBLProtokoll gRBLProtokoll = new GRBLProtokoll(); CNCMessage cNCMessage = gRBLProtokoll.GetSpindelSetRPMMessage(1000, "clockwise"); CNCMessage nNCMessagecounter = gRBLProtokoll.GetSpindelSetRPMMessage(1000, "counterclockwise"); Assert.Equal("M3 S1000", cNCMessage.Message.Trim()); Assert.Equal("M4 S1000", nNCMessagecounter.Message.Trim()); }
public void SendMessage_GotAnythingBack() { // Assamble GRBLProtokoll pr = new GRBLProtokoll(); CNCMessage m = pr.GetCurrentFeedMessage(); // Act GRBLInterface.SendMessage(m); // Assert // No Exception is proof enough }
public void SendMessage_ReceiveMessage() { // Assamble GRBLProtokoll pr = new GRBLProtokoll(); CNCMessage m = pr.GetCurrentFeedMessage(); CNCMessage start = new CNCMessage() { Message = "Grbl 1.1g ['$' for help]" }; var an = GRBLInterface.WaitReceiveMessage(100, start, 2000); // Act GRBLInterface.SendMessage(m); //CNCMessage answer = GRBLInterface.ReceiveMessage(10); CNCMessage tmp = new CNCMessage() { Message = "F" }; CNCMessage answer = GRBLInterface.WaitReceiveMessage(100, tmp, 3000); // Assert Assert.Contains("F", answer.Message); }