jAER project on SourceForge

net.sf.jaer.chip
Class Chip

java.lang.Object
  extended by java.util.Observable
      extended by net.sf.jaer.chip.Chip
Direct Known Subclasses:
Chip2D

public class Chip
extends java.util.Observable

A chip, having possibly a hardware interface and a bias generator. This class extends Observable and signals changes in its parameters via notifyObservers.

A Chip also has Preferences; the Preferences node is based on the package of the actual chip class.

A Chip has a preferred hardware interface class which is used in the HardwareInterfaceFactory or its subclasses to construct the actual hardware interface class when the hardware interface is enumerated.

A Chip may be remote-controllable via its remote control, see getRemoteControl().

Author:
tobi

Field Summary
protected  Biasgen biasgen
          The bias generator for this chip
protected  HardwareInterface hardwareInterface
          The Chip's HardwareInterface
protected static java.util.logging.Logger log
           
protected  java.lang.String name
          A String name
 
Constructor Summary
Chip()
          Creates a new instance of Chip
Chip(Biasgen biasgen)
           
Chip(HardwareInterface hardwareInterface)
          Creates a new instance of Chip
Chip(HardwareInterface hardwareInterface, Biasgen biasgen)
           
 
Method Summary
 Biasgen getBiasgen()
           
static java.lang.String getDescription()
          Override this String (can be html formatted) to show it as the Chip description in some GUI controls.
 HardwareInterface getHardwareInterface()
          gets the hardware interface for this Chip
 java.lang.Object getLastData()
          Gets the last data associated with this Chip object.
 java.lang.String getName()
           
static java.lang.Class<? extends HardwareInterface> getPreferredHardwareInterface()
          Should be overridden by a subclass of Chip to specify the preferred HardwareInterface.
 java.util.prefs.Preferences getPrefs()
          Returns the Preferences node for this Chip.
 RemoteControl getRemoteControl()
          This remote control can be used for remote (via UDP) control of the Chip, e.g.
 void setBiasgen(Biasgen biasgen)
           
 void setHardwareInterface(HardwareInterface hardwareInterface)
          Sets the hardware interface and the bias generators hardware interface (if the interface supports the bias generator).
 void setLastData(java.lang.Object lastData)
          Sets the last data captured or rendered by this Chip.
 void setName(java.lang.String name)
           
static void setPreferredHardwareInterface(java.lang.Class<? extends HardwareInterface> clazz)
          Sets the preferred HardwareInterface class.
 void setPrefs(java.util.prefs.Preferences prefs)
          Sets the Preferences node for the Chip
 void setRemoteControl(RemoteControl remoteControl)
          This remote control can be used for remote (via UDP) control of the Chip, e.g.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

biasgen

protected Biasgen biasgen
The bias generator for this chip


name

protected java.lang.String name
A String name


hardwareInterface

protected HardwareInterface hardwareInterface
The Chip's HardwareInterface


log

protected static java.util.logging.Logger log
Constructor Detail

Chip

public Chip()
Creates a new instance of Chip


Chip

public Chip(HardwareInterface hardwareInterface)
Creates a new instance of Chip


Chip

public Chip(Biasgen biasgen)

Chip

public Chip(HardwareInterface hardwareInterface,
            Biasgen biasgen)
Method Detail

getDescription

public static java.lang.String getDescription()
Override this String (can be html formatted) to show it as the Chip description in some GUI controls.


getPreferredHardwareInterface

public static java.lang.Class<? extends HardwareInterface> getPreferredHardwareInterface()
Should be overridden by a subclass of Chip to specify the preferred HardwareInterface. In the case of chips that use a variety of generic interfaces the factory will construct a default interface if getPreferredHardwareInterface return null.

Returns:
a HardwareInterface class.

setPreferredHardwareInterface

public static void setPreferredHardwareInterface(java.lang.Class<? extends HardwareInterface> clazz)
Sets the preferred HardwareInterface class. Warning: this can call static initializers of a class, which can cause problems especially in non-standard classloader contexts, e.g. applets.

Parameters:
clazz - the class that must extend HardwareInterface.

getBiasgen

public Biasgen getBiasgen()

setBiasgen

public void setBiasgen(Biasgen biasgen)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getHardwareInterface

public HardwareInterface getHardwareInterface()
gets the hardware interface for this Chip

Returns:
the hardware interface

setHardwareInterface

public void setHardwareInterface(HardwareInterface hardwareInterface)
Sets the hardware interface and the bias generators hardware interface (if the interface supports the bias generator). Notifies Observers with the new HardwareInterface.

Parameters:
hardwareInterface - the interface

getLastData

public java.lang.Object getLastData()
Gets the last data associated with this Chip object. Whatever method obtains this data is responsible for setting this reference.

Returns:
the last data object.

setLastData

public void setLastData(java.lang.Object lastData)
Sets the last data captured or rendered by this Chip. Can be used to reference this data through the Chip instance.

Parameters:
lastData - the data. Usually but not always (e.g. MotionData) this object is of type EventPacket.
See Also:
EventPacket

getPrefs

public java.util.prefs.Preferences getPrefs()
Returns the Preferences node for this Chip.

Returns:
the node

setPrefs

public void setPrefs(java.util.prefs.Preferences prefs)
Sets the Preferences node for the Chip

Parameters:
prefs - the node

getRemoteControl

public RemoteControl getRemoteControl()
This remote control can be used for remote (via UDP) control of the Chip, e.g. the biases.


setRemoteControl

public void setRemoteControl(RemoteControl remoteControl)
This remote control can be used for remote (via UDP) control of the Chip, e.g. the biases.


jAER project on SourceForge