Constructor
new OrientationQuaternion()
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 |
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 |
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
|
- Inherited From:
- Source: