During each iteration it checks the physical buttons whether any has been pressed and reads the statuses of all the floor sensors. Your system will execute in a single thread, and your design includes the following classes: ElevatorMain: This class runs an infinite loop. 0000000 budou - Requests outstanding to visit the floors L 2113 4|5|6||7 Floor where the elevator currently is Down Up Direction of travel Button to summon the elevator to this floor Suppose that you already have designed UML interaction and class diagrams. When the elevator has no requests, it remains at its current floor with its doors closed. After this, it will serve the requests in the opposite direction, if any. Let us assume that the outstanding requests are served so that the elevator will first visit all the requested floors in the direction to which it went first after the idle state. Also, the button that summoned the elevator to the floor should be turned off. After the elevator visits a requested floor, the corresponding lamp on all information panels should be turned off. For example, in the figure below, the panel indicates that the elevator car is currently on the fifth floor, going up, and there are outstanding requests to visit the lobby, third, fourth, and sixth floor. In addition, there will be two arrow-shaped lamps to indicate the current direction of travel. A square lamp indicates that the car is at the corresponding floor, and a round lamp indicates that there is a request outstanding for the elevator to visit the corresponding floor. The information panels will have two lamps representing each floor (see the figure below). There will be an information panel above the elevator doors on each floor, to show waiting people where the elevator car is at any time, so that they will know how long they can expect to wait until it arrives. At each floor, there will be a floor sensor that is “on” when the elevator car is within 10 cm of the rest position at the floor. Pressing a button will be detected as a pulse (i.e., it does not matter if the user keeps holding the button pressed). Assume that there will be a button at each floor to summon the elevator, and a set of buttons inside the elevator car-one button per floor to direct the elevator to the corresponding floor. Transcribed image text: Problem 3.7: Elevator Control Consider developing a software system to control an elevator in a building.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |