public abstract class ACDIDevices extends java.lang.Object implements ICDIDevice
This class represents all parameters of the corresponding CDI server or
the middle layer DB server. On a CDI server the
represented parameters can include the hardware address on SEDAC devices (i.e.
the crate and sub-address), the precision of the returned numerical device
(others then numerical devices are not sufficient for that), the conversion
factor for receiving or sending data. A difference is for the interval ranges
and units, which depends on the current data element instance. When the data
element implements the interface of IEDataPreference
then the interval
ranges and units are taken from the special DB middle layer server instead of
the CDI one.
Note that for the CDI servers their exists a special meaning of the property name, which are predefined by the common CDI device servers. For example the property name of RECV or RECV.CLBR are predefined by the CDI device server and represents the read back value, the last by calculating the resulting value with a predefined expression.
ICDIDevice.EApplicationModel
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLAZZ
Class name.
|
LOWER_LIMIT_REQUEST_FOR_TIMEOUT, UPPER_LIMIT_REQUEST_FOR_TIMEOUT
Modifier | Constructor and Description |
---|---|
protected |
ACDIDevices(IECDIDevice device_,
java.lang.String[] tineAddresses_)
Constructor of this class.
|
protected |
ACDIDevices(java.util.Map<java.lang.String,java.util.SortedMap<java.lang.String,IEData>> mapAppDevices_,
java.lang.String[] tineAddresses_)
Constructor of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
checkEnumElements()
Deprecated.
|
void |
checkEnumElements(ICDIDevice.EApplicationModel model_)
All enumeration elements in the delivered collection of the
constructor will be checked if they exists for the corresponding CDI device
server element in the table.
|
void |
checkEnumElements(ICDIDevice.EApplicationModel model_,
java.lang.String tineAddress_)
All enumeration elements in the delivered collection of the
constructor will be checked if they exists the corresponding CDI device
server element in the table.
|
void |
checkEnumElements(ICDIDevice.EApplicationModel model_,
java.lang.String tineAddress_,
boolean checkEverytime_,
boolean initAllDevices_)
All enumeration elements in the delivered collection of the
constructor will be checked if they exists for the corresponding CDI device
server element in the table.
|
void |
checkEnumElements(java.lang.String tineAddress_)
Deprecated.
|
void |
checkEnumElements(java.lang.String tineAddress_,
boolean checkEverytime_,
boolean initAllDevices_)
Deprecated.
|
java.lang.String |
fetchDevice(java.lang.String tineAddress_,
int deviceNumber_)
Fetches the current device by its current CDI number.
|
java.util.Collection<java.lang.String> |
fetchDevices(java.lang.String tineAddress_)
Fetches all device names and returns them as a collection.
|
int |
fetchNumber(java.lang.String tineAddress_,
java.lang.String deviceName_)
Fetches the current device by its current CDI name and returns its number.
|
int |
fetchNumberOfDevices()
Returns the number of all devices.
|
void |
getDevices(java.lang.String[] prefixTINEAddresses_,
boolean initAllDevices_)
Deprecated.
|
IExecute |
getExec(IEExpectList exert_)
Deprecated.
|
int |
getTINETimeout()
Returns the time out limit for requesting data from a TINE server.
|
void |
refreshDevices(boolean initAllDevices_,
java.lang.String... prefixTINEAddresses_)
Deprecated.
|
void |
refreshDevices(ICDIDevice.EApplicationModel model_,
boolean initAllDevices_,
java.lang.String... prefixTINEAddresses_)
Refresh all meta information of all devices by a given TINE context
and server (should be named in a TINE manner, i.e.
|
void |
refreshDevices(java.lang.String[] prefixTINEAddresses_,
boolean initAllDevices_)
Deprecated.
|
void |
setTINETimeout(int timeout)
Allows to set for requesting data from a TINE server a time out.
|
protected ACDIDevices(IECDIDevice device_, java.lang.String[] tineAddresses_)
RuntimeException
can be thrown by
this constructor if an error occurred.device_
- This enumeration interfaces includes all CDI devices
which are registered to this instance.protected ACDIDevices(java.util.Map<java.lang.String,java.util.SortedMap<java.lang.String,IEData>> mapAppDevices_, java.lang.String[] tineAddresses_)
RuntimeException
can be thrown by
this constructor if an error occurred.mapAppDevices_
- Is the collection of devices which are defined in
a CDI table. The first string element includes a list of the TINE
addresses, where each TINE address has a map of the device name -
data enumeration element type, which represents the device name.tineAddresses_
- This is an array of all TINE preliminary address
strings.public final void setTINETimeout(int timeout)
ICDIDevice
TineException
is thrown
with the error code 45 (link timeout).setTINETimeout
in interface ICDIDevice
timeout
- Time out in milliseconds should be between 1000 up to
10000 ms. If it exceeds one of these limit is forced to the
corresponding limit.public final int getTINETimeout()
ICDIDevice
getTINETimeout
in interface ICDIDevice
@Deprecated public final void checkEnumElements() throws TineException, EnumerationNotFoundException
ICDIDevice
ICDIDevice.checkEnumElements(EApplicationModel)
instead.
By default checks the server application model.
checkEnumElements
in interface ICDIDevice
TineException
- Throws a TineException if the TINE
connection failed for any reasons.EnumerationNotFoundException
- If one or more elements does not
exits or are misspelled.ICDIDevice.checkEnumElements(EApplicationModel)
public final void checkEnumElements(ICDIDevice.EApplicationModel model_) throws TineException, EnumerationNotFoundException
ICDIDevice
All enumeration elements in the delivered collection of the
constructor will be checked if they exists for the corresponding CDI device
server element in the table. If not an EnumerationNotFoundException
will be thrown. It will get all elements from CDI and set them to the
corresponding device name.
checkEnumElements
in interface ICDIDevice
model_
- Devides the two possible application model for initializing
the application. Internally this method will call the refresh method
which reflects via a synchronous TINE call the meta information
from the server, which depends on the application model (for example
the client would be interested in the unit of a value where the
server would be interested in the range of a value).TineException
- Throws a TineException if the TINE
connection failed for any reasons.EnumerationNotFoundException
- If one or more elements does not
exits or are misspelled.@Deprecated public final void checkEnumElements(java.lang.String tineAddress_) throws TineException, EnumerationNotFoundException
ICDIDevice
ICDIDevice.checkEnumElements(EApplicationModel, String)
instead.
By default checks the server application model.
checkEnumElements
in interface ICDIDevice
tineAddress_
- Preliminary TINE address (i.e. the TINE context and
server name) allows to specify the
CDI server name to be checked. This can also be null, which means
to check all elements of all CDI servers. If this string value
is set and the corresponding CDI server doesn't exist then a
IllegalArgumentException
is thrown.TineException
- Throws a TineException if the TINE
connection failed for any reasons.EnumerationNotFoundException
- If one or more elements does not
exits or are misspelled.ICDIDevice.checkEnumElements(EApplicationModel, String)
public final void checkEnumElements(ICDIDevice.EApplicationModel model_, java.lang.String tineAddress_) throws TineException, EnumerationNotFoundException
ICDIDevice
All enumeration elements in the delivered collection of the
constructor will be checked if they exists the corresponding CDI device
server element in the table. If not an EnumerationNotFoundException
will be thrown. It will get all elements from CDI and set them to the
corresponding device name.
checkEnumElements
in interface ICDIDevice
model_
- Devides the two possible application model for initializing
the application. Internally this method will call the refresh method
which reflects via a synchronous TINE call the meta information
from the server, which depends on the application model (for example
the client would be interested in the unit of a value where the
server would be interested in the range of a value).tineAddress_
- Preliminary TINE address (i.e. the TINE context and
server name) allows to specify the
CDI server name to be checked. This can also be null, which means
to check all elements of all CDI servers. If this string value
is set and the corresponding CDI server doesn't exist then a
IllegalArgumentException
is thrown.TineException
- Throws a TineException if the TINE
connection failed for any reasons.EnumerationNotFoundException
- If one or more elements does not
exits or are misspelled.@Deprecated public final void checkEnumElements(java.lang.String tineAddress_, boolean checkEverytime_, boolean initAllDevices_) throws TineException, EnumerationNotFoundException
ICDIDevice
ICDIDevice.checkEnumElements(EApplicationModel, String, boolean, boolean)
instead.checkEnumElements
in interface ICDIDevice
tineAddress_
- Preliminary TINE address (i.e. the TINE context and
server name) allows to specify the
CDI server name to be checked. This can also be null, which means
to check all elements of all CDI servers. If this string value
is set and the corresponding CDI server doesn't exist then a
IllegalArgumentException
is thrown.checkEverytime_
- Checks if this method executes every time you call
this method. If you use true independent of
every other field, it will try to get all device
information over TINE, otherwise it will do nothing.initAllDevices_
- Checks if all device elements should be initialized
(true) or not (false). Is this boolean value
false
then only the device names and numbers are initialize. If
it set to true
will initialize all device elements by getting the device
names, device numbers, units, precision, minimum and max values (range),
the addresses (crate and sub-address), and the description.TineException
- Throws a TineException if the TINE
connection failed for any reasons.EnumerationNotFoundException
- If one or more elements does not
exits or are misspelled.ICDIDevice.checkEnumElements(EApplicationModel, String, boolean, boolean)
public final void checkEnumElements(ICDIDevice.EApplicationModel model_, java.lang.String tineAddress_, boolean checkEverytime_, boolean initAllDevices_) throws TineException, EnumerationNotFoundException
ICDIDevice
EnumerationNotFoundException
is thrown.checkEnumElements
in interface ICDIDevice
model_
- Devides the two possible application model for initializing
the application. Internally this method will call the refresh method
which reflects via a synchronous TINE call the meta information
from the server, which depends on the application model (for example
the client would be interested in the unit of a value where the
server would be interested in the range of a value).tineAddress_
- Preliminary TINE address (i.e. the TINE context and
server name) allows to specify the
CDI server name to be checked. This can also be null, which means
to check all elements of all CDI servers. If this string value
is set and the corresponding CDI server doesn't exist then a
IllegalArgumentException
is thrown.checkEverytime_
- Checks if this method executes every time you call
this method. If you use true independent of
every other field, it will try to get all device
information over TINE, otherwise it will do nothing.initAllDevices_
- Checks if all device elements should be initialized
(true) or not (false). Is this boolean value is
false
then only the device names and numbers are initialize. When
it is true
it will initialize all device elements by getting the device
names, device numbers, units, precision, minimum and max values (range),
the addresses (crate and sub-address), and the description.TineException
- Throws a TineException if the TINE
connection failed for any reasons.EnumerationNotFoundException
- If one or more elements does not
exits or are misspelled.public final java.lang.String fetchDevice(java.lang.String tineAddress_, int deviceNumber_)
ICDIDevice
fetchDevice
in interface ICDIDevice
tineAddress_
- Is the preliminary TINE address string.deviceNumber_
- Is the current CDI device number.null
value can also be returned.public final java.util.Collection<java.lang.String> fetchDevices(java.lang.String tineAddress_)
ICDIDevice
fetchDevices
in interface ICDIDevice
tineAddress_
- The preliminary TINE address context is needed to
get all devices.public final int fetchNumber(java.lang.String tineAddress_, java.lang.String deviceName_)
ICDIDevice
fetchNumber
in interface ICDIDevice
tineAddress_
- Is the preliminary TINE address string.deviceName_
- Is the current CDI device name.public final int fetchNumberOfDevices()
ICDIDevice
fetchNumberOfDevices
in interface ICDIDevice
@Deprecated public IExecute getExec(IEExpectList exert_)
ICDIDevice
getExec
in interface ICDIDevice
exert_
- Is the exerted value.@Deprecated public final void getDevices(java.lang.String[] prefixTINEAddresses_, boolean initAllDevices_) throws TineException
refreshDevices(boolean, String...)
.prefixTINEAddresses_
- This is an array list of TINE
CDI servers, which this method will get the required information from.initAllDevices_
- Checks if all device elements should be initialized
(true) or not (false). Is this boolean value
false
then only the device names and numbers are initialize. If
it set to true
will initialize all device elements by getting the device
names, device numbers, units, precision, minimum and max values (range),
the addresses (crate and sub-address), and the description.TineException
- A TineException
is thrown if an error
occurred on the TINE context (i.e. it is null
), the current link
is invalid or returns no result. Moreover there are also other
runtime exception which can be thrown if the creating of the list
fails.#refreshDevices(boolean, String...)}
@Deprecated public final void refreshDevices(java.lang.String[] prefixTINEAddresses_, boolean initAllDevices_) throws TineException
refreshDevices(boolean, String...)
.prefixTINEAddresses_
- This is an array list of TINE
CDI servers, which this method will get the required information from.initAllDevices_
- Checks if all device elements should be initialized
(true) or not (false). Is this boolean value
false
then only the device names and numbers are initialize. If
it set to true
will initialize all device elements by getting the device
names, device numbers, units, precision, minimum and max values (range),
the addresses (crate and sub-address), and the description.TineException
- A TineException
is thrown if an error
occurred on the TINE context (i.e. it is null
), the current link
is invalid or returns no result. Moreover there are also other
runtime exception which can be thrown if the creating of the list
fails.#refreshDevices(boolean, String...)}
@Deprecated public final void refreshDevices(boolean initAllDevices_, java.lang.String... prefixTINEAddresses_) throws TineException
refreshDevicesOnServer(boolean, String...)
.initAllDevices_
- Checks if all device elements should be initialized
(true) or not (false). Is this boolean value
false
then only the device names and numbers are initialize. If
it set to true
will initialize all device elements by getting the device
names, device numbers, units, precision, minimum and max values (range),
the addresses (crate and sub-address), and the description.prefixTINEAddresses_
- This is an array list of TINE
CDI servers, which this method will get the required information from.TineException
- A TineException
is thrown if an error
occurred on the TINE context (i.e. it is null
), the current link
is invalid or returns no result. Moreover there are also other
runtime exception which can be thrown if the creating of the list
fails.refreshDevicesOnServer(boolean, String...)
public final void refreshDevices(ICDIDevice.EApplicationModel model_, boolean initAllDevices_, java.lang.String... prefixTINEAddresses_) throws TineException
Refresh all meta information of all devices by a given TINE context and server (should be named in a TINE manner, i.e. separated by slashes) for a middle layer server.
If an error occurred this method will throw aTineException
. By
the context of all meta information I also mean that this function will
also refresh meta information about the units and precision and set it in
the require enumeration data.
This connection is done via a TCP and not UDP.
model_
- Depending on the current application model different meta
values are read out from the CDI server. There currently exists two
distinguish enumerations for updating and refreshing the meta
information for all known TINE device names: one is for refreshing
the server and the other is for client environment.
The server refreshing enumeration provides
numbers reflecting the device names
(refreshNumbersReflectingDeviceNames(String...)
)interval ranges
(refreshIntervalRanges(String...)
)SEDAC addresses
(refreshAddresses(String...)
)description, send and receive factor, and multiplexer channel
(refreshDescriptions(String...)
).interval ranges
(refreshIntervalRanges(String...)
)The client refreshing enumeration provides
numbers reflecting the device names
(refreshNumbersReflectingDeviceNames(String...)
)units
(refreshUnits(String...)
)precision
(refreshPrecisions(String...)
)SEDAC addresses
(refreshAddresses(String...)
)description, send and receive factor, and multiplexer channel
(refreshDescriptions(String...)
)initAllDevices_
- Checks if all device elements should be initialized
(true) or not (false). Is this boolean value
false
then only the device names and numbers are initialize. If
it set to true
will initialize all device elements by getting the device
names, device numbers, units, precision, minimum and max values (range),
the addresses (crate and sub-address), and the description.prefixTINEAddresses_
- This is an array list of TINE
CDI servers, which this method will get the required information from.TineException
- A TineException
is thrown if an error
occurred on the TINE context (i.e. it is null
), the current link
is invalid or returns no result. Moreover there are also other
runtime exception which can be thrown if the creating of the list
fails.refreshDevicesOnClient(boolean, String...)
14-September-2016 18:23 Deutsches Elektronen-Synchrotron DESY in der Helmholtz-Gemeinschaft