|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.prosysopc.ua.MonitoredItemBase
com.prosysopc.ua.server.MonitoredItem
com.prosysopc.ua.server.MonitoredDataItem
public class MonitoredDataItem
| Nested Class Summary | |
|---|---|
protected class |
MonitoredDataItem.AggregateFilterConfiguration
|
| Field Summary | |
|---|---|
protected MonitoredDataItem.AggregateFilterConfiguration |
aggregateFilter
|
protected DataChangeListener |
dataChangeListener
|
| Fields inherited from class com.prosysopc.ua.server.MonitoredItem |
|---|
links, node, subscription |
| Fields inherited from class com.prosysopc.ua.MonitoredItemBase |
|---|
attributeId, clientHandle, dataEncoding, discardOldest, maxQueueSize, monitoredItemId, monitoringMode, nodeId, queueSize |
| Constructor Summary | |
|---|---|
MonitoredDataItem(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.builtintypes.UnsignedInteger nextMonitoredItemId,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.utils.NumericRange indexRange,
org.opcfoundation.ua.core.MonitoringMode monitoringMode)
|
|
| Method Summary | |
|---|---|
protected void |
addNewSample(org.opcfoundation.ua.builtintypes.DataValue value,
boolean mayReplaceLastSample)
|
protected org.opcfoundation.ua.builtintypes.DataValue |
applyIndexRange(org.opcfoundation.ua.builtintypes.DataValue value)
|
protected void |
assignEuRange(org.opcfoundation.ua.builtintypes.DataValue dataValue)
|
protected boolean |
checkDeadband(org.opcfoundation.ua.builtintypes.DataValue lastValue,
org.opcfoundation.ua.builtintypes.DataValue value,
org.opcfoundation.ua.core.DeadbandType deadbandType)
|
protected boolean |
checkDeadband(org.opcfoundation.ua.core.DeadbandType deadbandType,
Object lastValue,
Object value)
|
protected void |
clearQueue()
|
org.opcfoundation.ua.core.AggregateFilter |
getAggregateFilter()
|
protected MonitoredDataItem.AggregateFilterConfiguration |
getAggregateFilterConfiguration()
|
org.opcfoundation.ua.core.DataChangeFilter |
getDataChangeFilter()
|
org.opcfoundation.ua.core.DataChangeTrigger |
getDataChangeTrigger()
|
org.opcfoundation.ua.core.DeadbandType |
getDeadbandType()
DeadbandType defines how the getDeadbandValue() should be used. |
double |
getDeadbandValue()
Deadband defines the minimum change that is required for the monitored value before a data change notifications should be sent to the client. |
protected long |
getDefaultQueueSize()
|
org.opcfoundation.ua.core.Range |
getEuRange()
The range defined for the monitoredItem |
UaProperty |
getEuRangeProperty()
The property that defines the EuRange |
org.opcfoundation.ua.utils.NumericRange |
getIndexRange()
The range of array indexes to monitor with the monitored item. |
org.opcfoundation.ua.builtintypes.DataValue |
getLastValue()
|
protected org.opcfoundation.ua.builtintypes.DataValue |
getNextSample(boolean isTrigger)
|
protected org.opcfoundation.ua.builtintypes.DataValue |
getPrevValue()
|
protected BlockingDeque<org.opcfoundation.ua.builtintypes.DataValue> |
getQueue()
|
double |
getSamplingInterval()
The SamplingInterval. |
protected double |
getValueRange()
|
protected boolean |
hasAggregateFilter()
|
boolean |
hasMoreSamples()
|
protected boolean |
isAccessible()
|
protected boolean |
mayReplaceLastSample(org.opcfoundation.ua.builtintypes.DataValue value)
Check if the new sample belongs to the same samplingInterval as lastValue, i.e. timeDiff to prevValue is smaller than samplingInterval. |
void |
notifyDataChange(org.opcfoundation.ua.builtintypes.DataValue value)
Report a new data change to the item. |
void |
notifyDataChange(org.opcfoundation.ua.builtintypes.DataValue value,
boolean applyIndexRange)
Report a new data change to the item. |
void |
notifyResendData()
|
void |
onDataChange(UaNode sender,
org.opcfoundation.ua.builtintypes.DataValue prevValue,
org.opcfoundation.ua.builtintypes.DataValue value)
Deprecated. use notifyDataChange(DataValue) instead. |
protected void |
plugNodeListener()
|
protected void |
setDataChangeFilter(org.opcfoundation.ua.core.DataChangeFilter filter)
|
void |
setEuRange(org.opcfoundation.ua.core.Range range)
Define the EuRange corresponding to the monitored item. |
void |
setEuRangeProperty(UaProperty euRangeProperty)
The property that defines the EuRange for the monitoredItem. |
protected void |
setIndexRange(org.opcfoundation.ua.utils.NumericRange indexRange)
|
protected void |
setLastValue(org.opcfoundation.ua.builtintypes.DataValue value,
boolean updatePrevValue)
|
protected org.opcfoundation.ua.builtintypes.DataValue |
setOverflowBit(org.opcfoundation.ua.builtintypes.DataValue value)
|
void |
setSamplingInterval(double samplingInterval)
The interval that defines the fastest rate at which the MonitoredItem(s) should be accessed and evaluated. |
protected void |
startSampling()
|
protected void |
unPlugNodeListener()
|
protected void |
updateAccessible(Session session)
|
protected void |
updateFilter()
React to changes in the filter. |
protected void |
updateQueue()
Update the queue, when it's size has changed. |
| Methods inherited from class com.prosysopc.ua.server.MonitoredItem |
|---|
addLink, close, equals, getMaxQueueSize, getNode, getServiceContext, getSubscription, getTimestampsToReturn, hashCode, monitoringModeChanged, removeLink, setClientHandle, setFilter, setFilterResult, setMaxQueueSize, setNode, setServiceContext, setTimestampsToReturn |
| Methods inherited from class com.prosysopc.ua.MonitoredItemBase |
|---|
getAttributeId, getClientHandle, getDataEncoding, getFilter, getFilterResult, getMonitoredItemId, getMonitoringMode, getNodeId, getQueueSize, isDiscardOldest, setDiscardOldest, setMonitoredItemId, setMonitoringMode, setQueueSize, setQueueSize, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected MonitoredDataItem.AggregateFilterConfiguration aggregateFilter
protected DataChangeListener dataChangeListener
| Constructor Detail |
|---|
public MonitoredDataItem(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.builtintypes.UnsignedInteger nextMonitoredItemId,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.utils.NumericRange indexRange,
org.opcfoundation.ua.core.MonitoringMode monitoringMode)
subscription - nextMonitoredItemId - nodeId - attributeId - indexRange - monitoringMode - | Method Detail |
|---|
public org.opcfoundation.ua.core.AggregateFilter getAggregateFilter()
public org.opcfoundation.ua.core.DataChangeFilter getDataChangeFilter()
public org.opcfoundation.ua.core.DataChangeTrigger getDataChangeTrigger()
public org.opcfoundation.ua.core.DeadbandType getDeadbandType()
getDeadbandValue() should be used.
getDeadbandValue()public double getDeadbandValue()
The value is applied depending on the getDeadbandType():
getEuRange()
public org.opcfoundation.ua.core.Range getEuRange()
setEuRange(Range),
setEuRangeProperty(UaProperty)public UaProperty getEuRangeProperty()
setEuRange(Range),
setEuRangeProperty(UaProperty)public org.opcfoundation.ua.utils.NumericRange getIndexRange()
getIndexRange in class MonitoredItemBasepublic org.opcfoundation.ua.builtintypes.DataValue getLastValue()
public double getSamplingInterval()
MonitoredItemBase
getSamplingInterval in class MonitoredItemBasepublic boolean hasMoreSamples()
public void notifyDataChange(org.opcfoundation.ua.builtintypes.DataValue value)
This method is used for non-UaNode items from your application to report value changes in the monitored item. UaNode-based items will monitor the nodes automatically.
The value will be checked against the filter and deadband defined by the client to determine if
it really needs to be sent. getIndexRange() will be applied to the value, if defined.
value - the new value for the item.notifyDataChange(DataValue, boolean)
public void notifyDataChange(org.opcfoundation.ua.builtintypes.DataValue value,
boolean applyIndexRange)
This method is used for non-UaNode items from your application to report value changes in the monitored item. UaNode-based items will monitor the nodes automatically.
The value will be checked against the filter and deadband defined by the client to determine if
it really needs to be sent. You can define whether getIndexRange() should be applied
to the value.
value - the new value for the item.applyIndexRange - whether the getIndexRange() defined for the item should be
applied to the value. Default is true, but if you have already applied the range before
calling this method to notify the change, use false.notifyDataChange(DataValue)public void notifyResendData()
@Deprecated
public void onDataChange(UaNode sender,
org.opcfoundation.ua.builtintypes.DataValue prevValue,
org.opcfoundation.ua.builtintypes.DataValue value)
notifyDataChange(DataValue) instead.
This method is used for non-UaNode items from your application to report value changes in the monitored item. UaNode-based items will monitor the nodes automatically.
sender - not usedprevValue - not usedvalue - the new value for the item.public void setEuRange(org.opcfoundation.ua.core.Range range)
You can define the range for each item when they are created, in
NodeManager.afterCreateMonitoredDataItem(ServiceContext, Subscription, MonitoredDataItem)
or
NodeManagerListener.onAfterCreateMonitoredDataItem(ServiceContext, Subscription, MonitoredDataItem)
.
If the monitoredItem is linked to an UaVariable (in MonitoredItem.getNode()), the range is looked
among the properties of the variable. The property is then assigned to RangeProperty (with
setEuRangeProperty(UaProperty).
Instead of Range you may also define RangeProperty, if it is not assigned automatically.
range - the range to set setEuRangeProperty(UaProperty)public void setEuRangeProperty(UaProperty euRangeProperty)
euRangeProperty - the euRangeProperty to setsetEuRange(Range)public void setSamplingInterval(double samplingInterval)
The value 0 indicates that the Server should use the fastest practical rate.
The value -1 indicates that the default sampling interval defined by the publishing rate of the Subscription is used.
The Server uses this parameter to assign the MonitoredItems to a sampling interval that it supports.
The value can be modified at NodeManager#afterCreateMonitoredDataItem() or
NodeManagerListener#onAfterCreateMonitoredDataItem() - and the updated value is
returned as a revised value back to the client.
samplingInterval - the interval in milliseconds
protected void addNewSample(org.opcfoundation.ua.builtintypes.DataValue value,
boolean mayReplaceLastSample)
value - mayReplaceLastSample - protected org.opcfoundation.ua.builtintypes.DataValue applyIndexRange(org.opcfoundation.ua.builtintypes.DataValue value)
protected void assignEuRange(org.opcfoundation.ua.builtintypes.DataValue dataValue)
dataValue -
protected boolean checkDeadband(org.opcfoundation.ua.builtintypes.DataValue lastValue,
org.opcfoundation.ua.builtintypes.DataValue value,
org.opcfoundation.ua.core.DeadbandType deadbandType)
protected boolean checkDeadband(org.opcfoundation.ua.core.DeadbandType deadbandType,
Object lastValue,
Object value)
protected void clearQueue()
protected MonitoredDataItem.AggregateFilterConfiguration getAggregateFilterConfiguration()
protected long getDefaultQueueSize()
getDefaultQueueSize in class MonitoredItemBaseprotected org.opcfoundation.ua.builtintypes.DataValue getNextSample(boolean isTrigger)
protected org.opcfoundation.ua.builtintypes.DataValue getPrevValue()
protected BlockingDeque<org.opcfoundation.ua.builtintypes.DataValue> getQueue()
protected double getValueRange()
protected boolean hasAggregateFilter()
protected boolean isAccessible()
protected boolean mayReplaceLastSample(org.opcfoundation.ua.builtintypes.DataValue value)
value -
protected void plugNodeListener()
plugNodeListener in class MonitoredItem
protected void setDataChangeFilter(org.opcfoundation.ua.core.DataChangeFilter filter)
throws ServiceException
filter -
StatusException
ServiceExceptionprotected void setIndexRange(org.opcfoundation.ua.utils.NumericRange indexRange)
indexRange -
protected void setLastValue(org.opcfoundation.ua.builtintypes.DataValue value,
boolean updatePrevValue)
value - updatePrevValue - protected org.opcfoundation.ua.builtintypes.DataValue setOverflowBit(org.opcfoundation.ua.builtintypes.DataValue value)
value -
protected void startSampling()
protected void unPlugNodeListener()
unPlugNodeListener in class MonitoredItemprotected void updateAccessible(Session session)
protected void updateFilter()
MonitoredItemBase
updateFilter in class MonitoredItemBaseprotected void updateQueue()
updateQueue in class MonitoredItemBase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||