com.kuka.roboticsAPI.controllerModel.sunrise.api
Class SPRComponent

java.lang.Object
  extended by com.kuka.roboticsAPI.controllerModel.sunrise.api.SPRComponent
All Implemented Interfaces:
com.kuka.common.IDataEquatable, IExpressionSegment, ISprComponent, ISegment
Direct Known Subclasses:
ActiveDevice, Module

public abstract class SPRComponent
extends Object
implements ISprComponent, ISegment, IExpressionSegment

A SPR component is part of an SPR an provides outports for the data-flow and has inports which can be connected with outports of other SPR components. A SPR component can also have parameters.

Each SPR component will have a unique instance name. The API will ensure, that each SPR component will have such a unique name. But if the user wants to have a special name, he can set this name.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

Constructor Summary
protected SPRComponent()
          Creates a new compound with no instance name.
protected SPRComponent(String name)
          Creates a new compound with a unique instance name.
 
Method Summary
 InPort addInPort(InPort port)
          Adds a inport to this compound.
 InPort addInPort(String name)
          Adds an inport to this compound.
 OutPort addOutPort(OutPort port)
          Adds a outport to this compound.
 OutPort addOutPort(String name)
          Adds a outport to this compound.
<T> Parameter<T>
addParameter(String name, T value)
          Adds a new parameter to this compound.
 int getChecksum()
          Returns the checksum for the segment.
abstract  String getComponentType()
          Gets the type of this component.
abstract  String getComponentVersion()
          Gets the version of this component.
 String getExpressionSegmentString(String tag)
          Gets the runtime value of an expression segment.
 InPort getInPort(String name)
          Gets the inport with the specified name.
 List<InPort> getInPorts()
          Gets the inports of this compound.
 String getInstanceName()
          Gets the instance name of this compound.
 String getName()
          Gets the name of this compound.
 OutPort getOutPort(String name)
          Gets the outport with the specified name.
 List<OutPort> getOutPorts()
          Gets the outports of this compound.
 Parameter<?> getParameter(String name)
          Gets the parameter with the specified name.
 ParameterList getParameterList()
          Gets the parameter list of this compound.
 SPR getSPR()
          Gets the parent SPR.
 boolean hasSameDataAs(Object obj)
          
 void onAsyncEvent(Message msg)
          Called when a compound event was received.
protected  void onFinished()
          Called when the SPR in which this compound is added, is finished.
 void onInitialize()
          Called when the SPR-runtime is initialized.
protected  void onSerialization()
          Called when the SPR in which this compound is added, is serialized.
 void onSPRStateChanged(SPRState newState)
          Called when the SPR-runtime state changes (called asynchronously).
 void onSPRStateChangedSync(SPRState newState)
          Called when the SPR-runtime state changes (called synchronously).
 void setInstanceName(String instanceName)
          Sets the instance name of this compound.
 void setName(String name)
          Sets the name of this compound.
 String toString()
          
 Parameter<?> tryGetParameter(String name)
          Tries to get the parameter with the specified name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SPRComponent

protected SPRComponent(String name)
Creates a new compound with a unique instance name.

Parameters:
name - The name of the compound.

SPRComponent

protected SPRComponent()
Creates a new compound with no instance name.

Method Detail

addParameter

public final <T> Parameter<T> addParameter(String name,
                                           T value)
Adds a new parameter to this compound. This method does not care if the same parameter is added twice. If a parameter with the same name was already added, this parameter will be replaced by the new one.

Type Parameters:
T - The type of the parameter.
Parameters:
name - The name of the parameter.
value - The value of the parameter.
Returns:
The created parameter.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getParameterList

public final ParameterList getParameterList()
Gets the parameter list of this compound.

Returns:
The parameter list of this compound.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getParameter

public final Parameter<?> getParameter(String name)
Gets the parameter with the specified name.

Parameters:
name - The name of the parameter. null is not allowed.
Returns:
The parameter with the specified name.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

tryGetParameter

public final Parameter<?> tryGetParameter(String name)
Tries to get the parameter with the specified name.

Parameters:
name - The name of the parameter. null is not allowed.
Returns:
The parameter with the specified name, or null if not found.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addInPort

