Class Assembly
- 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.Assembly
-
- All Implemented Interfaces:
DataContext
,AttributeHolder
,Connectable
,DataWrapper
,java.lang.Comparable<CipInstance>
public class Assembly extends CipInstance implements Connectable, DataWrapper
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Assembly.AssyMember
protected static class
Assembly.DynamicData
protected class
Assembly.MemberList
protected class
Assembly.NumMembData
-
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 boolean
active
CipLINT
consumeTS
protected java.util.List<Assembly.AssyMember>
fastMembers
protected boolean
locked
protected java.util.List<Assembly.AssyMember>
members
static org.slf4j.Logger
sLogger
-
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 Assembly(InstanceSeg seg, AssyMgr parent, BaseDataType<?> data, java.lang.String name)
Construct a static assembly instance using a given CIP data element for read/write content.protected
Assembly(InstanceSeg seg, AssyMgr parent, ConnectableAttr data, java.lang.String name)
Construct an assembly instance with a given connectable data attribute.Assembly(InstanceSeg seg, AssyMgr parent, java.lang.String name)
Construct a dynamic assembly instance with an empty member list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
config(SimpleDataSeg dataseg)
Configuration assemblies or any other object that can be targeted for configuration data in a forward open service must implement this method.AppConsumer
connect(AppOwner owner, ConxClass.CxParams params, byte dirtrigcls)
This method requests that the given connection be assigned as the owner of this object and an appropriate AppConsumer shim be created to handle the incoming data.void
disconnect()
This method forces any owner's shim to shutdown (breaking a connection if applicable), and if there was an owner, shuts down subscribers too.void
disconnectSubscribers()
This method disconnects all subscribers, a requirement during shutdown.BaseDataType<?>
getData()
Many CIP objects wrap a CIP data type.int
getDataSize()
java.lang.String
getDisplayName()
java.util.List<Assembly.AssyMember>
getMembers()
AppOwner
getOwner()
Obtain the current owner's shim if owned, or null.AssyMgr
getParent()
int
payloadBytes()
Report number of payload bytes expected, other than the mode & CIP short sequence.void
putMembers(java.util.List<Assembly.AssyMember> newMembers)
void
service(CipObject appContext, CipRequest request, int nesting)
Execute a CIP service on the object, using the request supplied.void
subscribe(AppProducer sub, ConxClass.CxParams params, byte dirtrigcls)
This method requests that the given connection be added to the list of subscribers to new data production from this object.void
txFresh()
This method notifies a producer that a data has been updated and a new sequence number should be generated.void
txTrigger()
This method notifies a producer that a transmission trigger has expired and new data would be appropriate if it can be assembled and delivered synchronously in this call.void
unsubscribe(AppProducer sub)
This method drops the given connection from the list of new data subscribers.-
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, 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, 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
-
sLogger
public static final org.slf4j.Logger sLogger
-
locked
protected boolean locked
-
active
protected boolean active
-
members
protected final java.util.List<Assembly.AssyMember> members
-
fastMembers
protected java.util.List<Assembly.AssyMember> fastMembers
-
consumeTS
public final CipLINT consumeTS
-
-
Constructor Detail
-
Assembly
protected Assembly(InstanceSeg seg, AssyMgr parent, ConnectableAttr data, java.lang.String name)
Construct an assembly instance with a given connectable data attribute. The given attribute is expected to already be connected to this parent object.- Parameters:
seg
-parent
-data
-name
-
-
Assembly
public Assembly(InstanceSeg seg, AssyMgr parent, BaseDataType<?> data, java.lang.String name)
Construct a static assembly instance using a given CIP data element for read/write content. The data element may be an array or structure.- Parameters:
seg
- The instance segment that will identify this assembly. If null, an instance number will be chosen from the vendor specific ranges, or any available instance above the last vendor range.parent
- The assembly class object that will be the parentdata
- The content data element
-
Assembly
public Assembly(InstanceSeg seg, AssyMgr parent, java.lang.String name)
Construct a dynamic assembly instance with an empty member list.- Parameters:
seg
- The instance segment that will identify this assembly. If null, an instance number will be chosen from the vendor specific ranges, or any available instance above the last vendor range.parent
- The assembly class object that will be the parent
-
-
Method Detail
-
getMembers
public java.util.List<Assembly.AssyMember> getMembers()
-
putMembers
public void putMembers(java.util.List<Assembly.AssyMember> newMembers)
-
getDisplayName
public java.lang.String getDisplayName()
- Specified by:
getDisplayName
in interfaceAttributeHolder
- Overrides:
getDisplayName
in classCipObject
-
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.
-
connect
public AppConsumer connect(AppOwner owner, ConxClass.CxParams params, byte dirtrigcls)
Description copied from interface:Connectable
This method requests that the given connection be assigned as the owner of this object and an appropriate AppConsumer shim be created to handle the incoming data. Application Consumer objects handle data flow from connections to application objects. The providedAppOwner
instance includes appropriate buffer handling, including removal/use of CIP short sequence numbers and originator idle/run mode indicators. This class's shutdown() method is used to disconnect.- Specified by:
connect
in interfaceConnectable
dirtrigcls
- Direction/Trigger/Class combination to use.- Returns:
-
payloadBytes
public int payloadBytes()
Description copied from interface:Connectable
Report number of payload bytes expected, other than the mode & CIP short sequence.- Specified by:
payloadBytes
in interfaceConnectable
- Returns:
-
disconnect
public void disconnect()
Description copied from interface:Connectable
This method forces any owner's shim to shutdown (breaking a connection if applicable), and if there was an owner, shuts down subscribers too.- Specified by:
disconnect
in interfaceConnectable
-
disconnectSubscribers
public void disconnectSubscribers()
Description copied from interface:Connectable
This method disconnects all subscribers, a requirement during shutdown.- Specified by:
disconnectSubscribers
in interfaceConnectable
-
getOwner
public AppOwner getOwner()
Description copied from interface:Connectable
Obtain the current owner's shim if owned, or null.- Specified by:
getOwner
in interfaceConnectable
- Returns:
-
subscribe
public void subscribe(AppProducer sub, ConxClass.CxParams params, byte dirtrigcls)
Description copied from interface:Connectable
This method requests that the given connection be added to the list of subscribers to new data production from this object. Repeat subscriptions are ignored.- Specified by:
subscribe
in interfaceConnectable
dirtrigcls
- Direction/Trigger/Class combination to use.
-
unsubscribe
public void unsubscribe(AppProducer sub)
Description copied from interface:Connectable
This method drops the given connection from the list of new data subscribers.- Specified by:
unsubscribe
in interfaceConnectable
-
txTrigger
public void txTrigger()
Description copied from interface:Connectable
This method notifies a producer that a transmission trigger has expired and new data would be appropriate if it can be assembled and delivered synchronously in this call.- Specified by:
txTrigger
in interfaceConnectable
-
txFresh
public void txFresh()
Description copied from interface:Connectable
This method notifies a producer that a data has been updated and a new sequence number should be generated. Produces to subscribers with application or change of state trigger types.- Specified by:
txFresh
in interfaceConnectable
-
config
public void config(SimpleDataSeg dataseg)
Description copied from interface:Connectable
Configuration assemblies or any other object that can be targeted for configuration data in a forward open service must implement this method.- Specified by:
config
in interfaceConnectable
-
getParent
public AssyMgr getParent()
- Specified by:
getParent
in interfaceAttributeHolder
- Overrides:
getParent
in classCipObject
-
getDataSize
public int getDataSize()
-
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:
-
-