Conversation
abonstu
left a comment
There was a problem hiding this comment.
cheers for contributing a converter ethan :)
we encourage converters to be as flexible as possible, i.e. rather than being constrained to a single frequency sensor with a single sample, its useful to have one converter that handles all permutations of a payload format.
lib/AdroitVW/adroitvw-converter.ts
Outdated
| */ | ||
| export class AdroitVWJsonConverter extends Converter { | ||
| convert(input: Buffer): JtsDocument { | ||
| const series1 = new TimeSeries({ name: 'frequency' }); |
There was a problem hiding this comment.
consider using the 'name' json field to define the timeseries name
lib/AdroitVW/adroitvw-converter.ts
Outdated
| //const timestamp = new Date(record.lastUpdate); // using 'lastUpdate' as timestamp | ||
| //const timestamp = new Date(record.lastUpdate * 1000).toLocaleString("en-NZ", { timeZone: "Pacific/Auckland" }); | ||
| const timestamp_ep = new Date(record.lastUpdate); | ||
| const timestamp = new Date(timestamp_ep.getTime() + (12 * 60 * 60 * 1000)); |
There was a problem hiding this comment.
take a look at the sample-with-zone converter (this includes the timezone configured by the user)
lib/AdroitVW/adroitvw-converter.ts
Outdated
| */ | ||
| export class AdroitVWJsonConverter extends Converter { | ||
| convert(input: Buffer): JtsDocument { | ||
| const series1 = new TimeSeries({ name: 'frequency' }); |
There was a problem hiding this comment.
consider using the 'unit.symbol' json field to define the timeseries units
|
Hi Jarrah, thanks for your comments, code has been modified as below: import { JtsDocument, TimeSeries } from '@eagle-io/timeseries'; /**
// Parse the input buffer to JSON object } |
|
please update this pull request with your changes for review. note: take a look at line 17 of |
this converts the data file from Adroit VW logger from JSON format to eagle JST format.