Core overall function: Listen to messages from Faye about changes to the queue or people being called. When getting a message, normalize the incoming message data, and update the display based on the new data.
If several people are called at once, things get tricky so that we can allow each student some time displayed on the calling screen.
The calling aviodence logic is here: https://github.umn.edu/asrweb/queue_signage/blob/9659a7fd5d96c53b2c34d4673a66e9c082c83c69/app/routes/visitors.js#L56
There is some weirdness here with the multiplier
. A better name might be one less than the number of people who have been called to the counter
. We use multiplier
to ensure that every "calling" message is displayed for a set length of time before the next "calling" message gets to show, and that we give a period of time between the messages where we show the current state of the queue. As more people get called, the multiplier
gets increased. As people are done being called to the counter, multiplier
gets decreased. When displaying the "calling" messages, we set the time to start and stop displaying the message based on pre-set offsets times the multiplier
. We set it at one less that the number of people who have been called to the counter
so that when the first person is called, multiplier
is 0
- and thus the delay times are also 0.
Check out the following for details on the layout of the calling
and visitors
pages:
https://github.umn.edu/asrweb/queue_signage/tree/master/app/templates
This is where we handle the incoming messages & their payloads https://github.umn.edu/asrweb/queue_signage/blob/master/app/services/message-handler.js