Converter

Basics

The Converter sub-classes are designed to generate or decode various file formats, or both.

If a Converter sub-class supports generating data in a given file format it implements the Readable stream API documented by the Node.js core team. Calling the convertHeaderSet function on this Converter sub-classes generates the appropriately formatted data that then flow out of the readable stream into its consumers. An example for a generating Converter sub-class is the DLxJsonConverter class.

If a Converter sub-class supports decoding data in a given file format it implements the Writable stream API documented by the Node.js core team. Data written to that stream gets decoded and then emits headerSet events providing the decoded HeaderSet instance as a parameter. An example for a decoding Converter sub-class is the VBusRecordingConverter class. That class also supports generating data by implementing the Readable stream API described above.

Sub-classes

Class name File format Readable stream? Writable stream?
VBusRecordingConverter VBus Recording File Format Yes Yes
DLxJsonConverter Datalogger compatible JSON Yes No
TextConverter CSV and other text based formats Yes No