public class PhidgetInterface extends DeviceInterface implements com.phidgets.event.SensorChangeListener
Modifier and Type | Field and Description |
---|---|
int |
itsPhidgetModel |
static boolean |
kIsRatiometric |
static float |
kSamplesPerSec |
static int |
kSensorChangeTrigger |
attached, ChannelAccess_DIRECT, ChannelAccess_EVENTS, ChannelAccess_NONE, contrChannelsInUse, currSampleTime, datVal, DeviceType_IN, DeviceType_INOUT, DeviceType_NONE, DeviceType_OUT, fw, isActive, isDataInRunning, isDataLoggingReady, itsControlDesign, itsDeviceTimer, itsDeviceType, itsDurationTraceTime, itsEngine, itsHardware, itsInstrumentPanel, itsOffVoltage, itsOnVoltage, itsReader, itsRunTime, itsSamplesPerSec, itsSerNum, itsSettings, itsStartTraceTime, itsTimerRowCounter, itsType, itsWriter, lastSampleTime, listValues, logFileName, loggerIsRunning, operChannelsInUse, sensChannelsInUse, sensorTraces, startTimeDataIn, timeDevice, validRange
Constructor and Description |
---|
PhidgetInterface(int nChannels)
standard constructor for the DeviceInterface class
|
PhidgetInterface(int nChannels,
float samplesPerSec)
standard constructor for the DeviceInterface class
|
Modifier and Type | Method and Description |
---|---|
void |
activateUsedChannels()
activate the channels
|
void |
close()
closes the interface
|
void |
closeEventInterface()
close the event interface
|
void |
completeInterface()
complete the interface to a Phidget
|
boolean |
confirmPhidgetHardware()
confirms thqt the Interface controls a Phidget
|
com.phidgets.AdvancedServoPhidget |
getAdvancedServoHardware()
returns an advanced servo phidget - if it exists
|
com.phidgets.AnalogPhidget |
getAnalogOutHardware()
returns a AnalogOut phidget - if it exists
|
java.lang.Object |
getControlHardware()
returns an output phidget - if it exists
|
com.phidgets.InterfaceKitPhidget |
getIFKitHardware()
returns a interface kit phidget - if it exists
|
java.lang.Object |
getSensorHardware()
returns a sensor phidget - if it exists
|
float |
getSensorValue(DataChannelDescriptor dataSource)
gets the sensor's value from a channel
|
com.phidgets.ServoPhidget |
getServoHardware()
returns a servo phidget - if it exists
|
void |
handleSensorEvent(com.phidgets.event.SensorChangeEvent sensorEvent)
handles the incoming data from the sensor
|
void |
listDeviceInterface()
lists info for the device
|
static void |
main(java.lang.String[] args)
Main method.
|
void |
makeHardwareInterface()
makes the interface for a Phidget
|
void |
prepareEventInterface()
prepare the event interface
|
DataValue |
processSensorEvent(com.phidgets.event.SensorChangeEvent sensorEvent)
handles the incoming data from the sensor
|
void |
resetAllChannels()
reset the channels
|
void |
sensorChanged(com.phidgets.event.SensorChangeEvent sensorEvent)
handles the incoming data from the sensor
|
void |
setValue(int channel,
float value)
sets the output value on a channel.
|
void |
turnOff(int channel)
stops the device on one channel.
|
void |
turnOn(int channel)
starts the device on one channel.
|
addControlDeviceOperator, addDeviceOperator, addSensorDeviceOperator, autoColorTraces, confirmChannelRange, confirmInputCapable, confirmMinNChannels, confirmOutputCapable, controlAllDevices, controlDeviceFromSchedule, finalizeInterface, getAnalogSensorHardware, getChannelAccess, getControlDeviceOperator, getDataRate, getDeviceOperator, getDeviceOperatorForChannel, getDeviceType, getHardware, getHotShapeList, getItsName, getNControlDeviceOperators, getNDeviceOperators, getNInterfaceChannels, getNSensorDeviceOperators, getSensorDeviceOperator, getSensorValue, getTracker, initializeFromSettings, isValidControlHardware, isValidSensorHardware, list, listDeviceOperators, makeControlDeviceOperator, makeDeviceOperator, makeInterface, makeSensorDeviceOperator, makeSineWave, resetTraces, sendCommand, setByteValue, setByteValue, setChannelAccess, setDataRate, setDeviceType, setEnabled, setEngaged, setInterface, setItsName, setNControlInterfaceChannels, setTraceTimes, setTracker, setupDataLogging, setValidRange, startDataIn_DirectPolling, startDataIn_DirectPolling, startDataIn_EventDriven, startDataIn, startEventInterface, stopDataIn, stopEventInterface, toString, updateSamplingRate, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
public static float kSamplesPerSec
public static boolean kIsRatiometric
public static int kSensorChangeTrigger
public int itsPhidgetModel
public PhidgetInterface(int nChannels) throws java.lang.Exception
nChannels
- the number of channelsjava.lang.Exception
- ...public PhidgetInterface(int nChannels, float samplesPerSec) throws java.lang.Exception
nChannels
- the number of channelssamplesPerSec
- the sampling ratejava.lang.Exception
- ...public void makeHardwareInterface() throws java.lang.Exception
makeHardwareInterface
in class DeviceInterface
java.lang.Exception
- ...public void listDeviceInterface() throws java.lang.Exception
listDeviceInterface
in class DeviceInterface
java.lang.Exception
- ...public java.lang.Object getSensorHardware() throws java.lang.Exception
getSensorHardware
in class DeviceInterface
java.lang.Exception
- ...public java.lang.Object getControlHardware() throws java.lang.Exception
getControlHardware
in class DeviceInterface
java.lang.Exception
- ...public com.phidgets.InterfaceKitPhidget getIFKitHardware() throws java.lang.Exception
java.lang.Exception
- ...public com.phidgets.ServoPhidget getServoHardware() throws java.lang.Exception
java.lang.Exception
- ...public com.phidgets.AdvancedServoPhidget getAdvancedServoHardware() throws java.lang.Exception
java.lang.Exception
- ...public com.phidgets.AnalogPhidget getAnalogOutHardware() throws java.lang.Exception
getAnalogOutHardware
in class DeviceInterface
java.lang.Exception
- ...public float getSensorValue(DataChannelDescriptor dataSource) throws java.lang.Exception
getSensorValue
in class DeviceInterface
dataSource
- descriptor of the data sourcejava.lang.Exception
- ...public void setValue(int channel, float value) throws java.lang.Exception
setValue
in class DeviceInterface
channel
- index of the devicevalue
- the voltage to setjava.lang.Exception
- ...public void turnOn(int channel) throws java.lang.Exception
turnOn
in class DeviceInterface
channel
- index of the devicejava.lang.Exception
- ...public void turnOff(int channel) throws java.lang.Exception
turnOff
in class DeviceInterface
channel
- index of the devicejava.lang.Exception
- ...public void close() throws java.lang.Exception
close
in class DeviceInterface
java.lang.Exception
- ...public void completeInterface() throws java.lang.Exception
completeInterface
in class DeviceInterface
java.lang.Exception
- ...public void resetAllChannels() throws java.lang.Exception
resetAllChannels
in class DeviceInterface
java.lang.Exception
- ...public void activateUsedChannels() throws java.lang.Exception
activateUsedChannels
in class DeviceInterface
java.lang.Exception
- ...public void prepareEventInterface() throws java.lang.Exception
prepareEventInterface
in class DeviceInterface
java.lang.Exception
- ...public void closeEventInterface() throws java.lang.Exception
closeEventInterface
in class DeviceInterface
java.lang.Exception
- ...public DataValue processSensorEvent(com.phidgets.event.SensorChangeEvent sensorEvent)
sensorEvent
- the eventpublic void handleSensorEvent(com.phidgets.event.SensorChangeEvent sensorEvent) throws java.lang.Exception
sensorEvent
- the eventjava.lang.Exception
- ...public void sensorChanged(com.phidgets.event.SensorChangeEvent sensorEvent)
sensorChanged
in interface com.phidgets.event.SensorChangeListener
sensorEvent
- the eventpublic boolean confirmPhidgetHardware() throws java.lang.Exception
java.lang.Exception
- ...public static void main(java.lang.String[] args)
args
- the argumentsRH, 2017