Class ProfileDevice

java.lang.Object
xal.smf.AcceleratorNode
xal.smf.impl.profile.ProfileDevice
All Implemented Interfaces:
Comparable, ElementType, DataListener
Direct Known Subclasses:
WireHarp, WireScanner

public abstract class ProfileDevice extends AcceleratorNode

This class presents the common behavior of profile data acquisition devices. It also provides some tools for managing the device and its connections. For example, testing batch acquisition of data and configuration channels, along with some common enumerations.

Child classes can define their own specific behavior using the component-based classes ParameterSet and SignalSet. They allow the profile device to define configuration parameters and measurement data acquisition channels.

Derived classes must define the AcceleratorNodeAcceleratorNode.getType() method, since this class has no device type of its own. It simply represents the common behavior of profile data acquisition devices.

Ported from XAL on Jul 15, 2014.
· Jonathan M. Freed

Since:
Mar 21, 2014
Author:
Christopher K. Allen
  • Constructor Details

    • ProfileDevice

      protected ProfileDevice(String strId, ChannelFactory channelFactory)
      Primary Constructor for ProfileDevice.
      Parameters:
      strId -
      channelFactory - factory for generating channels
      Since:
      Mar 21, 2014
    • ProfileDevice

      protected ProfileDevice(String strId)
      Constructor for ProfileDevice.
      Parameters:
      strId -
      Since:
      Mar 21, 2014
  • Method Details

    • acquireConfig

      public <T extends ParameterSet> T acquireConfig(Class<T> clsType) throws ConnectionException, GetException, BadStructException
      Retrieves a given set of configuration parameter values. The values are returned in a new instance of the data structure type provided in the argument. (Note that all configuration parameters are contained in data structures derived from the base class ParameterSet.)
      Type Parameters:
      T - type parameter of the parameter set requested
      Parameters:
      clsType - class type of the parameter set requested
      Returns:
      set of configuration parameters for this device
      Throws:
      BadStructException - the DAQ data structure and DAQ channels are incompatible or could not be constructed
      ConnectionException - unable to connect to a parameter readback channel
      GetException - general CA GET exception while reading a parameter value
      Since:
      Nov 15, 2011
      See Also:
    • acquireData

      public <T extends SignalSet> T acquireData(Class<T> clsType) throws ConnectionException, GetException, BadStructException
      Acquires the current measurement data from the wire scanner data buffers. The type of data set is determined by the class type parameter T given to this method. (Note that all data sets are data structured derived from the base class Data.)
      Type Parameters:
      T - specific type of data set being requested
      Parameters:
      clsType - class type of data being requested
      Returns:
      measurement data set currently available on this wire scanner data buffers
      Throws:
      BadStructException - the DAQ data structure and DAQ channels are incompatible or could not be constructed
      ConnectionException - unable to connect to a data buffer channel
      GetException - general CA GET exception while reading data buffers
      Since:
      Nov 15, 2011
      See Also:
      • Data
    • createMonitor

      public Monitor createMonitor(XalPvDescriptor.IPvDescriptor pvdFld, IEventSinkValue snkEvents, int... mskEvtType) throws ConnectionException, MonitorException, NoSuchChannelException

      Setup a value monitor on the given process variable (i.e., using its handle). The monitor events are sent to the IEventSink object provided.

      One can specify the event type which fires the monitor using the argument intEvtType. Any combination of the following event types can be specified with a logical OR operation:

        Monitor.VALUE - fire upon PV value change
        Monitor.LOG -
        Monitor.ALARM - fire upon PV alarm value
      The default value (i.e., no argument) is Monitor.VALUE.

      Parameters:
      pvdFld - handle enumeration for process variable
      snkEvents - interface to data sink
      mskEvtType - code specifying when the monitor is fired (or'ed combination of {Monitor.VALUE, Monitor.LOG, Monitor.ALARM})
      Returns:
      A new monitor on the given process variable
      Throws:
      NoSuchChannelException - if the handle does not identify any process variable of this accelerator node
      ConnectionException - channel is not connected
      MonitorException - general monitor failure
    • configureHardware

      public void configureHardware(ParameterSet datPvFlds) throws PutException, ConnectionException
      Set all the hardware parameter values associated with the given data set.
      Parameters:
      datPvFlds - set of new hardware values
      Throws:
      ConnectionException - unable to connect PV channel
      PutException - general exception setting values
      Since:
      Dec 17, 2009
    • testConnection

      public boolean testConnection(Class<?> clsScada, double dblTmOut) throws BadStructException, BadChannelException
      Test the connections in all the channels of the given parameter set for this accelerator device. The test will wait up to the given length of time before declaring failure.
      Parameters:
      clsScada - type of a SCADA data structure
      dblTmOut - time out before test fails (in seconds)
      Returns:
      true if all connections were successful, false if not all connection were made within given time
      Throws:
      BadStructException - the given class is not a SCADA data structure
      BadChannelException - An unbound channel handle within a field descriptor
      Since:
      Feb 4, 2011
    • testConnection

      public boolean testConnection(Collection<ScadaFieldDescriptor> setFds, double dblTmOut) throws BadChannelException
      Test the connections in all the channels of the given parameter set for this accelerator device. The test will wait up to the given length of time before declaring failure.
      Parameters:
      setFds - set of field descriptors containing channel handles
      dblTmOut - time out before test fails (in seconds)
      Returns:
      true if all connections were successful, false if not all connection were made within given time
      Throws:
      BadChannelException - An unbound channel handle within a field descriptor
      Since:
      Feb 4, 2011