edu.berkeley.guir.ptk.output
Class PhidgetInterfaceKitOutput

java.lang.Object
  extended byedu.berkeley.guir.ptk.PTK
      extended byedu.berkeley.guir.ptk.output.Output
          extended byedu.berkeley.guir.ptk.output.PhidgetInterfaceKitOutput
All Implemented Interfaces:
Phidgets._IPhidgetManagerEvents, java.util.EventListener, java.lang.Runnable
Direct Known Subclasses:
BusLEDOutput

public abstract class PhidgetInterfaceKitOutput
extends Output
implements Phidgets._IPhidgetManagerEvents

Provides functionality for using a PhidgetInterfaceKit as a PTK Output. Implements _IPhidgetManagerEvents and provides default functionality for the functions this Interface defines. A single PhidgetInterfaceKitOutput object corresponds to a single physical Phidget Interface Kit - the object is assigned the serial number of the physical hardware upon instantiation.

The serial number is assigned on the microprocessor of the connector circuit board (i.e., the interface kit itself does not have a serial number - the USB port to USB hub / device board has a serial number.

Author:
tmatthew

Field Summary
protected  Phidgets.PhidgetInterfaceKit kit
           
static java.lang.String KIT
           
protected  Phidgets.PhidgetManager manager
           
 int my_serial_num
          The serial number is assigned on the microprocessor of the connector circuit board (i.e., the interface kit itself does not have a serial number - the USB port to USB hub / device board has a serial number.
 
Fields inherited from class edu.berkeley.guir.ptk.output.Output
animatable, d_queue, data_ids_I_want, history, ITEMS_LENGTH, metadata_I_want, num_ids, num_metadata, output_cycle_time, transition
 
Fields inherited from class edu.berkeley.guir.ptk.PTK
debug, MAX_DEBUG, MED_DEBUG, MIN_DEBUG, NO_DEBUG
 
Fields inherited from interface Phidgets._IPhidgetManagerEvents
event_package, id_1, id_2, id_3
 
Constructor Summary
PhidgetInterfaceKitOutput(int serial)
          Initializes the PhidgetManager, which listens for new Phidgets to be "attached."
PhidgetInterfaceKitOutput(int serial, boolean animatable)
          Initializes the PhidgetManager and indicates that this Output will be animatable.
PhidgetInterfaceKitOutput(int serial, java.lang.String data_id)
           
PhidgetInterfaceKitOutput(int serial, java.lang.String[] data_ids_I_want)
          Initializes the PhidgetManager and set the data IDs of data this Output can display.
PhidgetInterfaceKitOutput(int serial, java.lang.String[] data_ids_I_want, boolean animatable)
           
PhidgetInterfaceKitOutput(int serial, java.lang.String[] data_ids_I_want, Transition t)
           
PhidgetInterfaceKitOutput(int serial, java.lang.String data_id, boolean animatable)
           
PhidgetInterfaceKitOutput(int serial, java.lang.String data_id, Transition t)
           
PhidgetInterfaceKitOutput(int serial, Transition t)
          Initializes the PhidgetManager and provides a custom Transition object.
 
Method Summary
abstract  void initialize()
          This method is called after the Phidget with the correct serial number is attached; put initialization code for the Phidget here.
protected  void initManager()
           
 void OnAttach(Phidgets._IPhidgetManagerEvents_OnAttachEvent e)
          Called when a Phidget is attached (i.e., plugged in) and detected by the program.
 void OnDetach(Phidgets._IPhidgetManagerEvents_OnDetachEvent e)
          Called when a Phidget is detatched (i.e., unplugged).
 void OnError(Phidgets._IPhidgetManagerEvents_OnErrorEvent e)
          Called when a Phidget has an error.
 
Methods inherited from class edu.berkeley.guir.ptk.output.Output
addDataID, addMetadataIWant, checkAction, displayEvent, doIWant, getAllMetadata, getDataIDs, getFirstMetadata, getHistory, handleEvent, interDisplayEvent, isAnimatable, printMetadataIWant, run, setChangeblindTransitionSteps, setDataIDsIWant, setInterruptTransitionSteps, setMakeawareTransitionSteps, setTimeBetweenDisplayEvents, setTransition, setUnsetNotification
 
Methods inherited from class edu.berkeley.guir.ptk.PTK
getMAX, getMED, getMIN, getNO, printDebug, printDebug, printError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KIT

public static final java.lang.String KIT
See Also:
Constant Field Values

my_serial_num

public int my_serial_num
The serial number is assigned on the microprocessor of the connector circuit board (i.e., the interface kit itself does not have a serial number - the USB port to USB hub / device board has a serial number.


kit

protected Phidgets.PhidgetInterfaceKit kit

manager

protected Phidgets.PhidgetManager manager
Constructor Detail

PhidgetInterfaceKitOutput

public PhidgetInterfaceKitOutput(int serial)
Initializes the PhidgetManager, which listens for new Phidgets to be "attached."

Parameters:
serial - the serial number of the Phidget.

PhidgetInterfaceKitOutput

public PhidgetInterfaceKitOutput(int serial,
                                 boolean animatable)
Initializes the PhidgetManager and indicates that this Output will be animatable.

Parameters:
serial - the serial number of the Phidget.
animatable - boolean = true, indicating that the Output is animatable (you do not need to pass in this boolean if the Output is not animatable, since the default is false).

PhidgetInterfaceKitOutput

public PhidgetInterfaceKitOutput(int serial,
                                 Transition t)
Initializes the PhidgetManager and provides a custom Transition object.

Parameters:
serial - the serial number of the Phidget.
t - custom Transition object.

PhidgetInterfaceKitOutput

public PhidgetInterfaceKitOutput(int serial,
                                 java.lang.String[] data_ids_I_want)
Initializes the PhidgetManager and set the data IDs of data this Output can display.

Parameters:
serial -
data_ids_I_want -

PhidgetInterfaceKitOutput

public PhidgetInterfaceKitOutput(int serial,
                                 java.lang.String[] data_ids_I_want,
                                 boolean animatable)

PhidgetInterfaceKitOutput

public PhidgetInterfaceKitOutput(int serial,
                                 java.lang.String[] data_ids_I_want,
                                 Transition t)

PhidgetInterfaceKitOutput

public PhidgetInterfaceKitOutput(int serial,
                                 java.lang.String data_id)

PhidgetInterfaceKitOutput

public PhidgetInterfaceKitOutput(int serial,
                                 java.lang.String data_id,
                                 boolean animatable)

PhidgetInterfaceKitOutput

public PhidgetInterfaceKitOutput(int serial,
                                 java.lang.String data_id,
                                 Transition t)
Method Detail

initManager

protected void initManager()

initialize

public abstract void initialize()
This method is called after the Phidget with the correct serial number is attached; put initialization code for the Phidget here.


OnAttach

public void OnAttach(Phidgets._IPhidgetManagerEvents_OnAttachEvent e)
Called when a Phidget is attached (i.e., plugged in) and detected by the program. Checks to be sure the Phidget is an interface kit, that it has the correct serial number, then instantiates one, and calls initialize().

Specified by:
OnAttach in interface Phidgets._IPhidgetManagerEvents

OnDetach

public void OnDetach(Phidgets._IPhidgetManagerEvents_OnDetachEvent e)
Called when a Phidget is detatched (i.e., unplugged). Checks to be sure the Phidget is an interface kit with the right serial number and then sets the interface kit object to null.

Specified by:
OnDetach in interface Phidgets._IPhidgetManagerEvents

OnError

public void OnError(Phidgets._IPhidgetManagerEvents_OnErrorEvent e)
Called when a Phidget has an error.

Specified by:
OnError in interface Phidgets._IPhidgetManagerEvents