public class ArduinoInterface extends DeviceInterface
Modifier and Type | Field and Description |
---|---|
java.io.OutputStream |
outputStream |
jssc.SerialPort |
serialPort |
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, kSamplesPerSec, lastSampleTime, listValues, logFileName, loggerIsRunning, operChannelsInUse, sensChannelsInUse, sensorTraces, startTimeDataIn, timeDevice, validRange
Constructor and Description |
---|
ArduinoInterface(int nChannels)
standard constructor for the ArduinoInterface class
|
Modifier and Type | Method and Description |
---|---|
void |
addControlDeviceOperator(ControlDeviceOperator aDevCont)
adds a controller for a device
|
void |
close()
closes the interface
|
void |
completeInterface()
complete the interface for an Arduino
|
boolean |
confirmArduinoHardware()
confirms thqt the Interface controls an Arduino
|
void |
finalizeInterface() |
Arduino |
getControlHardware()
returns a control arduino - if it exists
|
Arduino |
getRelayHardware()
returns a relay arduino - if it exists
|
Arduino |
getSensorHardware()
returns a sensor arduino - if it exists
|
float |
getSensorValue(DataChannelDescriptor dataSource)
gets the sensor's value from a channel
|
Arduino |
getServoHardware()
returns a servo arduino - if it exists
|
void |
listDeviceInterface()
redirects the device listing to the Arduino
|
static void |
main(java.lang.String[] args)
Main method.
|
void |
makeHardwareInterface()
looks for and initializes the Arduino
|
void |
setByteValue(int channel,
byte 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.
|
activateUsedChannels, addDeviceOperator, addSensorDeviceOperator, autoColorTraces, closeEventInterface, confirmChannelRange, confirmInputCapable, confirmMinNChannels, confirmOutputCapable, controlAllDevices, controlDeviceFromSchedule, getAnalogOutHardware, 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, prepareEventInterface, resetAllChannels, resetTraces, sendCommand, setByteValue, setChannelAccess, setDataRate, setDeviceType, setEnabled, setEngaged, setInterface, setItsName, setNControlInterfaceChannels, setTraceTimes, setTracker, setupDataLogging, setValidRange, setValue, 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 jssc.SerialPort serialPort
public java.io.OutputStream outputStream
public ArduinoInterface(int nChannels)
nChannels
- the number of channelspublic void makeHardwareInterface() throws java.lang.Exception
makeHardwareInterface
in class DeviceInterface
java.lang.Exception
- ...public void completeInterface() throws java.lang.Exception
completeInterface
in class DeviceInterface
java.lang.Exception
- ...public void finalizeInterface()
finalizeInterface
in class DeviceInterface
public void listDeviceInterface() throws java.lang.Exception
listDeviceInterface
in class DeviceInterface
java.lang.Exception
- ...public void addControlDeviceOperator(ControlDeviceOperator aDevCont) throws java.lang.Exception
addControlDeviceOperator
in class DeviceInterface
aDevCont
- the controller for a serial devicejava.lang.Exception
- ...public Arduino getSensorHardware() throws java.lang.Exception
getSensorHardware
in class DeviceInterface
java.lang.Exception
- ...public Arduino getControlHardware() throws java.lang.Exception
getControlHardware
in class DeviceInterface
java.lang.Exception
- ...public Arduino getRelayHardware() throws java.lang.Exception
java.lang.Exception
- ...public Arduino getServoHardware() throws java.lang.Exception
java.lang.Exception
- ...public float getSensorValue(DataChannelDescriptor dataSource) throws java.lang.Exception
getSensorValue
in class DeviceInterface
dataSource
- descriptor for the source of the sensor datajava.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 setByteValue(int channel, byte value) throws java.lang.Exception
setByteValue
in class DeviceInterface
channel
- index of the devicevalue
- the voltage to setjava.lang.Exception
- ...public void close() throws java.lang.Exception
close
in class DeviceInterface
java.lang.Exception
- ...public boolean confirmArduinoHardware() throws java.lang.Exception
java.lang.Exception
- ...public static void main(java.lang.String[] args)
args
- the argumentsRH, 2017