Class GetStateData

This class is parser and access helper at once with integrated object representation for the response CSV of the GetStateService. (This might be changed/split in seperate classes in a future refactoring)

Indexable

  • [key: string]: unknown

    Extend the data object instances as you like.

Constructors

Properties

active: number[]

Lists all indices of objects that are not labeled with 'n.a.' and therefore considered to be active.

categories: IGetStateCategories = GetStateData.categories

Actual data objects for further processing.

Ordered by CSV column position starting at 0.

parsed: string[][]

CSV input parsed to a simple 2-dimensional array.

Structure:

[
0: [ // line one
0: // line one, column one
1: // line one, column two
],
1: [ // line two
0: // line two, column one
...
...
]
raw: string

Raw CSV input string (retrieved by the GetStateService).

SysInfo column data.

The first line of the csv has no relation to the rest of the CSV. So it is stored seperately in here.

categories: IGetStateCategories = ...

Data categories as array of objects.

Category names as keys and arrays as values. These arrays list columns (referencing the parsed CSV) which fall into this category. The array values might contain simple listings of the column positions or another array containing the starting and ending index of a slice/range. Counting columns starts at 0. The value is of type any to simplify dynamic iteration without linting or parsing errors.

Methods

  • Get the category of a data item by its column index.

    Parameters

    • index: number

      Column index

    Returns string

    Category name or string none if no category could be identified.

  • Get the object id aka column index of the chlorine dosage control relay.

    Returns number

  • Get the object id aka column index of the pH minus dosage control relay.

    Returns number

  • Get the object id aka column index of the pH plus dosage control relay.

    Returns number