mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
parse more hints, add todos
This commit is contained in:
parent
3556130f6b
commit
871db25bc9
3 changed files with 25 additions and 1 deletions
|
@ -76,10 +76,25 @@ const hints = Object.assign(Object.create(null), {
|
||||||
// todo: is passing in profile necessary?
|
// todo: is passing in profile necessary?
|
||||||
const parseHint = (profile, h) => {
|
const parseHint = (profile, h) => {
|
||||||
// todo: C
|
// todo: C
|
||||||
// todo: D code: '', txtN: 'Fire services operating close to the tracks'
|
|
||||||
|
|
||||||
const text = h.txtN && h.txtN.trim() || ''
|
const text = h.txtN && h.txtN.trim() || ''
|
||||||
|
|
||||||
|
if (h.type === 'M') {
|
||||||
|
return {
|
||||||
|
type: 'status',
|
||||||
|
code: h.code || null,
|
||||||
|
summary: h.txtS && h.txtS.trim() || '',
|
||||||
|
text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (h.type === 'D') {
|
||||||
|
return {
|
||||||
|
type: 'status',
|
||||||
|
code: h.code || null,
|
||||||
|
text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// todo: find sth more reliable than this
|
// todo: find sth more reliable than this
|
||||||
if (h.type === 'P' && text.toLowerCase() === 'journey cancelled') {
|
if (h.type === 'P' && text.toLowerCase() === 'journey cancelled') {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -26,11 +26,13 @@ const applyRemarks = (leg, hints, warnings, refs) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const createParseJourneyLeg = (profile, stations, lines, hints, warnings, polylines) => {
|
const createParseJourneyLeg = (profile, stations, lines, hints, warnings, polylines) => {
|
||||||
|
// todo: pt.status
|
||||||
// todo: pt.sDays
|
// todo: pt.sDays
|
||||||
// todo: pt.dep.dProgType, pt.arr.dProgType
|
// todo: pt.dep.dProgType, pt.arr.dProgType
|
||||||
// todo: what is pt.jny.dirFlg?
|
// todo: what is pt.jny.dirFlg?
|
||||||
// todo: how does pt.freq work?
|
// todo: how does pt.freq work?
|
||||||
// todo: what is pt.himL?
|
// todo: what is pt.himL?
|
||||||
|
// todo: pt.planrtTS
|
||||||
const parseJourneyLeg = (j, pt, passed = true) => { // j = journey, pt = part
|
const parseJourneyLeg = (j, pt, passed = true) => { // j = journey, pt = part
|
||||||
const dep = profile.parseDateTime(profile, j.date, pt.dep.dTimeR || pt.dep.dTimeS)
|
const dep = profile.parseDateTime(profile, j.date, pt.dep.dTimeR || pt.dep.dTimeS)
|
||||||
const arr = profile.parseDateTime(profile, j.date, pt.arr.aTimeR || pt.arr.aTimeS)
|
const arr = profile.parseDateTime(profile, j.date, pt.arr.aTimeR || pt.arr.aTimeS)
|
||||||
|
|
|
@ -8,6 +8,13 @@ const createParseJourney = (profile, stations, lines, hints, warnings, polylines
|
||||||
// todo: c.sDays
|
// todo: c.sDays
|
||||||
// todo: c.conSubscr
|
// todo: c.conSubscr
|
||||||
// todo: c.trfRes x vbb-parse-ticket
|
// todo: c.trfRes x vbb-parse-ticket
|
||||||
|
// todo: c.sotRating, c.isSotCon, c.sotCtxt
|
||||||
|
// todo: c.showARSLink
|
||||||
|
// todo: c.useableTime
|
||||||
|
// todo: c.cksum
|
||||||
|
// todo: c.isNotRdbl
|
||||||
|
// todo: c.badSecRefX
|
||||||
|
// todo: c.bfATS, c.bfIOSTS
|
||||||
const parseJourney = (j) => {
|
const parseJourney = (j) => {
|
||||||
const legs = j.secL.map(leg => parseLeg(j, leg))
|
const legs = j.secL.map(leg => parseLeg(j, leg))
|
||||||
const res = {
|
const res = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue