Package org.scictrl.csshell.epics.server
Class ValueLinks
java.lang.Object
org.scictrl.csshell.epics.server.ValueLinks
ValueLinks class.
- Author:
- igor@scictrl.com
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionValueLinks
(String name, String[] linkNames, PropertyChangeListener listener, String propertyType) Creates new link handler.ValueLinks
(String name, String linkName, PropertyChangeListener listener, String propertyType) Creates new link handler.ValueLinks
(String name, String context, String[] linkNames, PropertyChangeListener listener, String propertyType) Creates new link handler.ValueLinks
(String name, String context, String linkName, PropertyChangeListener listener, String propertyType) Creates new link handler. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Activates links to database records or remote objects.consume()
Receives copy of array with received values.boolean
consumeAsBooleanAnd.double[]
consumeAsDoubles.long
consumeAsLong.long[]
consumeAsLongs.void
Copy meta data from this link representation to the provided record reference.void
copyMetaData
(Record r, int link) Copy meta data from this link representation indicated by index to the provided record reference.void
deactivate.protected void
fireUpdate.gov.aps.jca.dbr.Severity
Getter for the fieldlastSeverity
.gov.aps.jca.dbr.Status
Getter for the fieldlastStatus
.String[]
Getter for the fieldlinkNames
.getMetaData
(int link) getMetaData.getName()
Returns the name of this links object.String[]
getNotConnected.getValue()
getValue.boolean
Returnstrue
if after consume was called and no new values were delivered.boolean
Returnstrue
if some of the connection failed.boolean
isLastSeverityHigh.boolean
isLastSeverityInvalid.boolean
isReady()
Returntrue
when all values from all links has been received and there is nonull
in array of values.void
printDebug
(Appendable sb) printDebug.void
resetConsumedFlag.void
setValue.void
setValueToAll
(double[] value) setValueToAll.void
setValueToAll
(Object value) setValueToAll.void
setValueToAll
(Object value, boolean[] select) setValueToAll.toString()
-
Field Details
-
SUMMARY
ConstantSUMMARY="Summary"
- See Also:
-
-
Constructor Details
-
ValueLinks
public ValueLinks(String name, String linkName, PropertyChangeListener listener, String propertyType) Creates new link handler. Name is used as a context.- Parameters:
name
- this name is used as identifier, so if several link handlers are used, they can be distinguished, for example as inAbstractApplication
.linkName
- name of PV links to be established by this handler.listener
- update listenerpropertyType
- how to listen to links,c an beRecord.PROPERTY_VALUE
orRecord.PROPERTY_ALARM
-
ValueLinks
public ValueLinks(String name, String context, String linkName, PropertyChangeListener listener, String propertyType) Creates new link handler.- Parameters:
name
- this name is used as identifier, so if several link handlers are used, they can be distinguished, for example as inAbstractApplication
.context
- a context to the link, this is used in logging to distinguish who is using this link. ifnull
then name is used.linkName
- name of PV links to be established by this handler.listener
- update listenerpropertyType
- how to listen to links,c an beRecord.PROPERTY_VALUE
orRecord.PROPERTY_ALARM
-
ValueLinks
public ValueLinks(String name, String[] linkNames, PropertyChangeListener listener, String propertyType) Creates new link handler. Name is used as a context.- Parameters:
name
- this name is used as identifier, so if several link handlers are used, they can be distinguished, for example as inAbstractApplication
.linkNames
- name of PV links to be established by this handler.listener
- update listenerpropertyType
- how to listen to links,c an beRecord.PROPERTY_VALUE
orRecord.PROPERTY_ALARM
-
ValueLinks
public ValueLinks(String name, String context, String[] linkNames, PropertyChangeListener listener, String propertyType) Creates new link handler.- Parameters:
name
- this name is used as identifier, so if several link handlers are used, they can be distinguished, for example as inAbstractApplication
.context
- a context to the link, this is used in logging to distinguish who is using this link. Can benull
.linkNames
- name of PV links to be established by this handler.listener
- update listenerpropertyType
- how to listen to links,c an beRecord.PROPERTY_VALUE
orRecord.PROPERTY_ALARM
-
-
Method Details
-
getName
Returns the name of this links object.- Returns:
- the name of this links object
-
activate
Activates links to database records or remote objects. But be called from activate method from Record or Application.- Parameters:
db
- aDatabase
object
-
deactivate
public void deactivate()deactivate.
-
consume
Receives copy of array with received values. Values in array are in same order as link names. Resets consumed flag to true.- Returns:
- copy of received values up to this point
-
consumeAsDoubles
public double[] consumeAsDoubles()consumeAsDoubles.
- Returns:
- an array of
invalid reference
double
-
consumeAsLongs
public long[] consumeAsLongs()consumeAsLongs.
- Returns:
- an array of
invalid reference
long
-
consumeAsLong
public long consumeAsLong()consumeAsLong.
- Returns:
- a long
-
consumeAsBooleanAnd
public boolean consumeAsBooleanAnd()consumeAsBooleanAnd.
- Returns:
- a boolean
-
getLastSeverity
public gov.aps.jca.dbr.Severity getLastSeverity()Getter for the field
lastSeverity
.- Returns:
- a
Severity
object
-
isLastSeverityInvalid
public boolean isLastSeverityInvalid()isLastSeverityInvalid.
- Returns:
- a boolean
-
isLastSeverityHigh
public boolean isLastSeverityHigh()isLastSeverityHigh.
- Returns:
- a boolean
-
getLastStatus
public gov.aps.jca.dbr.Status getLastStatus()Getter for the field
lastStatus
.- Returns:
- a
Status
object
-
isConsumed
public boolean isConsumed()Returnstrue
if after consume was called and no new values were delivered.- Returns:
true
if after consume was called and no new values were delivered
-
resetConsumedFlag
public void resetConsumedFlag()resetConsumedFlag.
-
isReady
public boolean isReady()Returntrue
when all values from all links has been received and there is nonull
in array of values.- Returns:
true
when there is no morenull
among values
-
getNotConnected
getNotConnected.
- Returns:
- an array of
String
objects
-
isInvalid
public boolean isInvalid()Returnstrue
if some of the connection failed.- Returns:
true
if some of the connection failed
-
printDebug
printDebug.
- Parameters:
sb
- aAppendable
object- Throws:
IOException
- if any.
-
fireUpdate
protected void fireUpdate()fireUpdate.
-
copyMetaData
Copy meta data from this link representation to the provided record reference. If there is more than one link, first link is used.- Parameters:
r
- the Record object for metadata to be copied to
-
copyMetaData
Copy meta data from this link representation indicated by index to the provided record reference.- Parameters:
r
- the Record object for metadata to be copied tolink
- the index of link to provide the data for copy
-
getMetaData
getMetaData.
- Parameters:
link
- a int- Returns:
- a
MetaData
object
-
setValue
setValue.
-
setValueToAll
setValueToAll.
- Parameters:
value
- an array ofinvalid reference
double
- Throws:
Exception
- if any.
-
setValueToAll
setValueToAll.
-
setValueToAll
setValueToAll.
-
getValue
getValue.
- Returns:
- an array of
ValueLinks.ValueHolder
objects - Throws:
Exception
- if any.
-
getLinkNames
Getter for the field
linkNames
.- Returns:
- an array of
String
objects
-
toString
-