public class LighthouseDriver extends Object
| Constructor and Description |
|---|
LighthouseDriver()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
alarmIsEnabled(String chanName)
Returns the setting of the alarm enable for a particle channel.
|
void |
clearRecords()
Clears all records from the device's internal data set.
|
void |
close()
Closes the device.
|
void |
ftdiOpen(String ftdiID,
boolean debug)
Opens the device on an FTDI USB-serial cable.
|
long |
getAlarmThreshold(String chanName)
Gets the alarm threshold for a particle channel.
|
java.time.Instant |
getClock()
Displays the device clock value.
|
void |
getRecentRecords(String instantString,
String filename)
Prints in ASCII, latest first, those data records more recent than a given date and time.
|
void |
getRecords(int nlimit,
int nskip,
String filename)
Prints in ASCII, earliest first, the device's buffered data records.
|
void |
netOpen(String hostname,
int portNo,
boolean debug)
Opens the device on a network socket.
|
void |
serialOpen(String portName,
boolean debug)
Opens the device on a serial port.
|
void |
setAlarmEnable(String chanName,
boolean on)
Sets the alarm enable state for a particle channel.
|
void |
setAlarmThreshold(String chanName,
long threshold)
Sets the alarm threshold for a particle channel.
|
void |
setClock()
Sets the device clock from the computer's.
|
void |
startRecording()
Starts the device, appending all future records to its internal data set.
|
void |
stopRecording()
Stops the device so that it no longer updates its internal data set.
|
@Command(description="Opens the device on a serial port.")
public void serialOpen(@Argument(description="The serial port name, for example /dev/ttyUSB0.")
String portName,
@Argument(description="When true, activates debug logging.",defaultValue="false")
boolean debug)
throws org.lsst.ccs.drivers.commons.DriverException
portName - The serial port name, for example /dev/ttyUSB0.debug - If true enables debug-level logging of device command traffic.org.lsst.ccs.drivers.commons.DriverException - for all errors.@Command(description="Opens the device on an FTDI USB-serial cable.")
public void ftdiOpen(@Argument(description="The serial no. of the cable, preceded by a hostname and a colon if it\'s a remote cable.")
String ftdiID,
@Argument(description="When true, activates debug logging.",defaultValue="false")
boolean debug)
throws org.lsst.ccs.drivers.commons.DriverException
ftdiID - The serial no. of the FTDI device to use, preceded by a hostname
and a colon if remote. Examples: XXXXX or foo:XXXXX.debug - If true enables debug-level logging of device command traffic.org.lsst.ccs.drivers.commons.DriverException - for all errors.@Command(description="Opens the device on a network socket.")
public void netOpen(@Argument(description="The remote host\'s name or IP address.")
String hostname,
@Argument(description="The number of the port to connect to.")
int portNo,
@Argument(description="When true, activates debug logging.",defaultValue="false")
boolean debug)
throws org.lsst.ccs.drivers.commons.DriverException
hostname - The remote host's name or IP address.portNo - The number of the port to connect to.debug - If true enables debug-level logging of device command traffic.org.lsst.ccs.drivers.commons.DriverException - for all errors.@Command(name="close",
description="Closes link used to communicate with the counter.")
public void close()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException - for all errors.@Command(name="stopRecording",
description="Stops the counter so that it no longer updates its internal data set.")
public void stopRecording()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException - for all errors.@Command(name="startRecording",
description="Starts the counter, appending all future records to its internal data set.")
public void startRecording()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="clearRecords",
description="Clears all readings from the counter\'s internal data set.")
public void clearRecords()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="getRecords",
description="Prints in ASCII, earliest first, the counter\'s buffered data records.")
public void getRecords(@Argument(description="The maximum number of records to get (0 = no limit).",defaultValue="0")
int nlimit,
@Argument(description="The number of records to skip at the start. -n means all but the last n.",defaultValue="0")
int nskip,
@Argument(description="The name of the file in which to write (System.out if omitted).",defaultValue="")
String filename)
throws org.lsst.ccs.drivers.commons.DriverException
begin record
start yyyy-mm-ddThh24:mm:ssZ
duration xxxxx seconds
location B84_123
status laser! sampler!
channel 10.0 counter 12230 particles
channel 2.5 counter 14 particles
channel temp temperature 39.1 Celsius
channel hum relhumidity 1.0 percent
end record
nlimit - The maximum number of records to get (0 = no limit).nskip - The number of records to skip at the beginning.
-n means all but the last n.filename - Where to print (System.out if empty).org.lsst.ccs.drivers.commons.DriverException - for all checked exceptions.@Command(description="Prints, latest first, data records more recent than a given date and time.")
public void getRecentRecords(@Argument(name="after",description="The records written will all be newer than this.")
String instantString,
@Argument(description="The name of the file (System.out if omitted).",defaultValue="")
String filename)
throws org.lsst.ccs.drivers.commons.DriverException
after - All the records printed will be newer than this. Format yyyy-mm-ddThh:mm:ssZ.filename - Where to print (System.out if empty).org.lsst.ccs.drivers.commons.DriverException - for I/O errors.IllegalArgumentException - if the first argument is rejected by Instant.parse().@Command(description="Set the device clock from the computer\'s.")
public void setClock()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException - if I/O error or the device clock can't be set to within 30 seconds
of the computer's clock.@Command(description="Displays the device clock value.")
public java.time.Instant getClock()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException - for I/O errors.@Command(description="Returns the setting of the alarm enable for a particle channel.")
public boolean alarmIsEnabled(@Argument(description="The name of the channel.")
String chanName)
throws org.lsst.ccs.drivers.commons.DriverException
chanName - The name of the channel.org.lsst.ccs.drivers.commons.DriverException - for I/O errors.IllegalArgumentException - if chanName is for an analog channel
or is invalid.@Command(description="Sets the alarm enable state for a particle channel.")
public void setAlarmEnable(@Argument(description="The name of the channel.")
String chanName,
@Argument(description="true for on, false for off.")
boolean on)
throws org.lsst.ccs.drivers.commons.DriverException
chanName - The name of the channel.on - true for on, false for off.org.lsst.ccs.drivers.commons.DriverException - for I/O errors.IllegalArgumentException - if chanName is for an analog channel
or is invalid.@Command(description="Sets the alarm threshold for a particle channel.")
public void setAlarmThreshold(@Argument(description="The name of the channel.")
String chanName,
@Argument(description="The threshold value in raw counts per sample.")
long threshold)
throws org.lsst.ccs.drivers.commons.DriverException
chanName - The name of the channel.threshold - The threshold value in raw counts per sample.org.lsst.ccs.drivers.commons.DriverException - for I/O errors.IllegalArgumentException - if chanName is for an analog channel
or is invalid.@Command(description="Sets the alarm threshold for a particle channel.")
public long getAlarmThreshold(@Argument(description="The name of the channel.")
String chanName)
throws org.lsst.ccs.drivers.commons.DriverException
chanName - The name of the channel.org.lsst.ccs.drivers.commons.DriverException - for I/O errors.IllegalArgumentException - if chanName is for an analog channel
or is invalid.Copyright © 2016 LSST. All rights reserved.