Class: VDataReaderFactory

VDataReaderFactory()

A factory class for building VDataReader. Examples: let uint8arry = new VDataByteReader(new Uint8Array(e.target.result)); //file upload let factory = new VDataReaderFactory(); factory.setDataReaders(uint8arry); factory.setSignals(signals); let reader = factory.open();

Constructor

new VDataReaderFactory()

The constructor of the factory.

Methods

open() → {VDataReader}

Create the data reader.
Returns:
Type
VDataReader

setColumnExpandMode(mode)

Set the column expand mode for expanding sub-items of complex type signals (array/struct) to individual signals. Supported values are 'none', 'flat', 'full'. 'none' means the complex type signal will be output as array and will not expand to individual sub-items, 'flat' means the complex type signal will be expanded to individual sub-items and each sub-item's defined name will be used, 'full' means the complex type signal will be expanded to individual sub-items but the sub-items will use a qualified naming 'signal_name.sub_name'.
Parameters:
Name Type Description
mode * the column expand mode

setDataReaders(readers)

Set a list of binary readers to vdata file contents.
Parameters:
Name Type Description
readers Array.<VDataByteReader> array of byte readers

setInsensitiveCase(insensitiveCase)

Set whether to read signal names as case insensitive. If true, it will read the names as lower-case; if false, it will read signal names as recorded in vdata. Default is false.
Parameters:
Name Type Description
insensitiveCase boolean true or false

setQueryEndTime(time)

Set whether to apply a custom query end time (inclusive) to data contents. This setting is on only if queryFilter is true and this value is non-zero. If on, only signal values with time equal to or earlier than this end time will be output. Default is 0.
Parameters:
Name Type Description
time number millisecond since EPOCH

setQueryFilter(filter)

Set whether to apply query start-end time filter to data contents (including custom start-end time and query start-time settings inside data files). Default is true.
Parameters:
Name Type Description
filter boolean true or false

setQueryStartTime(time)

Set whether to apply a custom query start time (inclusive) to data contents. This setting is on only if queryFilter is true and this value is non-zero. If on, only signal values with time equal to or later than this start time will be output. Default is 0.
Parameters:
Name Type Description
time number millisecond since EPOCH

setReadLivingData(readLiving)

Set whether to read vdata's living (not finalized) buckets. Default is true.
Parameters:
Name Type Description
readLiving boolean true or false

setSignalQueueMode(mode)

Set the queue mode for value triage when there are mutiple values at same time. Supported values are 'last', 'first', 'all'. 'last' means the last-read value is used, 'first' means the first-read value is used, and 'all' means for each value read a new row will be generated thereby maintaining all read values in the output.
Parameters:
Name Type Description
mode string the signal queue mode

setSignals(signals)

Set the list of signals to select from data contents.
Parameters:
Name Type Description
signals string comma-separated string of signal names or prefixes