Example #1
0
        public void addMotion(Motion motion)
        {
            Motion tempMotion;

                lock (motionStack)
                {
                    if (motion is MotionParameters)
                    {
                        tempMotion = new MotionParameters(motion.X, motion.Y, motion.Z, motion.A, motion.B, motion.C, motion.name, ((MotionParameters)motion).C_DIS, ((MotionParameters)motion).gripClose);
                    }
                    else
                    {
                        tempMotion = new Motion(motion.X, motion.Y, motion.Z, motion.A, motion.B, motion.C, motion.name);
                    }
                }

                lock (motionStack)
                {
                    motionStack.Add(motion);
                Debug.WriteLine("StackSize : " + stackSize());
                }
        }
 public void WriteHalfCircle(double CenterX, double CenterY, double Radius, Boolean circledown)
 {
     Double Point2Y = CenterY + Radius;
     //Besoin de 3 point
     motionArm = new Motion(CenterX + Radius, CenterY, up, 0, 0, 180, "LIN");
     R.addMotion(motionArm);
     //Point 1: le départ
     motionArm = new Motion(CenterX + Radius, CenterY, down, 0, 0, 180, "LIN");
     R.addMotion(motionArm);
     //Point 2: un point du cercle.
     if (circledown) { Point2Y = CenterY - Radius; }
     motionArmP = new MotionParameters(CenterX, Point2Y, down, 0, 0, 180, "CIRC", 5, true);
     R.addMotion(motionArmP);
     // Point 3: point d'arrivé
     motionArmP = new MotionParameters(CenterX - Radius, CenterY, down, 0, 0, 180, "CIRC", 5, true);
     R.addMotion(motionArmP);
     // On releve la pointe
     motionArm = new Motion(CenterX - Radius, CenterY, up, 0, 0, 180, "LIN");
     R.addMotion(motionArm);
     motionArm = new Motion(CenterX - Radius, CenterY, up, 0, 0, 180, "LIN");
     R.addMotion(motionArm);
 }
Example #3
0
        public void addMotion(Motion motion)
        {
            if (cli.clientReady)
            {
                Motion tempMotion;
                //s'il y a beaucoup de mouvements, on ralenti pour
                //éviter de saturer la mémoire

                lock (motionStack)
                {
                    if (motion is MotionParameters)
                    {
                        tempMotion = new MotionParameters(motion.X, motion.Y, motion.Z, motion.A, motion.B, motion.C, motion.name, ((MotionParameters)motion).C_DIS, ((MotionParameters)motion).gripClose);
                    }
                    else
                    {
                        tempMotion = new Motion(motion.X, motion.Y, motion.Z, motion.A, motion.B, motion.C, motion.name);
                    }
                }

                lock (motionStack)
                {
                    motionStack.Add(tempMotion);
                }

            }
        }
 public void copyM(MotionParameters mP)
 {
     this.copy((Motion)mP);
     this._C_DIS = mP.C_DIS;
     this._stateGripClose = mP.gripClose;
 }