Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
com.phidgets.InterfaceKitPhidget Class Reference
Inheritance diagram for com.phidgets.InterfaceKitPhidget:
Inheritance graph
[legend]

List of all members.

Public Member Functions

final void addInputChangeListener (InputChangeListener l)
final void addOutputChangeListener (OutputChangeListener l)
final void addSensorChangeListener (SensorChangeListener l)
native int getDataRate (int index) throws PhidgetException
native int getDataRateMax (int index) throws PhidgetException
native int getDataRateMin (int index) throws PhidgetException
native int getInputCount () throws PhidgetException
native boolean getInputState (int index) throws PhidgetException
native int getOutputCount () throws PhidgetException
native boolean getOutputState (int index) throws PhidgetException
native boolean getRatiometric () throws PhidgetException
native int getSensorChangeTrigger (int index) throws PhidgetException
native int getSensorCount () throws PhidgetException
native int getSensorRawValue (int index) throws PhidgetException
native int getSensorValue (int index) throws PhidgetException
 InterfaceKitPhidget () throws PhidgetException
final void removeInputChangeListener (InputChangeListener l)
final void removeOutputChangeListener (OutputChangeListener l)
final void removeSensorChangeListener (SensorChangeListener l)
native void setDataRate (int index, int newVal) throws PhidgetException
native void setOutputState (int index, boolean newVal) throws PhidgetException
native void setRatiometric (boolean state) throws PhidgetException
native void setSensorChangeTrigger (int index, int newVal) throws PhidgetException

Private Member Functions

final void enableDeviceSpecificEvents (boolean b)
native void enableInputChangeEvents (boolean b)
native void enableOutputChangeEvents (boolean b)
native void enableSensorChangeEvents (boolean b)
void fireInputChange (InputChangeEvent e)
void fireOutputChange (OutputChangeEvent e)
void fireSensorChange (SensorChangeEvent e)

Static Private Member Functions

static native long create () throws PhidgetException

Private Attributes

LinkedList inputChangeListeners = new LinkedList()
long nativeInputChangeHandler = 0
long nativeOutputChangeHandler = 0
long nativeSensorChangeHandler = 0
LinkedList outputChangeListeners = new LinkedList()
LinkedList sensorChangeListeners = new LinkedList()

Detailed Description

This class represents a Phidget Interface Kit. All methods to read and write data to and from an Interface Kit are implemented in this class.

There are many types of Interface Kits, but each is simply a collection of 0 or more digital inputs, digital outpus and analog sensor inputs. The inputs can be read and outputs can be set, and event handlers can be set for each of these.

See your device's User Guide for more specific API details, technical information, and revision details. The User Guide, along with other resources, can be found on the product page for your device.

Author:
Phidgets Inc.

Definition at line 26 of file InterfaceKitPhidget.java.


Constructor & Destructor Documentation

Class Constructor. Calling this opens a connection to the phidget21 C library creates an internal handle for this Phidget, ready to call open on.

Exceptions:
PhidgetExceptionIf there was a problem connecting to phidget21 or creating the internal handle.

Definition at line 35 of file InterfaceKitPhidget.java.


Member Function Documentation

final void com.phidgets.InterfaceKitPhidget.addInputChangeListener ( InputChangeListener  l) [inline]

Adds an input change listener. The input change handler is a method that will be called when an input on this Interface Kit has changed.

There is no limit on the number of input change handlers that can be registered for a particular Phidget.

Parameters:
lAn implemetation of the InputChangeListener interface

Definition at line 246 of file InterfaceKitPhidget.java.

final void com.phidgets.InterfaceKitPhidget.addOutputChangeListener ( OutputChangeListener  l) [inline]

Adds an output change listener. The output change handler is a method that will be called when an output on this Interface Kit has changed.

There is no limit on the number of output change handlers that can be registered for a particular Phidget.

Parameters:
lAn implemetation of the OutputChangeListener interface

Definition at line 284 of file InterfaceKitPhidget.java.

final void com.phidgets.InterfaceKitPhidget.addSensorChangeListener ( SensorChangeListener  l) [inline]

Adds a sensor change listener. The sensor change handler is a method that will be called when a sensor on this Interface Kit has changed by at least the Trigger that has been set for this sensor.

There is no limit on the number of sensor change handlers that can be registered for a particular Phidget.

Parameters:
lAn implemetation of the SensorChangeListener interface

Definition at line 322 of file InterfaceKitPhidget.java.

static native long com.phidgets.InterfaceKitPhidget.create ( ) throws PhidgetException [static, private]
final void com.phidgets.InterfaceKitPhidget.enableDeviceSpecificEvents ( boolean  b) [inline, private]

Reimplemented from com.phidgets.Phidget.

Definition at line 229 of file InterfaceKitPhidget.java.

void com.phidgets.InterfaceKitPhidget.fireInputChange ( InputChangeEvent  e) [inline, private]

Definition at line 263 of file InterfaceKitPhidget.java.

void com.phidgets.InterfaceKitPhidget.fireOutputChange ( OutputChangeEvent  e) [inline, private]

Definition at line 301 of file InterfaceKitPhidget.java.

void com.phidgets.InterfaceKitPhidget.fireSensorChange ( SensorChangeEvent  e) [inline, private]

Definition at line 339 of file InterfaceKitPhidget.java.

Returns the data rate for a sensor, in milliseconds.

Parameters:
indexIndex of the sensor
Returns:
data rate
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.

Returns the maximum data rate for a sensor, in milliseconds.

