Package com.automation_pros.odva.logix
Class LgxDevice
- 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.CipDevice
-
- com.automation_pros.odva.logix.LgxDevice
-
- All Implemented Interfaces:
DataContext
,HasGuid
public class LgxDevice extends CipDevice
-
-
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 LgxChangeMgr
chg
LgxTagMgr
tags
LgxTplMgr
udts
-
Fields inherited from class com.automation_pros.odva.cip.core.CipDevice
assemblies, guidLock, identity, internalGuid, ports
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.UUID
currentGuid()
java.util.concurrent.ExecutorService
executor()
Services and packet handlers may need to perform extended calculations or communicate with other systems in an unbounded way.LgxChangeMgr
getChg()
LgxDevice
getDevice()
CipObjects are expected to be organized as a tree, typically with a CipDevice at the root.AnonStructSeg
getNamedDef(java.lang.String typeName)
Look up a named type for use expanding a stub definition or to apply to a different context.java.util.List<StructDef>
getPrunedTypes()
Enumerate all user-defined (named) types in the context, plus any pre-defined types that are in use.LgxTagMgr
getTagMgr()
LgxTplMgr
getTplMgr()
java.lang.String
getTypeByCRC(int crc)
Look up a named type by CRC for use directly by a StructureDefSeg or indirectly by an AnonTypeSeg.StructDef
getTypeByName(java.lang.String typeName)
Look up a named type for use constructing nested elements of a structure.java.util.ArrayList<StructDef>
getTypesImpl()
java.util.UUID
resetGuid()
java.util.concurrent.ScheduledExecutorService
scheduler()
CIP connections that produce data at intervals need a way to schedule the transmissions, and may need significant time to assemble the data needed.protected void
setupTemplates()
Create typical Logic datatype like STRING, TIMER, and COUNTER with known instance numbers and structure handles.void
shutdown()
-
Methods inherited from class com.automation_pros.odva.cip.core.CipDevice
getAssemblyMgr, getConnectionsMgr, getConxMgrMgr, getCxManager, getEPathImpl, getIdentity, getIdentityMgr, getPortMgr, refreshSettings
-
Methods inherited from class com.automation_pros.odva.cip.types.CipObject
getChild, getDisplayName, getName, getParent, isShutdown, logger, onReplacement, removeChildSymbol, service, setChild, setChildSymbol, setName, setParent, toString
-
Methods inherited from class com.automation_pros.odva.cip.types.CipTreeCtx
getCtxDataImpl, getParentDataCtx
-
Methods inherited from class com.automation_pros.odva.cip.types.CipTree
cleanup, entrySet, follow, getChildren, getEPath, getSegment, keySet, removeChild, setSegment
-
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.data.DataContext
fromEnum, getCtxData, getCtxDataOrNull, getTypes, makeHosted, makeUnhosted, toEnum
-
-
-
-
Field Detail
-
tags
public final LgxTagMgr tags
-
udts
public final LgxTplMgr udts
-
chg
public final LgxChangeMgr chg
-
-
Constructor Detail
-
LgxDevice
public LgxDevice(EKeySeg ekey, int serial, java.lang.String name)
-
-
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.
-
getTagMgr
public LgxTagMgr getTagMgr()
-
getTplMgr
public LgxTplMgr getTplMgr()
-
getChg
public LgxChangeMgr getChg()
-
getNamedDef
public AnonStructSeg getNamedDef(java.lang.String typeName)
Description copied from interface:DataContext
Look up a named type for use expanding a stub definition or to apply to a different context.- Specified by:
getNamedDef
in interfaceDataContext
- Overrides:
getNamedDef
in classCipTreeCtx
-
getTypeByName
public StructDef getTypeByName(java.lang.String typeName)
Description copied from interface:DataContext
Look up a named type for use constructing nested elements of a structure.- Specified by:
getTypeByName
in interfaceDataContext
- Overrides:
getTypeByName
in classCipTreeCtx
- Parameters:
typeName
- The type name to look up in the predefined names.- Returns:
- The type suitable for use with CipStruct and/or StructMember.
-
getTypesImpl
public java.util.ArrayList<StructDef> getTypesImpl()
- Specified by:
getTypesImpl
in interfaceDataContext
- Overrides:
getTypesImpl
in classCipTreeCtx
-
getPrunedTypes
public java.util.List<StructDef> getPrunedTypes()
Enumerate all user-defined (named) types in the context, plus any pre-defined types that are in use.- Returns:
-
getTypeByCRC
public java.lang.String getTypeByCRC(int crc)
Description copied from interface:DataContext
Look up a named type by CRC for use directly by a StructureDefSeg or indirectly by an AnonTypeSeg.- Specified by:
getTypeByCRC
in interfaceDataContext
- Overrides:
getTypeByCRC
in classCipTreeCtx
- Returns:
- The type suitable for use with CipStruct and/or StructMember.
-
setupTemplates
protected void setupTemplates()
Create typical Logic datatype like STRING, TIMER, and COUNTER with known instance numbers and structure handles.
-
executor
public java.util.concurrent.ExecutorService executor()
Description copied from class:CipObject
Services and packet handlers may need to perform extended calculations or communicate with other systems in an unbounded way. This can be a resource management problem for devices, so the host device must make an appropriate executor service available.The base CIP object implementation simply retrieves the executor from the object's parent, returning a null if there's no parent. This will break real applications, so CipDevice implementations must override this method to supply a real executor.
-
scheduler
public java.util.concurrent.ScheduledExecutorService scheduler()
Description copied from class:CipObject
CIP connections that produce data at intervals need a way to schedule the transmissions, and may need significant time to assemble the data needed. As with executor(), this may be a resource problem for devices, so the host device must make an appropriate scheduler service available. Objects with repetitive housekeeping tasks should also use this scheduler instead of creating their own threads.The base CIP object implementation simply retrieves the scheduler from the object's parent, returning a null if there's no parent. This will break real applications, so CipDevice implementations must override this method to supply a real scheduler.
-
resetGuid
public java.util.UUID resetGuid()
-
currentGuid
public java.util.UUID currentGuid()
- Specified by:
currentGuid
in interfaceHasGuid
- Overrides:
currentGuid
in classCipDevice
-
-