procon-ip - v2.0.0
    Preparing search index...

    Class RelayDataObject

    The RelayDataObject extends the GetStateDataObject by an additional magic bitMask attribute, that determines the correct bitmask to toggle the relay's state.

    Hierarchy (View Summary)

    Indexable

    • [key: string]: unknown

      Making GetStateDataObject objects extensible, also allows accessing object keys using string variables.

    Index

    Constructors

    Properties

    active: boolean

    Indicates whether the object is considered to be active.

    Indeed this only means the name is not 'n.a.'.

    category: string

    Object instance category string.

    categoryId: number

    Sub-index for each category.

    Starts counting from 0 at the first object of the instances category. Used to determine e.g. the relay IDs.

    displayValue: string

    Object display value.

    gain: number

    Object value gain.

    id: number

    Object id aka column index.

    label: string

    Object label.

    offset: number

    Object value offset.

    raw: number

    Raw object input value.

    unit: string

    Object unit.

    value: string | number

    Plain (calculated) object value.

    Accessors

    • get bitMask(): number

      Returns the bit mask for toggling the relay's state using the /usrcfg.cgi endpoint (see: UsrcfgCgiService).

      The service endpoint expects two input values, one defining on/off states and another one for the auto-mode on/off. Both values are simple bit patterns, where every relay has one bit according to its categoryId, which sets its individual state.

      Ultimately this means, you have to consider the current on/off and auto state of every single relay to determine the values you need to change a single relays state. This is, where the RelayDataInterpreter comes in.

      Returns number

    Methods

    • Set object values based on the raw input values.

      The input values correspond to the data rows of the represented column (except the index paramter which indeed is the column id/index itself).

      Parameters

      • index: number

        Column id/index

      • name: string

        Column or data portion name

      • unit: string

        Column or data portion unit (if applicable in any way)

      • offset: string

        Column value offset

      • gain: string

        Column value gain

      • measure: string

        Column value raw measurement

      Returns void