Package gda.device.detector
Class EpicsScaler
- All Implemented Interfaces:
Detector,Device,Scannable,InitializationListener,Configurable,Findable,gda.observable.IObservable,Serializable
Epics scaler class.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields 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 TypeMethodDescriptionvoidaddMonitor(int channel, gov.aps.jca.event.MonitorListener l) adds a monitor to the specified channelvoidTells 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.booleanReturns a value which indicates whether the detector creates its own files.formatPosition(int format, double number) Does the same job as the other formatPosition method except rather than using a supplied format string, use the index of the array of formats this object holds.getChannelLabel(int channel) Gets the user set name of the ChanneldoubleGets the collection time from the scalersint[]Default which should be overridden by subclasses.String[]Gets the names of all the channels as a listdoubleGets the clock frequency of the ScalerintReturns the current collecting state of the device.intGets the total number of channels actually supported by the scaler hardwarevoidCalled when all critical channels are connected.booleanvoidloadPresetChans(double[] value) Loads the user set preset values to the scaler channels.double[]Reads the counts accumulated by all the scalersdouble[]readout()Returns the latest data collected.intreadout(int channel) voidsetChannelLabel(int channel, String label) Sets the name of the ChannelvoidsetCollectionTime(double time) Sets the collection time for the scalersvoidsetControlCountMode(boolean controlCountMode) voidvoidsetFrequency(double frequency) Sets the clock frequency of the scalervoidvoidstart()Starts the counting in the Scalervoidstop()Stops the counting in the ScalertoString()Methods inherited from class gda.device.detector.DetectorBase
asynchronousMoveTo, checkPositionValid, endCollection, getPosition, isBusy, prepareForCollection, toFormattedStringMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, externalToInternal, getInputNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, moveTo, rawAsynchronousMoveTo, rawGetPosition, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, throwExceptionIfInvalidTarget, validateScannable, valueUnavailableString, waitWhileBusy, waitWhileBusyMethods inherited from class gda.device.DeviceBase
addIObserver, close, deleteIObserver, deleteIObservers, getAttribute, getName, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, setAttribute, 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
getFileStructure, waitWhileBusyMethods inherited from interface gda.device.Device
close, getAttribute, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObserversMethods inherited from interface gda.device.Scannable
atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, getInputNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes
-
Constructor Details
-
EpicsScaler
public EpicsScaler()Constructor.
-
-
Method Details
-
configure
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. initialisation - create all channels to PVs and setup monitoring.- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classConfigurableBase- Throws:
FactoryException- if there is an error in configuration e.g. required variable not set or cannot connect to device
-
getCountMode
- Throws:
DeviceException
-
setCountMode
- Throws:
DeviceException
-
getTotalChans
Gets the total number of channels actually supported by the scaler hardware- Returns:
- integer number of channels
- Throws:
DeviceException
-
loadPresetChans
Loads the user set preset values to the scaler channels. If scaler channel n has been designated as a preset scaler channel , then when the scaler channel reaches the preset count , all scaler channels will be disabled, and the record will report counting has completed . When Preset changes to any positive value, the record will set gate of that corresponding scaler channel to 1.- Parameters:
value- double array of the preset values- Throws:
DeviceException
-
start
Starts the counting in the Scaler- Throws:
DeviceException
-
stop
Stops the counting in the Scaler- Specified by:
stopin interfaceScannable- Overrides:
stopin classScannableBase- Throws:
DeviceException- See Also:
-
readChans
Reads the counts accumulated by all the scalers- Returns:
- a double array of the scaler counts
- Throws:
DeviceException
-
getChannelLabel
Gets the user set name of the Channel- Parameters:
channel- integer channel number - zero based- Returns:
- the Name of the channel associated with a channel number
- Throws:
DeviceException
-
setChannelLabel
Sets the name of the Channel- Parameters:
channel- integer channel number - zero basedlabel- name to be associated with that channel- Throws:
DeviceException
-
getExtraNames
Gets the names of all the channels as a list- Specified by:
getExtraNamesin interfaceScannable- Overrides:
getExtraNamesin classScannableBase- Returns:
- list of all the channel names
-
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.- Specified by:
collectDatain interfaceDetector- Throws:
DeviceException
-
setCollectionTime
public void setCollectionTime(double time) Sets the collection time for the scalers- Specified by:
setCollectionTimein interfaceDetector- Overrides:
setCollectionTimein classDetectorBase- Parameters:
time- period to count
-
getCollectionTime
public double getCollectionTime()Gets the collection time from the scalers- Specified by:
getCollectionTimein interfaceDetector- Overrides:
getCollectionTimein classDetectorBase- Returns:
- double collectionTime
-
getStatus
public int getStatus()Description copied from interface:DetectorReturns the current collecting state of the device. -
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.- Specified by:
readoutin interfaceDetector- Returns:
- the data collected
- Throws:
DeviceException
-
readout
- Parameters:
channel-- Returns:
- data
- Throws:
DeviceException
-
getFrequency
public double getFrequency()Gets the clock frequency of the Scaler- Returns:
- double frequency
-
setFrequency
public void setFrequency(double frequency) Sets the clock frequency of the scaler- Parameters:
frequency-
-
getDataDimensions
Description copied from class:DetectorBaseDefault which should be overridden by subclasses.- Specified by:
getDataDimensionsin interfaceDetector- Overrides:
getDataDimensionsin classDetectorBase- Returns:
- the dimensions of the data object returned by the
Detector.readout()method - Throws:
DeviceException- See Also:
-
addMonitor
adds a monitor to the specified channel- Parameters:
channel-l-- Throws:
DeviceException
-
initializationCompleted
public void initializationCompleted()Description copied from interface:InitializationListenerCalled when all critical channels are connected.- Specified by:
initializationCompletedin interfaceInitializationListener
-
formatPosition
Does the same job as the other formatPosition method except rather than using a supplied format string, use the index of the array of formats this object holds. This is to be used when an object has multiple elements which descibe its position and those element require different formatting.- Parameters:
format- the index in the array of formats to usenumber- the number to format- Returns:
- a formatted string
-
toString
- Overrides:
toStringin classScannableBase
-
setPvName
- Parameters:
pvName-
-
getPvName
- Returns:
- pv name
-
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.- Specified by:
createsOwnFilesin interfaceDetector- 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
-
isControlCountMode
public boolean isControlCountMode() -
setControlCountMode
public void setControlCountMode(boolean controlCountMode)
-