
public class LighthouseOPC extends Object implements Instrument
Each instrument is a cluster of several sensors: two particle counters (for different-sized particles), an ambient relative humidity sensor and an ambient temperature sensor. Each sensor is represented in the instrument by its own "channel". The PC periodically directs each instrument to take sensor readings. Each channel produces several values which are then published by the PC using the OPC DA protocol. Due to the way the protocol works each value is published with its own timestamp even though all the values for a given channel are produced at the same time.
Each counter channel produces an absolute particle count for the air sample, a particle density, a flag indicating a limit violation (out of bounds value) and a sensor malfunction flag. Each analog channel produces a single value together with limit violation and malfunction flags.
Reading the latest OPC DA values using this class produces series of "trendable records".
One trendable record is produced per channel. Each has a master key which is the short name for
the instrument's location and a master timestamp which is the OPC DA timestamp of one of the
channel's values. The trendable record carries the sensor values as a single "item" with
a key which is the channel name and a serializable object which is an instance of either AnalogPoint
or CounterPoint depending on the type of channel. For counter channels the name
is the particle size in microns, e.g., "3.0", "0.3". Temperature channels are named "temp"
and humidity channels "humid".
A trendable record record is published on the CCS data bus as a KeyValueDataList (KVD list) whose
master timestamp and key are those of the record. Each KVD list has a single member derived from
the key and value of the single item in each trendable record. Therefore the trending path
to each value is composed of the agent name, the short sensor name, the channel name and
the name of the field from the AnalogPoint or CounterPoint object. For example
ir2-airwatch/MAIN_NW/3.0/density. Each published KVDL list looks like this:
AnalogPoint,
CounterPoint,
TrendableOPCRecord| Constructor and Description |
|---|
LighthouseOPC(InstrumentConfig iconf)
Constructs a new instance from configuration data.
|
| Modifier and Type | Method and Description |
|---|---|
Instrument |
disable()
Produces a new instance that has readout disabled.
|
Instrument |
enable()
Produces a new instance that has been enabled for readout and is serving
a new location.
|
int |
getIndex()
Gets the position of this instrument in the list of instruments.
|
Optional<org.lsst.ccs.HardwareException> |
getLastException()
Gets the exception thrown (if any) the last time we tried to operate on this instrument.
|
InstrumentStatus |
getStatus()
Gets the current status of the instrument.
|
Stream<TrendableRecord> |
getTrendables()
Gets all the trendable data resulting from the last reading of the instrument.
|
Instrument |
read()
Produces a new instance that contains a fresh set of data read from
the instrument.
|
public LighthouseOPC(InstrumentConfig iconf)
iconf - The subsystem's configuration information for the instrument.public Optional<org.lsst.ccs.HardwareException> getLastException()
getLastException in interface InstrumentOptional if there have been no operations or if the last operation
was successful. Otherwise an Optional containing the exception that terminated
the operation. Getters are not considered operations.public int getIndex()
getIndex in interface InstrumentLocalConfigService.getInstrumentConfigs()public InstrumentStatus getStatus()
getStatus in interface Instrumentpublic Stream<TrendableRecord> getTrendables()
getTrendables in interface InstrumentTrendableRecord instances, empty if no data
is available, for example if the instrument has never been read or if the last read
found no new data or failed. The master key of each record is the location for
which the data were taken. The master timestamp is the time at which the record was
made. Each key/value pair consists of a channel name and value.Instrument.read()public Instrument disable()
disable in interface Instrumentpublic Instrument enable()
enable in interface Instrumentpublic Instrument read()
Instrument.getTrendables() method relies on this
data to produce its result.read in interface InstrumentCopyright © 2021 LSST. All rights reserved.