예제 #1
0
        // With R
        public string ArcMove(double[] pos, double radius, WorkingPlane plane, bool clkwise, double[] vel, double[] acc, bool extrude,
                              bool interpolated, bool abs_coord, int line)
        {
            PackageJSON package = new PackageJSON();

            package.line = line;
            if (abs_coord)
            {
                package.keycode = (int)move_codes.ArcMoveRadius;
                package.text    = "Arc Move Radius";
            }
            else
            {
                package.keycode = (int)move_codes.IncArcMoveRadius;
                package.text    = "Incremental Arc Move Radius";
            }

            package.pos1     = pos;
            package.aux      = radius;
            package.plane    = (int)plane;
            package.clkwise  = clkwise;
            package.interpol = interpolated;
            package.vel      = vel;
            package.acc      = acc;
            package.extrude  = extrude;

            string pack_json = JsonConvert.SerializeObject(package);

            return(pack_json);
        }
예제 #2
0
        // Full circle
        public string ArcMove(double[] cen, WorkingPlane plane, bool clkwise, double[] vel, double[] acc, bool extrude, bool interpolated, bool abs_coord, int line)
        {
            PackageJSON package = new PackageJSON();

            package.line = line;
            if (abs_coord)
            {
                package.keycode = (int)move_codes.CircleMove;
                package.text    = "Circle Move";
            }
            else
            {
                package.keycode = (int)move_codes.IncCircleMove;
                package.text    = "Incremental Circle Move";
            }
            ////Convert milimeters to meters
            //for (int i = 0; i < 3; ++i)
            //{
            //    cen[i] /= 1000;
            //    vel[i] /= 1000;
            //    acc[i] /= 1000;
            //}

            package.pos2     = cen;
            package.plane    = (int)plane;
            package.clkwise  = clkwise;
            package.interpol = interpolated;
            package.vel      = vel;
            package.acc      = acc;
            package.extrude  = extrude;

            string pack_json = JsonConvert.SerializeObject(package);

            return(pack_json);
        }
예제 #3
0
        /// <summary>
        /// LINEAR MOVE
        ///
        /// Movement is transversed at the specified feed rate (primary velocity mm/min),
        /// on a straight line to the target position.
        /// The movement of all axis is synchronous, i.e., they stop moving simultaneously.
        /// </summary>
        /// <param name="pos">Final absolute position</param>
        /// <returns></returns>
        public string LinearMove(double[] pos, double[] vel, double[] acc, bool extrude, bool interpolated, bool abs_coord, int line)
        {
            PackageJSON package = new PackageJSON();

            package.line = line;
            //Check if sending incremental or absolute coordinates
            if (abs_coord)
            {
                package.keycode = (int)move_codes.LinearMove;
                package.text    = "Linear Move";
            }
            else
            {
                package.keycode = (int)move_codes.IncLinearMove;
                package.text    = "Linear Rapid Move";
            }

            package.pos1     = pos;
            package.interpol = interpolated;
            package.vel      = vel;
            package.acc      = acc;
            package.extrude  = extrude;

            string pack_json = JsonConvert.SerializeObject(package);

            return(pack_json);
        }
예제 #4
0
        /// <summary>
        /// DWELL
        ///
        /// Stops motion for a specific time frame (milliseconds).
        /// </summary>
        /// <param name="time">Defined either at X-coordinate or No_letter-coordinate</param>
        /// <returns></returns>
        public string Dwell(double time, int line)
        {
            PackageJSON package = new PackageJSON();

            package.line    = line;
            package.keycode = (int)move_codes.Dwell;
            package.text    = "Dwell";
            package.aux     = time;

            string pack_json = JsonConvert.SerializeObject(package);

            return(pack_json);
        }