ElevatorOperator.DoorTimer (ElevatorProject v0.1.0)
Finite state machine responible for running one elevator, implemented using the behaviour GenStateMachine.
The state machine has the states idle
, moving
and door_open
, and keeps track of the current floor,
moving direction, obstructed sensor state and door timer.
Uses the following modules:
Link to this section Summary
Functions
Starts the door timer if the elevator is not obstructed. Calls ElevatorOperator.timer_update/1
to update the timer reference to the newly set timer.
Stops the door timer if it is active. Calls ElevatorOperator.timer_update/1
to update the timer reference to nil
.
Link to this section Functions
start(e)
Starts the door timer if the elevator is not obstructed. Calls ElevatorOperator.timer_update/1
to update the timer reference to the newly set timer.
Parameters
- e: Struct containing the current state of the elevator :: %ElevatorOperator{}
stop(e)
Stops the door timer if it is active. Calls ElevatorOperator.timer_update/1
to update the timer reference to nil
.
Parameters
- e: Struct containing the current state of the elevator :: %ElevatorOperator{}