## SWDataSlot

Base class for a data slot.

### - Methods -

*new ( id )
  Create a new instance of a slot with identifier id

#### - Identifier and label -

id ( )
  The unique ID of the slot
id_ ( )
key ( )
  The label of the slot
key_ ( )
  Set the label of the slot (done internally when a mapping is added with the method add of SWDataNetwork

#### - Data and action -

value ( )
value_ ( val )
  the current value of the slot. When set, it is multiplied by the `scale` factor of the slot, and remapped according to map and range. The `action` of the slot is performed, the debugAction is performed (printing), and if a bus has been created the (scaled) value is put on the bus.
action ( )
action_ ( )
  Function to be performed each time the data is set

#### - Scaling, mapping and calibrating -

scale ( )
scale_ ( )
  The scaling factor for the data
map ( )
  If a map has been set the value will be (after scaling) `value = map.map( range.unmap( value ) )`. Thus range is the range the incoming values are expected to be in. map is the output range the data is mapped to.
map_ ( )
  Sets the output map. If range is not set yet, it will be set to a linear range between 0 and 1.
range ( )
  The input range.
range_ ( )
  Sets the input range. If map is not set yet, it will be set to a linear range between 0 and 1.
calibrate ( steps )
  This method looks at steps amount of times at the incoming data and calculates the mean of this. It assumes this mean is the minimum value the data will have, and it sets the minimum of range accordingly. Note, this method will be improved!

#### - Bus support -

createBus ( s )
  create a Bus for the node on the server
freeBus ( )
  free the Bus on the server
bus ( )
  Return the Bus object.
kr ( )
  JITLib support. This creates the bus (if not already present) and provides an In.kr around the bus.

#### - Debugging and monitoring -

debug_ ( onoff )
  print debugging messages for the slot
monitor ( onoff )
  Monitor the data in a plot. This uses the GNUPlot to plot the data and the interface class GNUPlot and BusMonitor, which can be found in the GNUPlot quark.
monitorClose ( )
  Cleans up the monitor (closing the pipe to GNUPlot).
busmonitor ( )
  Reference to the BusMonitor instance for monitoring the slot.