Example #1
0
        private void AddAxis(char c)
        {
            float distance = (float)GCodeParser.ParseDouble();

            if (distance == float.MinValue)
            {
                Logger.Error("ERROR, axis definition without real value");
                return;
            }

            switch (c)
            {
            case 'X': ToX = distance; break;

            case 'Y': ToY = distance; break;

            case 'Z': ToZ = distance; break;

            case 'I': ToI = distance; break;

            case 'J': ToJ = distance; break;

            case 'K': ToK = distance; break;

            case 'R': ToR = distance; break;

            default:
                Logger.Error("ERROR: unknown axis while parsing axes: {0}", c);
                break;
            }

            char next = GCodeParser.PeekChar();

            switch (next)
            {
            case 'X':
            case 'Y':
            case 'Z':
            case 'I':
            case 'J':
            case 'K':
            case 'R':
                GCodeParser.ReadChar();
                AddAxis(next);
                break;
            }
        }
Example #2
0
        public override void Parse()
        {
            float feedRate = (float)GCodeParser.ParseDouble();

            DeviceFactory.Get().SetFeedRate(feedRate);
        }