Class Gdhist

All Implemented Interfaces:
Device, Memory, Configurable, Findable, gda.observable.IObservable
Direct Known Subclasses:
EncoderCounter, Gdscaler, Scaler, Vvhist

public class Gdhist extends DeviceBase implements Memory
A memory class for the VME Generic data acquisition histogramming memory card implemented using DA.Server
  • Field Details

    • localEndian

      protected static final String localEndian
      See Also:
    • daServer

      protected DAServer daServer
    • startupScript

      protected String startupScript
    • openCommand

      protected String openCommand
    • width

      protected int width
    • height

      protected int height
    • totalFrames

      protected int totalFrames
    • handle

      protected int handle
    • user

      protected String user
    • password

      protected String password
    • host

      protected String host
    • remoteEndian

      protected String remoteEndian
  • Constructor Details

    • Gdhist

      public Gdhist()
  • Method Details

    • configure

      public void configure() throws FactoryException
      Description copied from class: ConfigurableBase
      Default implementation for classes that do not have to do any specific configuration.
      Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.
      Specified by:
      configure in interface Configurable
      Overrides:
      configure in class ConfigurableBase
      Throws:
      FactoryException - if there is an error in configuration e.g. required variable not set or cannot connect to device
    • reconfigure

      public void reconfigure() throws FactoryException
      Description copied from interface: Configurable
      Re-initialisation of values and states.

      Moved from Reconfigurable which has been deleted

      Specified by:
      reconfigure in interface Configurable
      Overrides:
      reconfigure in class ConfigurableBase
      Throws:
      FactoryException
    • ensureOpen

      protected void ensureOpen() throws DeviceException
      Throws:
      DeviceException
    • sendAndParse

      protected Object sendAndParse(String operation, String command) throws DeviceException
      send a command and report error/throw exception when operation fails, i.e. daserver replies -1
      Parameters:
      operation - descriptive name of the operation attempted for logging
      command - command to send to daserver
      Returns:
      Object
      Throws:
      DeviceException
    • open

      protected void open() throws DeviceException
      Throws:
      DeviceException
    • close

      public void close() throws DeviceException
      Description copied from interface: Device
      Close and unconfigure the device.
      Specified by:
      close in interface Device
      Overrides:
      close in class DeviceBase
      Throws:
      DeviceException
    • clear

      public void clear() throws DeviceException
      Description copied from interface: Memory
      Clear the complete memory system.
      Specified by:
      clear in interface Memory
      Throws:
      DeviceException
    • clear

      public void clear(int start, int count) throws DeviceException
      Description copied from interface: Memory
      Clear the specified number of frames/images/spectra starting with specified frame/image/spectrum number.
      Specified by:
      clear in interface Memory
      Parameters:
      start - is the starting frame/image/spectrum number (1st = 0)
      count - is the number of frames/images/spectra to clear
      Throws:
      DeviceException
    • clear

      public void clear(int x, int y, int t, int dx, int dy, int dt) throws DeviceException
      Description copied from interface: Memory
      Clear the specified block of memory. The parameters give the ability to clear a 3D block of memory.
      Specified by:
      clear in interface Memory
      Parameters:
      x - is the start address for the offset in the x dimension
      y - is the start address for the offset in the y dimension
      t - is the start address for the offset in the z or t dimension
      dx - is the address count in the x dimension
      dy - is the address count in the y dimension
      dt - is the address count in the z or t dimension
      Throws:
      DeviceException
    • start

      public void start() throws DeviceException
      Description copied from interface: Memory
      Starts/enables the memory system.
      Specified by:
      start in interface Memory
      Throws:
      DeviceException
    • stop

      public void stop() throws DeviceException
      Description copied from interface: Memory
      Stops/disables the memory system.
      Specified by:
      stop in interface Memory
      Throws:
      DeviceException
    • readFloat

      public float[] readFloat(int x, int y, int t, int dx, int dy, int dt) throws DeviceException
      Throws:
      DeviceException
    • readFloat

      public float[] readFloat(int frame) throws DeviceException
      Throws:
      DeviceException
    • read

      public double[] read(int x, int y, int t, int dx, int dy, int dt) throws DeviceException
      Description copied from interface: Memory
      Read the specified block of memory. The parameters give the ability to read a 3D block of memory.
      Specified by:
      read in interface Memory
      Parameters:
      x - is the start address for the offset in the x dimension
      y - is the start address for the offset in the y dimension
      t - is the start address for the offset in the z or t dimension
      dx - is the address count in the x dimension
      dy - is the address count in the y dimension
      dt - is the address count in the z or t dimension
      Returns:
      the data
      Throws:
      DeviceException
    • read

      public double[] read(int frame) throws DeviceException
      Description copied from interface: Memory
      Read the specified frame/image/spectrum.
      Specified by:
      read in interface Memory
      Parameters:
      frame - is the frame/image/spectrum number (1st = 0)
      Returns:
      the data
      Throws:
      DeviceException
    • getDaServer

      public DAServer getDaServer()
      Returns:
      Returns the daServer.
    • setDaServer

      public void setDaServer(DAServer daServer)
      Parameters:
      daServer - The daServer to set.
    • setDimension

      public void setDimension(int[] d) throws DeviceException
      Description copied from interface: Memory
      Set the size of the memory system.
      Specified by:
      setDimension in interface Memory
      Parameters:
      d - is the
      Throws:
      DeviceException
    • output

      public void output(String file) throws DeviceException
      Description copied from interface: Memory
      Output data from memory directly to file
      Specified by:
      output in interface Memory
      Parameters:
      file - is the fully qualified file name
      Throws:
      DeviceException
    • getMemorySize

      public int getMemorySize() throws DeviceException
      Description copied from interface: Memory
      Get the physical memory size
      Specified by:
      getMemorySize in interface Memory
      Returns:
      the physical memory size expressed in words.
      Throws:
      DeviceException
    • setAttribute

      public void setAttribute(String attributeName, Object value)
      Set attribute values for "User", "Password", "Host", "TotalFrames", "Endian".
      Specified by:
      setAttribute in interface Device
      Overrides:
      setAttribute in class DeviceBase
      Parameters:
      attributeName - is the name of the attribute
      value - is the value of the attribute
      See Also:
    • getAttribute

      public Object getAttribute(String attributeName)
      Description copied from interface: Device
      Get the value of the specified attribute
      Specified by:
      getAttribute in interface Device
      Overrides:
      getAttribute in class DeviceBase
      Parameters:
      attributeName - is the name of the attribute
      Returns:
      the value of the attribute as an Object type
    • getDimension

      public int[] getDimension()
      Description copied from interface: Memory
      Get the size of the memory system.
      Specified by:
      getDimension in interface Memory
      Returns:
      the memory dimension in x and y
    • setSupportedDimensions

      public void setSupportedDimensions(int[] d)
      set the number of pixel settings the detector can work at. assumes a 2d detector with identical axis.
      Parameters:
      d -
    • getSupportedDimensions

      public int[] getSupportedDimensions()
      Description copied from interface: Memory
      If the detector supports multiple pixel settings, this will return an array of possible values. Null otherwise. Assumes the detector is 2D with identical axes.
      Specified by:
      getSupportedDimensions in interface Memory
      Returns:
      a collection of supported Dimensions
    • write

      public void write(double[] data, int x, int y, int t, int dx, int dy, int dt)
      Description copied from interface: Memory
      Write to the specified block of memory. The parameters give the ability to write a 3D block of memory.
      Specified by:
      write in interface Memory
      Parameters:
      data - is the data to write to the memory
      x - is the start address for the offset in the x dimension
      y - is the start address for the offset in the y dimension
      t - is the start address for the offset in the z or t dimension
      dx - is the address count in the x dimension
      dy - is the address count in the y dimension
      dt - is the address count in the z or t dimension
    • write

      public void write(double[] data, int frame)
      Description copied from interface: Memory
      Write to the specified frame of memory.
      Specified by:
      write in interface Memory
      Parameters:
      data - is the data to write to the memory
      frame - the area in memory corresponding to the specified frame.
    • getWidth

      public int getWidth()
      Returns:
      width
    • setWidth

      public void setWidth(int width) throws DeviceException
      Parameters:
      width -
      Throws:
      DeviceException
    • getHeight

      public int getHeight()
      Returns:
      height
    • setHeight

      public void setHeight(int height) throws DeviceException
      Parameters:
      height -
      Throws:
      DeviceException
    • setDaServerName

      public void setDaServerName(String daServerName)
      Set the name of the daServer instance
      Parameters:
      daServerName - the server name
    • getDaServerName

      public String getDaServerName()
      Get the name of the daServer instance.
      Returns:
      the server name
    • setStartupScript

      public void setStartupScript(String startupScript)
      Set the startup script command
      Parameters:
      startupScript - the startup script command
    • getStartupScript

      public String getStartupScript()
      Get the startup script command
      Returns:
      the startup script command
    • setSizeCommand

      public void setSizeCommand(String sizeCommand)
      Set the command to obtain the size of memory
      Parameters:
      sizeCommand - the command to obtain the size of memory
    • getSizeCommand

      public String getSizeCommand()
      Get the command which obtains the size of memory
      Returns:
      the command
    • setOpenCommand

      public void setOpenCommand(String openCommand)
      Set the command (if necessary) for opening the memory
      Parameters:
      openCommand - the open command
    • getOpenCommand

      public String getOpenCommand()
      Get the open command
      Returns:
      the command
    • setFail

      protected void setFail() throws DeviceException
      for use by junit tests
      Throws:
      DeviceException