Ejemplo n.º 1
0
        public GCodeFile()
        {
            GCodeCommand mm = new GCodeCommand() { Command = 21 };
            GCodeCommand feed = new GCodeCommand() { Command = 1 };
            feed.Numbers["F"] = 50;

            Commands.Add(mm);
            Commands.Add(feed);

            Commands.Add(new GCodeCommand() { Command = 94 });
            Commands.Add(new GCodeCommand() { Command = 90 });
            Commands.Add(new GCodeCommand() { Command = 54 });
            Commands.Add(new GCodeCommand() { Command = 17 });

        }
Ejemplo n.º 2
0
        public void MoveTo(double tx, double ty, double tz, MoveMode mode = MoveMode.Slow)
        {
            GCodeCommand GCC = new GCodeCommand();
            GCC.Command =  1;
            if (x != tx)
            {
                GCC.Numbers["X"] = tx;
                x = tx;
            }
            if (y != ty)
            {
                GCC.Numbers["Y"] = ty;
                y = ty;
            }
            if (z != tz)
            {
                GCC.Numbers["Z"] = tz;
                z = tz;
            }
            switch (mode)
            {
                case MoveMode.ReallySlow:

                    GCC.Numbers["F"] = 30; ;
                    break;
                case MoveMode.Slow:

                    GCC.Numbers["F"] = 65; ;
                    break;
                case MoveMode.Fast:

                    GCC.Numbers["F"] = 65; ;
                    break;
            }
            Commands.Add(GCC);

        }