public class ControlDeviceOperator extends DeviceOperator
Modifier and Type | Field and Description |
---|---|
int |
beepToneFreq |
boolean |
isOn |
boolean |
justTurnedOn |
long |
notOffUntil |
long |
notOnDur |
long |
notOnUntil |
long |
onDur |
long |
time_On |
itsDeviceInterface, itsDevicePosCounter
Constructor and Description |
---|
ControlDeviceOperator()
standard constructor for the DeviceController class
|
ControlDeviceOperator(int channel)
standard constructor for the DeviceController class
|
Modifier and Type | Method and Description |
---|---|
void |
addHotShape(java.awt.Shape hShape)
add shapes that define "hot" areas
|
void |
confirmInterface()
confirms that the controller has an interface
|
void |
confirmPositionInValidRange(double position)
confirms that a setting is within the valid range
|
void |
controlDevice(Capture theCapture)
control the device depending on object location
|
java.util.List<java.awt.Shape> |
getHotShapes()
standard constructor for the DeviceController class
|
float |
getMaxVoltage(int theChannel)
returns the output voltage on a channel.
|
SignalGenerator |
getSignalGenerator()
returns the operator's signal generator
|
LEDButton |
getStatusLED() |
boolean |
isIn(java.awt.geom.Point2D thePt)
returns whether the provided capture is in the hot space
|
boolean |
isIn(SpatialVector theLocation)
returns whether the provided capture is in the hot space
|
void |
pullHigh()
pulls the voltage High on its channel
|
void |
pullLow()
pulls the voltage Low on its channel
|
void |
reportDeviceStatus()
reports the status of the device
|
java.lang.String |
sendCommand(java.lang.String cmd)
runs a command
|
void |
sendStartCommand()
controls a start command
|
void |
sendStartCommand(long timeStamp)
controls a start command
|
void |
sendStopCommand()
controls a stop command
|
void |
sendStopCommand(long timeStamp)
controls a stop command
|
void |
setByteValue(byte value)
sets the output voltage on a channel.
|
void |
setByteValue(int value)
sets the value for the channel
|
void |
setEnabled(boolean ON)
enables the channel
|
void |
setEngaged(boolean ON)
engages the channel
|
void |
setHotShapes(java.util.List<java.awt.Shape> hotShapes) |
void |
setHotSpace(GridSpace3D aSpace)
sets the current 3D space that is "hot".
|
void |
setMaxVoltage(float maxVoltage)
sets the output voltage on a channel.
|
void |
setNotOnDuration(long duration)
sets the duration for which the controller is forced off
|
void |
setOnDuration(long duration)
sets the duration for which the controller is forced on
|
void |
setPosition(double position)
sets the device to a specific position
|
void |
setSignalGenerator(SignalGenerator signalGenerator)
sets the operator's signal generator
|
void |
setStatusLED(LEDButton statusLED) |
void |
setValue(float value)
sets the value for the channel
|
void |
startSignalGenerator()
turn off the serial device
|
void |
stopSignalGenerator()
turn off the serial device
|
java.lang.String |
toString()
report the record as a string
|
void |
turnOff()
turns off the serial device
operate via sending start and stop commands rather than here directly
|
void |
turnOn()
turns on the device controller
operate via sending start and stop commands rather than here directly
|
getDataChannelDescriptor, getItsDeviceTypeStr, getTriggerProc, isControlDeviceOperator, isSensorDeviceOperator, list, setDataChannelDescriptor, setItsDeviceTypeStr, setTriggerProc
public long time_On
public long onDur
public long notOnDur
public long notOffUntil
public long notOnUntil
public boolean justTurnedOn
public boolean isOn
public int beepToneFreq
public ControlDeviceOperator()
public ControlDeviceOperator(int channel)
public void setOnDuration(long duration)
duration
- leave it on for that many milliseconds, then turn it offpublic void setNotOnDuration(long duration)
duration
- leave it off for that many millisecondspublic java.util.List<java.awt.Shape> getHotShapes()
rec
- the 2D dimensions that defines the hot space as a Rectanglepublic void setHotShapes(java.util.List<java.awt.Shape> hotShapes)
public void addHotShape(java.awt.Shape hShape)
hShapes
- the shape that defines the hot spacepublic void setHotSpace(GridSpace3D aSpace)
aSpace
- the 3D dimensions that defines the hot spacepublic void sendStartCommand() throws java.lang.Exception
java.lang.Exception
public void sendStartCommand(long timeStamp) throws java.lang.Exception
timeStamp
- the time stamp for the commandjava.lang.Exception
public void sendStopCommand() throws java.lang.Exception
java.lang.Exception
public void sendStopCommand(long timeStamp) throws java.lang.Exception
timeStamp
- the time stamp for the commandjava.lang.Exception
public void turnOn() throws java.lang.Exception
java.lang.Exception
public void turnOff() throws java.lang.Exception
java.lang.Exception
public void pullHigh() throws java.lang.Exception
java.lang.Exception
public void pullLow() throws java.lang.Exception
java.lang.Exception
public void setByteValue(byte value) throws java.lang.Exception
volts
- the voltagejava.lang.Exception
public void setByteValue(int value) throws java.lang.Exception
value
- the voltage between 0 (min Voltage) - 255 (max Voltage)java.lang.Exception
public void setValue(float value) throws java.lang.Exception
value
- the voltage between 0 (min Voltage) - 1 (max Voltage)java.lang.Exception
public java.lang.String sendCommand(java.lang.String cmd) throws java.lang.Exception
cmd
- the command to usejava.lang.Exception
public SignalGenerator getSignalGenerator()
public void setSignalGenerator(SignalGenerator signalGenerator)
signalGenerator
- the signal generator to usepublic void startSignalGenerator()
public void stopSignalGenerator()
public void setPosition(double position) throws java.lang.Exception
channelID
- index of the deviceposition
- desired positionjava.lang.Exception
public void setEnabled(boolean ON) throws java.lang.Exception
ON
- enabled?java.lang.Exception
public void setEngaged(boolean ON) throws java.lang.Exception
ON
- engaged?java.lang.Exception
public void controlDevice(Capture theCapture) throws java.lang.Exception
theCapture
- the capturejava.lang.Exception
public void reportDeviceStatus() throws java.lang.Exception
reportDeviceStatus
in class DeviceOperator
java.lang.Exception
public LEDButton getStatusLED()
public void setStatusLED(LEDButton statusLED)
public float getMaxVoltage(int theChannel)
theChannel
- index of the devicepublic void setMaxVoltage(float maxVoltage)
volts
- the voltagepublic void confirmInterface() throws java.lang.Exception
confirmInterface
in class DeviceOperator
java.lang.Exception
public void confirmPositionInValidRange(double position) throws java.lang.Exception
position
- desired positionjava.lang.Exception
public boolean isIn(SpatialVector theLocation) throws java.lang.Exception
theLocation
- the locationjava.lang.Exception
public boolean isIn(java.awt.geom.Point2D thePt) throws java.lang.Exception
theLocation
- the locationjava.lang.Exception
public java.lang.String toString()
toString
in class DeviceOperator
RH, 2017