new OSH.DataReceiver.DataReceiverController()
Listens to Events:
- OSH.EventManager.EVENT.event:CONNECT_DATASOURCE
- OSH.EventManager.EVENT.event:DISCONNECT_DATASOURCE
- OSH.EventManager.EVENT.event:DATASOURCE_UPDATE_TIME
Example
var datasource = new OSH.DataReceiver... // creates OSH.DataReceiver.<>
// creates controller
var dataProviderController = new OSH.DataReceiver.DataReceiverController({
replayFactor : replayFactor
});
// adds datasource to controller
dataProviderController.addDataSource(weatherDataSource);
// and/or adds entity to controller
var entity = {
id : "entity-"+OSH.Utils.randomUUID(),
name: "Some entity",
dataSources: [datasource]
};
dataProviderController.addEntity(entity);
Methods
-
addDataSource(dataSource, options)
-
Adds a dataSource to the current list of datasources and pushes it into the buffer.
Name Type Description dataSourceObject the datasource to add
options@deprecated
- See:
-
addEntity(dataSource, options)
-
Adds a entity to the current list of datasources and pushes it into the buffer.
Name Type Description dataSourceObject the datasource to add
options@deprecated
- See:
-
connectAll()
-
Connects each connector
-
initBuffer()
-
Instantiates a new OSH.Buffer OSH.Buffer
-
updateDataSourceTime(id, startTime, endTime)
-
Updates the datasource time range.
Name Type Description idthe datasource id
startTimethe start time
endTimethe end time