jAER project on SourceForge

net.sf.jaer.biasgen
Class PotArray

java.lang.Object
  extended by net.sf.jaer.biasgen.PotArray
All Implemented Interfaces:
BiasgenPreferences
Direct Known Subclasses:
IPotArray

public class PotArray
extends java.lang.Object
implements BiasgenPreferences

A collection of Pot's that belong to a common device, e.g. a chip or a board. This class allows common operations on the Pots and groups the Pots together.

Author:
tobi

Field Summary
protected  java.util.ArrayList<Pot> pots
           
 
Constructor Summary
PotArray(Biasgen biasgen)
          Creates a new instance of IPotArray
 
Method Summary
 boolean addPot(Pot pot)
          add a pot to the end of the list.
 void exportPreferences(java.io.OutputStream os)
          export the prefered values to an OutputStream
 int getNumPots()
          gets the number of ipots in this array
 Pot getPotByName(java.lang.String name)
          Get an Pot by name.
 Pot getPotByNumber(int number)
          Get an Pot by number in PotArray.
 java.util.ArrayList<Pot> getPots()
           
 void importPreferences(java.io.InputStream is)
          import prefs from an InputStream
 void loadPreferences()
          load the stored preferred values -- e.g.
 void setAllToBitValue(int val)
          sets all pots to the same value.
 void setPots(java.util.ArrayList<Pot> pots)
           
 void storePreferences()
          Flushes the preferred values to the Preferences
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pots

protected java.util.ArrayList<Pot> pots
Constructor Detail

PotArray

public PotArray(Biasgen biasgen)
Creates a new instance of IPotArray

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

exportPreferences

public void exportPreferences(java.io.OutputStream os)
Description copied from interface: BiasgenPreferences
export the prefered values to an OutputStream

Specified by:
exportPreferences in interface BiasgenPreferences

importPreferences

public void importPreferences(java.io.InputStream is)
Description copied from interface: BiasgenPreferences
import prefs from an InputStream

Specified by:
importPreferences in interface BiasgenPreferences

loadPreferences

public void loadPreferences()
Description copied from interface: BiasgenPreferences
load the stored preferred values -- e.g. revert to the last stored values

Specified by:
loadPreferences in interface BiasgenPreferences

storePreferences

public void storePreferences()
Flushes the preferred values to the Preferences

Specified by:
storePreferences in interface BiasgenPreferences

addPot

public boolean addPot(Pot pot)
add a pot to the end of the list. The biasgen is also added as an observer for changes in the pot.

Parameters:
pot - an Pot
Returns:
true

getPotByName

public Pot getPotByName(java.lang.String name)
Get an Pot by name.

Parameters:
name - name of pot as assigned in Pot
Returns:
the Pot, or null if there isn't one named that

setAllToBitValue

public void setAllToBitValue(int val)
sets all pots to the same value. Does not notify observers but does call biasgen.resend() after all pots are changed.

Parameters:
val - the bitValue

getPotByNumber

public Pot getPotByNumber(int number)
Get an Pot by number in PotArray. For on-chip biasgen design kit biases, first entry is last one in shift register.

Parameters:
number - name of pot as assigned in Pot
Returns:
the Pot, or null if there isn't one at that array position.

getNumPots

public int getNumPots()
gets the number of ipots in this array

Returns:
the number of pots

getPots

public java.util.ArrayList<Pot> getPots()

setPots

public void setPots(java.util.ArrayList<Pot> pots)

jAER project on SourceForge