Class: OrientationQuaternion

OrientationQuaternion()

This datasource provides parsing to Orientation Quaternion. Data: ISODATE,Qx,Qy,Qz,Qw.

Constructor

new OrientationQuaternion()

Source:
Example
import OrientationQuaternion from 'ext/datasource/OrientationQuaternion.js';

let androidPhoneOrientationDataSource = new OrientationQuaternion("android-Orientation", {
        protocol: "ws",
        service: "SOS",
        endpointUrl: "sensiasoft.net:8181/sensorhub/sos",
        offeringID: "urn:android:device:060693280a28e015-sos",
        observedProperty: "http://sensorml.com/ont/swe/property/OrientationQuaternion",
        startTime: "2015-02-16T07:58:00Z",
        endTime: "2015-02-16T08:09:00Z",
        replaySpeed: replaySpeed+"",
        bufferingTime: 1000
    });

Extends

Methods

(async) connect()

Connect the dataSource then the protocol will be opened as well.
Inherited From:
Source:

disconnect()

Disconnect the dataSource then the protocol will be closed as well.
Inherited From:
Source:

getId() → {String}

Gets the datasource id.
Inherited From:
Source:
Returns:
the datasource id
Type
String

getName() → {String}

Gets the datasource name.
Inherited From:
Source:
Returns:
the datasource name
Type
String

(protected) initDataSource(properties)

Inits the datasource with the constructor properties.
Parameters:
Name Type Description
properties
Inherited From:
Source:

onDisconnect()

Trigger when the datasource is disconnected for some reason.
Inherited From:
Source:

parseData(data) → {Object}

Extracts data from the message. The data are got such as:

  • qx: tokens[1]
  • qy: tokens [2]
  • qz: tokens[3]
  • qw: tokens[4]

.
Parameters:
Name Type Description
data Object the data to parse
Source:
Returns:
the parsed data
Type
Object
Example
{
  pitch:10,
  roll: 11,
  heading:12
}

parseTimeStamp(data) → {Number}

Extracts timestamp from the message. The timestamp is the first token got from split(',')
Parameters:
Name Type Description
data String the data to parse
Source:
Returns:
the extracted timestamp
Type
Number

updateProperties(name, properties)

Update properties
Parameters:
Name Type Description
name String the datasource name
properties Object the datasource properties
Properties
Name Type Description
timeShift Boolean fix some problem with some android devices with some timestamp shift to 16 sec
bufferingTime Number defines the time during the data has to be buffered
timeOut Number defines the limit time before data has to be skipped
protocol String defines the protocol of the datasource. @see DataConnector
endpointUrl String the endpoint url
service String the service
offeringID String the offeringID
observedProperty String the observed property
responseFormat Number the response format (e.g video/mp4)
reconnectTimeout Number the timeout before reconnecting
Inherited From:
Source: