Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On the d3/schedule rest service, the reported delay is wrong #5

Open
peter-mount opened this issue Apr 30, 2018 · 0 comments
Open

On the d3/schedule rest service, the reported delay is wrong #5

peter-mount opened this issue Apr 30, 2018 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@peter-mount
Copy link
Owner

Today there's a lot of disruption in the south east due to heavy rain & gales & I spotted this service which is delayed by about 45-50 minutes: 201804308706701

On the service display page on departure boards it's showing as left on time. Looking at the JSON the delay value is definitely wrong
{ "type": "IP", "tiploc": "MSTONEE", "displaytime": "07:40:00", "timetable": { "time": "07:40:00", "pta": "07:39", "ptd": "07:40", "wta": "07:38:30", "wtd": "07:40:00" }, "delay": 0, "planned": { "activity": "T " }, "forecast": { "time": "08:28:00", "arrived": true, "departed": true, "arr": { "at": "08:27:00", "src": "TD" }, "dep": { "at": "08:28:00", "src": "TD" }, "plat": { "plat": "2", "confirmed": true, "source": "A" } } },
Here it's saying it's ontime (Delay=0) but the equation to calculate that field is forecast.time - timetable.time which should read as 48 minutes (Delay=2880).

Earlier at Swanley:
{ "type": "IP", "tiploc": "SWLY", "displaytime": "07:04:00", "timetable": { "time": "07:04:30", "pta": "07:04", "ptd": "07:04", "wta": "07:03:30", "wtd": "07:04:30" }, "delay": -30, "planned": { "activity": "T " }, "forecast": { "time": "07:50:00", "arrived": true, "departed": true, "arr": { "at": "07:50:00", "src": "TD" }, "dep": { "at": "07:50:00", "src": "TD" }, "plat": { "plat": "2", "confirmed": true, "source": "A" } } },
Here it's showing Delay=-30 (i.e. early) when it should read 45m30s (Delay=2730).

The code that sets this seems to be correct:

darwind3/location.go line 323: l.Delay = l.Forecast.Time.Get() - l.Times.Time.Get()

Here's the json for that service: 201804308706701.json.txt

@peter-mount peter-mount added the bug Something isn't working label Apr 30, 2018
@peter-mount peter-mount self-assigned this Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant