Package com.automation_pros.odva.omron
Class OmronProbeContext
- java.lang.Object
-
- com.automation_pros.odva.omron.OmronProbeContext
-
- All Implemented Interfaces:
DataContext
public class OmronProbeContext extends java.lang.Object implements DataContext
Wrap anOmronProbeReportto serve as the data context for enclosed type definitions. Includes the transformation of probed data types into Structure definitions and the associatedDataDefinitionSegelements.Provides fast maps of tags, types, and type members by name, instance number, and for types, CRC handle.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classOmronProbeContext.OmTypeCache
-
Field Summary
Fields Modifier and Type Field Description static DataDefinitionSegOmBool16SegOmronProbeReportreportstatic org.slf4j.LoggersLoggerjava.util.Map<java.lang.Integer,OmronProbeReport.OmProbedTag>tagsByInstancejava.util.Map<java.lang.String,OmronProbeReport.OmProbedTag>tagsByNamejava.util.Map<java.lang.Integer,OmronProbeContext.OmTypeCache>typesByCRCjava.util.Map<java.lang.Integer,OmronProbeContext.OmTypeCache>typesByInstancejava.util.Map<java.lang.String,OmronProbeContext.OmTypeCache>typesByName-
Fields inherited from interface com.automation_pros.odva.cip.data.DataContext
emptyContext
-
-
Constructor Summary
Constructors Constructor Description OmronProbeContext(OmronProbeReport report)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OmronProbeContext.OmTypeCachegetCachedType(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.AnonStructSeggetNamedDef(java.lang.String typeName)Look up a named type for use expanding a stub definition or to apply to a different context.DataContextgetParentDataCtx()Get the next outer DataContext from the current context.java.lang.StringgetTypeByCRC(int crc)Look up a named type by CRC for use directly by a StructureDefSeg or indirectly by an AnonTypeSeg.StructDefgetTypeByName(java.lang.String typeName)Look up a named type for use constructing nested elements of a structure.java.util.ArrayList<StructDef>getTypesImpl()CipBOOLmakeHosted(PathSegment parentSeg, BoolHost parent, int bitnum)CipBOOLmakeUnhosted()voidreplaceTypes(DataContext substitutes)When multiple data types need substitution, it is important that the replacements occur in order by depth of nested referenced types.-
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, toEnum
-
-
-
-
Field Detail
-
sLogger
public static final org.slf4j.Logger sLogger
-
OmBool16Seg
public static final DataDefinitionSeg OmBool16Seg
-
report
public final OmronProbeReport report
-
typesByName
public final java.util.Map<java.lang.String,OmronProbeContext.OmTypeCache> typesByName
-
typesByCRC
public final java.util.Map<java.lang.Integer,OmronProbeContext.OmTypeCache> typesByCRC
-
typesByInstance
public final java.util.Map<java.lang.Integer,OmronProbeContext.OmTypeCache> typesByInstance
-
tagsByName
public final java.util.Map<java.lang.String,OmronProbeReport.OmProbedTag> tagsByName
-
tagsByInstance
public final java.util.Map<java.lang.Integer,OmronProbeReport.OmProbedTag> tagsByInstance
-
-
Constructor Detail
-
OmronProbeContext
public OmronProbeContext(OmronProbeReport report)
-
-
Method Detail
-
getParentDataCtx
public DataContext getParentDataCtx()
Description copied from interface:DataContextGet the next outer DataContext from the current context.- Specified by:
getParentDataCtxin interfaceDataContext- Returns:
- The containing DataContext, or null if the current context is the root context.
-
getCachedType
public OmronProbeContext.OmTypeCache getCachedType(java.lang.String typeName)
-
getNamedDef
public AnonStructSeg getNamedDef(java.lang.String typeName)
Description copied from interface:DataContextLook up a named type for use expanding a stub definition or to apply to a different context.- Specified by:
getNamedDefin interfaceDataContext
-
getTypeByName
public StructDef getTypeByName(java.lang.String typeName)
Description copied from interface:DataContextLook up a named type for use constructing nested elements of a structure.- Specified by:
getTypeByNamein 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:
getTypesImplin interfaceDataContext
-
getTypeByCRC
public java.lang.String getTypeByCRC(int crc)
Description copied from interface:DataContextLook up a named type by CRC for use directly by a StructureDefSeg or indirectly by an AnonTypeSeg.- Specified by:
getTypeByCRCin interfaceDataContext- Returns:
- The type suitable for use with CipStruct and/or StructMember.
-
makeHosted
public CipBOOL makeHosted(PathSegment parentSeg, BoolHost parent, int bitnum)
- Specified by:
makeHostedin interfaceDataContext
-
makeUnhosted
public CipBOOL makeUnhosted()
- Specified by:
makeUnhostedin interfaceDataContext
-
getCtxDataImpl
public BaseDataType<?> getCtxDataImpl(java.util.List<PathSegment> reference)
Description copied from interface:DataContextLook 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:
getCtxDataImplin interfaceDataContext- Parameters:
reference- The path to a data item.- Returns:
- A data object
-
replaceTypes
public void replaceTypes(DataContext substitutes)
When multiple data types need substitution, it is important that the replacements occur in order by depth of nested referenced types. This helper routine accepts a map associating names with substitute structure definitions, and applies them to the type cache shallowest-first.- Parameters:
substitutes- A data context to be checked for same-named types to be injected into this context.
-
-