Phidgets
Class PhidgetInterfaceKit

java.lang.Object
  extended byjava.lang.Thread
      extended byPhidgets.Phidget
          extended byPhidgets.PhidgetInterfaceKit
All Implemented Interfaces:
java.lang.Runnable

public class PhidgetInterfaceKit
extends Phidget


Field Summary
 
Fields inherited from class Phidgets.Phidget
attached, deviceType, deviceVersion, events, handler, IPAddr, password, Port, serialNumber, ServerID
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
PhidgetInterfaceKit()
           
 
Method Summary
 void add_IPhidgetInterfaceKitEventsListener(_IPhidgetInterfaceKitEvents l)
          Sets up the event handlers
 boolean GetInputState(int Index)
          Gets the state of a digital input
 int GetNumInputs()
          Gets the number of ditigal inputs
 int GetNumOutputs()
          Gets the number of digital outputs
 int GetNumSensors()
          Gets the number of analog inputs
 boolean GetOutputState(int Index)
          Gets the state of a digital output
 int GetSensorChangeTrigger(int Index)
          Gets the change trigger for an analog input
 int GetSensorNormalizeMaximum(int Index)
          Gets the maximum input value for an analog input
 int GetSensorNormalizeMinimum(int Index)
          Gets the minimum input value for an analog input
 int GetSensorValue(int Index)
          Gets the value of a analog input.
protected  void gotData(java.lang.String[] dataArray)
           
protected  void init(java.lang.String[] dataArray)
           
 int OpenRemote(int serverSerial, int port, int serialNumber, java.lang.String pass)
          Open the device when it is on the local network.
 int OpenRemoteIP(java.lang.String ip, int port, int serialNumber, java.lang.String pass)
          Open the device when it is on a remote network.
 void remove_IPhidgetInterfaceKitEventsListener()
          Removes the events handlers
 void SetOutputState(int Index, boolean newVal)
          Sets the state of a ditigal output
 void SetSensorChangeTrigger(int Index, int newVal)
          Sets the change trigger for an analog input.
 void SetSensorNormalizeMaximum(int Index, int newVal)
          Sets the maximum value for a analog input.
 void SetSensorNormalizeMinimum(int Index, int newVal)
          Sets the minimum value for a analog input.
 
Methods inherited from class Phidgets.Phidget
Close, equals, getBoolean, GetDeviceType, GetDeviceVersion, GetIsAttached, GetSerialNumber, GetServerAddress, GetServerID, GetServerPort, OpenRemote, OpenRemoteIP, run, setDeviceType, setDeviceVersion, setSerialNumber
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PhidgetInterfaceKit

public PhidgetInterfaceKit()
Method Detail

OpenRemote

public int OpenRemote(int serverSerial,
                      int port,
                      int serialNumber,
                      java.lang.String pass)
Open the device when it is on the local network. This uses a UDB broadcast to find the server with a specified serial number, so you don't need to know it's IP address, but only works on internal networks where broadcasting is allowed

Parameters:
serverSerial - Serial number of the server, or -1 for any serial
port - Server port
serialNumber - Serial number of the device or -1 for any serial
pass - Server password
Returns:
0 on success

OpenRemoteIP

public int OpenRemoteIP(java.lang.String ip,
                        int port,
                        int serialNumber,
                        java.lang.String pass)
Open the device when it is on a remote network. Use this when OpenRemote fails, such as opening Phidgets over the internet. You need to know the IP address here.

Parameters:
ip - IP address or hostname of the server
port - Server port
serialNumber - Serial number of the device or -1 for any serial
pass - Server password
Returns:
0 on success

GetNumOutputs

public int GetNumOutputs()
Gets the number of digital outputs

Returns:
Outputs

GetNumInputs

public int GetNumInputs()
Gets the number of ditigal inputs

Returns:
inputs

GetNumSensors

public int GetNumSensors()
Gets the number of analog inputs

Returns:
Inputs

GetInputState

public boolean GetInputState(int Index)
Gets the state of a digital input

Parameters:
Index - Input
Returns:
State

GetOutputState

public boolean GetOutputState(int Index)
Gets the state of a digital output

Parameters:
Index - Output
Returns:
State

GetSensorValue

public int GetSensorValue(int Index)
Gets the value of a analog input. The range here is 0-1000

Parameters:
Index - Input
Returns:
value

GetSensorNormalizeMinimum

public int GetSensorNormalizeMinimum(int Index)
Gets the minimum input value for an analog input

Parameters:
Index - Input
Returns:
Value

GetSensorNormalizeMaximum

public int GetSensorNormalizeMaximum(int Index)
Gets the maximum input value for an analog input

Parameters:
Index - Input
Returns:
Value

GetSensorChangeTrigger

public int GetSensorChangeTrigger(int Index)
Gets the change trigger for an analog input

Parameters:
Index - Input
Returns:
Trigger

SetOutputState

public void SetOutputState(int Index,
                           boolean newVal)
Sets the state of a ditigal output

Parameters:
Index - Output
newVal - State

SetSensorNormalizeMinimum

public void SetSensorNormalizeMinimum(int Index,
                                      int newVal)
Sets the minimum value for a analog input. The input from this analog sensor will be normalized so that anything below this value will correspond to 0.

Parameters:
Index - Input
newVal - Value

SetSensorNormalizeMaximum

public void SetSensorNormalizeMaximum(int Index,
                                      int newVal)
Sets the maximum value for a analog input. The input from this analog sensor will be normalized so that anything above this value will correspond to 1000.

Parameters:
Index - Input
newVal - Value

SetSensorChangeTrigger

public void SetSensorChangeTrigger(int Index,
                                   int newVal)
Sets the change trigger for an analog input. This is the difference that must happen on a analog input before the OnSensorChange event will be fired

Parameters:
Index - Input
newVal - Value

add_IPhidgetInterfaceKitEventsListener

public void add_IPhidgetInterfaceKitEventsListener(_IPhidgetInterfaceKitEvents l)
Sets up the event handlers

Parameters:
l - An object implementing the __IPhidgetInterfaceKitEvents interface

remove_IPhidgetInterfaceKitEventsListener

public void remove_IPhidgetInterfaceKitEventsListener()
Removes the events handlers


init

protected void init(java.lang.String[] dataArray)
Overrides:
init in class Phidget

gotData

protected void gotData(java.lang.String[] dataArray)
Overrides:
gotData in class Phidget


www.Phidgets.com

Phidgets is a trademark or registered trademark of Phidgets Inc. in the Canada and other countries.
Copyright 2005