예제 #1
0
 public Drawer(Elevator e, Buttons[] eButton, Display eDisplay, Doors eDoors, Doors[] sDoors, Shaft s, Buttons[] sButton, Display[] sDisplay)
 {
     this.e = e;
     this.eButton = eButton;
     this.eDisplay = eDisplay;
     this.eDoors = eDoors;
     this.sDoors = sDoors;
     this.sButton = sButton;
     this.sDisplay = sDisplay;
     this.s = s;
 }
예제 #2
0
        private void StartBuild()
        {
            //ConstructElevator
            e = new Elevator(height, width);
            eDoors = new Doors(height, width);
            eDisplay = new Display(20, (width - 20) / 2);
            eButton = new Buttons[nFloor];

            //ConstructShaft
            s = new Shaft(height, width, nFloor, floorDist);
            sButton = new Buttons[nFloor];
            sDisplay = new Display[nFloor];
            sDoors = new Doors[nFloor];

            //Arrays
            for (int x = 0; x < nFloor; x++)
            {
                sButton[x] = new Buttons(35, 35);
                sDisplay[x] = new Display(40, 65);
                sDoors[x] = new Doors(height, width);
                eButton[x] = new Buttons(15, 20);
            }
        }
예제 #3
0
        private void FlipDoor(Doors door)
        {
            int mDoorV = door.DoorValMax;
            int DoorV = door.DoorVal;
            if (DoorV == 0)
            {
                while (DoorV < mDoorV)
                {
                    DoorV++;
                    door.DoorVal = DoorV;
                    eDoors.DoorVal = DoorV;
                    elevatorDisplay.RefreshDrawing();
                    Thread.Sleep(5);
                }

                AddEventList("Doors opened", e.Floor);
                Thread.Sleep(1000);
            }
            else
            {
                Thread.Sleep(1000);
                while (DoorV != 0)
                {
                    DoorV--;
                    door.DoorVal = DoorV;
                    eDoors.DoorVal = DoorV;
                    elevatorDisplay.RefreshDrawing();
                    Thread.Sleep(5);
                }

                AddEventList("Doors closed", e.Floor);
            }
        }