Class TfgScaler
- All Implemented Interfaces:
CounterTimer,Detector,Device,Scannable,Configurable,Findable,gda.observable.IObservable,Serializable
- Direct Known Subclasses:
TfgScalerWithDarkCurrent
- See Also:
-
Field Summary
FieldsFields inherited from class gda.device.detector.countertimer.TFGCounterTimer
isTFGv2Fields inherited from class gda.device.detector.countertimer.CounterTimerBase
slave, timerFields inherited from class gda.device.detector.DetectorBase
collectionTimeFields inherited from class gda.device.scannable.ScannableBase
__doc__, DEFAULT_INPUT_NAME, DEFAULT_OUTPUT_FORMAT, extraNames, inputNames, level, outputFormatFields inherited from class gda.device.DeviceBase
DEFAULT_PROTECTION_LEVEL_PROPERTYFields inherited from interface gda.device.Scannable
ATTR_NEXUS_CATEGORY, ATTR_NX_CLASS, DEFAULT_INPUT_NAME, VALUE_UNAVAILABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFrameSet(int frameCount, double requestedDeadTime, double requestedLiveTime) For a time framing counter-timer a single frameSet object is created for a specified live and dead time.voidaddFrameSet(int frameCount, double requestedDeadTime, double requestedLiveTime, int deadPort, int livePort, int deadPause, int livePause) For a time framing counter-timer a single frameSet object is created for a specified live and dead time.voidHook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred.voidCalled for every Scannable at the end of a group of nested scans (or a single scan if that is the case).voidCalled for every Scannable at the start of every scanvoidFor a time framing counter-timer all current frameSets are cleared.voidTells the detector to begin to collect a set of data, then returns immediately.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.voidcountAsync(double time) Initiates a single specified timing period and allows the counter-timer to proceed asynchronously.booleanReturns a value which indicates whether the detector creates its own files.getAttribute(String attributeName) Get the value of the specified attributeString[]Override ScannableBase to work within scansintintUsed by Castor for instantiation.intReturns the total number of available counter-timer readout channels that will be returned by calls to readChans() For a time-framing device it is the number of channels per frame.booleandouble[]readChannel(int startFrame, int frameCount, int channel) For a time framing counter-timer read out a specified channel, beginning from the specified start frame number using the requested frame count.double[]Obtain an array of available readout channels.double[]readFrame(int frame) For a time framing counter-timer, read out from channel 0 beginning from the specified start frame number using all the scaler dimensions.double[]readFrame(int startChannel, int channelCount, int frame) For a time framing counter-timer read out a specified frame, beginning from the specified start channel number using the requested channel count.double[]readout()Returns the latest data collected.double[]Returns the current data but does not increment the frame counter if frames are being used.double[][]readoutFrames(int startFrame, int finalFrame) voidsetAttribute(String attributeName, Object value) Set any attribute the implementing classes may providevoidsetFirstDataChannel(Integer firstDataChannel) voidsetMinimumReadoutDelay(int minimumReadoutDelay) voidsetNumChannelsToRead(int numChannelsToRead) voidvoidsetScalerName(String scalerName) Set the name of the scaler for the FindervoidsetTimeChannelRequired(boolean timeChannelRequired) voidstart()For a time framing counter-timer this initiates framing.voidstop()Stop the current move/operation.Methods inherited from class gda.device.detector.countertimer.TFGCounterTimer
isTFGv2, setTFGv2Methods inherited from class gda.device.detector.countertimer.CounterTimerBase
getCurrentCycle, getCurrentFrame, getMaximumFrames, getStatus, getTimer, getTimerName, isSlave, loadFrameSets, restart, setCycles, setSlave, setTimer, setTimerNameMethods inherited from class gda.device.detector.DetectorBase
asynchronousMoveTo, checkPositionValid, endCollection, getCollectionTime, getDataDimensions, getPosition, isBusy, prepareForCollection, setCollectionTime, toFormattedStringMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanLineEnd, atScanStart, externalToInternal, getExtraNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, moveTo, rawAsynchronousMoveTo, rawGetPosition, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, throwExceptionIfInvalidTarget, toString, validateScannable, valueUnavailableString, waitWhileBusy, waitWhileBusyMethods inherited from class gda.device.DeviceBase
addIObserver, close, deleteIObserver, deleteIObservers, getName, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, setConfigureAtStartup, setName, setProtectionLevelMethods inherited from class gda.factory.ConfigurableBase
isConfigured, reconfigure, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gda.factory.Configurable
isConfigureAtStartup, isConfigured, reconfigureMethods inherited from interface gda.device.Detector
endCollection, getCollectionTime, getDataDimensions, getFileStructure, prepareForCollection, setCollectionTime, waitWhileBusyMethods inherited from interface gda.device.Device
close, getProtectionLevel, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObserversMethods inherited from interface gda.device.Scannable
asynchronousMoveTo, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanLineEnd, atScanStart, checkPositionValid, getExtraNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, isBusy, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, toFormattedString
-
Field Details
-
scaler
-
timeChannelRequired
protected boolean timeChannelRequired -
numChannelsToRead
-
-
Constructor Details
-
TfgScaler
public TfgScaler()
-
-
Method Details
-
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 classCounterTimerBase- Throws:
FactoryException- if there is an error in configuration e.g. required variable not set or cannot connect to device
-
setScalerName
Set the name of the scaler for the Finder- Parameters:
scalerName-
-
getScalerName
Used by Castor for instantiation.- Returns:
- the scaler name
-
getScaler
-
setScaler
-
isTimeChannelRequired
public boolean isTimeChannelRequired() -
setTimeChannelRequired
public void setTimeChannelRequired(boolean timeChannelRequired) -
getTotalChans
Returns the total number of available counter-timer readout channels that will be returned by calls to readChans() For a time-framing device it is the number of channels per frame. All counter-timers must fully implement this.- Returns:
- total number of readout channels
- Throws:
DeviceException
-
countAsync
Initiates a single specified timing period and allows the counter-timer to proceed asynchronously. The end of period can be determined by calls to isCounting() returning false. All counter-timers must fully implement this.- Parameters:
time- the requested counting time in milliseconds- Throws:
DeviceException
-
start
Description copied from interface:CounterTimerFor a time framing counter-timer this initiates framing.- Specified by:
startin interfaceCounterTimer- Overrides:
startin classCounterTimerBase- Throws:
DeviceException
-
stop
Description copied from class:ScannableBaseStop the current move/operation. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
stopin interfaceScannable- Overrides:
stopin classCounterTimerBase- Throws:
DeviceException- See Also:
-
addFrameSet
public void addFrameSet(int frameCount, double requestedDeadTime, double requestedLiveTime) throws DeviceException Description copied from interface:CounterTimerFor a time framing counter-timer a single frameSet object is created for a specified live and dead time. A count for identical frames is specified by the frameCount.- Specified by:
addFrameSetin interfaceCounterTimer- Overrides:
addFrameSetin classCounterTimerBase- Parameters:
frameCount- number of frames required of this typerequestedDeadTime- frame live time in millisecondsrequestedLiveTime- frame dead time in milliseconds- Throws:
DeviceException
-
addFrameSet
public void addFrameSet(int frameCount, double requestedDeadTime, double requestedLiveTime, int deadPort, int livePort, int deadPause, int livePause) throws DeviceException Description copied from interface:CounterTimerFor a time framing counter-timer a single frameSet object is created for a specified live and dead time. A count for identical frames is specified by the frameCount.- Specified by:
addFrameSetin interfaceCounterTimer- Overrides:
addFrameSetin classCounterTimerBase- Parameters:
frameCount- requested number of frames required of this typerequestedDeadTime- requested frame live time in millisecondsrequestedLiveTime- requested frame dead time in millisecondsdeadPort- wait period output level 0 or 1livePort- run period output level 0 or 1deadPause- pause before wait period 0 or 1livePause- pause before run period 0 or 1- Throws:
DeviceException
-
clearFrameSets
Description copied from interface:CounterTimerFor a time framing counter-timer all current frameSets are cleared.- Specified by:
clearFrameSetsin interfaceCounterTimer- Overrides:
clearFrameSetsin classCounterTimerBase- Throws:
DeviceException
-
atScanLineStart
Description copied from class:ScannableBaseCalled for every Scannable at the start of every scan Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
atScanLineStartin interfaceScannable- Overrides:
atScanLineStartin classScannableBase- Throws:
DeviceException- See Also:
-
atCommandFailure
Description copied from class:ScannableBaseHook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred. However not called when the command is aborted using an InterruptionException. If a Scan is aborted then onlyScannable.stop()will be called by the Scan or pos command.Useful for telling Scannables which hold state during a scan for example, to reset themselves. Used for example by CoordinatedMotionScannables. This hook should be used not in the same way as the stop hook. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.
- Specified by:
atCommandFailurein interfaceScannable- Overrides:
atCommandFailurein classScannableBase- Throws:
DeviceException- See Also:
-
atScanEnd
Description copied from class:ScannableBaseCalled for every Scannable at the end of a group of nested scans (or a single scan if that is the case).Note that this is only called if the Scan finishes normally, or has been requested to finish early. This will not be called if the scan finishes due to an exception of any kind. See
Scannable.atCommandFailure()Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
atScanEndin interfaceScannable- Overrides:
atScanEndin classScannableBase- Throws:
DeviceException- See Also:
-
readChans
Obtain an array of available readout channels. This should be available at any time. If the hardware does not allow it during active counter-timing periods, it should return zero values. High level counter-timers may return values in user units. All counter-timers must fully implement this.- Returns:
- array of all channel readout values
- Throws:
DeviceException
-
readChannel
Description copied from interface:CounterTimerFor a time framing counter-timer read out a specified channel, beginning from the specified start frame number using the requested frame count.- Parameters:
startFrame- starting frame number (1st=0)frameCount- number of frames to read the counter data out fromchannel- read this channel- Returns:
- array of requested readout counter-timer data
- Throws:
DeviceException
-
readFrame
Description copied from interface:CounterTimerFor a time framing counter-timer read out a specified frame, beginning from the specified start channel number using the requested channel count.- Parameters:
startChannel- starting channel number (1st=0)channelCount- number of channels to read the counter data out fromframe- read this frame- Returns:
- array of requested readout counter-timer data
- Throws:
DeviceException
-
readFrame
For a time framing counter-timer, read out from channel 0 beginning from the specified start frame number using all the scaler dimensions.- Parameters:
frame- read this frame- Returns:
- array of requested readout counter-timer data
- Throws:
DeviceException
-
setAttribute
Description copied from interface:DeviceSet any attribute the implementing classes may provide- Specified by:
setAttributein interfaceDevice- Overrides:
setAttributein classDeviceBase- Parameters:
attributeName- is the name of the attributevalue- is the value of the attribute- Throws:
DeviceException- if an attribute cannot be set
-
getAttribute
Description copied from interface:DeviceGet the value of the specified attribute- Specified by:
getAttributein interfaceDevice- Overrides:
getAttributein classDeviceBase- Parameters:
attributeName- is the name of the attribute- Returns:
- the value of the attribute as an Object type
- Throws:
DeviceException- if an attribute cannot be retrieved
-
collectData
Description copied from interface:DetectorTells the detector to begin to collect a set of data, then returns immediately. Should cause the hardware to start collecting immediately: if there is any delay then detectors used in the same scan would collect over different times when beam conditions may differ.- Throws:
DeviceException
-
readout
Description copied from interface:DetectorReturns the latest data collected. The size of the Object returned must be consistent with the values returned by getDataDimensions and getExtraNames.If
LocalProperties.GDA_SCAN_CONCURRENTSCAN_READOUT_CONCURRENTLYis true then motors may be moved while the detector readouts. The value returned must not be effected by any concurrent motor or shutter movements. SeeDetector.waitWhileBusy()andConcurrentScan. Readout must block until the detector is ready to respond quickly toDetector.collectData()again.- Returns:
- the data collected
- Throws:
DeviceException- See Also:
-
readoutCurrentFrame
Returns the current data but does not increment the frame counter if frames are being used.- Returns:
- double[]
- Throws:
DeviceException
-
readoutFrames
- Throws:
DeviceException
-
createsOwnFiles
Description copied from interface:DetectorReturns a value which indicates whether the detector creates its own files. If it does (return true) the readout() method returns the name of the latest file created as a string. If it does not (return false) the readout() method will return the data directly.- Returns:
- true if readout() returns filenames
- Throws:
DeviceException
-
getDescription
- Specified by:
getDescriptionin interfaceDetector- Overrides:
getDescriptionin classDetectorBase- Returns:
- A description of the detector.
- Throws:
DeviceException
-
getDetectorID
- Specified by:
getDetectorIDin interfaceDetector- Overrides:
getDetectorIDin classDetectorBase- Returns:
- A identifier for this detector.
- Throws:
DeviceException
-
getDetectorType
- Specified by:
getDetectorTypein interfaceDetector- Overrides:
getDetectorTypein classDetectorBase- Returns:
- The type of detector.
- Throws:
DeviceException
-
getInputNames
Override ScannableBase to work within scans- Specified by:
getInputNamesin interfaceScannable- Overrides:
getInputNamesin classScannableBase- Returns:
- array of the names of the elements of the object returned by getPosition
-
setNumChannelsToRead
public void setNumChannelsToRead(int numChannelsToRead) -
getNumChannelsToRead
public int getNumChannelsToRead() -
getMinimumReadoutDelay
public int getMinimumReadoutDelay() -
setMinimumReadoutDelay
public void setMinimumReadoutDelay(int minimumReadoutDelay) -
getFirstDataChannel
-
setFirstDataChannel
-