db-vendo-client/p/db/modes.js

109 lines
1.7 KiB
JavaScript
Raw Normal View History

2017-11-12 23:51:39 +01:00
'use strict'
2017-12-18 23:33:29 +01:00
// todo: https://gist.github.com/anonymous/d3323a5d2d6e159ed42b12afd0380434#file-haf_products-properties-L1-L95
2017-11-12 23:51:39 +01:00
const m = {
nationalExp: {
bitmask: 1,
name: 'InterCityExpress',
short: 'ICE',
mode: 'train',
product: 'nationalExp'
},
national: {
bitmask: 2,
name: 'InterCity & EuroCity',
short: 'IC/EC',
mode: 'train',
product: 'national'
},
regionalExp: {
bitmask: 4,
2017-12-18 23:25:41 +01:00
name: 'RegionalExpress & InterRegio',
short: 'RE/IR',
2017-11-12 23:51:39 +01:00
mode: 'train',
product: 'regionalExp'
},
regional: {
bitmask: 8,
2017-12-18 23:25:41 +01:00
name: 'Regio',
short: 'RB',
2017-11-12 23:51:39 +01:00
mode: 'train',
product: 'regional'
},
suburban: {
bitmask: 16,
name: 'S-Bahn',
short: 'S',
mode: 'train',
product: 'suburban'
},
bus: {
bitmask: 32,
name: 'Bus',
short: 'B',
mode: 'bus',
product: 'bus'
},
ferry: {
bitmask: 64,
name: 'Ferry',
short: 'F',
mode: 'watercraft',
2017-11-12 23:51:39 +01:00
product: 'ferry'
},
subway: {
bitmask: 128,
name: 'U-Bahn',
short: 'U',
mode: 'train',
product: 'subway'
},
tram: {
bitmask: 256,
name: 'Tram',
short: 'T',
2018-04-24 17:01:25 +02:00
mode: 'train',
2017-11-12 23:51:39 +01:00
product: 'tram'
},
taxi: {
bitmask: 512,
name: 'Group Taxi',
short: 'Taxi',
2018-03-13 21:45:42 +01:00
mode: 'taxi',
2017-11-12 23:51:39 +01:00
product: 'taxi'
},
unknown: {
bitmask: 0,
name: 'unknown',
short: '?',
product: 'unknown'
}
}
m.bitmasks = []
m.bitmasks[1] = m.nationalExp
m.bitmasks[2] = m.national
m.bitmasks[4] = m.regionalExp
m.bitmasks[8] = m.regional
m.bitmasks[16] = m.suburban
m.bitmasks[32] = m.bus
m.bitmasks[64] = m.ferry
m.bitmasks[128] = m.subway
m.bitmasks[256] = m.tram
m.bitmasks[512] = m.taxi
2017-12-12 03:28:54 +01:00
m.allProducts = [
m.nationalExp,
m.national,
m.regionalExp,
m.regional,
m.suburban,
m.bus,
m.ferry,
m.subway,
m.tram,
m.taxi
]
2017-11-12 23:51:39 +01:00
module.exports = m