Package gda.device
Interface Timer
- All Superinterfaces:
Configurable,Device,Findable,gda.observable.IObservable
- All Known Implementing Classes:
DummyTfg,Etfg,LoadFramesTimerHook,Tfg,TimerWrapper
Interface for objects which control Timers.
Timers can have collections of time intervals to operate in known as frame sets.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFrameSet(int frameCount, double requestedDeadTime, double requestedLiveTime) Create a single frameSet object for a specified live and dead time.voidaddFrameSet(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.voidClear all current frameSetsvoidcountAsync(double time) Initiates a single specified timing period and allows the timer to proceed asynchronously.intReturns the current cycle number.intReturns the current frame number.intReturns the total number of frame pairs supported (each specifying a live and a dead period)intReturns the current state of the timer All timers must fully implement this.voidLoad an array of frameSets obtained from calls to makeFrameSet() are loaded into the timer.voidOutput data from timer directly to filevoidrestart()Restarts framing from the paused statevoidsetCycles(int cycles) sets the number of times the timer cycles through the framesets.voidstart()For a time framing counter-timer, this initiates framing, starting from the current frame number (specified by setFrameNumber())voidstop()Aborts any current timing and returns it to an idle state.Methods inherited from interface gda.factory.Configurable
configure, isConfigureAtStartup, isConfigured, reconfigureMethods inherited from interface gda.device.Device
close, getAttribute, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObservers
-
Field Details
-
IDLE
static final int IDLETimer is idle- See Also:
-
ACTIVE
static final int ACTIVETimer is running- See Also:
-
PAUSED
static final int PAUSEDTimer is paused- See Also:
-
ARMED
static final int ARMEDTimer is paused- See Also:
-
-
Method Details
-
getStatus
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
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
Returns the current frame number.- Returns:
- the current frame counter number (1st=0)
- Throws:
DeviceException
-
getCurrentCycle
Returns the current cycle number. If not implemented this should return a default of 1.- Returns:
- the current cycle number
- Throws:
DeviceException
-
setCycles
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
For a time framing counter-timer, this initiates framing, starting from the current frame number (specified by setFrameNumber())- Throws:
DeviceException
-
stop
Aborts any current timing and returns it to an idle state.- Throws:
DeviceException
-
restart
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 typerequestedDeadTime- the requested frame dead time in millisecondsrequestedLiveTime- 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 typerequestedDeadTime- the requested frame dead time in millisecondsrequestedLiveTime- the requested frame live time in millisecondsdeadPort- the wait period output level 0 or 1livePort- the run period output level 0 or 1deadPause- the pause before wait period 0 or 1livePause- the pause before run period 0 or 1- Throws:
DeviceException
-
clearFrameSets
Clear all current frameSets- Throws:
DeviceException
-
loadFrameSets
Load an array of frameSets obtained from calls to makeFrameSet() are loaded into the timer.- Throws:
DeviceException
-
countAsync
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
Output data from timer directly to file- Parameters:
file- is the fully qualified file name- Throws:
DeviceException
-