CS 4330/6310
ASSIGNMENT 4 - STATE CHARTS
Pretend that you are a systems analyst for a company that wants
to develop and market a garage door opening device. You have
identified
a potential customer and gathered some requirements.
- The system should be composed of three devices: a remote
control
device, a stationary control device, and a mounted motor.
- The remote control device consists of an activator button and a
light.
The light goes on when the button is pushed and goes off when the
button
is released. The remote control device sends a signal to the motor.
- The motor works in two directions, pulling the door up or pushing
it
down.
It is turned on and off by either of the control devices. If the motor
is currently inactive and it receives an activation event notification,
it will move in the opposite direction from the last previous motion.
Also, if either control device button is pressed while the motor is
running
in a upward direction, the motor is immediately turned off. However, as
a safety
precaution, if the motor is running downward and either button is
pressed,
the motor stops and then immediately starts again, going in the upward
direction. The motor is automatically turned off when the door reaches
its fully open or fully closed position.
- Housed with the motor is a work light. Each time the motor
is
activated,
the light comes on and stays on for at least five minutes. It then
turns
off unless overridden as indicated by requirement 5c. If the motor is
re-activated
within
the five minute period, the five minute time period is reset.
- The stationary device consists of three button-light pairs. These
lights
are small telltales indicating system state.
- One button and light combination works identically with the
button and light on the remote
control
device.
- Another button enables and disables the remote control device.
That
is, it
acts as a toggle, alternatively enabling and disabling the remote
control
device. If the remote is deactivated, this button's light is on;
otherwise
it is off. This is intended as a security feature for disabling remote
access.
- The third button-light pair controls the work light on the
motor. There
are four possibilities, depending on whether the motor has run in the
last
five minutes or not and whether the button has been pushed an odd or
even
number of times:
Work Light Behavior
Run
within the last five minutes
|
Pushed
an odd or even number of times
|
Behavior
|
Yes
|
Even
|
Light
stays on until time expires
|
Yes
|
Odd
|
Light
stays on until the button is re-pressed
|
No
|
Even
|
Light
is turned off
|
No
|
Odd
|
Light
stays on until the button is re-pressed
|
The button itself has a small telltale light. This
light comes on when the button is first pressed. It goes off the next
time
the button is pressed. It continues to alternate with each button
press.
- You should assume that the door is initially closed, the
motor is
off,
the light is off, the remote is enabled, and the motor has not been run
in the last five minutes.
Note that this model does not address issues like the security code
settings
for the radio signal, the motor's obstruction detection system, and
range
limitations for the remote signaling device. Please do not be concerned
with these.
Your assignment is to model the external behavior of this system.
Use
a UML State Chart to express the model. Use a drawing tool to
prepare your diagram. Turn in the diagram that you
generated. You
may work in pairs for this problem.