parse more hints, add todos

This commit is contained in:
Jannis R 2018-06-11 19:50:44 +02:00
parent 3556130f6b
commit 871db25bc9
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
3 changed files with 25 additions and 1 deletions

View file

@ -76,10 +76,25 @@ const hints = Object.assign(Object.create(null), {
// todo: is passing in profile necessary?
const parseHint = (profile, h) => {
// todo: C
// todo: D code: '', txtN: 'Fire services operating close to the tracks'
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
if (h.type === 'P' && text.toLowerCase() === 'journey cancelled') {
return {

View file

@ -26,11 +26,13 @@ const applyRemarks = (leg, hints, warnings, refs) => {
}
const createParseJourneyLeg = (profile, stations, lines, hints, warnings, polylines) => {
// todo: pt.status
// todo: pt.sDays
// todo: pt.dep.dProgType, pt.arr.dProgType
// todo: what is pt.jny.dirFlg?
// todo: how does pt.freq work?
// todo: what is pt.himL?
// todo: pt.planrtTS
const parseJourneyLeg = (j, pt, passed = true) => { // j = journey, pt = part
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)

View file

@ -8,6 +8,13 @@ const createParseJourney = (profile, stations, lines, hints, warnings, polylines
// todo: c.sDays
// todo: c.conSubscr
// 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 legs = j.secL.map(leg => parseLeg(j, leg))
const res = {