Example #1
0
        private void Parse10()
        {
            Logger.Log("D10: move axis n steps");

            char axis  = GCodeParser.ReadChar();
            int  steps = GCodeParser.ParseInt();

            if (steps == -1)
            {
                return;
            }

            switch (axis)
            {
            case 'x':
            case 'X':
                DeviceFactory.Get().MoveRawX(steps);
                break;

            case 'y':
            case 'Y':
                DeviceFactory.Get().MoveRawY(steps);
                break;

            case 'z':
            case 'Z':
                DeviceFactory.Get().MoveRawZ(steps);
                break;
            }
        }
Example #2
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;
            }
        }