Package com.automation_pros.odva.logix
Class LgxProbeContext
- java.lang.Object
-
- com.automation_pros.odva.logix.LgxProbeContext
-
- All Implemented Interfaces:
DataContext
public class LgxProbeContext extends java.lang.Object implements DataContext
Interpret probed Logix types as LibODVA types, and maintain multiple indices of the probe results.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LgxProbeContext.Aliasable
static class
LgxProbeContext.LgxTagIndex
class
LgxProbeContext.LgxTypeCache
protected class
LgxProbeContext.OrderedMember
-
Field Summary
Fields Modifier and Type Field Description java.util.Map<java.lang.Integer,LgxProbeContext.LgxTagIndex>
programsByInstance
java.util.Map<java.lang.String,LgxProbeContext.LgxTagIndex>
programsByName
LgxProbeReport
report
static org.slf4j.Logger
sLogger
java.util.Map<java.lang.Integer,LgxProbeContext.LgxTypeCache>
typesByCRC
java.util.Map<java.lang.Integer,LgxProbeContext.LgxTypeCache>
typesByInstance
java.util.Map<java.lang.String,LgxProbeContext.LgxTypeCache>
typesByName
-
Fields inherited from interface com.automation_pros.odva.cip.data.DataContext
emptyContext
-
-
Constructor Summary
Constructors Constructor Description LgxProbeContext(LgxProbeReport report)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LgxProbeContext.LgxTypeCache
getCachedType(java.lang.String typeName)
BaseDataType<?>
getCtxDataImpl(java.util.List<PathSegment> reference)
Look up reference data within this current context for use in indirection of various kinds, as described for getCtxData(), which uses this implementation and handles delegation to outer contexts.AnonStructSeg
getNamedDef(java.lang.String typeName)
Look up a named type for use expanding a stub definition or to apply to a different context.DataContext
getParentDataCtx()
Get the next outer DataContext from the current context.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()
LgxProbeContext.OrderedMember
makeFakeHost(int offset, java.util.Map<java.lang.Integer,LgxProbeContext.OrderedMember> occupants, LgxProbeReport.LgxProbedType type)
Given a byte offset that needs to host a boolean, fit either a DWORD or a WORD or an SINT into structure using a map of current byte offsets to occupying members.LgxProbeContext.OrderedMember
makeFiller(int offset, LgxProbeContext.OrderedMember om, LgxProbeReport.LgxProbedType type)
Given a byte offset prior to a given member (or end of type if the member is omitted), try to fit aligned members into the gap, in the following order: DWORD array, Single DWORD, Single WORD, Single SINT-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.automation_pros.odva.cip.data.DataContext
fromEnum, getCtxData, getCtxDataOrNull, getTypes, makeHosted, makeUnhosted, toEnum
-
-
-
-
Field Detail
-
sLogger
public static final org.slf4j.Logger sLogger
-
report
public final LgxProbeReport report
-
typesByName
public final java.util.Map<java.lang.String,LgxProbeContext.LgxTypeCache> typesByName
-
typesByCRC
public final java.util.Map<java.lang.Integer,LgxProbeContext.LgxTypeCache> typesByCRC
-
typesByInstance
public final java.util.Map<java.lang.Integer,LgxProbeContext.LgxTypeCache> typesByInstance
-
programsByName
public final java.util.Map<java.lang.String,LgxProbeContext.LgxTagIndex> programsByName
-
programsByInstance
public final java.util.Map<java.lang.Integer,LgxProbeContext.LgxTagIndex> programsByInstance
-
-
Constructor Detail
-
LgxProbeContext
public LgxProbeContext(LgxProbeReport report)
-
-
Method Detail
-
makeFakeHost
public LgxProbeContext.OrderedMember makeFakeHost(int offset, java.util.Map<java.lang.Integer,LgxProbeContext.OrderedMember> occupants, LgxProbeReport.LgxProbedType type)
Given a byte offset that needs to host a boolean, fit either a DWORD or a WORD or an SINT into structure using a map of current byte offsets to occupying members.The map of current occupants is updated to include this new member.
- Parameters:
offset
-occupants
-type
-- Returns:
-
makeFiller
public LgxProbeContext.OrderedMember makeFiller(int offset, LgxProbeContext.OrderedMember om, LgxProbeReport.LgxProbedType type)
Given a byte offset prior to a given member (or end of type if the member is omitted), try to fit aligned members into the gap, in the following order:- DWORD array,
- Single DWORD,
- Single WORD,
- Single SINT
- Parameters:
offset
-om
-type
-- Returns:
-
getParentDataCtx
public DataContext getParentDataCtx()
Description copied from interface:DataContext
Get the next outer DataContext from the current context.- Specified by:
getParentDataCtx
in interfaceDataContext
- Returns:
- The containing DataContext, or null if the current context is the root context.
-
getCachedType
public LgxProbeContext.LgxTypeCache getCachedType(java.lang.String typeName)
-
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
-
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
- 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
-
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
- Returns:
- The type suitable for use with CipStruct and/or StructMember.
-
getCtxDataImpl
public BaseDataType<?> getCtxDataImpl(java.util.List<PathSegment> reference)
Description copied from interface:DataContext
Look up reference data within this current context for use in indirection of various kinds, as described for getCtxData(), which uses this implementation and handles delegation to outer contexts.- Specified by:
getCtxDataImpl
in interfaceDataContext
- Parameters:
reference
- The path to a data item.- Returns:
- A data object
-
-