Events and State Transition Table

Events

Event Description Detection
Button User presses Remote control button REMOTE_PIN changes to it's true value
DoorOpen Door has opened completely OPEN_SENSOR_PIN changes to it's true value
DoorClosed Door has closed completly CLOSED_SENSOR_PIN changes to it's true value
Timeout Door hasn't reached it target position within maximum time time>MAX_TIME
Obstacle Something under the door OBSTACLE_SENSOR_PIN changes to it's true value
Overload Motor consumes too much power POWER_SENSOR_PORT > MAX_POWER

State Transition Table (STT)

State Event Target State Action Note
CLOSED Button OPENING StartOpening()
OPENING DoorOpen OPENED Stop()
OPENING Button STOPPED_OPEN Stop()
STOPPED_OPEN Button CLOSING StartClosing() Or should continue opening?
OPENED Button CLOSING StartClosing()
CLOSING DoorClosed CLOSED Stop()
CLOSING Button STOPPED_CLOSING Stop() Or should start opening?
STOPPED_CLOSING Button OPENING StartOpening() Or should continue closing?

When You model problems don't mix what- and how-models. What model tells the wanted behaviour from end user's point of view. Implementation can be done in many different ways. There is one to many relationship from what-space to how-space even tough we normally develop only one how model. Do You think the event table contains only what-model related events?

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License