public abstract class AbstractExecutableTag extends AbstractGatewayTag implements TagPropertyValue, AlarmObserver
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractExecutableTag.AlarmConfigHarness
This is a bit of a trick to deal with how we have to initialize tags in a memory efficient manner.
|
protected class |
AbstractExecutableTag.ArrayAlarmEvaluator |
protected class |
AbstractExecutableTag.ArrayEvaluator<T> |
class |
AbstractExecutableTag.ArrayHistorizer |
protected static class |
AbstractExecutableTag.CustomPermissions |
protected static interface |
AbstractExecutableTag.ExecTagHistoryEvaluator |
protected class |
AbstractExecutableTag.Historizer |
protected class |
AbstractExecutableTag.InternalTagScriptEvaluator |
protected class |
AbstractExecutableTag.ModifiedValueAsyncWriteRequest<T> |
protected static class |
AbstractExecutableTag.ReadOnlyPermissions |
protected static class |
AbstractExecutableTag.RWPermissions |
protected class |
AbstractExecutableTag.ScriptConfigHarness |
protected class |
AbstractExecutableTag.TagHistoryHarness |
protected static class |
AbstractExecutableTag.TagPermissions |
TagPropertyValue.HashKey
Modifier and Type | Field and Description |
---|---|
protected AlarmEvaluator |
alarmEval |
protected Deadband |
deadband |
protected AbstractExecutableTag.TagHistoryHarness |
historizer |
protected AbstractExecutableTag.TagPermissions |
permissions |
protected ValueScaler |
scaler |
protected static LoggerEx |
TAG_HISTORY_LOGGER |
RUNTIME_PROPERTIES, tagChangeListener
Modifier | Constructor and Description |
---|---|
protected |
AbstractExecutableTag() |
protected |
AbstractExecutableTag(AbstractExecutableTag copy) |
Modifier and Type | Method and Description |
---|---|
void |
alarmTransitioned(AlarmEvent event,
AlarmStateTransition transition) |
protected TagValue |
coerceAndCheck(TagValue incoming)
Converts the incoming value to the tag's data type.
|
void |
configure(Tag def)
Provides the tag with it's configuration so that it can set up anything it needs.
|
void |
evaluate()
Evaluates the tag for any outstanding changes.
|
protected void |
evaluateAlerts() |
void |
evaluateHistory(TagEvaluationContext context) |
protected void |
fireEvent(java.lang.String id,
java.lang.Object... params) |
AccessRightsType |
getAccessRights()
Gets the type of access rights for this tag
|
TagValue |
getAttribute(TagProp prop)
Subclasses can override this to provide more efficient or complete implementations.
|
protected TagEvaluationContext |
getContext() |
DataType |
getDataType()
Returns the datatype of this tag's value property
|
DataTypeClass |
getDataTypeClass() |
java.util.List<TagPath> |
getHistoryPaths() |
EntityId |
getId()
*****
Implementation of TagPropertyValue for the VALUE property in order to reduce memory allocation when value is
changing all of the time.
|
java.lang.String |
getName()
Returns the name of the tag.
|
TagPermissionsModel |
getPermissionModel()
Returns this tags permission model, if any
|
TagProp |
getProperty() |
protected TagValue |
getRuntimeProperty(TagProp prop) |
protected ValueScaler |
getScaler() |
TagValue |
getValue()
Returns the value in qualified form- along with quality and timestamp.
|
boolean |
hasHintConfig() |
boolean |
hasHintPersistent() |
void |
initialize(TagInitializationContext context)
ExecutableTag
|
protected void |
internalEvaluate()
Executes the tag, updating the current value if necessary.
|
protected void |
internalPropertyWrite(AsyncWriteRequest<TagPath> value) |
protected void |
internalUninitialize(TagUninitializeContext context) |
protected void |
internalUpdateCurrentValue(TagValue value) |
protected void |
internalWrite(TagWriteContext context,
AsyncWriteRequest<TagPath> value)
Passes value to subclass for evaluation, if supported.
|
boolean |
isAlarmingSupported()
All executable tags currently support alarming.
|
boolean |
isEnabled()
Returns the enabled bit for this tag
|
boolean |
isEvaluated() |
protected boolean |
isInitialized() |
boolean |
isWritable()
Returns whether or not a tag can be written to.
|
void |
resetEvaluation()
Resets the isEvaluated flag, along with the various value changed flags.
|
void |
sampleDiagnostics(DiagnosticsSample sample)
Provides the sample upon which the object can set diagnostics information.
|
void |
setAttribute(TagProp property,
TagValue value)
This function should only be called when updates are received from redundancy, or we don't want the value to propagate back to redundancy.
|
protected void |
setCurrentValue(TagValue value)
Sets the current value and any relevant change flags.
|
void |
setDataType(DataType value) |
protected void |
setIsEvaluated(boolean value) |
void |
setTagError(java.lang.String message,
java.lang.Exception cause) |
protected void |
setValue(TagValue value)
Only called when the value has changed, sets the value directly.
|
boolean |
supportsCurrentValueUpdate()
Returns whether the current value can be set directly.
|
void |
unInitialize(TagUninitializeContext context) |
void |
updateCurrentValue(TagValue value)
Updates the current value, if supportsCurrentValueUpdate is true.
|
protected void |
updateRuntimeAlertProperties(AlarmStateSummary summary) |
protected void |
updateRuntimePropertyValue(TagProp prop,
java.lang.Object value) |
protected void |
updateRuntimeQuality(int flag,
boolean on) |
void |
write(TagWriteContext context,
AsyncWriteRequest<TagPath> value)
This function can be called at any time to write a value to the tag.
|
compareTo, createTagChangeEvent, fireChangeEvent, fireChangeEvent, getAlarmStates, getConfigProvider, getEntityId, getEventScripts, getExecutor, getTagChangeListener, getTagLogger, getTagPath, setConfigProvider, setEntityId, setExecutor, setTagChangeListener, setTagChangeListener, setTagPath
protected static final LoggerEx TAG_HISTORY_LOGGER
protected AbstractExecutableTag.TagHistoryHarness historizer
protected AlarmEvaluator alarmEval
protected ValueScaler scaler
protected AbstractExecutableTag.TagPermissions permissions
protected Deadband deadband
protected AbstractExecutableTag()
protected AbstractExecutableTag(AbstractExecutableTag copy)
protected TagEvaluationContext getContext()
public void sampleDiagnostics(DiagnosticsSample sample)
Diagnosable
sampleDiagnostics
in interface Diagnosable
protected void updateRuntimePropertyValue(TagProp prop, java.lang.Object value)
protected void updateRuntimeQuality(int flag, boolean on)
public void setTagError(java.lang.String message, java.lang.Exception cause)
public boolean isAlarmingSupported()
isAlarmingSupported
in interface Tag
protected ValueScaler getScaler()
public boolean isEvaluated()
isEvaluated
in interface ExecutableTag
public void resetEvaluation()
resetEvaluation
in interface ExecutableTag
protected void setIsEvaluated(boolean value)
protected void setCurrentValue(TagValue value)
value
- quality
- protected void evaluateAlerts()
protected TagValue coerceAndCheck(TagValue incoming)
incoming
- protected void fireEvent(java.lang.String id, java.lang.Object... params)
public void alarmTransitioned(AlarmEvent event, AlarmStateTransition transition)
alarmTransitioned
in interface AlarmObserver
public void configure(Tag def)
configure
in class AbstractGatewayTag
protected boolean isInitialized()
public void initialize(TagInitializationContext context)
ExecutableTag
initialize
in interface ExecutableTag
public final void unInitialize(TagUninitializeContext context)
unInitialize
in interface ExecutableTag
protected void internalUninitialize(TagUninitializeContext context)
public TagValue getAttribute(TagProp prop)
AbstractGatewayTag
getAttribute
in interface Tag
getAttribute
in class AbstractGatewayTag
public final void evaluate()
ExecutableTag
evaluate
in interface ExecutableTag
protected void internalEvaluate()
context
- public void evaluateHistory(TagEvaluationContext context)
evaluateHistory
in interface ExecutableTag
public void setAttribute(TagProp property, TagValue value)
ExecutableTag
setAttribute
in interface ExecutableTag
public boolean supportsCurrentValueUpdate()
ExecutableTag
supportsCurrentValueUpdate
in interface ExecutableTag
public final void updateCurrentValue(TagValue value)
ExecutableTag
updateCurrentValue
in interface ExecutableTag
protected void internalUpdateCurrentValue(TagValue value)
public boolean isWritable()
ExecutableTag
isWritable
in interface ExecutableTag
public void write(TagWriteContext context, AsyncWriteRequest<TagPath> value)
ExecutableTag
write
in interface ExecutableTag
value
- WriteValue to be used. The function can set the write value response right away to indicate the write
has be completed, or it can process it and pass it on to the context or some other function.protected void internalWrite(TagWriteContext context, AsyncWriteRequest<TagPath> value)
value
- context
- protected void internalPropertyWrite(AsyncWriteRequest<TagPath> value)
protected void updateRuntimeAlertProperties(AlarmStateSummary summary)
public TagValue getValue()
Tag
getValue
in interface Tag
getValue
in interface TagPropertyValue
protected void setValue(TagValue value)
value
- public DataType getDataType()
Tag
getDataType
in interface Tag
public void setDataType(DataType value)
public java.lang.String getName()
Tag
public TagPermissionsModel getPermissionModel()
Tag
getPermissionModel
in interface Tag
public AccessRightsType getAccessRights()
Tag
getAccessRights
in interface Tag
public boolean isEnabled()
Tag
public EntityId getId()
getId
in interface TagPropertyValue
public DataTypeClass getDataTypeClass()
getDataTypeClass
in interface TagPropertyValue
public TagProp getProperty()
getProperty
in interface TagPropertyValue
public boolean hasHintConfig()
hasHintConfig
in interface TagPropertyValue
public boolean hasHintPersistent()
hasHintPersistent
in interface TagPropertyValue
public java.util.List<TagPath> getHistoryPaths()