Class Tfg

All Implemented Interfaces:
Device, Timer, Configurable, Findable, gda.observable.IObservable
Direct Known Subclasses:
Etfg

@ServiceInterface(Timer.class) public class Tfg extends DeviceBase implements Timer
A timer class for the VME time frame generator card implemented using DA.Server
  • Field Details

  • Constructor Details

    • Tfg

      public Tfg()
  • Method Details

    • configure

      public void configure()
      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
    • reconfigure

      public void reconfigure()
      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
    • close

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

      public void setDaServerName(String daServerName)
      Parameters:
      daServerName -
    • getDaServerName

      public String getDaServerName()
      Returns:
      da.server name
    • getDaServer

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

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

      public int getUpdateInterval()
      Returns:
      the update interval in milliseconds
    • setUpdateInterval

      public void setUpdateInterval(int updateInterval)
      Parameters:
      updateInterval -
    • getAcqStatus

      protected String getAcqStatus() throws DeviceException
      Throws:
      DeviceException
    • getStatus

      public int getStatus() throws DeviceException
      Description copied from interface: Timer
      Returns the current state of the timer All timers must fully implement this.
      Specified by:
      getStatus in interface Timer
      Returns:
      ACTIVE if the timer has not finished the requested operation(s), IDLE if in an completely idle state and PAUSED if temporarily suspended.
      Throws:
      DeviceException
    • getProgress

      public String getProgress() throws DeviceException
      get the tfg progress message
      Throws:
      DeviceException
    • stop

      public void stop() throws DeviceException
      Description copied from interface: Timer
      Aborts any current timing and returns it to an idle state.
      Specified by:
      stop in interface Timer
      Throws:
      DeviceException
    • getMaximumFrames

      public int getMaximumFrames()
      Description copied from interface: Timer
      Returns the total number of frame pairs supported (each specifying a live and a dead period)
      Specified by:
      getMaximumFrames in interface Timer
      Returns:
      maximum number of time frames available
    • getTotalFrames

      public int getTotalFrames()
      Returns:
      the total number of frames
    • getTotalCycles

      public int getTotalCycles()
    • getTotalExptTime

      public long getTotalExptTime()
    • getCurrentFrame

      public int getCurrentFrame() throws DeviceException
      Description copied from interface: Timer
      Returns the current frame number.
      Specified by:
      getCurrentFrame in interface Timer
      Returns:
      the current frame counter number (1st=0)
      Throws:
      DeviceException
    • getCurrentCycle

      public int getCurrentCycle() throws DeviceException
      Description copied from interface: Timer
      Returns the current cycle number. If not implemented this should return a default of 1.
      Specified by:
      getCurrentCycle in interface Timer
      Returns:
      the current cycle number
      Throws:
      DeviceException
    • setCycles

      public void setCycles(int cycles)
      Description copied from interface: Timer
      sets the number of times the timer cycles through the framesets. Default is 1 if h/w does not allow the implementation
      Specified by:
      setCycles in interface Timer
      Parameters:
      cycles - sets the cycle count to the specified number
    • cont

      public void cont() throws DeviceException
      Throws:
      DeviceException
    • start

      public void start() throws DeviceException
      Starts or arms (or both) a predefine frameset
      Specified by:
      start in interface Timer
      Throws:
      DeviceException
    • restart

      public void restart() throws DeviceException
      Description copied from interface: Timer
      Restarts framing from the paused state
      Specified by:
      restart in interface Timer
      Throws:
      DeviceException
    • checkOKToSendCommand

      protected void checkOKToSendCommand() throws DeviceException
      Throws:
      DeviceException
    • addFrameSet

      public void addFrameSet(int frameCount, double requestedDeadTime, double requestedLiveTime)
      Description copied from interface: Timer
      Create a single frameSet object for a specified live and dead time. A count for identical frames is specified by the frameCount.
      Specified by:
      addFrameSet in interface Timer
      Parameters:
      frameCount - the requested number of frames required of this type
      requestedDeadTime - the requested frame dead time in milliseconds
      requestedLiveTime - the requested frame live time in milliseconds
    • addFrameSet

      public void addFrameSet(int frameCount, double requestedDeadTime, double requestedLiveTime, int deadPort, int livePort, int deadPause, int livePause)
      Description copied from interface: Timer
      Create a single frameSet object for a specified live and dead time. A count for identical frames is specified by the frameCount.
      Specified by:
      addFrameSet in interface Timer
      Parameters:
      frameCount - the requested number of frames required of this type
      requestedDeadTime - the requested frame dead time in milliseconds
      requestedLiveTime - the requested frame live time in milliseconds
      deadPort - the wait period output level 0 or 1
      livePort - the run period output level 0 or 1
      deadPause - the pause before wait period 0 or 1
      livePause - the pause before run period 0 or 1
    • clearFrameSets

      public void clearFrameSets()
      Description copied from interface: Timer
      Clear all current frameSets
      Specified by:
      clearFrameSets in interface Timer
    • getFramesets

      public List<FrameSet> getFramesets()
    • loadFrameSets

      public void loadFrameSets() throws DeviceException
      Description copied from interface: Timer
      Load an array of frameSets obtained from calls to makeFrameSet() are loaded into the timer.
      Specified by:
      loadFrameSets in interface Timer
      Throws:
      DeviceException
    • countAsync

      public void countAsync(double time) throws DeviceException
      Count the specified time (in ms)
      Specified by:
      countAsync in interface Timer
      Parameters:
      time - the requested counting time in milliseconds
      Throws:
      DeviceException
    • output

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

      public void setAttribute(String attributeName, Object value) throws DeviceException
      Set attribute values for "Ext-Start", "Ext-Inhibit", "VME-Start" and "Auto-Continue"
      Specified by:
      setAttribute in interface Device
      Overrides:
      setAttribute in class DeviceBase
      Parameters:
      attributeName - the attribute name
      value - the attribute value
      Throws:
      DeviceException
    • getAttribute

      public Object getAttribute(String attributeName)
      Get attribute values for "Ext-Start", "Ext-Inhibit".
      Specified by:
      getAttribute in interface Device
      Overrides:
      getAttribute in class DeviceBase
      Parameters:
      attributeName - the attribute name
      Returns:
      the attribute value
    • getCurrentLiveTime

      public double getCurrentLiveTime(int currentFrame)
    • getCurrentDeadTime

      public double getCurrentDeadTime(int currentFrame)
    • getCurrentFrames

      public int getCurrentFrames(int currentFrame)
    • setFail

      protected void setFail() throws DeviceException
      Throws:
      DeviceException
    • isShowArmed

      public boolean isShowArmed()
    • setShowArmed

      public void setShowArmed(boolean showArmed)
    • isMonitorInBackground

      public boolean isMonitorInBackground()
    • setMonitorInBackground

      public void setMonitorInBackground(boolean monitorInBackground)
      Parameters:
      monitorInBackground - if true (default) the tfg state is monitored regularly and observers are notified of changes.
    • shutdown

      public void shutdown()
      Stop the runner thread