- Example -
x = SWDataNetwork.new;
x.add( \floor1, 2 );
x.add( \floor2, 11 );
x.add( \floor3, 12 );
x.add( \floorAll, 100 );
~floorsorders = [
[0,1,4,6, 2,3,4,6],
[1,0,6,7, 2,3,4,5],
[5,4,3,0, 6,7,1,2]
];
~floorsensors = [0,2,1];
~floorall = SWCombineNode.new( 100, x, 24 );
[\floor1,\floor2,\floor3].do{ |it,i|
x[it].scale_( 1/256 );
x[it].action_( { |data|
~floorall.set( (~floorsensors[i]*8), data.at( ~floorsorders[i].copyRange(0,data.size-1) ) );
}; );
};
- Methods -
- *new ( id, network, size )
- Creates a node that gets data from various sources, but combines it into one node. size is the total size of the data array that will be supplied as one node.
- data ( )
- The current data values.
- set ( index, newdata )
- Puts newdata into the data array at offset index, and updates the node in the network accordingly.
- network ( )
- The SWDataNetwork.
- id ( )
- id_ ( )
- The node ID.
- node ( )
- The SWDataNode.
Marije Baalman
2009-03-16