示例#1
0
        public void CheckSumTest4M115()
        {
            var cmd = TestSuiteDataSource.TestSyntheticCodes[6];
            var g   = GcodeParser.ToGCode(cmd);

            g.N = 6;
            var crc = GcodeCrc.FrameCrc(g);

            Assert.IsTrue(crc >= 0, $"{cmd}");
        }
示例#2
0
        public void CheckSumTest1()
        {
            var cmd = TestSuiteDataSource.TestSyntheticCodes[0];
            var g   = GcodeParser.ToGCode(cmd);

            g.N = 1;
            var crc = GcodeCrc.FrameCrc(g);

            Assert.IsInstanceOfType(crc, typeof(int));
        }
示例#3
0
 public void CheckSumTest3()
 {
     for (var i = 1; i < TestSuiteDataSource.TestSyntheticCodes.Length; i++)
     {
         var cmd = TestSuiteDataSource.TestSyntheticCodes[i];
         var g   = GcodeParser.ToGCode(cmd);
         g.N = i;
         var crc = GcodeCrc.FrameCrc(g);
         Assert.IsTrue(crc >= 0, $"{i} {cmd}");
     }
 }
示例#4
0
 public void CheckSumTest2()
 {
     for (var i = 1; i < TestSuiteDataSource.TestSyntheticCodes.Length; i++)
     {
         var cmd = TestSuiteDataSource.TestSyntheticCodes[i];
         var g   = GcodeParser.ToGCode(cmd);
         g.N = i;
         var crc = GcodeCrc.FrameCrc(g);
         Assert.IsInstanceOfType(crc, typeof(int));
     }
 }
示例#5
0
        public void GcodeParserTestsCheckSumIcTest1()
        {
            var ds    = TestSuiteDataSource.TestSyntheticCodes[0];
            var gcode = GcodeParser.ToGCode(ds);

            gcode.N        = 1;
            gcode.CheckSum = GcodeCrc.FrameCrc(gcode);
            var resStr = GcodeParser.ToStringCommand(gcode);

            Assert.IsNotNull(resStr);
            Assert.IsTrue(resStr.Contains($"*{gcode.CheckSum}"));
        }
示例#6
0
        public void CheckSumTest4()
        {
            var ds = TestSuiteDataSource.Ds100Gcode.Split("\n");

            for (var i = 1; i < ds.Length; i++)
            {
                var cmd = ds[i];
                var g   = GcodeParser.ToGCode(cmd);
                g.N = i;
                var crc = GcodeCrc.FrameCrc(g);
                Assert.IsTrue(crc >= 0, $"{i} {cmd}");
            }
        }
示例#7
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} ");
                }
            }
        }
示例#8
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));
                }
            }
        }