Exemple #1
0
        public Arm(double length1, double length2, Servo baseServo, Servo elbowServo)
        {
            this.length1    = length1;
            this.length2    = length2;
            this.baseServo  = baseServo;
            this.elbowServo = elbowServo;

            CreateUI();

            baseServo.Move  += OnMove;
            elbowServo.Move += OnMove;
        }
        private void Initialize()
        {
            Servo baseServo  = new Servo(0, 0, Math.PI, Math.PI, 0.5);
            Servo elbowServo = new Servo(Math.PI / 2.0, 0, Math.PI, Math.PI, 0.5);

            arm = new Arm(150, 125, baseServo, elbowServo);

            CreateUI();

            canvas.Children.Add(arm.boundariesCanvas);
            canvas.Children.Add(arm.accuracyCanvas);
            canvas.Children.Add(arm.armCanvas);
            canvas.Margin = new Thickness(360, 360, 0, 0);


            arm.Move         += Arm_Move;;
            canvas.MouseMove += Canvas_MouseMove;;
        }
 public DrawingArm(Arm arm, Servo linearServo)
 {
     this.arm         = arm;
     this.linearServo = linearServo;
 }