ElevatorOperator (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
Returns a specification to start this module under a supervisor.
Signals that the elevator has arrived at a floor.
Returns the current state of the elevator.
Signals that the state of the obstruction switch has changed.
Signals the push of an order button.
Signals that the door timer has been started or stopped, and changes the timer reference.
Link to this section Functions
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
floor_arrival(floor)
Signals that the elevator has arrived at a floor.
Parameters
- floor: The floor the elevator has arrived at :: integer()
Return
- no_return
get_data()
Returns the current state of the elevator.
Return
- Current state of the elevator, tuple of form {floor, direction, state, orders} :: {integer(), atom(), atom(), %MapSet}
obstruction(is_obstructed)
Signals that the state of the obstruction switch has changed.
Return
- no_return
order_button_press(order)
Signals the push of an order button.
Parameters
- order: Order corresponding to pressed order button :: %Order{}
Return
- no_return
timer_update(timer_ref)
Signals that the door timer has been started or stopped, and changes the timer reference.
Return
- no_return