Beispiel #1
0
 //Method for receiving part from previous model
 public override void ReceivePart(Part receivingPart)
 {
     _parts[0] = new Part(DrawingWindow, 874, 295)
     {
         Color = receivingPart.Color,
         Height = receivingPart.Height,
         Hidden = false
     };
 }
Beispiel #2
0
        private Rectangle _upsideViewedPart; //Moving part on model 1 (Viewed from upside)

        #endregion Fields

        #region Constructors

        public Model1(Graphics mainDrawingWindow, CallBack nextModelCallBack = null)
            : base(mainDrawingWindow, nextModelCallBack)
        {
            //Objects to move
            _model1Pusher = new Rectangle(50, 90, 85, 20);
            _part = new Part(mainDrawingWindow, 65, 375);
            _auxiliaryPart = new Part(mainDrawingWindow, 65, 375);
            _upsideViewedPart = new Rectangle(135, 80, 40, 40);
            _positionSucker = new PointF((float)(324 + (Math.Sin((Math.PI / 180) * _model1ArmAngle) * 238)),
                                   (float)(367 - (Math.Cos((Math.PI / 180) * _model1ArmAngle) * 238)));
        }
Beispiel #3
0
        //Constructor
        public Model2(Graphics mainDrawingWindow, CallBack nextModelCallBack = null)
            : base(mainDrawingWindow, nextModelCallBack)
        {
            //Initialize brushes
            _brushOrange = new SolidBrush(Color.Orange);

            //Parts to move
            _auxPart = new Part(mainDrawingWindow, 595, 210);
            _auxPart2 = new Part(mainDrawingWindow, 595, 210);
            _auxPart.Hidden = true;
            Parts = new Part[3];
            Parts[0] = new Part(mainDrawingWindow, 540, 350);
            Parts[1] = new Part(mainDrawingWindow, 0, -20);
            Parts[2] = new Part(mainDrawingWindow, 0, -20);
            Parts[0].Hidden = true;
            Parts[1].Hidden = true;
            Parts[2].Hidden = true;
            _upsideViewedPart = new Rectangle(65, 95, 40, 40);

            _elevator = new Rectangle(425, 370, 170, 35);
            _elevatorCylinder = new Rectangle(425, 340, 80, 30);
            _elevatorPiston = new Rectangle(505, 350, 10, 10);
            _measurementCylinder = new Rectangle(545, 80, 30, 80);
            _measurementPiston = new Rectangle(555, 160, 10, 40);
            _topCylinder = new Rectangle(440, 25, 30, 70);
            _topPiston = new Rectangle(450, 95, 10, 10);
            _topPlatform = new Rectangle(425, 100, 170, 45);
            _downRamp = new[] { new Point(595, 360), new Point(775, 397), new Point(775, 405), new Point(595, 405) };
            _topRamp = new[] { new Point(595, 220), new Point(595, 245), new Point(865, 300), new Point(865, 275) };
            _rampTopView = new Rectangle(650, 80, 215, 70);
            _rampPiston1 = new Rectangle(760, 80, 10, 10);
            _rampPiston2 = new Rectangle(830, 80, 10, 40);

            _onRamp = false;
            _onDownRamp = false;
            _showTopView = false;
            _rotateAngle = 11.62f;
            _endFeederAnimation = false;
        }
Beispiel #4
0
 public override void ReceivePart(Part receivingPart)
 {
 }
Beispiel #5
0
 private void AnimationArmToModel2()
 {
     if (_model1Pusher.X != 50)
     {
         _auxiliaryPart.Hidden = true;
     }
     for (; _model1ArmAngle <= 83; _model1ArmAngle++) //Move to the elevator
     {
         if (SetEndAnimation)
         {
             _model1ArmAngle = 83;
             break;
         }
         Thread.Sleep(3);
     }
     if (_model1ArmPart)
     {
         DeliverPart(_part);
         _part = null;
         _part = new Part(DrawingWindow, 65, 375);
         _model1ArmPart = false;
     }
 }
Beispiel #6
0
 //Method for passing a part to the next model
 protected void DeliverPart(Part deliveringPart)
 {
     if (_nextModelReceivePart != null)
     {
         _nextModelReceivePart(deliveringPart);
     }
 }
Beispiel #7
0
 //Method for receiving a new part from the previous model
 public abstract void ReceivePart(Part receivingPart);
Beispiel #8
0
 //Method for receiving part from previous model
 public override void ReceivePart(Part receivingPart)
 {
     Parts[0].X = 540;
     Parts[0].Y = 350;
     Parts[0].Hidden = false;
 }