Class Parameter
- 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.cip.application.Parameter
-
- All Implemented Interfaces:
DataContext
,AttributeHolder
,DataWrapper
,java.lang.Comparable<CipInstance>
public class Parameter extends CipInstance implements DataWrapper
Implementation of Stub Parameter Instances.Although the CIP Spec doesn't come out and say it, the definition of attribute #5 as a single USINT indicates that Parameter objects can only represent single instances of a base data type. No arrays or structures are allowed.
This is also required by the structure of the scaling, limits, and indirection attributes that provide the information needed by a configuration tool to present an appropriate user interface.
This implementation does not enforce this. A complex or array data element may be exposed here, but a caller will receive the complete formal data type in attribute #5, not just a byte.
-
-
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 CipAttribute
attr
protected CipUSINT
attrType
protected CipWORD
descriptor
protected CipEPATH
linkPath
-
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 Modifier Constructor Description Parameter(ParamMgr parent, int descriptor, CipAttribute target, java.lang.String name)
Support a reference to data in another attribute.Parameter(ParamMgr parent, int descriptor, BaseDataType<?> data, java.lang.String name)
Expose data directly in a parameter.Parameter(ParamMgr parent, int descriptor, CipPath path, java.lang.String name)
Expose data indirectly in a parameter.protected
Parameter(ParamMgr parent, int descriptor, java.lang.String name, byte aType)
Subclasses may pass any desired descriptor bits, and are responsible for creating the value attribute, and any non-stub parameter attributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BaseDataType<?>
getData()
Many CIP objects wrap a CIP data type.ParamMgr
getParent()
boolean
hasSettablePath()
boolean
isIndirect()
boolean
isMonitor()
boolean
isNonDisplay()
boolean
isReadOnly()
boolean
isWriteOnly()
void
service(CipObject appContext, CipRequest request, int nesting)
Execute a CIP service on the object, using the request supplied.-
Methods inherited from class com.automation_pros.odva.cip.core.CipInstance
compareTo, getAttribute, getEPathImpl, getSegment, isPrivate, number, setParent, toString
-
Methods inherited from class com.automation_pros.odva.cip.types.CipObject
executor, getChild, getDevice, getDisplayName, getName, isShutdown, logger, onReplacement, removeChildSymbol, scheduler, setChild, setChildSymbol, setName, shutdown
-
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, 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.types.AttributeHolder
executor, getChild, getDisplayName, getEPath, isShutdown, logger, scheduler, shutdown
-
Methods inherited from interface com.automation_pros.odva.cip.data.DataContext
fromEnum, getCtxData, getCtxDataOrNull, getTypes, makeHosted, makeUnhosted, toEnum
-
-
-
-
Field Detail
-
descriptor
protected final CipWORD descriptor
-
attr
protected CipAttribute attr
-
linkPath
protected final CipEPATH linkPath
-
attrType
protected final CipUSINT attrType
-
-
Constructor Detail
-
Parameter
protected Parameter(ParamMgr parent, int descriptor, java.lang.String name, byte aType)
Subclasses may pass any desired descriptor bits, and are responsible for creating the value attribute, and any non-stub parameter attributes. They must also set the attr and linkPath fields appropriately.- Parameters:
parent
- The parameter manager class object.descriptor
- The feature descriptor for this parameter. No restrictions.name
- The display name for the parameter instance.
-
Parameter
public Parameter(ParamMgr parent, int descriptor, CipAttribute target, java.lang.String name)
Support a reference to data in another attribute. The given attribute will be wrapped in a proxy and this Parameter's link path attribute will be set to the given attribute's EPath.- Parameters:
parent
- The parameter manager class object.descriptor
- The feature descriptor for this parameter, enforced in the proxy regardless of the given attribute's permissions. The following feature bits are allowed: 0x0010 Read-only 0x0020 Monitor (real time) 0x0200 Non-displayed 0x0400 Indirect reference 0x4000 Write-onlytarget
- The attribute to wrap in a proxy.name
- The display name for the parameter instance.
-
Parameter
public Parameter(ParamMgr parent, int descriptor, BaseDataType<?> data, java.lang.String name)
Expose data directly in a parameter. The given data is expected to be the master instance. The link path will be empty and not settable.- Parameters:
parent
- The parameter manager class object.descriptor
- The feature descriptor for this parameter, enforced in the attribute. The following feature bits are allowed: 0x0010 Read-only 0x0020 Monitor (real time) 0x0200 Non-displayed 0x0400 Indirect reference 0x4000 Write-onlydata
- The data to wrap in an attribute.name
- The display name for the parameter instance.
-
Parameter
public Parameter(ParamMgr parent, int descriptor, CipPath path, java.lang.String name)
Expose data indirectly in a parameter. The given path will be resolved to the inner data of the target. The link path will be filled. It will also be settable if the descriptor bit is set.- Parameters:
parent
- The parameter manager class object.descriptor
- The feature descriptor for this parameter, enforced in the attribute. The following feature bits are allowed: 0x0001 Settable path 0x0010 Read-only 0x0020 Monitor (real time) 0x0200 Non-displayed 0x0400 Indirect reference 0x4000 Write-onlypath
- The true attribute to point at via linkage.name
- The display name for the parameter instance.
-
-
Method Detail
-
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.
-
getParent
public ParamMgr getParent()
- Specified by:
getParent
in interfaceAttributeHolder
- Overrides:
getParent
in classCipObject
-
hasSettablePath
public boolean hasSettablePath()
-
isReadOnly
public boolean isReadOnly()
-
isMonitor
public boolean isMonitor()
-
isNonDisplay
public boolean isNonDisplay()
-
isIndirect
public boolean isIndirect()
-
isWriteOnly
public boolean isWriteOnly()
-
getData
public BaseDataType<?> getData()
Description copied from interface:DataWrapper
Many CIP objects wrap a CIP data type. This interface allows the member resolver to access fragments of complex wrapped data in a uniform way.- Specified by:
getData
in interfaceDataWrapper
- Returns:
-
-