new DataSynchronizer(properties)
Creates The dataSynchronizer.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
properties |
Object | the property of the object
Properties
|
- Source:
Methods
addDataSource(dataSource)
Adds a new DataSource object to the list of datasources to synchronize.
note: don't forget to call reset() to be sure to re-init the synchronizer internal properties.
Parameters:
Name | Type | Description |
---|---|---|
dataSource |
DataSource | the new datasource to add |
connect()
Connects all dataSources
disconnect()
Disconnects all dataSources
getEndTime() → {String}
Gets the endTime of the first DataSource objet
Returns:
- endTime as ISO date
- Type
- String
getMaxTime() → {String}
Gets the maxTime of the first DataSource objet
Returns:
- endTime as ISO date
- Type
- String
getMinTime() → {String}
Gets the minTime of the first DataSource objet
Returns:
- startTime as ISO date
- Type
- String
getReplaySpeed() → {Number}
Gets the replaySpeed
Returns:
- the replay speed
- Type
- Number
getStartTime() → {String}
Gets the startTime of the first DataSource objet
Returns:
- startTime as ISO date
- Type
- String
(async) isConnected()
Connect the dataSource then the protocol will be opened as well.
push(dataSourceId, data)
Parameters:
Name | Type | Description |
---|---|---|
dataSourceId |
String | the dataSource id |
data |
Object | the data to push into the data synchronizer |
reset()
Resets reference time
setReplaySpeed()
Sets the replaySpeed
setTimeRange(startTime, endTime, replaySpeed, reconnect)
Sets the data source time range
Parameters:
Name | Type | Default | Description |
---|---|---|---|
startTime |
String | the startTime (in date ISO) | |
endTime |
String | the startTime (in date ISO) | |
replaySpeed |
Number | the replay speed | |
reconnect |
boolean | false | reconnect if was connected |
terminate()
Terminate the corresponding running WebWorker by calling terminate() on it.