Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

Hierarchy

Index

Constructors

constructor

Properties

createdTimestamp

createdTimestamp: number

Data frame created timestamp (ISO 8601)

uid

uid: string = ...

Data frame unique identifier

Accessors

source

Methods

addObject

addReferenceSpace

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

    alias

    addObject Alias for addObject

    Parameters

    Returns void

clone

getObjectByUID

  • getObjectByUID<T>(uid: string): T

getObjects

  • getObjects<T>(dataType?: new () => T): T[]
  • 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

hasObject

removeObject