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 CipUINTa6protected CipUDINTa7protected CipUDINTa8protected CipUDINTdatasizeprotected StructDefdefinitionprotected CipUDINTdefsizeprotected java.util.Set<LgxTplListener>listenersprotected java.lang.Stringnameprotected CipUINTtagtypecodeprotected java.lang.StringtemplateReadName-
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 voidaddListener(LgxTplListener listener)intbytesEach()voidchange(LgxTemplate template)voidchkAbbrevType(java.nio.ByteBuffer source)shortgetCRC()intgetDataSize()StructDefgetDefinition()intgetDepth()LgxDevicegetDevice()CipObjects are expected to be organized as a tree, typically with a CipDevice at the root.intgetListenerCount()java.lang.StringgetName()LgxTplMgrgetParent()shortgetTagTypeCode()java.lang.StringgetTemplateReadName()voidputAbbrevType(java.nio.ByteBuffer dest)voidremoveListener(LgxTplListener listener)voidservice(CipObject appContext, CipRequest request, int nesting)Execute a CIP service on the object, using the request supplied.CipInstancesetParent(CipTree parent)Set or remove the parent of this CipTree, possibly removing this object from a previous parent before assigning to the new parent.CipTreesetSegment(PathSegment segment)LgxTemplatesetTagTypeCode(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.LgxTemplatesetTemplateReadName(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.voidshutdown()java.lang.StringstructCRCString()-
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:CipObjectCipObjects 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:
setSegmentin classCipTree
-
setParent
public CipInstance setParent(CipTree parent)
Description copied from class:CipTreeSet 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:
setParentin 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:
shutdownin interfaceAttributeHolder- Overrides:
shutdownin classCipObject
-
getName
public java.lang.String getName()
-
getDefinition
public StructDef getDefinition()
- Specified by:
getDefinitionin 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:CipObjectExecute 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:
servicein interfaceAttributeHolder- Overrides:
servicein classCipInstance- Parameters:
appContext- Root object for application path lookups. Generally aMirrored Devicefrom 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:
addListenerin interfaceTemplate
-
removeListener
public void removeListener(LgxTplListener listener)
-
getListenerCount
public int getListenerCount()
-
change
public void change(LgxTemplate template)
- Specified by:
changein interfaceLgxTplListener
-
getDataSize
public int getDataSize()
-
getDepth
public int getDepth()
-
getParent
public LgxTplMgr getParent()
- Specified by:
getParentin interfaceAttributeHolder- Overrides:
getParentin classCipObject
-
getCRC
public short getCRC()
-
-