codeforhuntsville / transitTracks

system for tracking trolley and shuttle service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Highlight the next stop

larrymason opened this issue · comments

System should change the 'next stop' when bus goes by current selected 'next stop'

I have added a check on the server that looks to see if each new trolley coordinate update is within about 75 to 100 foot of a trolley stop. If it is it advances the next stop sequence... and notifies clients of updated stop sequence. The client then highlights the next stop. This change is in the dev instance but we won't know if it works until we push it to production... which I'll do late tonight so I can set it back if there is a problem.

I won't close until it has been tested.

I think I have a way around the sequence problem. It seems to simple to be true, so please try and shoot holes through it. If I have three variables, next_stop and last_stop, and possibly a third p_missed_stop_count.
If last_stop is 1 and next_stop is 2, and I go past 17, and put 1 in p_missed_stop_count if it is null, then when I get to 2, put 2 in last_stop, 3 in next_stop and clear p_missed_stop (null). If 5 is last_stop and 6 is next_stop but I skip 6, when I get to 7 put 1 in p_missed_stop_count if it is null when I get to 8 if p_missed_stop_count is 1 thenI advance next_stop to 9 and last_stop = 8; The logic is if you have missed one stop it may be an anomaly if you miss more than 1 stop you got off track so pick it up where it is! Also, there may be some logic in the sequence itself - We might need to whiteboard this.