Class ChannelSnapshot

java.lang.Object
xal.service.pvlogger.ChannelSnapshot

public class ChannelSnapshot extends Object
ChannelSnapshot is a representation of the data associated with a channel at some point in time.
Author:
tap
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final String
    raw process variable
    protected final int
    severity code
    protected final int
    status code
    protected final Timestamp
    time stamp reported for the channel monitor event
    protected final double[]
    value array
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChannelSnapshot(String pv, double[] value, int status, int severity, Timestamp timestamp)
    Primary constructor of a snapshot.
    Constructor of a snapshot from a channel record.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the PV
    double
    get the scalar value which corresponds to the first element of the value array if it exists or NaN otherwise
    int
    Get the severity of the PV at the time of the snapshot.
    int
    Get the status of the PV at the time of the snapshot.
    Get the timestamp of the PV's data identifying the time the data was acquired.
    double[]
    Get the value of the PV's data at the time of the snapshot
    int
    Get the number of elements in the value array
    Override toString() to describe the snapshot in a meaningful way.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • pv

      protected final String pv
      raw process variable
    • timestamp

      protected final Timestamp timestamp
      time stamp reported for the channel monitor event
    • value

      protected final double[] value
      value array
    • status

      protected final int status
      status code
    • severity

      protected final int severity
      severity code
  • Constructor Details

    • ChannelSnapshot

      public ChannelSnapshot(String pv, double[] value, int status, int severity, Timestamp timestamp)
      Primary constructor of a snapshot.
      Parameters:
      pv - The PV identifying the channel.
      value - The value of the channel's data at the time of the snapshot.
      status - The status of the channel at the time of the snapshot.
      severity - The severity of the channel at the time of the snapshot.
      timestamp - The timestamp of the snapshot identifying when the data was acquired.
    • ChannelSnapshot

      public ChannelSnapshot(String pv, ChannelTimeRecord channelRecord)
      Constructor of a snapshot from a channel record.
      Parameters:
      pv - The PV identifying the channel.
      channelRecord - The record holding the channel data, state and timestamp
  • Method Details

    • getPV

      public String getPV()
      Get the PV
      Returns:
      the PV
    • getValue

      public double[] getValue()
      Get the value of the PV's data at the time of the snapshot
      Returns:
      the value of the PV's data
    • getScalarValue

      public double getScalarValue()
      get the scalar value which corresponds to the first element of the value array if it exists or NaN otherwise
    • getValueCount

      public int getValueCount()
      Get the number of elements in the value array
    • getStatus

      public int getStatus()
      Get the status of the PV at the time of the snapshot.
      Returns:
      the status of the PV
    • getSeverity

      public int getSeverity()
      Get the severity of the PV at the time of the snapshot.
      Returns:
      the severity of the PV
    • getTimestamp

      public Timestamp getTimestamp()
      Get the timestamp of the PV's data identifying the time the data was acquired.
      Returns:
      the timestamp of the PV's data
    • toString

      public String toString()
      Override toString() to describe the snapshot in a meaningful way.
      Overrides:
      toString in class Object
      Returns:
      a string describing the snapshot.