jAER project on SourceForge

net.sf.jaer.biasgen.VDAC
Class VPot

java.lang.Object
  extended by java.util.Observable
      extended by net.sf.jaer.biasgen.Pot
          extended by net.sf.jaer.biasgen.VDAC.VPot
All Implemented Interfaces:
java.util.EventListener, java.util.prefs.PreferenceChangeListener, RemoteControlled

public class VPot
extends Pot
implements RemoteControlled

Describes a voltage bias, controlled by a voltage that is generated by a voltage DAC. Used for off-chip voltage DACs for older chips that do not have integrated IPots. A DAC may have an internal reference voltage that results in clipping of the output values to Vdd. For example, if the DAC is running on a 3.3V supply and uses an internal 2.5V reference and also has a gain-of-2 buffer its full scale output would be 5V, but of course the value is clipped to 3.3V.

Author:
tobi

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.jaer.biasgen.Pot
Pot.Sex, Pot.Type
 
Field Summary
static float VOLTAGE_CHANGE_VALUE_VOLTS
          the delta voltage to change by in increment and decrement methods
 
Fields inherited from class net.sf.jaer.biasgen.Pot
bitValue, CHANGE_FRACTION, chip, chipNumber, displayPosition, group, log, masterbias, name, numBits, numBytes, pinNumber, prefs, sex, tooltipString, type
 
Constructor Summary
VPot(Chip chip, java.lang.String name, DAC dac, int channel, Pot.Type type, Pot.Sex sex, int bitValue, int displayPosition, java.lang.String tooltipString)
          Creates a new instance of VPot and loads the preferred bit value.
 
