Package xal.smf.impl

Class MagnetPowerSupply

java.lang.Object
xal.smf.impl.MagnetPowerSupply
All Implemented Interfaces:
DataListener
Direct Known Subclasses:
MagnetMainSupply, MagnetTrimSupply

public abstract class MagnetPowerSupply extends Object implements DataListener
PowerSupply is the abstract super class of all power supplies.
Author:
tap
  • Field Details

  • Constructor Details

    • MagnetPowerSupply

      protected MagnetPowerSupply(Accelerator anAccelerator)
      Creates a new instance of PowerSupply using the same channel factory as the provided accelerator
  • Method Details

    • setId

      public void setId(String id)
      Set supply ID.
      Parameters:
      id - The power supply ID
    • getId

      public String getId()
      Get the unique power supply ID
      Returns:
      The power supply ID
    • getAccelerator

      public Accelerator getAccelerator()
      Get the associated accelerator
      Returns:
      the accelerator
    • getType

      public abstract String getType()
      Get the power supply type
      Returns:
      The power supply type
    • dataLabel

      public String dataLabel()
      dataLabel() provides the name used to identify the class in an external data source.
      Specified by:
      dataLabel in interface DataListener
      Returns:
      a tag that identifies the receiver's type
    • update

      public void update(DataAdaptor adaptor)
      Instructs the receiver to update its data based on the given adaptor.
      Specified by:
      update in interface DataListener
      Parameters:
      adaptor - The adaptor from which to update the receiver's data
    • write

      public void write(DataAdaptor adaptor)
      Instructs the receiver to write its data to the adaptor for external storage.
      Specified by:
      write in interface DataListener
      Parameters:
      adaptor - The adaptor to which the receiver's data is written
    • getChannelSuite

      public ChannelSuite getChannelSuite()
      Get the channel suite.
      Returns:
      the channel suite.
    • findChannel

      public Channel findChannel(String handle)
      Find the channel for the specified handle.
      Parameters:
      handle - The handle for the channel to fetch
      Returns:
      the channel if found or null if not found
    • getChannel

      public Channel getChannel(String handle) throws NoSuchChannelException
      Get the channel for the specified handle.
      Parameters:
      handle - The handle for the channel to fetch
      Returns:
      the channel
      Throws:
      NoSuchChannelException
    • getAndConnectChannel

      public Channel getAndConnectChannel(String handle) throws NoSuchChannelException
      Get the channel corresponding to the specified handle and connect it.
      Parameters:
      handle - The handle for the channel to get.
      Returns:
      The channel associated with this node and the specified handle or null if there is no match.
      Throws:
      NoSuchChannelException - if no such channel as specified by the handle is associated with this node.
      ConnectionException - if the channel cannot be connected
    • getCycleState

      public int getCycleState() throws GetException
      Gets the cycle state of the magnet. The magnet may be in one of three states: cycle is invalid (field changed in reverse direction of initial setting), cycling in progress or cycle is valid
      Returns:
      One of CYCLE_INVALID, CYCLING or CYCLE_VALID
      Throws:
      GetException
    • getCurrent

      public double getCurrent() throws GetException
      Get the magnet power supply current
      Returns:
      the magnet power supply current in amperes
      Throws:
      ConnectionException - if the readback channel cannot be connected
      GetException - if the readback channel get action fails
    • setCurrent

      public void setCurrent(double current) throws PutException
      Set the magnet power supply current.
      Parameters:
      current - The current in amperes
      Throws:
      ConnectionException - if the put channel cannot be connected
      PutException - if the put channel set action fails
    • upperCurrentLimit

      public double upperCurrentLimit() throws GetException
      get the current lower settable limit (A)
      Throws:
      GetException
    • lowerCurrentLimit

      public double lowerCurrentLimit() throws GetException
      get the current lower settable limit (A)
      Throws:
      GetException
    • getNodes

      public Collection<AcceleratorNode> getNodes()
      Get the accelerator nodes which are tied to this supply.
      Returns:
      The collection of nodes that use this supply.
    • getNodes

      public <T extends AcceleratorNode> Collection<T> getNodes(Collection<T> trialNodes)
      Get the subset of nodes from trialNodes which are supplied by this power supply.
      Parameters:
      trialNodes - The collection of nodes from which to check for matches.
      Returns:
      The collection of nodes that use this supply.
    • getDefaultHandles

      public Collection<String> getDefaultHandles()
      Returns:
      a list with expected channel handles by default.
    • suppliesNode

      public abstract boolean suppliesNode(AcceleratorNode node)
      Check if the electromagnet is supplied by this power supply.
      Parameters:
      node - The electromagnet to check
      Returns:
      true if the node is supplied by this supply and false otherwise
    • getReadbackHandles

      public String[] getReadbackHandles(String setHandle)
      Get the readback handle corresponding to a set channel.
      Parameters:
      setHandle - The set handle.
      Returns:
      The corresponding readback handle.
    • getSetHandle

      public String getSetHandle(String readbackHandle)
      Get the set handle corresponding to a readback channel.
      Parameters:
      readbackHandle - The readback handle.
      Returns:
      The corresponding set handle.
    • getProperties

      public List<String> getProperties()
      Returns:
      properties that can be accessed via EPICS.
    • getAccessibleProperties

      public List<AccessibleProperty> getAccessibleProperties()
      Returns:
      properties that can be accessed via EPICS.
    • getAccessibleProperties

      protected List<AccessibleProperty> getAccessibleProperties(List<AccessibleProperty> properties, Class<?> cls)