Class LgxTemplate
- java.lang.Object
-
- com.automation_pros.odva.cip.types.CipTree
-
- com.automation_pros.odva.cip.types.CipTreeCtx
-
- com.automation_pros.odva.cip.types.CipObject
-
- com.automation_pros.odva.cip.core.CipInstance
-
- com.automation_pros.odva.logix.LgxTemplate
-
- All Implemented Interfaces:
DataContext
,AttributeHolder
,Template
,LgxTplListener
,java.lang.Comparable<CipInstance>
public class LgxTemplate extends CipInstance implements LgxTplListener, Template
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.types.CipObject
CipObject.FutureMultipleReply
-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.types.CipTree
CipTree.ChildMap
-
-
Field Summary
Fields Modifier and Type Field Description protected CipUINT
a6
protected CipUDINT
a7
protected CipUDINT
a8
protected CipUDINT
datasize
protected StructDef
definition
protected CipUDINT
defsize
protected java.util.Set<LgxTplListener>
listeners
protected java.lang.String
name
protected CipUINT
tagtypecode
protected java.lang.String
templateReadName
-
Fields inherited from class com.automation_pros.odva.cip.core.CipInstance
attr_all
-
Fields inherited from class com.automation_pros.odva.cip.types.CipTree
children, objEPath, parent, segment
-
Fields inherited from interface com.automation_pros.odva.cip.data.DataContext
emptyContext
-
-
Constructor Summary
Constructors Constructor Description LgxTemplate(InstanceSeg seg, LgxTplMgr parent, StructDef definition)
LgxTemplate(InstanceSeg seg, LgxTplMgr parent, LgxTemplate other)
LgxTemplate(InstanceSeg seg, LgxTplMgr parent, java.lang.String name, int maxAlign, StructMember... members)
LgxTemplate(InstanceSeg seg, LgxTplMgr parent, java.lang.String name, int maxAlign, java.util.List<StructMember> members)
LgxTemplate(InstanceSeg seg, LgxTplMgr parent, java.lang.String name, StructMember... members)
LgxTemplate(InstanceSeg seg, LgxTplMgr parent, java.lang.String name, java.util.List<StructMember> members)
LgxTemplate(LgxTplMgr parent, StructDef definition)
LgxTemplate(LgxTplMgr parent, java.lang.String name, int maxAlign, StructMember... members)
LgxTemplate(LgxTplMgr parent, java.lang.String name, StructMember... members)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(LgxTplListener listener)
int
bytesEach()
void
change(LgxTemplate template)
void
chkAbbrevType(java.nio.ByteBuffer source)
short
getCRC()
int
getDataSize()
StructDef
getDefinition()
int
getDepth()
LgxDevice
getDevice()
CipObjects are expected to be organized as a tree, typically with a CipDevice at the root.int
getListenerCount()
java.lang.String
getName()
LgxTplMgr
getParent()
short
getTagTypeCode()
java.lang.String
getTemplateReadName()
void
putAbbrevType(java.nio.ByteBuffer dest)
void
removeListener(LgxTplListener listener)
void
service(CipObject appContext, CipRequest request, int nesting)
Execute a CIP service on the object, using the request supplied.CipInstance
setParent(CipTree parent)
Set or remove the parent of this CipTree, possibly removing this object from a previous parent before assigning to the new parent.CipTree
setSegment(PathSegment segment)
LgxTemplate
setTagTypeCode(short ttc)
When a template definition is read from another processor, it may be a built-in or module-defined type whose structure handle doesn't follow the published algorithm.LgxTemplate
setTemplateReadName(java.lang.String templateReadName)
When a template definition is read from another processor, the name delivered in the template read service may include additional text after a semi-colon that is only meaningful to logix processors but should be delivered to other clients that query this implementation.void
shutdown()
java.lang.String
structCRCString()
-
Methods inherited from class com.automation_pros.odva.cip.core.CipInstance
compareTo, getAttribute, getEPathImpl, getSegment, isPrivate, number, toString
-
Methods inherited from class com.automation_pros.odva.cip.types.CipObject
executor, getChild, getDisplayName, isShutdown, logger, onReplacement, removeChildSymbol, scheduler, setChild, setChildSymbol, setName
-
Methods inherited from class com.automation_pros.odva.cip.types.CipTreeCtx
getCtxDataImpl, getNamedDef, getParentDataCtx, getTypeByCRC, getTypeByName, getTypesImpl
-
Methods inherited from class com.automation_pros.odva.cip.types.CipTree
cleanup, entrySet, follow, getChildren, getEPath, keySet, removeChild
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.automation_pros.odva.cip.types.AttributeHolder
executor, getChild, getDisplayName, getEPath, isShutdown, logger, scheduler
-
Methods inherited from interface com.automation_pros.odva.cip.data.DataContext
fromEnum, getCtxData, getCtxDataOrNull, getTypes, makeHosted, makeUnhosted, toEnum
-
-
-
-
Field Detail
-
name
protected final java.lang.String name
-
templateReadName
protected java.lang.String templateReadName
-
definition
protected StructDef definition
-
tagtypecode
protected final CipUINT tagtypecode
-
defsize
protected final CipUDINT defsize
-
datasize
protected final CipUDINT datasize
-
a6
protected final CipUINT a6
-
a7
protected final CipUDINT a7
-
a8
protected final CipUDINT a8
-
listeners
protected java.util.Set<LgxTplListener> listeners
-
-
Constructor Detail
-
LgxTemplate
public LgxTemplate(InstanceSeg seg, LgxTplMgr parent, java.lang.String name, StructMember... members)
-
LgxTemplate
public LgxTemplate(LgxTplMgr parent, java.lang.String name, StructMember... members)
-
LgxTemplate
public LgxTemplate(InstanceSeg seg, LgxTplMgr parent, java.lang.String name, java.util.List<StructMember> members)
-
LgxTemplate
public LgxTemplate(InstanceSeg seg, LgxTplMgr parent, java.lang.String name, int maxAlign, StructMember... members)
-
LgxTemplate
public LgxTemplate(LgxTplMgr parent, java.lang.String name, int maxAlign, StructMember... members)
-
LgxTemplate
public LgxTemplate(InstanceSeg seg, LgxTplMgr parent, java.lang.String name, int maxAlign, java.util.List<StructMember> members)
-
LgxTemplate
public LgxTemplate(InstanceSeg seg, LgxTplMgr parent, StructDef definition)
-
LgxTemplate
public LgxTemplate(InstanceSeg seg, LgxTplMgr parent, LgxTemplate other)
-
-
Method Detail
-
getDevice
public LgxDevice getDevice()
Description copied from class:CipObject
CipObjects are expected to be organized as a tree, typically with a CipDevice at the root. (CipDevices can have a parent too, if an implementer chooses to represent a virtual chassis that way.)By default, any CipObject will simply ask its parent for the device if asked for the device. A CipDevice returns itself.
-
setSegment
public CipTree setSegment(PathSegment segment)
- Overrides:
setSegment
in classCipTree
-
setParent
public CipInstance setParent(CipTree parent)
Description copied from class:CipTree
Set or remove the parent of this CipTree, possibly removing this object from a previous parent before assigning to the new parent. Override this method if additional housekeeping is required when assigning or removing parents.- Overrides:
setParent
in classCipInstance
- Parameters:
parent
- The new parent of this object.- Returns:
- The object replaced by this object in the parent, if any.
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceAttributeHolder
- Overrides:
shutdown
in classCipObject
-
getName
public java.lang.String getName()
-
getDefinition
public StructDef getDefinition()
- Specified by:
getDefinition
in interfaceTemplate
-
getTemplateReadName
public java.lang.String getTemplateReadName()
-
setTemplateReadName
public LgxTemplate setTemplateReadName(java.lang.String templateReadName)
When a template definition is read from another processor, the name delivered in the template read service may include additional text after a semi-colon that is only meaningful to logix processors but should be delivered to other clients that query this implementation.Also, many predefined datatypes in Logix processors report a different, more verbose name in the template read service. When creating such types manually, the common name (as used in processor XML exports) should be given in the constructor, and the verbose name and suffix set here.
- Parameters:
templateReadName
-
-
getTagTypeCode
public short getTagTypeCode()
-
setTagTypeCode
public LgxTemplate setTagTypeCode(short ttc)
When a template definition is read from another processor, it may be a built-in or module-defined type whose structure handle doesn't follow the published algorithm. The code that constructs an instance from a remote must follow up by setting the remote's tag type code on this instance.- Parameters:
ttc
-
-
structCRCString
public java.lang.String structCRCString()
-
service
public void service(CipObject appContext, CipRequest request, int nesting)
Description copied from class:CipObject
Execute a CIP service on the object, using the request supplied. Supply a reply to the request and/or throw an appropriate CipException. Replies are not required before this routine returns.
Direct service() calls MUST NOT BLOCK. Any operation that will take any significant time must be delegated to an executor. "Significant" may vary by application, but typically would be in the fractional millisecond range.
- Specified by:
service
in interfaceAttributeHolder
- Overrides:
service
in classCipInstance
- Parameters:
appContext
- Root object for application path lookups. Generally aMirrored Device
from a port context.request
- What to do and where to reply. Services to be handled by child objects are to be passed to their service() method with nesting+1.nesting
- How many leading path segments items to skip when processing this request. Avoids copying the balance of an application path into a new request when passing a request to a child object.
-
bytesEach
public int bytesEach()
-
putAbbrevType
public void putAbbrevType(java.nio.ByteBuffer dest)
-
chkAbbrevType
public void chkAbbrevType(java.nio.ByteBuffer source)
-
addListener
public void addListener(LgxTplListener listener)
- Specified by:
addListener
in interfaceTemplate
-
removeListener
public void removeListener(LgxTplListener listener)
-
getListenerCount
public int getListenerCount()
-
change
public void change(LgxTemplate template)
- Specified by:
change
in interfaceLgxTplListener
-
getDataSize
public int getDataSize()
-
getDepth
public int getDepth()
-
getParent
public LgxTplMgr getParent()
- Specified by:
getParent
in interfaceAttributeHolder
- Overrides:
getParent
in classCipObject
-
getCRC
public short getCRC()
-
-