diff options
author | stuebinm | 2024-04-20 03:18:46 +0200 |
---|---|---|
committer | stuebinm | 2024-04-20 03:18:46 +0200 |
commit | 607b9486a81ed6cb65d30227aeecea3412bd1ccd (patch) | |
tree | 0bfde1a39d2af5e56d53dbaea05638458c478de5 /tools/obu-guess-trip | |
parent | 9301b4b012d3cae1a481320b1460c5bea674fd8c (diff) |
restructure: have "tickets" independent of gtfs
this is mostly meant to guard against the gtfs changing under
tracktrain, and not yet complete (e.g. a ticket does not yet save its
expected stops, which it probably should).
Diffstat (limited to 'tools/obu-guess-trip')
-rwxr-xr-x | tools/obu-guess-trip | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/obu-guess-trip b/tools/obu-guess-trip index b9264f6..32aa6d4 100755 --- a/tools/obu-guess-trip +++ b/tools/obu-guess-trip @@ -44,8 +44,9 @@ Arguments: (define pos (with-input-from-process `(obu-ping -s ,statefile -n 1 -d) read)) (define guessed - (closest-stop-to stops pos)) + (closest-stop-to stops pos)) (define trip (assoc-ref guessed 'trip)) + (display stops) (do-process `(obu-config -s ,statefile sequencelength ,(assoc-ref guessed 'sequencelength))) (display trip)) @@ -68,7 +69,7 @@ Arguments: (define day (date->string (current-date) "~1")) (define tls (equal? (uri-ref url 'scheme) "https")) - (parameterize + (define thing (parameterize ; replace all json keys with symbols; everything else is confusing ([json-object-handler (cut map (lambda p `(,(string->symbol (car (car p))) . ,(cdr (car p)))) <>)]) @@ -76,3 +77,5 @@ Arguments: (values-ref (http-get (uri-ref url 'host+port) (format "/api/timetable/stops/~a" day) :secure tls) 2)))) + (display thing) + thing) |