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

List of all members.

Public Member Functions

final void addWeightChangeListener (WeightChangeListener l)
native double getWeight () throws PhidgetException
native double getWeightChangeTrigger () throws PhidgetException
final void removeWeightChangeListener (WeightChangeListener l)
native void setWeightChangeTrigger (double newVal) throws PhidgetException
 WeightSensorPhidget () throws PhidgetException

Private Member Functions

final void enableDeviceSpecificEvents (boolean b)
native void enableWeightChangeEvents (boolean b)
void fireWeightChange (WeightChangeEvent e)

Static Private Member Functions

static native long create () throws PhidgetException

Private Attributes

long nativeWeightChangeHandler = 0
LinkedList weightChangeListeners = new LinkedList ()

Detailed Description

This class represents a Phidget Weight Sensor. All methods to read weight data from the weight sensor are implemented in this class.

The Phidget Weight Sensor is simply an electronic scale with a USB interface. It provides one weight value, in kg.

Author:
Phidget Inc.

Definition at line 19 of file WeightSensorPhidget.java.


Constructor & Destructor Documentation

Definition at line 21 of file WeightSensorPhidget.java.


Member Function Documentation

final void com.phidgets.WeightSensorPhidget.addWeightChangeListener ( WeightChangeListener  l) [inline]

Adds a weight change listener. The weight change handler is a method that will be called when the weight has changed by at least the Trigger that has been set.

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

Parameters:
lAn implemetation of the WeightChangeListener interface

Definition at line 66 of file WeightSensorPhidget.java.

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

Reimplemented from com.phidgets.Phidget.

Definition at line 54 of file WeightSensorPhidget.java.

void com.phidgets.WeightSensorPhidget.fireWeightChange ( WeightChangeEvent  e) [inline, private]

Definition at line 80 of file WeightSensorPhidget.java.

Returns the sensed weight in kg. This weight is in kg (kilograms), but can easily be converted into other units. The accuracy, sesitivity and range depends on the scale and version.

Returns:
The sensed weight
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached. See open for information on determining if a device is attached.

Returns the weight change trigger. This is the ammount by which the sensed weight must change between WeightChangeEvents. By default this is set to 5.

Returns:
The trigger value
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached. See open for information on determining if a device is attached.
final void com.phidgets.WeightSensorPhidget.removeWeightChangeListener ( WeightChangeListener  l) [inline]

Definition at line 74 of file WeightSensorPhidget.java.

Sets the weight change trigger. This is the ammount by which the sensed weight must change between WeightChangeEvents. By default this is set to 5.

Parameters:
newValThe new trigger value
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached. See open for information on determining if a device is attached.

Member Data Documentation

Definition at line 73 of file WeightSensorPhidget.java.

LinkedList com.phidgets.WeightSensorPhidget.weightChangeListeners = new LinkedList () [private]

Definition at line 72 of file WeightSensorPhidget.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:23