db-vendo-client/format/radar-req.js

30 lines
846 B
JavaScript
Raw Permalink Normal View History

2019-10-31 20:08:56 +01:00
'use strict'
const formatRadarReq = (ctx, north, west, south, east) => {
const {profile, opt} = ctx
return {
meth: 'JourneyGeoPos',
req: {
maxJny: opt.results,
onlyRT: false, // todo: does this mean "only realtime"?
date: profile.formatDate(profile, opt.when),
time: profile.formatTime(profile, opt.when),
// todo: would a ring work here as well?
rect: profile.formatRectangle(profile, north, west, south, east),
perSize: opt.duration * 1000,
perStep: Math.round(opt.duration / Math.max(opt.frames, 1) * 1000),
ageOfReport: true, // todo: what is this?
jnyFltrL: [
profile.formatProductsFilter(ctx, opt.products || {})
],
2021-11-18 18:29:25 +01:00
// todo: what is this? what about realtime?
// - CALC
// - CALC_REPORT (as seen in the INSA Young app)
trainPosMode: 'CALC',
2019-10-31 20:08:56 +01:00
}
}
}
module.exports = formatRadarReq