Parameters:
indexIndex of the input
Returns:
maximum data rate
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.

Returns the minimum data rate for a sensor, in milliseconds.

Parameters:
indexIndex of the input
Returns:
minimum data rate
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.

Returns the number of ditigal inputs on this Interface Kit. Not all interface kits have the same number of digital inputs, and some don't have any digital inputs at all.

Returns:
Number of digital inputs
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached. See open for information on determining if a device is attached.

Returns the state of a digital input. Digital inputs read True where they are activated and false when they are in their default state.

Be sure to check getInputCount first if you are unsure as to the number of inputs, so as not to set an Index that is out of range.

Parameters:
indexIndex of the input
Returns:
State of the input
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.

Returns the number of digital outputs on this Interface Kit. Not all interface kits have the same number of digital outputs, and some don't have any digital outputs at all.

Returns:
Number of digital outputs
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached. See open for information on determining if a device is attached.

Returns the state of a digital output. Depending on the Phidget, this value may be either the value that you last wrote out to the Phidget, or the value that the Phidget last returned. This is because some Phidgets return their output state and others do not. This means that with some devices, reading the output state of a pin directly after setting it, may not return the value that you just set.

Be sure to check getOutputCount first if you are unsure as to the number of outputs, so as not to attempt to get an Index that is out of range.

Parameters:
indexIndex of the output
Returns:
State of the output
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.

Gets the ratiometric state for the analog sensors

Returns:
state State
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if this phidget does not support ratiometric. See open for information on determining if a device is attached.

Returns the change trigger for an analog input. This is the ammount that an inputs must change between successive SensorChangeEvents. This is based on the 0-1000 range provided by getSensorValue. This value is by default set to 10 for most Interface Kits with analog inputs.

Parameters:
indexIndex of the sensor
Returns:
Trigger value
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.

Returns the number of analog inputs on the Interface Kit. Not all interface kits have the same number of analog inputs, and some don't have any analog inputs at all.

Returns:
Number of analog inputs
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached. See open for information on determining if a device is attached.

Returns the raw value of a analog input. This is a more accurate version of getSensorValue. The valid range is 0-4095. Note however that the analog outputs on the Interface Kit 8/8/8 are only 10-bit values and this value represents an oversampling to 12-bit.

Parameters:
indexIndex of the sensor
Returns:
Sensor value
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.

Returns the value of a analog input. The analog inputs are where analog sensors are attached on the InterfaceKit 8/8/8. On the Linear and Circular touch sensor Phidgets, analog input 0 represents position on the slider.

The valid range is 0-1000. In the case of a sensor, this value can be converted to an actual sensor value using the formulas provided here: http://www.phidgets.com/documentation/Sensors.pdf

Parameters:
indexIndex of the sensor
Returns:
Sensor value
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.
final void com.phidgets.InterfaceKitPhidget.removeInputChangeListener ( InputChangeListener  l) [inline]

Removes an input change listener. This will remove a previously added input change listener.

Definition at line 256 of file InterfaceKitPhidget.java.

final void com.phidgets.InterfaceKitPhidget.removeOutputChangeListener ( OutputChangeListener  l) [inline]

Removes an output change listener. This will remove a previously added output change listener.

Definition at line 294 of file InterfaceKitPhidget.java.

final void com.phidgets.InterfaceKitPhidget.removeSensorChangeListener ( SensorChangeListener  l) [inline]

Removes a sensor change listener. This will remove a previously added sensor change listener.

Definition at line 332 of file InterfaceKitPhidget.java.

native void com.phidgets.InterfaceKitPhidget.setDataRate ( int  index,
int  newVal 
) throws PhidgetException

Sets the data rate of a sensor, in milliseconds.

Parameters:
indexInput
newValdata rate
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.
native void com.phidgets.InterfaceKitPhidget.setOutputState ( int  index,
boolean  newVal 
) throws PhidgetException

Sets the state of a digital output. Setting this to true will activate the output, False is the default state.

Parameters:
indexIndex of the output
newValState to set the output to
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.

Sets the ratiometric state for the analog inputs. The default is for ratiometric to be set on and this is appropriate for most sensors.

Parameters:
stateState
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if this Phidget does not support ratiometric See open for information on determining if a device is attached.
native void com.phidgets.InterfaceKitPhidget.setSensorChangeTrigger ( int  index,
int  newVal 
) throws PhidgetException

Sets the change trigger for an analog input. This is the ammount that an inputs must change between successive SensorChangeEvents. This is based on the 0-1000 range provided by getSensorValue. This value is by default set to 10 for most Interface Kits with analog inputs.

Parameters:
indexInput
newValValue
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.

Member Data Documentation

LinkedList com.phidgets.InterfaceKitPhidget.inputChangeListeners = new LinkedList() [private]

Definition at line 235 of file InterfaceKitPhidget.java.

Definition at line 236 of file InterfaceKitPhidget.java.

Definition at line 274 of file InterfaceKitPhidget.java.

Definition at line 312 of file InterfaceKitPhidget.java.

LinkedList com.phidgets.InterfaceKitPhidget.outputChangeListeners = new LinkedList() [private]

Definition at line 273 of file InterfaceKitPhidget.java.

LinkedList com.phidgets.InterfaceKitPhidget.sensorChangeListeners = new LinkedList() [private]

Definition at line 311 of file InterfaceKitPhidget.java.


The documentation for this class was generated from the following file:


pedal_monitor
Author(s): Pedro Mendes
autogenerated on Fri Jun 6 2014 18:37:22