Class DummyMalcolmTriggeredDetector<T extends DummyMalcolmTriggeredModel>
- All Implemented Interfaces:
EventListener,INexusDevice<NXdetector>,IActivatable,IPausableDevice<T>,IResettableDevice,IRunnableDevice<T>,IRunnableEventDevice<T>,IDeviceRoleActor,IConfigurable<T>,ILevel,IModelProvider<T>,INameable,IScanAttributeContainer,IValidator<T>,IMalcolmEventListener
-
Field Summary
Fields inherited from class org.eclipse.scanning.api.device.AbstractRunnableDevice
connectorService, model, runnableDeviceService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoideventPerformed(MalcolmEvent event) Called when Malcolm notifies the service that something happened.Returns the object provider required for writing correct NeXus files.voidvoidpointStart(IPosition outerPoint) voidpostConfigure(ScanInformation scanInformation) voidBlocking call to execute the scan.voidvoidscanStart(ScanBean scanBean, SubscanModerator subscanModerator) If overriding don't forget the old super.validate(...)voidMethods inherited from class org.eclipse.scanning.api.device.AbstractRunnableDevice
abort, addRunListener, configure, disable, fireRunPerformed, fireRunWillPerform, fireStateChanged, fireWritePerformed, fireWriteWillPerform, getConfigureTime, getConnectorService, getDeviceHealth, getDeviceInformation, getDeviceInformation, getDeviceState, getLevel, getModel, getPublisher, getRole, getRunnableDeviceService, getScanAttribute, getScanAttributeNames, getScanId, getSupportedScanModes, isActivated, isAlive, isDeviceBusy, pause, register, removeRunListener, reset, resume, seek, setActivated, setAlive, setBusy, setConfigureTime, setConnectorService, setDeviceInformation, setDeviceState, setLevel, setModel, setPublisher, setRole, setRunnableDeviceService, setScanAttribute, setScanId, setSupportedScanMode, setSupportedScanModes, setSupportedScanModes, toStringMethods inherited from class org.eclipse.scanning.api.AbstractNameable
equals, getName, hashCode, setNameMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.scanning.api.IModelProvider
updateModelMethods inherited from interface org.eclipse.dawnsci.nexus.INexusDevice
getCustomNexusModification, getName, getNexusProviders, registerMethods inherited from interface org.eclipse.scanning.api.device.IRunnableDevice
latch, latch, run, start, throwFirstRunExceptionMethods inherited from interface org.eclipse.scanning.api.IValidator
setService
-
Constructor Details
-
DummyMalcolmTriggeredDetector
- Throws:
ScanningException
-
-
Method Details
-
run
Description copied from interface:IRunnableDeviceBlocking call to execute the scan. The position specified may be null.- Specified by:
runin interfaceIRunnableDevice<T extends DummyMalcolmTriggeredModel>- Throws:
ScanningExceptionInterruptedException
-
validate
Description copied from class:AbstractRunnableDeviceIf overriding don't forget the old super.validate(...)- Specified by:
validatein interfaceIValidator<T extends DummyMalcolmTriggeredModel>- Overrides:
validatein classAbstractRunnableDevice<T extends DummyMalcolmTriggeredModel>- Parameters:
model- - a model of type T to validate- Returns:
- a valid model
- Throws:
ValidationException
-
scanStart
public void scanStart(ScanBean scanBean, SubscanModerator subscanModerator) throws ScanningException - Throws:
ScanningException
-
scanFinally
public void scanFinally() -
postConfigure
- Throws:
Exception
-
pointStart
-
getNexusProvider
Description copied from interface:INexusDeviceReturns the object provider required for writing correct NeXus files.In this method you should prepare the
LazyDatasets the device will fill during the scan. You can also write out static device metadata, which will not change during the scan.Use the methods on
NexusNodeFactoryto create a NeXus object which matches the device e.g. aNXdetector.final NXdetector detector = NexusNodeFactory.createNXdetector();On the detector object you can create
In this method you can also write static metadata such as the detector exposure e.g.LazyDatasets and keep references which you can later use during the scan to write data. e.g.imageData = detector.initializeLazyDataset(NXdetector.NX_DATA, info.getRank() + 2, Double.class);You should also set chunking on theLazyDatasets you create e.g.imageData.setChunking(info.createChunk(detectorXSize, detectorYSize));.detector.setField("exposure_time", model.getExposure());. Or static datasets such as the image axis datadetector.setDataset("image_x_axis", DatasetFactory.createLinearSpace(DoubleDataset.class, minX, maxX, xPoints));For fields that are defined in the NXDL base class definition for the returned nexus object, a setXXX or setXXXScalar method may be used as appropriate, e.g.detector.setLocalName(DatasetFactory.createFromObject("my detector"));ordetector.setLocalNameScalar("my detector");If this device is a 'metadata scannable', then the device should write its data at this point directly into the returned nexus object. This can be done with the
NXobject.setField(String, Object)method, or thesetXXXScalarmethods for fields defined in the appropriate NXDL base class definition.The default implementation of this method throws
UnsupportedOperationException. One of either this method orINexusDevice.getNexusProviders(NexusScanInfo)must be overridden to create and return the nexus object(s) for thisINexusDevice.- Specified by:
getNexusProviderin interfaceINexusDevice<T extends DummyMalcolmTriggeredModel>- Parameters:
info- information about the scan which can be useful when creating datasets e.g.info.getRank()- Returns:
- The
NXobjectcreated using thenodeFactoryto represent this device - Throws:
NexusException- if the nexus object could not be created for any reason
-
eventPerformed
Description copied from interface:IMalcolmEventListenerCalled when Malcolm notifies the service that something happened.- Specified by:
eventPerformedin interfaceIMalcolmEventListener- Parameters:
event-
-
hardwareTriggerReceived
public void hardwareTriggerReceived() -
writeLine
public void writeLine() throws org.eclipse.january.DatasetException- Throws:
org.eclipse.january.DatasetException
-