Package gda.device.epicsdevice
Class FindableEpicsDevice
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.epicsdevice.FindableEpicsDevice
- All Implemented Interfaces:
Device,IEpicsDevice,IFindableEpicsDevice,Configurable,Findable,gda.observable.IObservable
A generic Epics device object which can be used for low-level access to arbitrary devices, most commonly XMAP devices.
It manages a map of "field names" to PVs, for example:
<entry key="SETNBINS" value="BL08I-EA-DET-02:MCA1.NUSE" />
and Epics channel access (via an EpicsDevice) and translates calls such as:
setValue("SETNBINS", "" numberOfBins)
to the appropriate channel access call, using the PV mapping.-
Field Summary
FieldsFields inherited from class gda.device.DeviceBase
DEFAULT_PROTECTION_LEVEL_PROPERTYFields inherited from interface gda.device.epicsdevice.IEpicsDevice
defPutTimeOutInSec -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription__getattr__(org.python.core.PyString name) voidaddIObserver(gda.observable.IObserver anIObserver) voidclose()Close and unconfigure the device.voidvoidDefault 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.static IEpicsChannelcreateChannel(ReturnType returnType, String device, String record, String field) createDetector(String record, String field) createDetector(String name, String record, String field) createEpicsChannel(ReturnType returnType, String record, String field) createEpicsChannel(ReturnType returnType, String record, String field, double putTimeout) createEpicsChannel(String name) createEpicsChannel(String name, ReturnType returnType, String record, String field) static IEpicsChannelcreateSimpleScannable(String device, String record, String field) voiddeleteIObserver(gda.observable.IObserver anIObserver) voidvoiddispose()getAttribute(String attributeName) Get the value of the specified attributestatic IEpicsChannelgetCtrlEnumChannel(String device, String record, String field) booleangetDummy()intgetElementCount(String record, String field) getRecordPV(String mcaName) Get the PV associated with a given elementgetValue()getValue(ReturnType returnType, String record, String field) Get the value of an Epics record, specifying the return type requiredgetValueAsString(String record, String field) Get the value of an Epics record as a stringvoidsetAttribute(String attributeName, Object value) Set any attribute the implementing classes may providevoidsetDummy(boolean dummy) voidsetRecordPVs(Map<String, String> recordPVs) voidvoidSet the value of an Epics record, specifying the typevoidSet the value of an Epics record, using a default timeout.voidsetValue(String record, String field, Object val, double connectionTimeout, gov.aps.jca.event.PutListener listener) voidsetValueNoWait(String record, String field, Object val) Set the value of an Epics record, without waiting for the put to completetoString()Methods inherited from class gda.device.DeviceBase
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, reconfigure
-
Field Details
-
dummy
protected boolean dummy
-
-
Constructor Details
-
FindableEpicsDevice
public FindableEpicsDevice() -
FindableEpicsDevice
-
-
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 classConfigurableBase- Throws:
FactoryException- if there is an error in configuration e.g. required variable not set or cannot connect to device
-
getRecordPVs
-
setRecordPVs
-
getRecordPV
Description copied from interface:IFindableEpicsDeviceGet the PV associated with a given element- Specified by:
getRecordPVin interfaceIFindableEpicsDevice- Parameters:
mcaName- Name of the element- Returns:
- Corresponding PV
-
setDummy
public void setDummy(boolean dummy) -
getDummy
public boolean getDummy() -
close
Description copied from interface:DeviceClose and unconfigure the device.- Specified by:
closein interfaceDevice- Overrides:
closein classDeviceBase- Throws:
DeviceException
-
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
-
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
-
addIObserver
public void addIObserver(gda.observable.IObserver anIObserver) - Specified by:
addIObserverin interfacegda.observable.IObservable- Overrides:
addIObserverin classDeviceBase
-
deleteIObserver
public void deleteIObserver(gda.observable.IObserver anIObserver) - Specified by:
deleteIObserverin interfacegda.observable.IObservable- Overrides:
deleteIObserverin classDeviceBase
-
deleteIObservers
public void deleteIObservers()- Specified by:
deleteIObserversin interfacegda.observable.IObservable- Overrides:
deleteIObserversin classDeviceBase
-
createEpicsChannel
public IEpicsChannel createEpicsChannel(ReturnType returnType, String record, String field, double putTimeout) - Specified by:
createEpicsChannelin interfaceIEpicsDevice- Parameters:
returnType-record-field-putTimeout-- Returns:
- IEpicsChannel
-
createEpicsChannel
- Specified by:
createEpicsChannelin interfaceIEpicsDevice- Parameters:
returnType-record-field-- Returns:
- IEpicsChannel
-
createEpicsChannel
-
createEpicsChannel
public IEpicsChannel createEpicsChannel(String name, ReturnType returnType, String record, String field) -
createEpicsChannel
-
createDetector
-
createDetector
-
getValue
Description copied from interface:IFindableEpicsDeviceGet the value of an Epics record, specifying the return type required- Specified by:
getValuein interfaceIFindableEpicsDevice- Parameters:
returnType- One of the permitted values of ReturnTyperecord- Epics record to getfield- Field within the record (can be empty string)- Returns:
- Value of the Epics record
- Throws:
DeviceException
-
getValueAsString
Description copied from interface:IFindableEpicsDeviceGet the value of an Epics record as a string- Specified by:
getValueAsStringin interfaceIFindableEpicsDevice- Parameters:
record- Epics record to getfield- Field within the record (can be empty string)- Returns:
- Value of the Epics record as a string
- Throws:
DeviceException
-
getElementCount
- Throws:
DeviceException
-
getValue
- Throws:
DeviceException
-
setValue
public void setValue(Object type, String record, String field, Object val, double putTimeout) throws DeviceException Description copied from interface:IFindableEpicsDeviceSet the value of an Epics record, specifying the type- Specified by:
setValuein interfaceIFindableEpicsDevice- Parameters:
type- Type of the value: note that null may be the only valid value in some implementationsrecord- Epics record to setfield- Field within the record (can be empty string)val- Value to setputTimeout- Timeout on the call in seconds- Throws:
DeviceException
-
setValue
public void setValue(String record, String field, Object val, double connectionTimeout, gov.aps.jca.event.PutListener listener) throws DeviceException - Throws:
DeviceException
-
setValue
Description copied from interface:IFindableEpicsDeviceSet the value of an Epics record, using a default timeout.- Specified by:
setValuein interfaceIFindableEpicsDevice- Parameters:
record- Epics record to setfield- Field within the record (can be empty string)val- Value to set- Throws:
DeviceException
-
setValueNoWait
Description copied from interface:IFindableEpicsDeviceSet the value of an Epics record, without waiting for the put to complete- Specified by:
setValueNoWaitin interfaceIFindableEpicsDevice- Parameters:
record- Epics record to setfield- Field within the record (can be empty string)val- Value to set- Throws:
DeviceException
-
setValue
- Throws:
DeviceException
-
dispose
- Specified by:
disposein interfaceIEpicsDevice- Throws:
DeviceException
-
closeUnUsedChannels
- Specified by:
closeUnUsedChannelsin interfaceIEpicsDevice- Throws:
DeviceException
-
createSimpleScannable
-
createChannel
public static IEpicsChannel createChannel(ReturnType returnType, String device, String record, String field) -
getCtrlEnumChannel
public static IEpicsChannel getCtrlEnumChannel(String device, String record, String field) throws DeviceException - Throws:
DeviceException
-
toString
-
__getattr__
-