Class DummyMalcolmDevice
java.lang.Object
org.eclipse.scanning.api.AbstractNameable
org.eclipse.scanning.api.device.AbstractRunnableDevice<IMalcolmModel>
org.eclipse.scanning.malcolm.core.AbstractMalcolmDevice
org.eclipse.scanning.example.malcolm.DummyMalcolmDevice
- All Implemented Interfaces:
INexusDevice<NXobject>,IActivatable,IPausableDevice<IMalcolmModel>,IResettableDevice,IRunnableDevice<IMalcolmModel>,IRunnableEventDevice<IMalcolmModel>,IDeviceRoleActor,IConfigurable<IMalcolmModel>,ILevel,IModelProvider<IMalcolmModel>,INameable,IScanAttributeContainer,IValidator<IMalcolmModel>,IMalcolmDevice
A dummy Malcolm device for use in dummy mode or tests.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassAbstract superclass for a dummy malcolm controlled device which writes nexus. -
Field Summary
FieldsFields inherited from class org.eclipse.scanning.malcolm.core.AbstractMalcolmDevice
isMultiScan, outputDir, pointGenerator, scanModelFields inherited from class org.eclipse.scanning.api.device.AbstractRunnableDevice
connectorService, model, runnableDeviceService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(IMalcolmModel model) Call to configure the device.voiddispose()Disposes of the malcolm device causing it to disconnect from the underlying malcolm device.Returns the axes that this malcolm device can move.Returns aMalcolmTableobject describing the datasets that this malcolm device is configured to create during a scan.Returns theMalcolmDetectorInfos for the detectors controlled by this malcolm device, describing their current state.getModel()The model being used for the device.Returns the version of this malcolm device.voidInitializes the connection to the actual malcolm device.booleanisLocked()Attempts to determine if the device is locked doing something like a configure or a run.voidpause()Allowed when the device is in Running state.voidresume()Allowed when the device is in Paused state.voidBlocking call to execute the scan.void<T> voidsetAttributeValue(String attributeName, T value) voidsetAvailableAxes(List<String> availableAxes) protected voidsetDeviceState(DeviceState nstate) voidsetFlattenGridScan(boolean flattenGridScan) voidsetOutputDir(String outputDir) Set the directory where malcolm will write its h5 files to.voidsetPointGenerator(IPointGenerator<? extends IScanPointGeneratorModel> pointGenerator) Set the point generator for the malcolm device.voidsetPrependScanName(boolean prependScanName) validate(IMalcolmModel model) If overriding don't forget the old super.validate(...)Methods inherited from class org.eclipse.scanning.malcolm.core.AbstractMalcolmDevice
addMalcolmListener, afterExecute, beforeExecute, calculateAxesToMove, close, configureScan, getBreakpoints, getConfiguredAxes, getConfiguredAxes, getConfiguredScan, getDeviceInformation, getMultiScanModel, getNexusProviders, getOutputDir, getPointGenerator, register, removeMalcolmListener, sendEvent, setTemplateBean, startMethods inherited from class org.eclipse.scanning.api.device.AbstractRunnableDevice
abort, addRunListener, disable, fireRunPerformed, fireRunWillPerform, fireStateChanged, fireWritePerformed, fireWriteWillPerform, getConfigureTime, getConnectorService, getDeviceHealth, getDeviceInformation, getLevel, getPublisher, getRole, getRunnableDeviceService, getScanAttribute, getScanAttributeNames, getScanId, getSupportedScanModes, isActivated, isAlive, isDeviceBusy, removeRunListener, reset, seek, setActivated, setAlive, setBusy, setConfigureTime, setConnectorService, setDeviceInformation, 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.device.models.IDeviceRoleActor
getRole, getSupportedScanModes, setRoleMethods inherited from interface org.eclipse.scanning.api.IModelProvider
setModel, updateModelMethods inherited from interface org.eclipse.dawnsci.nexus.INexusDevice
getCustomNexusModification, getName, getNexusProviderMethods inherited from interface org.eclipse.scanning.api.device.IPausableDevice
seekMethods inherited from interface org.eclipse.scanning.api.device.IResettableDevice
resetMethods inherited from interface org.eclipse.scanning.api.device.IRunnableDevice
abort, disable, getDeviceHealth, isAlive, isDeviceBusy, latch, latch, run, setAlive, throwFirstRunExceptionMethods inherited from interface org.eclipse.scanning.api.device.IRunnableEventDevice
addRunListener, fireRunPerformed, fireRunWillPerform, fireWritePerformed, fireWriteWillPerform, removeRunListenerMethods inherited from interface org.eclipse.scanning.api.IValidator
setService
-
Field Details
-
DATASET_NAME_UNIQUE_KEYS
- See Also:
-
UNIQUE_KEYS_DATASET_PATH
- See Also:
-
FILE_EXTENSION_HDF5
- See Also:
-
-
Constructor Details
-
DummyMalcolmDevice
public DummyMalcolmDevice()
-
-
Method Details
-
setPrependScanName
public void setPrependScanName(boolean prependScanName) -
configure
Description copied from interface:IConfigurableCall to configure the device. If the model provided is invalid, a scanning exception will be thrown.- Specified by:
configurein interfaceIConfigurable<IMalcolmModel>- Overrides:
configurein classAbstractMalcolmDevice- Parameters:
model-- Throws:
ScanningException
-
initialize
Description copied from interface:IMalcolmDeviceInitializes the connection to the actual malcolm device. This methods must be called before the malcolm device can be used.- Specified by:
initializein interfaceIMalcolmDevice- Overrides:
initializein classAbstractMalcolmDevice- Throws:
MalcolmDeviceException- if the malcolm device could not be initialized
-
scanFinally
- Overrides:
scanFinallyin classAbstractMalcolmDevice- Throws:
ScanningException
-
setDeviceState
- Overrides:
setDeviceStatein classAbstractRunnableDevice<IMalcolmModel>- Parameters:
nstate-
-
getDeviceState
- Specified by:
getDeviceStatein interfaceIRunnableDevice<IMalcolmModel>- Overrides:
getDeviceStatein classAbstractRunnableDevice<IMalcolmModel>- Returns:
- the current device State. This is not the same as the Status of the scan.
- Throws:
ScanningException
-
setOutputDir
Description copied from interface:IMalcolmDeviceSet the directory where malcolm will write its h5 files to. The directory should exist at the point that the malcolm device is configured, malcolm is not responsible for creating it.- Specified by:
setOutputDirin interfaceIMalcolmDevice- Overrides:
setOutputDirin classAbstractMalcolmDevice
-
setPointGenerator
Description copied from interface:IMalcolmDeviceSet the point generator for the malcolm device.- Specified by:
setPointGeneratorin interfaceIMalcolmDevice- Overrides:
setPointGeneratorin classAbstractMalcolmDevice- Parameters:
pointGenerator- point generator
-
getModel
Description copied from interface:IRunnableDeviceThe model being used for the device.- Specified by:
getModelin interfaceIModelProvider<IMalcolmModel>- Specified by:
getModelin interfaceIRunnableDevice<IMalcolmModel>- Overrides:
getModelin classAbstractRunnableDevice<IMalcolmModel>- Returns:
-
validate
Description copied from class:AbstractRunnableDeviceIf overriding don't forget the old super.validate(...)- Specified by:
validatein interfaceIValidator<IMalcolmModel>- Overrides:
validatein classAbstractRunnableDevice<IMalcolmModel>- Parameters:
model- - a model of type T to validate- Returns:
- a valid model
- Throws:
ValidationException
-
run
Description copied from interface:IRunnableDeviceBlocking call to execute the scan. The position specified may be null. -
dispose
Description copied from interface:IMalcolmDeviceDisposes of the malcolm device causing it to disconnect from the underlying malcolm device.- Specified by:
disposein interfaceIMalcolmDevice- Overrides:
disposein classAbstractMalcolmDevice- Throws:
MalcolmDeviceException
-
isLocked
Description copied from interface:IMalcolmDeviceAttempts to determine if the device is locked doing something like a configure or a run.- Returns:
- true if not in locked state, otherwise false.
- Throws:
MalcolmDeviceException
-
setAttributeValue
- Throws:
ScanningException
-
pause
Description copied from interface:IPausableDeviceAllowed when the device is in Running state. Will block until the device is in a rest state. When paused the same thread must call resume() or abort() which has paused or an IllegalMonitorState Exception will be thrown.- Specified by:
pausein interfaceIPausableDevice<IMalcolmModel>- Overrides:
pausein classAbstractRunnableDevice<IMalcolmModel>- Throws:
ScanningException
-
resume
Description copied from interface:IPausableDeviceAllowed when the device is in Paused state. Will block until the device is unpaused. When paused the same thread must call resume() or abort() which has paused or an IllegalMonitorState Exception will be thrown.- Specified by:
resumein interfaceIPausableDevice<IMalcolmModel>- Overrides:
resumein classAbstractRunnableDevice<IMalcolmModel>- Throws:
ScanningException
-
getAvailableAxes
Description copied from interface:IMalcolmDeviceReturns the axes that this malcolm device can move.- Returns:
- the axes this malcolm device can move, never
null - Throws:
ScanningException
-
setAvailableAxes
-
getDatasets
Description copied from interface:IMalcolmDeviceReturns aMalcolmTableobject describing the datasets that this malcolm device is configured to create during a scan. This method should only be called afterhas been called on this malcolm device.invalid reference
#configure(IMalcolmModel)- Returns:
- a table of the datasets created by this malcolm device
- Throws:
MalcolmDeviceException- if the datasets table could not be returned for any reason
-
getVersion
Description copied from interface:IMalcolmDeviceReturns the version of this malcolm device.- Returns:
- version
- Throws:
MalcolmDeviceException- if the version cannot be returned for any reason
-
getDetectorInfos
Description copied from interface:IMalcolmDeviceReturns theMalcolmDetectorInfos for the detectors controlled by this malcolm device, describing their current state.- Returns:
- detector infos
- Throws:
MalcolmDeviceException
-
setFlattenGridScan
public void setFlattenGridScan(boolean flattenGridScan)
-