|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfr.esrf.TangoApi.Connection
fr.esrf.TangoApi.DeviceProxy
fr.esrf.tangoatk.core.Device
public class Device
An object that maps to a Tango Device. It is able to produce the attributes and the commands belonging to this Device.
Normally a Device object is obtained through the
DeviceFactoryto make sure that we do not
create two instances of the same physical device. The device sends out three
events, a Status-change event, a state-change event, and an error event.
Objects interested in receiving such events must register as listeners.
| Field Summary | |
|---|---|
protected boolean |
devPropertiesLoaded
|
static java.lang.String |
INSERT_EXTRACT_PROP
|
static java.lang.String |
OPEN_CLOSE_PROP
|
protected EventSupport |
propChanges
|
protected java.util.Map<java.lang.String,DeviceProperty> |
propertyMap
|
protected fr.esrf.TangoApi.DeviceProxy |
proxy
|
| Fields inherited from class fr.esrf.TangoApi.DeviceProxy |
|---|
event_queue, proxy_lock_cnt |
| Fields inherited from class fr.esrf.TangoApi.Connection |
|---|
access, check_access, classname, dev_src, device, device_2, device_3, device_4, devname, idl_version, ior, taco_device, transparent_reconnection, url |
| Fields inherited from interface fr.esrf.tangoatk.core.IDevice |
|---|
ALARM, CLOSE, DISABLE, EXTRACT, FAULT, INIT, INSERT, MOVING, OFF, ON, OPEN, RUNNING, STANDBY, UNKNOWN |
| Fields inherited from interface fr.esrf.TangoApi.ApiDefs |
|---|
ALL_ASYNCH, ATT_R, ATT_W, CALLBACK, CMD, D_TCP, D_UDP, FROM_ATTR, FROM_CMD, FROM_DBASE, FROM_IOR, LOGGING_DEBUG, LOGGING_ERROR, LOGGING_FATAL, LOGGING_INFO, LOGGING_OFF, LOGGING_WARN, MISC, NO_TIMEOUT, POLLING, protocol_name, PULL_CALLBACK, PUSH_CALLBACK, TACO, TANGO |
| Constructor Summary | |
|---|---|
Device(java.lang.String name)
Creates a new Device instance. |
|
Device(java.lang.String name,
java.lang.String host,
java.lang.String port)
|
|
| Method Summary | |
|---|---|
void |
addErrorListener(IErrorListener l)
|
void |
addListener(IDeviceListener l)
addListener adds a listener to all device events |
void |
addStateListener(IStateListener l)
addStateListener adds a listener to state-events |
void |
addStatusListener(IStatusListener l)
addStatusListener adds a listener to status-events |
boolean |
areDevPropertiesLoaded()
|
protected void |
deviceError(java.lang.String s,
java.lang.Throwable t)
deviceError fires of an error event from this device |
boolean |
doesEvent()
Returns true if this device supports event. |
fr.esrf.TangoApi.DeviceData |
executeCommand(java.lang.String command,
fr.esrf.TangoApi.DeviceData argin)
executeCommand |
java.lang.String |
getAlias()
getAlias returns the alias of this device. |
fr.esrf.TangoApi.AttributeInfoEx |
getAttributeInfo(java.lang.String name)
getAttributeInfo gets the attribute config of an attribute |
fr.esrf.TangoApi.AttributeInfoEx[] |
getAttributeInfo(java.lang.String[] name)
getAttributeInfo returns the attribute configs for the
attributes named in the parameter. |
fr.esrf.TangoApi.CommandInfo |
getCommand(java.lang.String name)
getCommand returns a CommandInfo corresponding to the
given name. |
fr.esrf.TangoApi.CommandInfo[] |
getCommandList()
getCommandList returns the list of commands known to this
device |
int |
getDevTimeout()
This method is provided to ATK applications so that they don't need to import fr.esrf.TangoApi.DeviceProxy to get the timeout for the connection to the device. |
int |
getIdlVersion()
Returns the IDL version number of this device. |
boolean |
getInvertedInsertExtract()
|
boolean |
getInvertedOpenClose()
|
AtkEventListenerList |
getListenerList()
|
java.lang.String |
getName()
getName returns the name of this device. |
EventSupport |
getPropChanges()
Returns the EventSupport object which manages ATKEvents for this device. |
DeviceProperty |
getProperty(java.lang.String propertyName)
|
java.util.Map |
getPropertyMap()
|
long |
getRefreshCount()
Returns the number of call to refresh() |
java.lang.String |
getState()
getState returns the state of the device as a string. |
static fr.esrf.Tango.DevState |
getStateFromString(java.lang.String st)
|
java.lang.String |
getStatus()
getStatus returns the status of the device. |
java.lang.String |
getVersion()
|
protected void |
init(java.lang.String name)
|
boolean |
isAlive()
isAlive checks to see if this device is reachable |
void |
loadDevProperties()
|
fr.esrf.TangoApi.DeviceAttribute |
readAttribute(java.lang.String name)
readAttribute reads the value of an attribute. |
fr.esrf.TangoApi.DeviceAttribute |
readAttributeFromDevice(java.lang.String name)
readAttributeFromDevice reads the value of an attribute. |
void |
refresh()
refresh sends out status and state events. |
void |
refreshPropertyMap()
You can use this method if you added or removed a property for this device by using jive. |
void |
removeErrorListener(IErrorListener l)
|
void |
removeListener(IDeviceListener l)
removeListener removes a listener to this device. |
void |
removeStateListener(IStateListener l)
removeStateListener removes a listener to a state-events |
void |
removeStatusListener(IStatusListener l)
removeStatusListener removes a status listener |
void |
setDevTimeout(int tmout_ms)
This method is provided to ATK applications so that they don't need to import fr.esrf.TangoApi.DeviceProxy to set the timeout for the connection to the device. |
void |
storeInfo(fr.esrf.TangoApi.AttributeInfoEx c)
storeInfo |
void |
storeProperty(java.lang.String propertyName)
Stores a property in database |
java.lang.String |
toString()
|
static java.lang.String |
toString(fr.esrf.Tango.DevState st)
|
void |
writeAttribute(fr.esrf.TangoApi.DeviceAttribute a)
writeAttribute writes an attribute. |
| Methods inherited from class fr.esrf.TangoApi.DeviceProxy |
|---|
add_device, add_logging_target, add_logging_target, attribute_history, attribute_history, check_asynch_reply, command_history, command_history, command_inout_asynch, command_inout_asynch, command_inout_asynch, command_inout_asynch, command_inout_asynch, command_inout_asynch, command_inout_reply, command_inout_reply, command_query, delete_attribute_property, delete_attribute_property, delete_attribute_property, delete_attribute_property, delete_attribute, delete_device, delete_property, delete_property, delete_property, dev_inform, export_device, finalize, get_adm_dev, get_alias, get_asynch_idl_cmd, get_asynch_replies, get_asynch_replies, get_attribute_config, get_attribute_config, get_attribute_config, get_attribute_info_ex, get_attribute_info_ex, get_attribute_info_ex, get_attribute_info, get_attribute_info, get_attribute_info, get_attribute_list, get_attribute_polling_period, get_attribute_property, get_attribute_property, get_class_inheritance, get_class, get_command_polling_period, get_db_obj, get_event_queue_size, get_event_queue_size, get_events, get_events, get_evt_import_info, get_info, get_last_event_date, get_logging_level, get_logging_target, get_next_event, get_next_event, get_property_list, get_property, get_property, get_property, get_rpc_protocol, getAdm_dev, getAttnames_array, getDb_dev, getDeviceProxy, getEventQueue, getFull_class_name, getLockerInfo, getLockerStatus, import_admin_device, import_admin_device, import_device, isCheck_idl, isLocked, isLockedByMe, lock, lock, main, name, pending_asynch_call, poll_attribute, poll_command, polling_status, put_alias, put_attribute_property, put_attribute_property, put_property, put_property, read_attribute_asynch, read_attribute_asynch, read_attribute_asynch, read_attribute_asynch, read_attribute_reply, read_attribute_reply, read_attribute_value, read_attribute, read_attribute, remove_logging_target, set_attribute_config, set_attribute_info, set_attribute_info, set_evt_import_info, set_logging_level, set_rpc_protocol, setAdm_dev, setAttnames_array, setDb_dev, setDeviceProxy, setEventQueue, setFull_class_name, state, state, status, status, stop_poll_attribute, stop_poll_command, subscribe_event, subscribe_event, subscribe_event, unexport_device, unlock, unsubscribe_event, use_db, write_attribute_asynch, write_attribute_asynch, write_attribute_asynch, write_attribute_asynch, write_attribute_asynch, write_attribute_asynch, write_attribute_reply, write_attribute_reply, write_attribute, write_attribute, write_read_attribute, write_read_attribute |
| Methods inherited from class fr.esrf.TangoApi.Connection |
|---|
adm_name, black_box, build_connection, checkIfTaco, checkIfTango, command_inout, command_inout, command_list_query, description, dev_import, get_class_name, get_device, get_host_name, get_idl_version, get_ior, get_name, get_server_name, get_source, get_tango_host, get_timeout_millis, get_timeout, get_transparency_reconnection, getAccessControl, getDev_timeout, getIConnection, getObj, getPrev_failed_t0, getPrev_failed, info_3, info, is_taco, isAllowedCommand, isAlready_connected, isDevice_is_dbase, isPrev_failed, ping, set_source, set_timeout_millis, set_transparency_reconnection, setAccessControl, setAlready_connected, setDev_timeout, setDevice_is_dbase, setIConnection, setObj, setPrev_failed_t0, setPrev_failed, throw_dev_failed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String OPEN_CLOSE_PROP
public static final java.lang.String INSERT_EXTRACT_PROP
protected EventSupport propChanges
protected transient fr.esrf.TangoApi.DeviceProxy proxy
protected java.util.Map<java.lang.String,DeviceProperty> propertyMap
protected boolean devPropertiesLoaded
| Constructor Detail |
|---|
public Device(java.lang.String name)
throws fr.esrf.Tango.DevFailed
Device instance.
name - a String containing the name of the device to
connect to.
fr.esrf.Tango.DevFailed - if an error occursDeviceProxy.DeviceProxy(java.lang.String, java.lang.String, java.lang.String)
public Device(java.lang.String name,
java.lang.String host,
java.lang.String port)
throws fr.esrf.Tango.DevFailed
fr.esrf.Tango.DevFailed| Method Detail |
|---|
protected void init(java.lang.String name)
throws fr.esrf.Tango.DevFailed
fr.esrf.Tango.DevFailedpublic void addErrorListener(IErrorListener l)
public void removeErrorListener(IErrorListener l)
public void addStatusListener(IStatusListener l)
addStatusListener adds a listener to status-events
addStatusListener in interface IDevicel - an IDeviceListener valueIDeviceListenerpublic void removeStatusListener(IStatusListener l)
removeStatusListener removes a status listener
removeStatusListener in interface IDevicel - an IDeviceListener valuepublic void addStateListener(IStateListener l)
addStateListener adds a listener to state-events
addStateListener in interface IDevicel - an IDeviceListener valuepublic void removeStateListener(IStateListener l)
removeStateListener removes a listener to a state-events
removeStateListener in interface IDevicel - an IDeviceListener valuepublic void addListener(IDeviceListener l)
addListener adds a listener to all device events
l - an IDeviceListener valuepublic void removeListener(IDeviceListener l)
removeListener removes a listener to this device.
l - an IDeviceListener valuepublic EventSupport getPropChanges()
public void refresh()
refresh sends out status and state events. This forces a
synchronous device state and status reading.
refresh in interface IRefresheepublic boolean isAlive()
isAlive checks to see if this device is reachable
boolean value which is true if the device is
reachable, false otherwiseConnection.ping()
public fr.esrf.TangoApi.CommandInfo[] getCommandList()
throws fr.esrf.Tango.DevFailed
getCommandList returns the list of commands known to this
device
DevCmdInfo[] value
fr.esrf.Tango.DevFailed - if an error occurs
public fr.esrf.TangoApi.CommandInfo getCommand(java.lang.String name)
throws fr.esrf.Tango.DevFailed
getCommand returns a CommandInfo corresponding to the
given name.
name - Command name
fr.esrf.Tango.DevFailed - in case of failure.
public fr.esrf.TangoApi.AttributeInfoEx[] getAttributeInfo(java.lang.String[] name)
throws fr.esrf.Tango.DevFailed
getAttributeInfo returns the attribute configs for the
attributes named in the parameter.
name - a String[] value containing the names of the
attributes we want the configs of.
AttributeConfig[] value
fr.esrf.Tango.DevFailed - if an error occurs
public fr.esrf.TangoApi.AttributeInfoEx getAttributeInfo(java.lang.String name)
throws fr.esrf.Tango.DevFailed
getAttributeInfo gets the attribute config of an attribute
getAttributeInfo in interface IDevicename - a String value containing the name of the
attribute we want the config of.
AttributeConfig value
fr.esrf.Tango.DevFailed - if an error occursgetAttributeInfo(String[] name)public java.lang.String getName()
getName returns the name of this device.
getName in interface IDeviceString value containing the name of the device.public java.lang.String getAlias()
getAlias returns the alias of this device.
getAlias in interface IDeviceString value containing the alias of the device.
protected void deviceError(java.lang.String s,
java.lang.Throwable t)
deviceError fires of an error event from this device
s - a String value containing an error message.t - a Throwable value containing the exception
which caused this error message to be called.public java.lang.String getState()
getState returns the state of the device as a string.
getState in interface IDeviceString value containing the states.for information on which states can bee
returned.public static java.lang.String toString(fr.esrf.Tango.DevState st)
public static fr.esrf.Tango.DevState getStateFromString(java.lang.String st)
public java.lang.String getStatus()
getStatus returns the status of the device. returns
UNKNOWN and sets an error if a DevFailed is thrown while obtaining the
status.
getStatus in interface IDeviceString value containing the status.
public final fr.esrf.TangoApi.DeviceAttribute readAttribute(java.lang.String name)
throws fr.esrf.Tango.DevFailed
readAttribute reads the value of an attribute. It is made
final to be a bit quicker.
name - a String value
DeviceAttribute value
fr.esrf.Tango.DevFailed - if an error occurspublic long getRefreshCount()
public int getIdlVersion()
public final fr.esrf.TangoApi.DeviceAttribute readAttributeFromDevice(java.lang.String name)
throws fr.esrf.Tango.DevFailed
readAttributeFromDevice reads the value of an attribute.
Force the reading from the tango device (ignore polling buffer).
name - a String value
DeviceAttribute value
fr.esrf.Tango.DevFailed - if an error occurs
public void writeAttribute(fr.esrf.TangoApi.DeviceAttribute a)
throws fr.esrf.Tango.DevFailed
writeAttribute writes an attribute.
a - a DeviceAttribute value to write.
fr.esrf.Tango.DevFailed - if an error occurs
public fr.esrf.TangoApi.DeviceData executeCommand(java.lang.String command,
fr.esrf.TangoApi.DeviceData argin)
throws fr.esrf.Tango.DevFailed
executeCommand
executeCommand in interface IDevicecommand - a String value containing the name of the
command, obtained by getCommandList();argin - a DeviceData value holding the in argument
DeviceData value containing the result
fr.esrf.Tango.DevFailed - if an error occurs
public void storeInfo(fr.esrf.TangoApi.AttributeInfoEx c)
throws fr.esrf.Tango.DevFailed
storeInfo
c - an AttributeInfo value to store
fr.esrf.Tango.DevFailed - if an error occurspublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean doesEvent()
public java.lang.String getVersion()
public DeviceProperty getProperty(java.lang.String propertyName)
public java.util.Map getPropertyMap()
public void storeProperty(java.lang.String propertyName)
propertyName - the name of the property to storepublic void refreshPropertyMap()
Device to refresh
its Map of properties (DeviceProperty).
public int getDevTimeout()
throws ConnectionException
ConnectionException
public void setDevTimeout(int tmout_ms)
throws ConnectionException
ConnectionExceptionpublic AtkEventListenerList getListenerList()
getListenerList in interface IDevicepublic boolean getInvertedOpenClose()
getInvertedOpenClose in interface IDevicepublic boolean getInvertedInsertExtract()
getInvertedInsertExtract in interface IDevicepublic boolean areDevPropertiesLoaded()
public void loadDevProperties()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||