Class CoboldTDC
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.detector.DetectorBase
gda.device.detector.cobolddetector.CoboldTDC
- All Implemented Interfaces:
AsynchronousDetector,CoboldDetector,Detector,Device,Scannable,Configurable,Findable,gda.observable.IObservable,AlarmListener,Serializable
- Direct Known Subclasses:
DummyCoboldTDC,OfflineCoboldTDC
Class to implement a Cobold Time to Digital Converter for data acquisition using a Micro Channel Plate (MCP) detector
for Ion Imaging Spectrometry (IIS)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected Stringprotected booleanprotected booleanFields 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 TypeMethodDescriptionvoidaddChannelLabel(String label) Add channel labelvoidAlarm callback.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 collectionTime) Start counting asynchronously (don't wit till finished)booleanReturns a value which indicates whether the detector creates its own files.voidEnd the Cobold data collection by sending STOP_COMMAND and cancelling the timer and the spectrum updatervoidExecute a file of Cobold commands for setting up an experiment in terms of pareameters, coordinates, conditions and spectra.getChannelLabel(int channel) Get the label string for the channel specifiedGet the label string for the channel specifiedintReturns the current collecting state of the device.voidDefault which should be overridden by subclasses.readout()Returns the latest data collected.voidrestart()Restart the CoboldPC by clearing all parameters, coordinates and spectraSave current Cobold Document FilevoidsendAsynchronousCommand(String command) Send a command to CoboldPC without waiting for command to executevoidsendSynchronousCommand(String command) Send a command to CoboldPC waiting for it to finish executionvoidsetChannelLabel(int channel, String label) Set the label string for the channel specifiedvoidsetChannelLabelList(ArrayList<String> channelLabelList) voidsetCollectTime(int t) voidsetComment(String comment) Set the comment to be used in the LMF headervoidsetLmfName(String name) Set LMF namevoidsetMaxNumEvents(int events) voidsetReadFromHardware(boolean b) voidsetSaveDCFsBetweenRuns(boolean b) Set whether to auto-save DCFs between runsvoidsetStandAlone(boolean b) voidsetZ1(int z1) Set the value of 1st hit on channel z1 via parameter 99 to stream data into the current LMF eventvoidShow the defined Cobold parameters from the CoboldPC GUIvoidShow the defined Cobold spectra from the CoboldPC GUIvoidstartCoboldScan(String newCommand) Start the Cobold scan letting the scanTimer alarm end the collection and scheduling regular spectrum updatesprotected voidvoidupdate the spectrumprotected voidwaitForStatus(int state) Methods inherited from class gda.device.detector.DetectorBase
asynchronousMoveTo, checkPositionValid, getCollectionTime, getDataDimensions, getPosition, isBusy, setCollectionTime, 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, getExtraNames, getInputNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, moveTo, rawAsynchronousMoveTo, rawGetPosition, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, throwExceptionIfInvalidTarget, toString, 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
getCollectionTime, getDataDimensions, getFileStructure, setCollectionTime, 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
asynchronousMoveTo, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, checkPositionValid, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, isBusy, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, toFormattedString
-
Field Details
-
coboldPCCMD
-
lmfName
-
dataDir
-
saveDCFsBetweenRuns
protected boolean saveDCFsBetweenRuns -
readFromHardware
protected boolean readFromHardware
-
-
Constructor Details
-
CoboldTDC
public CoboldTDC()Constructor
-
-
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
-
prepareForCollection
public void prepareForCollection()Description copied from class:DetectorBaseDefault which should be overridden by subclasses.- Specified by:
prepareForCollectionin interfaceDetector- Overrides:
prepareForCollectionin classDetectorBase- See Also:
-
setCollectTime
public void setCollectTime(int t) - Parameters:
t- the collection time
-
setZ1
public void setZ1(int z1) Set the value of 1st hit on channel z1 via parameter 99 to stream data into the current LMF event- Parameters:
z1- the value to set z1 to in LMF event
-
setReadFromHardware
public void setReadFromHardware(boolean b) - Parameters:
b- true to read from hardware
-
setMaxNumEvents
public void setMaxNumEvents(int events) - Parameters:
events-
-
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
-
getChannelLabelList
Get the label string for the channel specified- Specified by:
getChannelLabelListin interfaceCoboldDetector- Returns:
- label the label string
- Throws:
DeviceException- // * @see gda.device.CounterTimer#getChannelLabel(int)
-
setChannelLabelList
-
addChannelLabel
Add channel label- Parameters:
label- the label string
-
setChannelLabel
Set the label string for the channel specified- Specified by:
setChannelLabelin interfaceCoboldDetector- Parameters:
channel- intlabel- String- Throws:
DeviceException
-
getChannelLabel
Get the label string for the channel specified- Specified by:
getChannelLabelin interfaceCoboldDetector- Parameters:
channel- who's label is to be returned- Returns:
- label the label string
- Throws:
DeviceException
-
waitForStatus
- Throws:
DeviceExceptionInterruptedException
-
alarm
Description copied from interface:AlarmListenerAlarm callback.- Specified by:
alarmin interfaceAlarmListener- Parameters:
anAlarm- the alarm performing the callback
-
updateSpectrum
public void updateSpectrum()update the spectrum -
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
-
countAsync
Start counting asynchronously (don't wit till finished)- Specified by:
countAsyncin interfaceAsynchronousDetector- Parameters:
collectionTime-- Throws:
DeviceException- See Also:
-
sendAsynchronousCommand
Send a command to CoboldPC without waiting for command to execute- Parameters:
command- the CoboldPC command String
-
sendSynchronousCommand
Send a command to CoboldPC waiting for it to finish execution- Parameters:
command- String containing the CoboldPC command
-
startCoboldScan
Start the Cobold scan letting the scanTimer alarm end the collection and scheduling regular spectrum updates- Parameters:
newCommand-- Throws:
InterruptedException
-
startCollecting
protected void startCollecting() -
getStatus
public int getStatus()Description copied from interface:DetectorReturns the current collecting state of the device. -
readout
Returns 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. Return the file name created by the asynchronous detector since createsOwnFiles() -
endCollection
public void endCollection()End the Cobold data collection by sending STOP_COMMAND and cancelling the timer and the spectrum updater- Specified by:
endCollectionin interfaceDetector- Overrides:
endCollectionin classDetectorBase- See Also:
-
setStandAlone
public void setStandAlone(boolean b) - Parameters:
b- true to set stand alone mode
-
saveCurrentDcf
Save current Cobold Document File- Returns:
- String name of DCF file
-
restart
public void restart()Restart the CoboldPC by clearing all parameters, coordinates and spectra -
setLmfName
Set LMF name- Parameters:
name- String full path name of lmf file to be used in creation of New Acquisition command
-
setSaveDCFsBetweenRuns
public void setSaveDCFsBetweenRuns(boolean b) Set whether to auto-save DCFs between runs- Parameters:
b-
-
showParams
public void showParams()Show the defined Cobold parameters from the CoboldPC GUI -
showSpectra
public void showSpectra()Show the defined Cobold spectra from the CoboldPC GUI -
setComment
Set the comment to be used in the LMF header- Parameters:
comment- String the user defined comment
-
executeCoboldCommandFile
Execute a file of Cobold commands for setting up an experiment in terms of pareameters, coordinates, conditions and spectra. Correct syntax assumed (see CoboldPC user manual)- Parameters:
ccf-
-
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
-