Package gda.device.timer
Class Tfg
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.timer.Tfg
- All Implemented Interfaces:
Device,Timer,Configurable,Findable,gda.observable.IObservable
- Direct Known Subclasses:
Etfg
A timer class for the VME time frame generator card implemented using DA.Server
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected booleanprotected intstatic final Stringprotected DAServerprotected longstatic final Stringstatic final Stringstatic final Stringprotected booleanprotected booleanstatic final Stringstatic final Stringprotected booleanstatic final Stringstatic final Stringprotected Threadstatic final Stringprotected booleanprotected booleanprotected longstatic final Stringstatic final Stringprotected longprotected intstatic final Stringstatic final Stringstatic final Stringprotected booleanprotected booleanFields inherited from class gda.device.DeviceBase
DEFAULT_PROTECTION_LEVEL_PROPERTY -
Constructor Summary
Constructors -
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.protected voidvoidClear all current frameSetsvoidclose()Close and unconfigure the device.voidDefault 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.voidcont()voidcountAsync(double time) Count the specified time (in ms)protected StringgetAttribute(String attributeName) Get attribute values for "Ext-Start", "Ext-Inhibit".intReturns the current cycle number.doublegetCurrentDeadTime(int currentFrame) intReturns the current frame number.intgetCurrentFrames(int currentFrame) doublegetCurrentLiveTime(int currentFrame) intReturns the total number of frame pairs supported (each specifying a live and a dead period)get the tfg progress messageintReturns the current state of the timer All timers must fully implement this.intlongintintbooleanbooleanvoidLoad an array of frameSets obtained from calls to makeFrameSet() are loaded into the timer.voidOutput data from timer directly to filevoidRe-initialisation of values and states.voidrestart()Restarts framing from the paused statevoidsetAttribute(String attributeName, Object value) Set attribute values for "Ext-Start", "Ext-Inhibit", "VME-Start" and "Auto-Continue"voidsetCycles(int cycles) sets the number of times the timer cycles through the framesets.voidsetDaServer(DAServer daServer) voidsetDaServerName(String daServerName) protected voidsetFail()voidsetMonitorInBackground(boolean monitorInBackground) voidsetShowArmed(boolean showArmed) voidsetUpdateInterval(int updateInterval) voidshutdown()Stop the runner threadvoidstart()Starts or arms (or both) a predefine framesetvoidstop()Aborts any current timing and returns it to an idle state.Methods inherited from class gda.device.DeviceBase
addIObserver, deleteIObserver, deleteIObservers, getName, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, setConfigureAtStartup, setName, setProtectionLevelMethods inherited from class gda.factory.ConfigurableBase
isConfigured, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface gda.factory.Configurable
isConfigureAtStartup, isConfiguredMethods inherited from interface gda.device.Device
getProtectionLevel, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObservers
-
Field Details
-
CYCLES
- See Also:
-
FRAME_SETS
- See Also:
-
FRAMES_LOADED
- See Also:
-
VERSION
- See Also:
-
TOTAL_EXP_TIME
- See Also:
-
TOTAL_FRAMES
- See Also:
-
ENDIAN
- See Also:
-
HOST
- See Also:
-
PASSWORD
- See Also:
-
USER
- See Also:
-
AUTO_CONTINUE_ATTR_NAME
- See Also:
-
EXT_START_ATTR_NAME
- See Also:
-
AUTO_REARM_ATTR_NAME
- See Also:
-
EXT_INHIBIT_ATTR_NAME
- See Also:
-
VME_START_ATTR_NAME
- See Also:
-
SOFTWARE_START_AND_TRIG_ATTR_NAME
- See Also:
-
daServer
-
extStart
protected boolean extStart -
vmeStart
protected boolean vmeStart -
autoReArm
protected boolean autoReArm -
softwareTriggering
protected boolean softwareTriggering -
extInh
protected boolean extInh -
cycles
protected int cycles -
totalFrames
protected int totalFrames -
timeFrameProfile
-
runner
-
started
protected boolean started -
startTime
protected long startTime -
totalExptTime
protected long totalExptTime -
elapsedTime
protected long elapsedTime -
framesLoaded
protected boolean framesLoaded -
waitingForExtStart
protected boolean waitingForExtStart
-
-
Constructor Details
-
Tfg
public Tfg()
-
-
Method Details
-
configure
public void configure()Description copied from class:ConfigurableBaseDefault 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:
configurein interfaceConfigurable- Overrides:
configurein classConfigurableBase
-
reconfigure
public void reconfigure()Description copied from interface:ConfigurableRe-initialisation of values and states.Moved from Reconfigurable which has been deleted
- Specified by:
reconfigurein interfaceConfigurable- Overrides:
reconfigurein classConfigurableBase
-
close
public void close()Description copied from interface:DeviceClose and unconfigure the device.- Specified by:
closein interfaceDevice- Overrides:
closein classDeviceBase
-
setDaServerName
- Parameters:
daServerName-
-
getDaServerName
- Returns:
- da.server name
-
getDaServer
- Returns:
- Returns the daServer.
-
setDaServer
- 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
- Throws:
DeviceException
-
getStatus
Description copied from interface:TimerReturns the current state of the timer All timers must fully implement this.- Specified by:
getStatusin interfaceTimer- 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
get the tfg progress message- Throws:
DeviceException
-
stop
Description copied from interface:TimerAborts any current timing and returns it to an idle state.- Specified by:
stopin interfaceTimer- Throws:
DeviceException
-
getMaximumFrames
public int getMaximumFrames()Description copied from interface:TimerReturns the total number of frame pairs supported (each specifying a live and a dead period)- Specified by:
getMaximumFramesin interfaceTimer- 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
Description copied from interface:TimerReturns the current frame number.- Specified by:
getCurrentFramein interfaceTimer- Returns:
- the current frame counter number (1st=0)
- Throws:
DeviceException
-
getCurrentCycle
Description copied from interface:TimerReturns the current cycle number. If not implemented this should return a default of 1.- Specified by:
getCurrentCyclein interfaceTimer- Returns:
- the current cycle number
- Throws:
DeviceException
-
setCycles
public void setCycles(int cycles) Description copied from interface:Timersets the number of times the timer cycles through the framesets. Default is 1 if h/w does not allow the implementation -
cont
- Throws:
DeviceException
-
start
Starts or arms (or both) a predefine frameset- Specified by:
startin interfaceTimer- Throws:
DeviceException
-
restart
Description copied from interface:TimerRestarts framing from the paused state- Specified by:
restartin interfaceTimer- Throws:
DeviceException
-
checkOKToSendCommand
- Throws:
DeviceException
-
addFrameSet
public void addFrameSet(int frameCount, double requestedDeadTime, double requestedLiveTime) Description copied from interface:TimerCreate a single frameSet object for a specified live and dead time. A count for identical frames is specified by the frameCount.- Specified by:
addFrameSetin interfaceTimer- 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
-
addFrameSet
public void addFrameSet(int frameCount, double requestedDeadTime, double requestedLiveTime, int deadPort, int livePort, int deadPause, int livePause) Description copied from interface:TimerCreate a single frameSet object for a specified live and dead time. A count for identical frames is specified by the frameCount.- Specified by:
addFrameSetin interfaceTimer- 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
-
clearFrameSets
public void clearFrameSets()Description copied from interface:TimerClear all current frameSets- Specified by:
clearFrameSetsin interfaceTimer
-
getFramesets
-
loadFrameSets
Description copied from interface:TimerLoad an array of frameSets obtained from calls to makeFrameSet() are loaded into the timer.- Specified by:
loadFrameSetsin interfaceTimer- Throws:
DeviceException
-
countAsync
Count the specified time (in ms)- Specified by:
countAsyncin interfaceTimer- Parameters:
time- the requested counting time in milliseconds- Throws:
DeviceException
-
output
Description copied from interface:TimerOutput data from timer directly to file- Specified by:
outputin interfaceTimer- Parameters:
file- is the fully qualified file name- Throws:
DeviceException
-
setAttribute
Set attribute values for "Ext-Start", "Ext-Inhibit", "VME-Start" and "Auto-Continue"- Specified by:
setAttributein interfaceDevice- Overrides:
setAttributein classDeviceBase- Parameters:
attributeName- the attribute namevalue- the attribute value- Throws:
DeviceException
-
getAttribute
Get attribute values for "Ext-Start", "Ext-Inhibit".- Specified by:
getAttributein interfaceDevice- Overrides:
getAttributein classDeviceBase- 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
- 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
-