|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.roboticsAPI.controllerModel.sunrise.api.SPR
public class SPR
A SPR is a data structure which represents a Sunrise Primitive Record.
| Field Summary | |
|---|---|
static long |
INVALID_SPR_ID
SPR ID synonymous with "invalid SPR". |
| Constructor Summary | |
|---|---|
SPR(String typeName)
Creates a new instance with the given type name. |
|
SPR(String typeName,
int layer,
String deviceName)
Creates a new instance of layered with the given type name and description. |
|
SPR(String typeName,
String deviceName)
Creates a new instance with the given type name for a device and on the default layer. |
|
| Method Summary | ||
|---|---|---|
Assignment |
addAssignment(Assignment assignment)
Adds an assignment to this SPR. |
|
DefaultAssignment |
addAssignment(DefaultAssignment assignment)
Adds the default assignment to this SPR. |
|
Assignment |
addAssignment(InPort inport,
OutPort outport)
Adds an assignment to this SPR. |
|
DefaultAssignment |
addAssignment(SPRComponent destination,
SPRComponent source)
Adds a new default assignment to this SPR connecting the leftInportsCompound (the compound with the inports) with the rightOutportsCompound (the compound with the outports). |
|
Assignment |
addAssignment(SPRComponent destination,
String inportName,
SPRComponent source,
String outportName)
Adds an assignment to this SPR. |
|
Assignment |
addInterSprAssignment(InPort inport,
OutPort outport)
Adds assignment between ports belonging to compounds from different SPRs. |
|
Assignment |
addLooseAssignment(InPort inport,
OutPort outport)
Adds an intercyclic (loose) assignment to this SPR. |
|
DefaultAssignment |
addLooseAssignment(SPRComponent destination,
SPRComponent source)
Adds a new intercyclic (loose) default assignment to this SPR connecting the leftInportsCompound (the compound with the inports) with the rightOutportsCompound (the compound with the outports). |
|
Assignment |
addLooseAssignment(SPRComponent destination,
String inportName,
SPRComponent source,
String outportName)
Adds an intercyclic (loose) assignment to this SPR. |
|
void |
addModule(Module module)
Adds a compound to this SPR. |
|
SelectiveAssignment |
addSelectiveAssignment(int selectionLevel,
InPort inport,
OutPort outport)
Adds an selective assignment to this SPR. |
|
SelectiveAssignment |
addSelectiveAssignment(int selectionLevel,
SPRComponent left,
String inportName,
SPRComponent right,
String outportName)
Adds an selective assignment to this SPR. |
|
SelectiveAssignment |
addSelectiveAssignment(SelectiveAssignment assignment)
Adds an selective assignment to this SPR. |
|
SunriseStopCondition |
addStopCondition(String stopConditionExpression)
Adds a stop condition to this SPR. |
|
SunriseStopCondition |
addStopCondition(SunriseStopCondition stopCondition)
Adds a stop condition to this SPR. |
|
boolean |
canHandleSafetyStopRequest()
Returns true if this SPR can handle safety StopRequest and will not be automatically cancelled by Sunrise when a StopRequest is signaled. |
|
ActiveDevice |
getActiveDevice()
Gets the active device for this SPR. |
|
Assignment |
getAssignmentByInPort(InPort inPort)
Gets the assignment with the specified input port. |
|
Assignment |
getAssignmentByInPort(String componentInstanceName,
String portName)
Gets the assignment with the specified input port. |
|
Iterable<Assignment> |
getAssignments()
Gets all assignments. |
|
Iterable<DefaultAssignment> |
getDefaultAssignments()
Gets all default assignments. |
|
String |
getDescription()
Gets the SPR description. |
|
String |
getDeviceName()
Gets the name of the device with which this SPR associated. |
|
String |
getExpressionSegmentString(String tag)
Gets the runtime value of an expression segment. |
|
FrameDefinitionList |
getFrameDefinitions()
Gets the frame definitions of this SPR. |
|
GlobalDataServiceModule |
getGlobalDataServiceModule()
Gets instance of GlobalDataServiceModule used for this SPR. |
|
int |
getLayerAttachment()
Gets the layer attachment. |
|
|
getModule(Class<T> clazz)
Gets the first module of the specified type. |
|
Module |
getModule(String name)
Gets the module of the given name. |
|
Iterable<Module> |
getModules()
Gets all modules. |
|
|
getModules(Class<T> clazz)
Gets the all modules of the specified type. |
|
Map<String,Port> |
getPublishedPorts()
Gets a list of all published ports of this SPR. |
|
ReturnValues |
getReturnValues()
Gets all return values. |
|
SPRRuntime |
getRuntime()
Gets the runtime class associated with this SPR. |
|
Selection |
getSelection(InPort inport)
Returns the selection which targets the given inport. |
|
protected SelectionModule |
getSelectionModule()
Gets the selection module. |
|
SelectionList |
getSelections()
Gets the selections defined for this SPR. |
|
String |
getSPRInfoString()
Gets the string containing the full SPR info. |
|
String |
getStackDescription()
Gets SPR stack type description. |
|
String |
getStackTypeName()
Gets SPR stack type name. |
|
List<SunriseStopCondition> |
getStopConditions()
Gets all stop conditions. |
|
String |
getTypeName()
Gets the SPR type. |
|
|
hasModule(Class<T> clazz)
Determines if the SPR contains a module of the given type. |
|
boolean |
hasSameDataAs(Object obj)
|
|
boolean |
hasStopConditions()
Determines if this SPR has stop conditions. |
|
boolean |
isPortPublished(Port port)
Gets a flag which indicates if the given port is published or not. |
|
void |
onFinished()
Called when SPR is finished. |
|
void |
onSerialization()
Tell the SPR that serialization takes place. |
|
void |
publishPort(Port port)
Publishes the given port. |
|
void |
registerForReturnValues(OutPort port)
Registers the given port as return value of this SPR. |
|
void |
registerForReturnValues(OutPort port,
Object value)
Registers the given port as return value of this SPR. |
|
boolean |
registerForReturnValuesIfUnregistered(OutPort port,
Object value)
Registers the given port as return value of this SPR. |
|
void |
removeAssignment(Assignment assignment)
Removes the specified assignment from the SPR. |
|
void |
removeDefaultAssignment(DefaultAssignment defaultAssignment)
Removes the specified DefaultAssignment from the SPR. |
|
ActiveDevice |
setActiveDevice(ActiveDevice activeDevice)
Sets the active device for this SPR. |
|
ActiveDevice |
setActiveDevice(String deviceName,
String mode)
Sets the active device for this SPR. |
|
void |
setCanHandleSafetyStopRequest(boolean can)
Sets "can handle safety request" flag. |
|
void |
setDescription(String description)
Sets the SPR description. |
|
void |
setDeviceName(String deviceName)
Sets the of the device with which this SPR associated. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final long INVALID_SPR_ID
| Constructor Detail |
|---|
public SPR(String typeName)
typeName - The type name of the SPR.
public SPR(String typeName,
String deviceName)
typeName - The type name of the SPR.deviceName - name of the device for which this SPR is defined.
public SPR(String typeName,
int layer,
String deviceName)
typeName - The type name of the SPR. Can be null (for the moment).deviceName - name of the device for which this SPR is defined.layer - The layer id.| Method Detail |
|---|
public SPRRuntime getRuntime()
public final FrameDefinitionList getFrameDefinitions()
public final ReturnValues getReturnValues()
public final Iterable<Module> getModules()
public Module getModule(String name)
name - The name of a module.
null. The method expects that all module
names are uniquepublic final <T extends Module> Iterable<T> getModules(Class<T> clazz)
T - type of the moduleclazz - type of the module to look for.
public <T extends Module> T getModule(Class<T> clazz)
T - type of the moduleclazz - type of the module to look for.
public <T extends Module> boolean hasModule(Class<T> clazz)
T - type of the moduleclazz - the module which the SPR is supposed to contain.
True if the SPR contains the given module type, otherwise false.public final ActiveDevice getActiveDevice()
public final SelectionList getSelections()
public final Iterable<DefaultAssignment> getDefaultAssignments()
public final Iterable<Assignment> getAssignments()
public final Assignment getAssignmentByInPort(InPort inPort)
inPort - the input port to search for.
public final Assignment getAssignmentByInPort(String componentInstanceName,
String portName)
componentInstanceName - the instance name of the componentportName - the port name
public final List<SunriseStopCondition> getStopConditions()
public final boolean hasStopConditions()
public final ActiveDevice setActiveDevice(String deviceName,
String mode)
deviceName - The name of the device.mode - The mode of the device.
public final SelectiveAssignment addSelectiveAssignment(int selectionLevel,
SPRComponent left,
String inportName,
SPRComponent right,
String outportName)
selectionLevel - The level of the selective assignment.left - The compound containing the inport.inportName - The name of the inport.right - The compound containing the outport.outportName - The name of the outport.
public final SelectiveAssignment addSelectiveAssignment(SelectiveAssignment assignment)
assignment - The selective assignment.
public final SelectiveAssignment addSelectiveAssignment(int selectionLevel,
InPort inport,
OutPort outport)
selectionLevel - The level of the selective assignment.inport - The inport of the assignment.outport - The outport of the assignment.
public final Selection getSelection(InPort inport)
inport - The inport for which the selection should be returned.
public final Assignment addAssignment(SPRComponent destination,
String inportName,
SPRComponent source,
String outportName)
destination - The compound containing the inport.inportName - The name of the inport.source - The compound containing the outport.outportName - The name of the outport.
public final Assignment addLooseAssignment(SPRComponent destination,
String inportName,
SPRComponent source,
String outportName)
destination - The compound containing the inport.inportName - The name of the inport.source - The compound containing the outport.outportName - The name of the outport.
public final Assignment addAssignment(InPort inport,
OutPort outport)
inport - The inport of the assignment.outport - The outport of the assignment.
public final Assignment addLooseAssignment(InPort inport,
OutPort outport)
inport - The inport of the assignment.outport - The outport of the assignment.
public Assignment addInterSprAssignment(InPort inport,
OutPort outport)
inport - The inport of the assignment.outport - The outport of the assignment.
public final DefaultAssignment addAssignment(SPRComponent destination,
SPRComponent source)
destination - The compound whose inports will be connected.source - The compound whose outports will be connected.
public final DefaultAssignment addLooseAssignment(SPRComponent destination,
SPRComponent source)
destination - The compound whose inports will be connected.source - The compound whose outports will be connected.
public final boolean registerForReturnValuesIfUnregistered(OutPort port,
Object value)
port - The port which should be registered. null is not allowed.value - The value which should be assigned to the port and which will contain the return values. Please note
that the value needs to be convertible to an ISerializableType.
public final void registerForReturnValues(OutPort port,
Object value)
port - The port which should be registered. null is not allowed.value - The value which should be assigned to the port and which will contain the return values. Please note
that the value needs to be convertible to an ISerializableType.public void registerForReturnValues(OutPort port)
Note that the port needs to have a valid value (a value that can be converted to an ISerializableType). Otherwise, the method will fail.
port - The port which should be registered.public SunriseStopCondition addStopCondition(String stopConditionExpression)
stopConditionExpression - The stop condition expression.
E.g.: moduleInstanceName["OutportName"] > 0.99
public SunriseStopCondition addStopCondition(SunriseStopCondition stopCondition)
stopCondition - The stop condition.
public ActiveDevice setActiveDevice(ActiveDevice activeDevice)
activeDevice - The active device.
public void addModule(Module module)
module - The module to add.public DefaultAssignment addAssignment(DefaultAssignment assignment)
assignment - The default assignment. May no be null.
public void removeDefaultAssignment(DefaultAssignment defaultAssignment)
defaultAssignment - DefaultAssignment to remove.public Assignment addAssignment(Assignment assignment)
assignment - The assignment to add.
public void removeAssignment(Assignment assignment)
assignment - Assignment to remove.public void onSerialization()
public void onFinished()
Used to release resources sued by the compounds of the SPR. Calls onFinished methods of all compounds.
public String getSPRInfoString()
public String toString()
toString in class Objectprotected SelectionModule getSelectionModule()
public String getTypeName()
public String getDescription()
public void setDescription(String description)
description - the description to setpublic int getLayerAttachment()
public boolean hasSameDataAs(Object obj)
hasSameDataAs in interface com.kuka.common.IDataEquatablepublic String getExpressionSegmentString(String tag)
getExpressionSegmentString in interface IExpressionSegmenttag - An identifier which specifies the requested value.
public void publishPort(Port port)
port - The port to be published.public boolean isPortPublished(Port port)
port - The port of which the caller wants to know if it is published.
True if the given port is published; otherwise false.public Map<String,Port> getPublishedPorts()
public boolean canHandleSafetyStopRequest()
public void setCanHandleSafetyStopRequest(boolean can)
can - true if the SPR can handle safety requests.public String getDeviceName()
If SPR contains an ActiveDevice - the name of it will be returned, otherwise - returned value set by
setDeviceName(String) method.
null.public void setDeviceName(String deviceName)
SPRs which contain an ActiveDevice (pipe SPRs) do not need it. The name should be set for layer SPRs without a pipe.
deviceName - name of the associated device.
IllegalStateException - if the SPR contains an ActiveDevicepublic String getStackTypeName()
public String getStackDescription()
public GlobalDataServiceModule getGlobalDataServiceModule()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||