Method Summary
 void changeByFractionOfFullScale(float fraction)
          changes VPot value by a fraction of full scale, e.g.
 void decrementVoltage()
          decrement pot value
 byte[] getBinaryRepresentation()
          Computes and returns a the reused array of bytes representing the bias to be sent over hardware interface to the device
 byte[] getByteRepresentation()
           
 int getChannel()
           
 DAC getDac()
           
 int getDacNumber()
           
 float getMaxVoltage()
           
 float getMinVoltage()
           
 float getPhysicalValue()
          returns physical value of bias, e.g.
 java.lang.String getPhysicalValueUnits()
          return units (e.g.
 float getVoltage()
          gets the voltage output by this VPot according the bit value times the difference between ref min and ref max, clipped to the DAC's vdd.
 float getVoltageResolution()
          return resolution of pot in voltage.
 void incrementVoltage()
          increment pot value
 javax.swing.JComponent makeGUIPotControl()
          Contructs the UI control for this Pot.
protected  java.lang.String prefsKey()
          Returns the String key by which this pot is known in the Preferences.
 java.lang.String processCommand(RemoteControlCommand command, java.lang.String input)
          Called when remote control recieved for this RemoteControlled.
 void setChannel(int channel)
           
 void setDac(DAC dac)
           
 void setDacNumber(int dacNumber)
           
 void setPhysicalValue(float value)
          sets physical value of bias
 float setVoltage(float voltage)
          sets the bit value based on desired voltage, clipped the DAC's vdd.
 
Methods inherited from class net.sf.jaer.biasgen.Pot
addObserver, decrementBitValue, getBitValue, getChipNumber, getDisplayPosition, getGroup, getMaxBitValue, getMinBitValue, getName, getNumBits, getNumBytes, getPinNumber, getPreferedBitValue, getSex, getTooltipString, getType, incrementBitValue, loadPreferences, preferenceChange, resume, setBitValue, setDisplayPosition, setGroup, setName, setNumBits, setNumBytes, setPinNumber, setSex, setTooltipString, setType, storePreferences, suspend, toBitPatternString, toString
 
Methods inherited from class java.util.Observable
clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VOLTAGE_CHANGE_VALUE_VOLTS

public static final float VOLTAGE_CHANGE_VALUE_VOLTS
the delta voltage to change by in increment and decrement methods

See Also:
Constant Field Values
Constructor Detail

VPot

public VPot(Chip chip,
            java.lang.String name,
            DAC dac,
            int channel,
            Pot.Type type,
            Pot.Sex sex,
            int bitValue,
            int displayPosition,
            java.lang.String tooltipString)
Creates a new instance of VPot and loads the preferred bit value.

Parameters:
name -
dac - the DAC on the board
channel - the DAC channel for this bias
type - (NORMAL, CASCODE)
sex - Sex (N, P)
bitValue - initial bitValue
displayPosition - position in GUI from top (logical order)
tooltipString - a String to display to user of GUI telling them what the pots does
Method Detail

setVoltage

public float setVoltage(float voltage)
sets the bit value based on desired voltage, clipped the DAC's vdd. Observers are notified if value changes.

Parameters:
voltage - in volts
Returns:
actual float value of voltage after resolution rounding and vdd clipping.

getByteRepresentation

public byte[] getByteRepresentation()

getVoltage

public float getVoltage()
gets the voltage output by this VPot according the bit value times the difference between ref min and ref max, clipped to the DAC's vdd.

Returns:
voltage in volts.

getMaxVoltage

public float getMaxVoltage()
Returns:
max possible voltage

getMinVoltage

public float getMinVoltage()
Returns:
min possible voltage.

getVoltageResolution

public float getVoltageResolution()
return resolution of pot in voltage.

Returns:
smallest possible voltage change -- in principle.

incrementVoltage

public void incrementVoltage()
increment pot value


decrementVoltage

public void decrementVoltage()
decrement pot value


getDacNumber

public int getDacNumber()

setDacNumber

public void setDacNumber(int dacNumber)

getChannel

public int getChannel()

setChannel

public void setChannel(int channel)

getDac

public DAC getDac()

setDac

public void setDac(DAC dac)

getPhysicalValue

public float getPhysicalValue()
Description copied from class: Pot
returns physical value of bias, e.g. in current amps or voltage volts

Specified by:
getPhysicalValue in class Pot
Returns:
physical value

getPhysicalValueUnits

public java.lang.String getPhysicalValueUnits()
Description copied from class: Pot
return units (e.g. A, mV) of physical value of bias

Specified by:
getPhysicalValueUnits in class Pot

setPhysicalValue

public void setPhysicalValue(float value)
Description copied from class: Pot
sets physical value of bias

Specified by:
setPhysicalValue in class Pot
Parameters:
value - the physical value, e.g. in amps or volts

makeGUIPotControl

public javax.swing.JComponent makeGUIPotControl()
Description copied from class: Pot
Contructs the UI control for this Pot.

Specified by:
makeGUIPotControl in class Pot
Returns:
the UI component that user uses to control the Pot

changeByFractionOfFullScale

public void changeByFractionOfFullScale(float fraction)
changes VPot value by a fraction of full scale, e.g. -0.05f for a -5% decrease of full-scale value

Parameters:
fraction - of full scale value

getBinaryRepresentation

public byte[] getBinaryRepresentation()
Computes and returns a the reused array of bytes representing the bias to be sent over hardware interface to the device

Specified by:
getBinaryRepresentation in class Pot
Returns:
array of bytes to be sent, by convention values are ordered in big endian format so that byte 0 is the most significant byte and is sent first to the hardware

prefsKey

protected java.lang.String prefsKey()
Returns the String key by which this pot is known in the Preferences. For VPot's, this name is the Chip simple class name followed by VPot., e.g. "Tmpdiff128.VPot.VRefAmp".

Overrides:
prefsKey in class Pot
Returns:
preferences key

processCommand

public java.lang.String processCommand(RemoteControlCommand command,
                                       java.lang.String input)
Description copied from interface: RemoteControlled
Called when remote control recieved for this RemoteControlled.

Specified by:
processCommand in interface RemoteControlled
Parameters:
command - the received command that was parsed as being the type sent.
input - the input line which starts with the command token.
Returns:
an optional response to the command which can be null.

jAER project on SourceForge