コード例 #1
0
ファイル: CNCDeviceTester.cs プロジェクト: Bobbbl/PC
        public CNCDeviceTester()
        {
            CNCInterface iface    = new SerialGRBLInterface(GeneralTestInformations.PortName, GeneralTestInformations.BaudRate);
            CNCProtokoll potokoll = new GRBLProtokoll();

            device = new CNC_Device(iface, potokoll);
        }
コード例 #2
0
        public void GetHomingMessage_IsEqual()
        {
            GRBLProtokoll protokoll  = new GRBLProtokoll();
            CNCMessage    cNCMessage = protokoll.GetHomingMessage();

            Assert.Equal("$H", cNCMessage.Message);
        }
コード例 #3
0
        public void GetSetZeroMessage_IsEqual()
        {
            GRBLProtokoll protokoll = new GRBLProtokoll();

            CNCMessage output = protokoll.GetSetZeroMessage();

            Assert.Equal("G10 P1 L20 X0 Y0 Z0", output.Message);
        }
コード例 #4
0
        public void GetKillAlarmMessage_IsEqual()
        {
            GRBLProtokoll protokoll = new GRBLProtokoll();

            CNCMessage cNCMessage = protokoll.GetKillAlarmMessage();

            Assert.Equal("$X", cNCMessage.Message.Trim());
        }
コード例 #5
0
        public void GetMoveByZMessage_IsEqual()
        {
            // Arrange
            GRBLProtokoll protokoll = new GRBLProtokoll();

            // Act
            CNCMessage output = protokoll.GetMoveByZMessage(12, 100);

            // Assert
            Assert.Equal("Z12 F100", output.Message.Trim());
        }
コード例 #6
0
        public void GetCurrentXYZMessage_IsEqual()
        {
            // Arrange
            GRBLProtokoll protokoll = new GRBLProtokoll();

            // Act
            CNCMessage output = protokoll.GetCurrentXYZMessage();

            // Assert
            Assert.Equal("?", output.Message);
        }
コード例 #7
0
        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());
        }
コード例 #8
0
        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());
        }
コード例 #9
0
ファイル: SerialGRBLInterfaceTest.cs プロジェクト: Bobbbl/PC
        public void SendMessage_GotAnythingBack()
        {
            // Assamble
            GRBLProtokoll pr = new GRBLProtokoll();
            CNCMessage    m  = pr.GetCurrentFeedMessage();

            // Act
            GRBLInterface.SendMessage(m);


            // Assert
            // No Exception is proof enough
        }
コード例 #10
0
ファイル: SerialGRBLInterfaceTest.cs プロジェクト: Bobbbl/PC
        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);
        }