Пример #1
0
        public void NormalizeRawFrameTestReal2()
        {
            var data = TestSuiteDataSource.ReadTextFromFile("28.gcode.modified.gcode").Split("\r\n");

            foreach (var d in data)
            {
                var parser = new GcodeParser(d);
                if (!parser.IsComment)
                {
                    var res = parser.NormalizeRawFrame();
                    Assert.AreEqual(d, res);
                }
            }
        }
Пример #2
0
        public void NormalizeRawFrameTestReal1()
        {
            var data = TestSuiteDataSource.ReadTextFromFile("pattern_blade_fp_piece2_v1.gcode").Split("\r\n");

            foreach (var d in data)
            {
                var parser = new GcodeParser(d);
                if (!parser.IsComment)
                {
                    var res = parser.NormalizeRawFrame();
                    Assert.AreEqual(d, res);
                }
            }
        }
Пример #3
0
        public void NormalizeRawFrameTestReal_Cube()
        {
            var data = TestSuiteDataSource.ReadTextFromFile("100.gcode").Split("\r\n");

            foreach (var d in data)
            {
                if (!d.Contains(";"))
                {
                    var parser = new GcodeParser(d);
                    var res    = parser.NormalizeRawFrame();
                    Assert.AreEqual(d, res);
                }
            }
        }
Пример #4
0
        public void GcodeCheckSumTest3()
        {
            var gcodeCommands = TestSuiteDataSource.ReadTextFromFile("100.gcode").Split("\r\n");

            if (gcodeCommands == null || gcodeCommands.Length == 0)
            {
                return;
            }

            for (var i = 1; i < gcodeCommands.Length; i++)
            {
                var frame  = gcodeCommands[i];
                var parser = new GcodeParser(frame);

                if (!parser.IsComment)
                {
                    var frameCrc = GcodeCrc.FrameCrc(i, frame);
                    Assert.IsTrue(frameCrc > 0, $"CRC: {frameCrc} Failed at {i},frame: {frame} ");
                }
            }
        }
Пример #5
0
        public void GcodeCheckSumTest1()
        {
            var gcodeCommands = TestSuiteDataSource.ReadTextFromFile("pattern_blade_fp_piece2_v1.gcode").Split("\r\n");

            if (gcodeCommands == null || gcodeCommands.Length == 0)
            {
                return;
            }

            for (var i = 1; i < gcodeCommands.Length; i++)
            {
                var frame  = gcodeCommands[i];
                var parser = new GcodeParser(frame);

                if (!parser.IsComment)
                {
                    var frameCrc = GcodeCrc.FrameCrc(i, frame);
                    Assert.IsInstanceOfType(frameCrc, typeof(int));
                }
            }
        }