Class SimpleBoundTagAdapter
- java.lang.Object
-
- com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapter
-
- com.inductiveautomation.factorypmi.application.binding.AbstractTagAdapter
-
- com.inductiveautomation.factorypmi.application.binding.SimpleBoundTagAdapter
-
- All Implemented Interfaces:
Adapter
,Adapter.ValueHolder
,SearchablePropertyAdapter
,PropertyAdapter
,Blinker
,TagChangeListener
,java.awt.event.ActionListener
,java.beans.PropertyChangeListener
,java.util.EventListener
,javax.swing.event.ChangeListener
- Direct Known Subclasses:
IndirectTagBindingAdapter
public class SimpleBoundTagAdapter extends AbstractTagAdapter implements TagChangeListener, java.beans.PropertyChangeListener, javax.swing.event.ChangeListener, java.awt.event.ActionListener, Blinker, SearchablePropertyAdapter
A property adapter that hooks up a property to a tag.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
SimpleBoundTagAdapter.WriteOp
A wrapper between the old way of doing things and completeable future.-
Nested classes/interfaces inherited from class com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapter
AbstractPropertyAdapter.EdtUpdateValue
-
Nested classes/interfaces inherited from interface com.inductiveautomation.factorypmi.application.binding.Adapter
Adapter.ValueHolder
-
Nested classes/interfaces inherited from interface com.inductiveautomation.factorypmi.application.binding.PropertyAdapter
PropertyAdapter.PAType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.TimerTask
blinkTask
TimerTask generated by the BlinkTimer that is controlling our blink timing.protected ColorStateTable
colorMappingTable
Used when binding a color property to a numeric tag.protected ColorState
currentColorState
The current color state.protected SimpleBoundTagAdapter.WriteOp
currentWriteOp
The current(latest) write operation, if any.protected boolean
inBlink
Used to keep track of the blink status when blinking.protected LoggerEx
log
protected QualifiedValue
previousValue
Remembers the value before a write requestprotected QualifiedValue
updatedValue
The last seen value update that was squelched during the write requestprotected boolean
updatingProperty
True when the target property is being updated.protected boolean
updatingTag
True when the push listener that listens to PropertyChangeEvents on the target property for bidirectional mode is updating the tag's value.-
Fields inherited from class com.inductiveautomation.factorypmi.application.binding.AbstractTagAdapter
bidirectional, fallbackDelay, tagPath, tagPathString
-
Fields inherited from class com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapter
appContext, isTargetPropertyDynamic, overlayOptOut, target, targetPropertyName, value, valueClass
-
-
Constructor Summary
Constructors Constructor Description SimpleBoundTagAdapter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
Listens to the ReadAfterWrite timervoid
connect(VisionClientContext appContext)
Calls connect() on all interaction descriptorsvoid
disconnect()
Calls disconnect() on all interaction descriptorsvoid
doBlink()
Implements Blinker.BindingConfiguration
getBindingConfiguration()
ColorStateTable
getColorMappingTable()
protected TagPath
getCurrentTagPath()
protected LoggerEx
getLogger()
protected java.lang.String
getLoggerName()
static boolean
isWriteForced()
Returns true if an adapter is currently executing a forced write.void
propertyChange(java.beans.PropertyChangeEvent evt)
Listens to the target property for tag updating.void
setColorMappingTable(ColorStateTable colorMappingTable)
void
setQValue(QualifiedValue value)
Overridden to support translation to colorsvoid
shutdown()
Notifies the adapter that it is becoming inactive, and should cease any polling/threaded activities.void
startup()
Notifies the adapter that it is becoming active, and should start any polling/threaded activities.void
stateChanged(javax.swing.event.ChangeEvent e)
Listens to the current WriteOperation for when the write is done.void
tagChanged(TagChangeEvent e)
Listens for tag changes (implements TagChangeListener)java.lang.String
toString()
protected void
updateTarget()
Sets the target property to the value.-
Methods inherited from class com.inductiveautomation.factorypmi.application.binding.AbstractTagAdapter
_getTagPath, _setTagPath, getFallbackDelay, getInteractions, getReferenceType, getTagPathString, isBidirectional, setBidirectional, setFallbackDelay, setTagPathString
-
Methods inherited from class com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapter
getQValue, getTarget, getTargetDesc, getTargetFullPath, getTargetPropertyName, getValueClass, handleError, handleNullToPrimitive, initLogger, isDataUsed, isDataUsed, isOverlayOptOut, isTargetPropertyDynamic, isValid, isValueClassPrimitive, setOverlayOptOut, setSetterMethodName, setTarget, setTargetPropertyDynamic, setTargetPropertyName, setValue, setValueClass, updateQuality, updateValue, useQuality
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.factorypmi.application.binding.Adapter
getInteractions, getTarget, isValid, setTarget
-
Methods inherited from interface com.inductiveautomation.factorypmi.application.binding.PropertyAdapter
getReferenceType, getTargetPropertyName, setTargetPropertyName
-
Methods inherited from interface com.inductiveautomation.ignition.common.tags.model.event.TagChangeListener
getSecurityContext, isLightweight
-
-
-
-
Field Detail
-
colorMappingTable
protected ColorStateTable colorMappingTable
Used when binding a color property to a numeric tag.
-
currentColorState
protected ColorState currentColorState
The current color state. Used to avoid re-lookup every blink.
-
inBlink
protected boolean inBlink
Used to keep track of the blink status when blinking.
-
blinkTask
protected java.util.TimerTask blinkTask
TimerTask generated by the BlinkTimer that is controlling our blink timing.
-
currentWriteOp
protected SimpleBoundTagAdapter.WriteOp currentWriteOp
The current(latest) write operation, if any. While this is non-null, values coming in through setValue() will be cached. When the write is done, this class's implementation of ChangeListener will be invoked, which will clear out this value.
-
previousValue
protected QualifiedValue previousValue
Remembers the value before a write request
-
updatedValue
protected QualifiedValue updatedValue
The last seen value update that was squelched during the write request
-
updatingTag
protected boolean updatingTag
True when the push listener that listens to PropertyChangeEvents on the target property for bidirectional mode is updating the tag's value.
-
updatingProperty
protected boolean updatingProperty
True when the target property is being updated. This means that the push listener can ignore property change events, since they came from the adapter
-
log
protected final LoggerEx log
-
-
Method Detail
-
isWriteForced
public static boolean isWriteForced()
Returns true if an adapter is currently executing a forced write. Forced writes are intended to bypass systems such as "Reject updates during edit" on text boxes.
-
getLoggerName
protected java.lang.String getLoggerName()
-
getLogger
protected LoggerEx getLogger()
-
getBindingConfiguration
public BindingConfiguration getBindingConfiguration()
- Specified by:
getBindingConfiguration
in interfaceSearchablePropertyAdapter
-
startup
public void startup()
Description copied from interface:Adapter
Notifies the adapter that it is becoming active, and should start any polling/threaded activities.- Specified by:
startup
in interfaceAdapter
- Overrides:
startup
in classAbstractPropertyAdapter
-
shutdown
public void shutdown()
Description copied from interface:Adapter
Notifies the adapter that it is becoming inactive, and should cease any polling/threaded activities.- Specified by:
shutdown
in interfaceAdapter
- Overrides:
shutdown
in classAbstractPropertyAdapter
-
connect
public void connect(VisionClientContext appContext)
Description copied from class:AbstractPropertyAdapter
Calls connect() on all interaction descriptors- Specified by:
connect
in interfaceAdapter
- Overrides:
connect
in classAbstractPropertyAdapter
-
disconnect
public void disconnect()
Description copied from class:AbstractPropertyAdapter
Calls disconnect() on all interaction descriptors- Specified by:
disconnect
in interfaceAdapter
- Overrides:
disconnect
in classAbstractPropertyAdapter
-
setQValue
public void setQValue(QualifiedValue value)
Overridden to support translation to colors- Specified by:
setQValue
in interfaceAdapter.ValueHolder
- Overrides:
setQValue
in classAbstractPropertyAdapter
-
doBlink
public void doBlink()
Implements Blinker. Called when the BlinkTask is running for a blinking color state.
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
Listens to the target property for tag updating.- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent e)
Listens to the current WriteOperation for when the write is done.- Specified by:
stateChanged
in interfacejavax.swing.event.ChangeListener
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
Listens to the ReadAfterWrite timer- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
tagChanged
public void tagChanged(TagChangeEvent e)
Listens for tag changes (implements TagChangeListener)- Specified by:
tagChanged
in interfaceTagChangeListener
- Parameters:
e
- a ChangeEvent object
-
updateTarget
protected void updateTarget()
Description copied from class:AbstractPropertyAdapter
Sets the target property to the value. If a problem occurs, the problem is displayed, not thrown. Note that updateValue() is probably a better bet, as it updates both value and quality.- Overrides:
updateTarget
in classAbstractPropertyAdapter
-
getCurrentTagPath
protected TagPath getCurrentTagPath()
-
getColorMappingTable
public ColorStateTable getColorMappingTable()
-
setColorMappingTable
public void setColorMappingTable(ColorStateTable colorMappingTable)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractPropertyAdapter
-
-