public final InPort addInPort(String name)
Adds an inport to this compound. If an inport with the same name was already added, this port will be used (as return value of this method). We do this because there may be some references on this port (like return values).

Parameters:
name - The name of the inport.
Returns:
The created inport.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addInPort

public InPort addInPort(InPort port)
Adds a inport to this compound. If an inport with the same name was already added, this port will be used (as return value of this method). We do this because there may be some references on this port (like return values).

Parameters:
port - The inport to add.
Returns:
The inport.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addOutPort

public final OutPort addOutPort(String name)
Adds a outport to this compound. If an outport with the same name was already added, this port will be used (as return value of this method). We do this because there may be some references on this port (like return values).

Parameters:
name - The name of the outport.
Returns:
The created outport.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addOutPort

public OutPort addOutPort(OutPort port)
Adds a outport to this compound. If an outport with the same name was already added, this port will be used (as return value of this method). We do this because there may be some references on this port (like return values).

Parameters:
port - The outport to add.
Returns:
The outport.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getInPorts

public final List<InPort> getInPorts()
Gets the inports of this compound.

Returns:
The inports of this compound.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getOutPorts

public final List<OutPort> getOutPorts()
Gets the outports of this compound.

Returns:
The outports of this compound.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getOutPort

public final OutPort getOutPort(String name)
Gets the outport with the specified name.

Parameters:
name - The name of the port. null is not allowed.
Returns:
The outport with the specified name.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getInPort

public final InPort getInPort(String name)
Gets the inport with the specified name.

Parameters:
name - The name of the port. null is not allowed.
Returns:
The inport with the specified name.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

setInstanceName

public void setInstanceName(String instanceName)
Sets the instance name of this compound. The instance name is a unique identifier for a compound within a SPR.

Parameters:
instanceName - The instance name for this compound.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getInstanceName

public String getInstanceName()
Gets the instance name of this compound.

Specified by:
getInstanceName in interface ISprComponent
Returns:
The instance name of this compound.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

toString

public String toString()

Overrides:
toString in class Object
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getName

public final String getName()
Gets the name of this compound. The name identifies the type of this compound for Sunrise.

Specified by:
getName in interface ISprComponent
Returns:
The name of this compound.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

setName

public final void setName(String name)
Sets the name of this compound.

Parameters:
name - The name of this compound. null is not allowed.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

onSerialization

protected void onSerialization()
Called when the SPR in which this compound is added, is serialized.


onFinished

protected void onFinished()
Called when the SPR in which this compound is added, is finished.


onInitialize

public void onInitialize()
Called when the SPR-runtime is initialized.


onAsyncEvent

public void onAsyncEvent(Message msg)
Called when a compound event was received.

Parameters:
msg - Message containing compound event

onSPRStateChanged

public void onSPRStateChanged(SPRState newState)
Called when the SPR-runtime state changes (called asynchronously).

Parameters:
newState - the new SPR state

onSPRStateChangedSync

public void onSPRStateChangedSync(SPRState newState)
Called when the SPR-runtime state changes (called synchronously).

Parameters:
newState - the new SPR state
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getComponentType

public abstract String getComponentType()
Gets the type of this component.

Specified by:
getComponentType in interface ISegment
Returns:
The type of this component.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getChecksum

public int getChecksum()
Returns the checksum for the segment.

Specified by:
getChecksum in interface ISegment
Returns:
The checksum for the segment.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getComponentVersion

public abstract String getComponentVersion()
Gets the version of this component.

Specified by:
getComponentVersion in interface ISegment
Returns:
The version of this component.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

hasSameDataAs

public boolean hasSameDataAs(Object obj)

Specified by:
hasSameDataAs in interface com.kuka.common.IDataEquatable
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getSPR

public SPR getSPR()
Gets the parent SPR.

Specified by:
getSPR in interface ISprComponent
Returns:
The parent SPR.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getExpressionSegmentString

public String getExpressionSegmentString(String tag)
Description copied from interface: IExpressionSegment
Gets the runtime value of an expression segment.

Specified by:
getExpressionSegmentString in interface IExpressionSegment
Parameters:
tag - An identifier which specifies the requested value.
Returns:
The runtime value of the given tag.


Copyright © 2019. All rights reserved.