Package gda.device

Interface Timer

All Superinterfaces:
Configurable, Device, Findable, gda.observable.IObservable
All Known Implementing Classes:
DummyTfg, Etfg, LoadFramesTimerHook, Tfg, TimerWrapper

public interface Timer extends Device
Interface for objects which control Timers.

Timers can have collections of time intervals to operate in known as frame sets.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Timer is running
    static final int
    Timer is paused
    static final int
    Timer is idle
    static final int
    Timer is paused
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addFrameSet(int frameCount, double requestedDeadTime, double requestedLiveTime)
    Create a single frameSet object for a specified live and dead time.
    void
    addFrameSet(int frameCount, double requestedDeadTime, double requestedLiveTime, int deadPort, int livePort, int deadPause, int livePause)
    Create a single frameSet object for a specified live and dead time.
    void
    Clear all current frameSets
    void
    countAsync(double time)
    Initiates a single specified timing period and allows the timer to proceed asynchronously.
    int
    Returns the current cycle number.
    int
    Returns the current frame number.
    int
    Returns the total number of frame pairs supported (each specifying a live and a dead period)
    int
    Returns the current state of the timer All timers must fully implement this.
    void
    Load an array of frameSets obtained from calls to makeFrameSet() are loaded into the timer.
    void
    output(String file)
    Output data from timer directly to file
    void
    Restarts framing from the paused state
    void
    setCycles(int cycles)
    sets the number of times the timer cycles through the framesets.
    void
    For a time framing counter-timer, this initiates framing, starting from the current frame number (specified by setFrameNumber())
    void
    Aborts any current timing and returns it to an idle state.

    Methods inherited from interface gda.factory.Configurable

    configure, isConfigureAtStartup, isConfigured, reconfigure

    Methods inherited from interface gda.device.Device

    close, getAttribute, getProtectionLevel, setAttribute, setProtectionLevel

    Methods inherited from interface gda.factory.Findable

    getName, setName

    Methods inherited from interface gda.observable.IObservable

    addIObserver, deleteIObserver, deleteIObservers
  • Field Details

  • Method Details

    • getStatus

      int getStatus() throws DeviceException
      Returns the current state of the timer All timers must fully implement this.
      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
    • getMaximumFrames

      int getMaximumFrames() throws DeviceException
      Returns the total number of frame pairs supported (each specifying a live and a dead period)
      Returns:
      maximum number of time frames available
      Throws:
      DeviceException
    • getCurrentFrame

      int getCurrentFrame() throws DeviceException
      Returns the current frame number.
      Returns:
      the current frame counter number (1st=0)
      Throws:
      DeviceException
    • getCurrentCycle

      int getCurrentCycle() throws DeviceException
      Returns the current cycle number. If not implemented this should return a default of 1.
      Returns:
      the current cycle number
      Throws:
      DeviceException
    • setCycles

      void setCycles(int cycles) throws DeviceException
      sets the number of times the timer cycles through the framesets. Default is 1 if h/w does not allow the implementation
      Parameters:
      cycles - sets the cycle count to the specified number
      Throws:
      DeviceException
    • start

      void start() throws DeviceException
      For a time framing counter-timer, this initiates framing, starting from the current frame number (specified by setFrameNumber())
      Throws:
      DeviceException
    • stop

      void stop() throws DeviceException
      Aborts any current timing and returns it to an idle state.
      Throws:
      DeviceException
    • restart

      void restart() throws DeviceException
      Restarts framing from the paused state
      Throws:
      DeviceException
    • addFrameSet

      void addFrameSet(int frameCount, double requestedDeadTime, double requestedLiveTime) throws DeviceException
      Create a single frameSet object for a specified live and dead time. A count for identical frames is specified by the frameCount.
      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
      Throws:
      DeviceException
    • addFrameSet

      void addFrameSet(int frameCount, double requestedDeadTime, double requestedLiveTime, int deadPort, int livePort, int deadPause, int livePause) throws DeviceException
      Create a single frameSet object for a specified live and dead time. A count for identical frames is specified by the frameCount.
      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
      Throws:
      DeviceException
    • clearFrameSets

      void clearFrameSets() throws DeviceException
      Clear all current frameSets
      Throws:
      DeviceException
    • loadFrameSets

      void loadFrameSets() throws DeviceException
      Load an array of frameSets obtained from calls to makeFrameSet() are loaded into the timer.
      Throws:
      DeviceException
    • countAsync

      void countAsync(double time) throws DeviceException
      Initiates a single specified timing period and allows the timer to proceed asynchronously. The end of period can be determined by calls to getStatus() returning IDLE.
      Parameters:
      time - the requested counting time in milliseconds
      Throws:
      DeviceException
    • output

      void output(String file) throws DeviceException
      Output data from timer directly to file
      Parameters:
      file - is the fully qualified file name
      Throws:
      DeviceException