new DataSynchronizer(properties)
Creates The dataSynchronizer.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
properties |
Object | the property of the object
Properties
|
- Source:
Methods
(async) 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 |
TimeSeriesDataSource | the new datasource to add |
(async) connect()
Connects all dataSources
(async) disconnect()
Disconnects all dataSources
getEndTimeAsIsoDate() → {String}
Gets the endTime of the first DataSource objet
Returns:
- endTime as ISO date
- Type
- String
getMaxTimeAsIsoDate() → {String}
Gets the maxTime of the first DataSource objet
Returns:
- endTime as ISO date
- Type
- String
getMaxTimeAsTimestamp() → {String}
Gets the maxTime of the first DataSource objet
Returns:
- endTime as unix timestamp
- Type
- String
getMinTimeAsIsoDate() → {String}
Gets the minTime of the first DataSource objet
Returns:
- startTime as ISO date
- Type
- String
getMinTimeAsTimestamp() → {String}
Gets the minTime of the first DataSource objet
Returns:
- startTime as unix timestamp
- Type
- String
getReplaySpeed() → {Number}
Gets the replaySpeed
Returns:
- the replay speed
- Type
- Number
getStartTimeAsIsoDate() → {String}
Gets the startTime of the first DataSource objet
Returns:
- startTime as ISO date
- Type
- String
getStartTimeAsTimestamp() → {String}
Gets the startTime of the first DataSource objet
Returns:
- startTime as unix timestamp
- Type
- String
(async) isConnected()
Connect the dataSource then the protocol will be opened as well.
(async) push(dataSourceId, data)
Parameters:
Name | Type | Description |
---|---|---|
dataSourceId |
String | the dataSource id |
data |
Object | the data to push into the data synchronizer |
(async) removeDataSource(dataSource)
Removes a DataSource object from the list of datasources of the synchronizer.
Parameters:
Name | Type | Description |
---|---|---|
dataSource |
TimeSeriesDatasource | the new datasource to add |
(async) reset()
Resets reference time
(async) setReplaySpeed()
Sets the replaySpeed
(async) 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.