public abstract class ALinkData extends java.lang.Object implements ILinkData
Here all instances of TINE links are stored, which means all single and
grouped access links. The connection is WRITE or READ,
depending on the access you defined in the
getLink(IEDeviceGroup, EAccess)
, getLink(IEDeviceGroup, EAccess, TDataType)
,
or getLinkGroup(IEDeviceGroup, EAccess, TDataType...)
methods.
This is an abstract class and can therefore be extended by a concrete class in a real project of a machine.
The TDataType
is constructed as a variable arguments. You can also
deliver non of these arguments.
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.util.Map<IEDeviceGroup,de.desy.tine.client.TLink>> |
_lstLink
This is the link array of TINE.
|
protected java.util.List<java.util.Map<IEDeviceGroup,java.util.Map<IEData,de.desy.tine.client.TLink>>> |
_lstLinkGroup
A list of map entries, where each map has a device which points to a
list of TINE links.
|
static java.lang.String |
CLAZZ
Class name.
|
TINE_MISSING_ADDRESS
Modifier | Constructor and Description |
---|---|
protected |
ALinkData(IEDeviceGroup[] devices_)
This is the protected constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelAllLinks(IEDeviceGroup[] devices_)
This will cancel all set links in the map.
|
void |
cancelLink(IEDeviceGroup devices_)
Will cancel the current device link.
|
void |
cancelLinkGroup(IEDeviceGroup devices_)
Will cancel the current device group of links from the list.
|
protected void |
createLink(IEDeviceGroup devices_,
EAccess access_,
java.lang.String fullTINEPath_,
de.desy.tine.dataUtils.TDataType dataType_)
Creates a new link.
|
protected void |
createLinkGroup(IEDeviceGroup devices_,
EAccess access_,
de.desy.tine.dataUtils.TDataType... dataTypes_)
Creates a new link.
|
protected void |
createLinkGroupCDI(IEDeviceGroup devices_,
EAccess access_,
java.lang.String property_)
Creates a new link.
|
protected void |
createLinkGroupMetaDataType(IEDeviceGroup devices_)
The first data component sends data to the server to retain
afterwards its information from it.
|
protected void |
createLinkGroupMetaValue(IEDeviceGroup devices_,
java.lang.String property_,
de.desy.tine.dataUtils.TDataType... dataTypes_)
Create the new link group, where each link has the access
READ
and send per link the common output data to the server in integer
format, i.e. |
protected void |
createLinkMetaValue(IEDeviceGroup devices_,
java.lang.String property_,
de.desy.tine.dataUtils.TDataType dataType_)
Creates a new link with access
READ . |
de.desy.tine.client.TLink |
getLink(IEDeviceGroup devices_,
EAccess access_)
Get the TINE link for the enumeration of devices and the access to it.
|
de.desy.tine.client.TLink |
getLink(IEDeviceGroup devices_,
EAccess access_,
de.desy.tine.dataUtils.TDataType dataType_)
Get the TINE link for the enumeration of devices and the access to it.
|
de.desy.tine.client.TLink |
getLink(IEDeviceGroup devices_,
EAccess access_,
de.desy.tine.dataUtils.TDataType dataType_,
boolean isUnsortedDevicenames_)
Get the TINE link for the enumeration of devices and the access to it.
|
java.util.Map<IEData,de.desy.tine.client.TLink> |
getLinkGroup(IEDeviceGroup devices_,
EAccess access_,
de.desy.tine.dataUtils.TDataType... dataTypes_)
This method decides which special call is made to create the TINE link
(if it doesn't exists before) and returns it as a group (here a map).
|
java.lang.String |
getRangeNumbers(IEDeviceGroup devices_,
boolean unsortDevices_)
This method will return from a range with CDI names to a range of the
corresponding CDI numbers.
|
java.lang.String |
getTINEAddress(IEDeviceGroup devices_)
Returns on the given device group enumeration the corresponding TINE
address including the host name.
|
java.lang.String |
getTINEAddress(IEDeviceGroup devices_,
EAccess access_)
Returns on the given device group enumeration the corresponding TINE
address including the host name.
|
java.lang.String |
getTINEAddress(IEDeviceGroup devices_,
EAccess access_,
boolean isHTMLStyled_)
Returns on the given device group enumeration the corresponding TINE
address including the host name.
|
boolean |
hasLink(IEDeviceGroup devices_,
EAccess access_)
Checks if the device group has already been initialized by this instance
or not.
|
boolean |
hasLinkGroup(IEDeviceGroup devices_,
EAccess access_)
Checks if the device group has already been initialized by this instance
or not.
|
void |
removeAllLinks(IEDeviceGroup[] devices_)
This will cancel all positive set links in the array and after that deleting
it (i.e.
|
void |
removeLink(IEDeviceGroup devices_)
Will remove the current device link from the list.
|
void |
removeLinkGroup(IEDeviceGroup devices_)
Will remove the current device group links from the list.
|
public static final java.lang.String CLAZZ
protected java.util.List<java.util.Map<IEDeviceGroup,de.desy.tine.client.TLink>> _lstLink
protected java.util.List<java.util.Map<IEDeviceGroup,java.util.Map<IEData,de.desy.tine.client.TLink>>> _lstLinkGroup
protected ALinkData(IEDeviceGroup[] devices_)
devices_
- Is the device group which I need from the concrete
project and which cannot be defined in this library.public final java.lang.String getTINEAddress(IEDeviceGroup devices_)
ILinkData
Returns on the given device group enumeration the corresponding TINE
address including the host name. The address is received by default from
a READ access: EAccess.READ
. Moreover the returned address string
is published with HTML flavored tags.
getTINEAddress
in interface ILinkData
devices_
- Device group enumeration.ILinkData.getTINEAddress(IEDeviceGroup, EAccess)
public final java.lang.String getTINEAddress(IEDeviceGroup devices_, EAccess access_)
ILinkData
Returns on the given device group enumeration the corresponding TINE address including the host name.
First it internally looks if the the device group only contains
one TINE link. If this is true it returns the corresponding address.
If a negative request is fetched then it looks if their exists a
group of TINE links. If this is true it returns from the
first fetched link the TINE address. If this also fails then the
content of the field ILinkData.TINE_MISSING_ADDRESS
is returned. If one of
the parameters is null
then a null
is returned.
Moreover the returned address string is published with HTML flavored tags.
getTINEAddress
in interface ILinkData
devices_
- Device group enumeration.access_
- TINE access enumeration.public final java.lang.String getTINEAddress(IEDeviceGroup devices_, EAccess access_, boolean isHTMLStyled_)
ILinkData
Returns on the given device group enumeration the corresponding TINE address including the host name.
First it internally looks if the the device group only contains
one TINE link. If this is true it returns the corresponding address.
If a negative request is fetched then it looks if their exists a
group of TINE links. If this is true it returns from the
first fetched link the TINE address. If this also fails then the
content of the field ILinkData.TINE_MISSING_ADDRESS
is returned. If one of
the parameters is null
then a null
is returned.
Furthermore the output depends on the last parameter. So, if this is set to true then the output will deliver HTML-stylish new line tags; if this is false it will deliver the normal carriage return tag.
getTINEAddress
in interface ILinkData
devices_
- Device group enumeration.access_
- TINE access enumeration.isHTMLStyled_
- HTML stylish flag.public final boolean hasLink(IEDeviceGroup devices_, EAccess access_)
ILinkData
public final de.desy.tine.client.TLink getLink(IEDeviceGroup devices_, EAccess access_) throws TineException
ILinkData
Get the TINE link for the enumeration of devices and the access to it. Currently there are read, write and read-write access allowed. Other access will throw an exception.
When the TINE link is created then all data elements, which are taken
from the IEDeviceGroup.getDataComponent()
, are sorted before
requesting its range.
getLink
in interface ILinkData
devices_
- Is the devices of the derivated enumeration ones.access_
- Is the access to the devices. It is of the TINE form
of de.desy.tine.definitons.TAccess
.TineException
- A TINE exception is thrown if the current link can
not be established.public final de.desy.tine.client.TLink getLink(IEDeviceGroup devices_, EAccess access_, de.desy.tine.dataUtils.TDataType dataType_) throws TineException
ILinkData
Get the TINE link for the enumeration of devices and the access to it. Currently there are read, write and read-write access allowed. Other access will throw an exception.
The extension of this method according to
ILinkData.getLink(IEDeviceGroup, EAccess)
is that
it will take the TINE data element, which also can possibly by
set in the constructor of the monitor, but it can also be null
.
When the TINE link is created then all data elements, which are taken
from the IEDeviceGroup.getDataComponent()
, are sorted before
requesting its range.
getLink
in interface ILinkData
devices_
- Is the devices of the derivated enumeration ones.access_
- Is the access to the devices. It is of the TINE form
of de.desy.tine.definitons.TAccess
.dataType_
- Is the data type of the TINE link, which can also be
null
.TineException
- A TINE exception is thrown if the current link can
not be established.public final de.desy.tine.client.TLink getLink(IEDeviceGroup devices_, EAccess access_, de.desy.tine.dataUtils.TDataType dataType_, boolean isUnsortedDevicenames_) throws TineException
ILinkData
Get the TINE link for the enumeration of devices and the access to it. Currently there are read, write and read-write access allowed. Other access will throw an exception.
The extension of this method according to
ILinkData.getLink(IEDeviceGroup, EAccess)
is that
it will take the TINE data element, which also can possibly by
set in the constructor of the monitor, but it can also be null
.
The boolean argument of unsortedDevicename_
allows the user
to sort the CDI device numbers, which are taken from
IEDeviceGroup.getDataComponent()
, in a sorted way by setting
this argument to false
. Otherwise it will created the
actual TINE link with the unsorted man as they are delivered by the
device group. For more information about the sorting of the device
numbers you should have a look at the method of
ILinkData.getRangeNumbers(IEDeviceGroup, boolean)
.
getLink
in interface ILinkData
devices_
- Is the devices of the derivated enumeration ones.access_
- Is the access to the devices. It is of the TINE form
of de.desy.tine.definitons.TAccess
.dataType_
- Is the data type of the TINE link, which can also be
null
.isUnsortedDevicenames_
- Allows the user to sort the device numbers
by introducing a false
to this argument. Otherwise it will
sort the device numbers and, perhaps, also transform it into a
range of device numbers.TineException
- A TINE exception is thrown if the current link can
not be established.protected final void createLink(IEDeviceGroup devices_, EAccess access_, java.lang.String fullTINEPath_, de.desy.tine.dataUtils.TDataType dataType_) throws TineException
devices_
- Is the device group enumeration.access_
- Is the access to the device name link.fullTINEPath_
- Is the TINE device name.dataType_
- Possibly all TINE data types.TineException
- A TINE exception is thrown if the current link
can not be established.protected final void createLinkMetaValue(IEDeviceGroup devices_, java.lang.String property_, de.desy.tine.dataUtils.TDataType dataType_) throws TineException
Creates a new link with accessREAD
. This link will send before
receiving data from it by writing out the input data value (is declared in
the TINE link definition as the input parameter) to the server
application. The send value depends on the delivered interface, where
only ONE should be defined for the data elements from the device.
Currently this method only requires the following interfaces:
IEDataMetaValue
, which sends a list of integer valuesIEDataMetaDataType
, which sends a list of TCompoundDataObject
.The TINE output value (is declared in the TINE link definition as the output parameter) also deliver on different interfaces which a data element can inherit. So, the device group and the first data element from are defined and declared in the following way:
IEDataReadStructureType
=> sends a tagged TINE structure via
the data output field of the link.IEDataReadCompounDataType
=> sends a the TINE compound data instances via
the data output field of the link.devices_
- Is the device group enumeration.property_
- Is the TINE property name.dataType_
- Possibly all TINE data types.TineException
- A TINE exception is thrown if the current link
can not be established.public final boolean hasLinkGroup(IEDeviceGroup devices_, EAccess access_)
ILinkData
hasLinkGroup
in interface ILinkData
devices_
- Is the device group on which the link(s) should exist.access_
- Is the access mode of the link.true
if the link already
exists or false
if not.public final java.util.Map<IEData,de.desy.tine.client.TLink> getLinkGroup(IEDeviceGroup devices_, EAccess access_, de.desy.tine.dataUtils.TDataType... dataTypes_) throws TineException
This method decides which special call is made to create the TINE link (if it doesn't exists before) and returns it as a group (here a map).
The following is done to divide the different group links:
createLinkGroupCDI(IEDeviceGroup, EAccess, String)
.IEDataMetaValue
and the access is only READ
it will call the protected method of
createLinkGroupMetaValue(IEDeviceGroup, String, TDataType...)
.
If the access is WRITE
an IllegalArgumentException
is
thrown.IEDataMetaDataType
and the access is only READ
it will call the method protected
method of createLinkGroupMetaDataType(IEDeviceGroup)
. If the
access is WRITE
an IllegalArgumentException
is thrown.createLinkGroup(IEDeviceGroup, EAccess, TDataType...)
.getLinkGroup
in interface ILinkData
devices_
- Is the devices of the derivated enumeration ones.access_
- Is the access to the device name. It is of the TINE form
of de.desy.tine.definitons.TAccess
.dataTypes_
- Possibly all TINE data types.TineException
- A TINE exception is thrown if the current link can
not be established.ILinkData.getLinkGroup(IEDeviceGroup, EAccess, TDataType...)
protected final void createLinkGroup(IEDeviceGroup devices_, EAccess access_, de.desy.tine.dataUtils.TDataType... dataTypes_) throws TineException
devices_
- Is the device group.access_
- Is the access to the device name link.dataTypes_
- Possibly all TINE data types.TineException
- A TINE exception is thrown if the current link
can not be established.protected final void createLinkGroupCDI(IEDeviceGroup devices_, EAccess access_, java.lang.String property_) throws TineException
devices_
- Is the device name.access_
- Is the access to the device name link.property_
- Is the property of the device context and server.TineException
- A TINE exception is thrown if the current link
can not be established.protected final void createLinkGroupMetaValue(IEDeviceGroup devices_, java.lang.String property_, de.desy.tine.dataUtils.TDataType... dataTypes_) throws TineException
READ
and send per link the common output data to the server in integer
format, i.e. the data elements from the device group is an instance of
IEDataMetaValue
.devices_
- Is the device group.property_
- Is the property of the device context and server.dataTypes_
- Possibly all TINE data types.TineException
- A TINE exception is thrown if the current link
can not be established.protected final void createLinkGroupMetaDataType(IEDeviceGroup devices_) throws TineException
The first data component sends data to the server to retain
afterwards its information from it. Here it is an interface of
IEDataMetaDataType
, i.e. it sends an array of the interface
TCompoundDataObject
's to the server before providing its
result.
The returned value depends of the concrete installed interface of the data elements from the device group:
TCompoundDataObject
-> interface of IEDataReadCompoundDataType
TTaggedStructure
-> interface of IEDataReadStructureType
devices_
- Is the device group.TineException
- A TINE exception is thrown if the current link
can not be established.public final void cancelLink(IEDeviceGroup devices_)
ILinkData
cancelLink
in interface ILinkData
devices_
- Is the devices of the derivated enumeration ones.public final void cancelLinkGroup(IEDeviceGroup devices_)
ILinkData
cancelLinkGroup
in interface ILinkData
devices_
- Is the devices of the derivated enumeration ones.public final void cancelAllLinks(IEDeviceGroup[] devices_)
ILinkData
cancelAllLinks
in interface ILinkData
devices_
- Is a collection of all devices which should be canceled.public final void removeLink(IEDeviceGroup devices_)
ILinkData
removeLink
in interface ILinkData
devices_
- Is the devices of the derivated enumeration ones.public final void removeLinkGroup(IEDeviceGroup devices_)
ILinkData
removeLinkGroup
in interface ILinkData
devices_
- Is the devices of the derivated enumeration ones.public final void removeAllLinks(IEDeviceGroup[] devices_)
ILinkData
null
).removeAllLinks
in interface ILinkData
devices_
- Is a collection of all devices which should be removed.public final java.lang.String getRangeNumbers(IEDeviceGroup devices_, boolean unsortDevices_)
ILinkData
This method will return from a range with CDI names to a range of the corresponding CDI numbers. All are enclosed with the number sign (#) and aligned with a - sign, if it fits a range.
For example, the range value, which is returned by the device group of HF104ESUANODE - HF104CAVSTEMPE2, will be returned as #1 - #17.
The argument of unsortedDevices_
permit the user to get all
CDI device numbers in an unsorted way, as they are delivered by the
device group of IEDeviceGroup.getDataComponent()
if it set to
true
.
If this argument is set to true
then
all data elements are converted to their CDI device numbers, each number
filled in the string value, separated by commas, without any
sorting, for example #3,#2,#6,#4,#5,#1.
If this argument is set to false
, then at first the list
of device numbers is sorted, and looked if their exists a difference
between two numbers which is greater then 1. Then all numbers will be
returned as a sorted list of device numbers, each separated with a
comma, for example #1,#2,#5,#6. If not it returns a range of the
device numbers from the first to the last one, separated both with a
hyphen, for example #1 - #6.
getRangeNumbers
in interface ILinkData
devices_
- Is the corresponding enumeration interface of a device
group.unsortDevices_
- Request if the user wants the CDI device names in
an unsorted manner as they are delivered or sorted.14-September-2016 18:23 Deutsches Elektronen-Synchrotron DESY in der Helmholtz-Gemeinschaft