DataBus:
Filter:
SenseWorld/Classes (extension) | Control

DataBus
ExtensionExtension

Put data from a function onto a bus

Description

DataBus evaluates a function at a regular time interval and puts the resulting data on a control bus on the server.

Class Methods

.new

Creates a new DataBus

Arguments:

function

Function to be evaluated which provides the data for the server

nchan

Number of channels for the bus. The function should give as a result an Array with the same size as the number of channels given.

server

An instance of Server. If none is given the default server is used.

Instance Methods

.renew

Create the bus, and start the updater. This is called automatically when a new instance is created, but it may be used if the method free was called previously during the session.

.free

Free the bus, and stop the updater.

.scale

Scale factor with which the result of the function is scaled before putting the values on the bus.

.dT

The update rate. This is the delta time at which the function is evaluated.

.bus

The Bus object to which the data is set.

.func

The function to be evaluated.

.numChannels

Number of channels of the bus.

.server

The Server object on which the bus is.