Class DataFrame

A data frame is information that is passed through each node in a positioning model.

DataFrame content

Usage

Creation

A data frame can be created with an optional source DataObject that represents the object responsible for generating the frame.

const dataFrame = new DataFrame(new DataObject("phone"));

Creating a custom DataFrame

Custom data frames can be created by extending the default DataFrame class. Important when handling data frames (and objects) is to add serializable decorators.

import { DataFrame, SerializableObject, SerializableArrayMember } from '@openhps/core';

@SerializableObject()
export class CustomDataFrame extends DataFrame {
@SerialisableArrayMember(Number)
public customFrameAttribute: number[];
}

Adding DataObjects

Adding data object will clone the data objects to the data frame. Any changes made to the object after cloning will not be applied to the data frame.

Constructors

Properties

createdTimestamp: number

Data frame created timestamp (ISO 8601)

phenomenonTimestamp?: number

Data frame sensor data pheonomenon timestamp (ISO 8601)

uid: string = ...

Data frame unique identifier

Accessors

Methods

  • Add a new reference space relevant to this data frame.

    Parameters

    Returns void

    Alias

    addObject Alias for addObject

  • Clear all objects

    Parameters

    • Optional objectFilter: ((object) => boolean)

      object filter

        • (object): boolean
        • Parameters

          Returns boolean

    Returns void

  • Get a specific object by its identifier

    Type Parameters

    Parameters

    • uid: string

      Object UID

    Returns T

    Data object if found

  • Get known objects used in this data frame

    Type Parameters

    Parameters

    • Optional dataType: (new () => T)

      Data object type

        • new (): T
        • Returns T

    Returns T[]

    Array of found data objects

  • Get known sensor objects used in this data frame

    Type Parameters

    Parameters

    • type: (new (uid?) => T)

      Sensor type

        • new (uid?): T
        • Parameters

          • Optional uid: string

          Returns T

    • Optional defaultUID: string

      Default UID. When sensor is not added, it will be created

    Returns T

    Found data objects

  • Check if the data frame has an object

    Parameters

    Returns boolean

    Object exist