RecipeElementSimple¶
Bases: RecipeElement
RecipeElementSimple class represents a basic recipe step with actions and conditions.
Notes: This class is non-copyable and non-movable.
This is the main recipe element type, supporting actions on sub-devices, conditional execution based on tags or values, and optimization settings.
__init__()
¶
Default constructor.
Initializes a new instance of the RecipeElementSimple class.
fromXML(xml)
¶
Load from XML.
Populates the simple recipe element from an XML node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xml
|
XMLNode
|
The XML node containing the simple recipe element |
required |
Raises:
| Type | Description |
|---|---|
InscoperException
|
If an error occurs |
toXML(xmlParent)
¶
Save to XML.
Exports the simple recipe element to an XML node attached to the parent XML node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xmlParent
|
XMLNode
|
The parent XML node |
required |
Raises:
| Type | Description |
|---|---|
InscoperException
|
If an error occurs |
getType()
¶
Get the element type.
Retrieves the type of this recipe element.
Returns:
| Type | Description |
|---|---|
int
|
The type (SIMPLE) |
getDescription()
¶
Get the description.
Retrieves the description of the recipe element.
Returns:
| Type | Description |
|---|---|
str
|
The description |
setDescription(description)
¶
Set the description.
Sets the description of the recipe element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
description
|
string
|
The description |
required |
getSubDeviceId()
¶
Get the sub-device ID.
Retrieves the ID of the sub-device associated with this element.
Returns:
| Type | Description |
|---|---|
SubDeviceId
|
The sub-device ID |
setSubDeviceId(subDeviceId)
¶
Set the sub-device ID.
Sets the ID of the sub-device associated with this element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subDeviceId
|
SubDeviceId
|
The sub-device ID |
required |
getRecipeId()
¶
Get the recipe ID.
Retrieves the identifier of the recipe element.
Returns:
| Type | Description |
|---|---|
str
|
The recipe ID |
setRecipeId(recipeId)
¶
Set the recipe ID.
Sets the identifier of the recipe element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipeId
|
string
|
The recipe ID |
required |
getFunction()
¶
Get the function type.
Retrieves the function type to be executed on the sub-device.
Returns:
| Type | Description |
|---|---|
int
|
The function type |
setFunction(function)
¶
Set the function type.
Sets the function type to be executed on the sub-device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
function
|
int
|
The function type |
required |
getValue()
¶
Get the value.
Retrieves the parameter value associated with the function call.
Returns:
| Type | Description |
|---|---|
str
|
The value |
setValue(value)
¶
Set the value.
Sets the parameter value associated with the function call.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
string
|
The value |
required |
getImage()
¶
Check if this element will generate an image.
Determines if the function to be called by the element generates an image.
Returns:
| Type | Description |
|---|---|
boolean
|
True if an image will be generated, false otherwise |
setImage(image)
¶
Set the image generation flag.
Sets whether the function to be called will generate an image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
boolean
|
True if an image will be generated, false otherwise |
required |
getValueConditionList()
¶
Get value conditions.
Retrieves the list of value conditions that must be met for this element to execute.
Returns:
| Type | Description |
|---|---|
list[ValueCondition]
|
The list of value conditions |
setValueConditionList(valueConditionList)
¶
Set value conditions.
Sets the list of value conditions that must be met for this element to execute.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
valueConditionList
|
list[ValueCondition]
|
The list of value conditions |
required |
addValueCondition(valueCondition)
¶
Add a value condition.
Adds a value condition to the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
valueCondition
|
ValueCondition
|
The value condition to add |
required |
getTagCondition()
¶
Get the tag condition.
Retrieves the tag condition required for execution.
Returns:
| Type | Description |
|---|---|
str
|
The tag condition |
setTagCondition(tagCondition)
¶
Set the tag condition.
Sets the tag condition required for execution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tagCondition
|
string
|
The tag condition |
required |
getOptimisation()
¶
Check the optimization flag.
Determines if optimization is enabled for this element.
Returns:
| Type | Description |
|---|---|
boolean
|
True if optimization is enabled, false otherwise |
setOptimisation(optimisation)
¶
Set the optimization flag.
Enables or disables optimization for this element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
optimisation
|
boolean
|
True to enable optimization, false to disable |
required |
hasValueCondition()
¶
Check for value conditions.
Returns whether there are value conditions associated with this recipe element.
Returns:
| Type | Description |
|---|---|
boolean
|
True if value conditions exist, false otherwise |
getCallId()
¶
Get the call ID.
Retrieves the call ID associated with this element.
Returns:
| Type | Description |
|---|---|
str
|
The call ID |
setCallId(callId)
¶
Set the call ID.
Sets the call ID associated with this element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callId
|
string
|
The call ID |
required |
addOnCallSubRecipes(elems)
¶
Add recipe elements to notify on call.
Adds a list of simple recipe elements to notify when this recipe element is called.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
elems
|
list[shared_ptr< RecipeElementSimple >]
|
The list of recipe elements to add |
required |
addOnCallSubRecipe(elem)
¶
Add a recipe element to notify on call.
Adds a simple recipe element to notify when this recipe element is called.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
elem
|
RecipeElementSimple
|
The recipe element to add |
required |
getDependencies()
¶
Get the list of recipe element call IDs that will, when called, notify this recipe element.
Retrieves the list of recipe element call IDs that will, when called, notify this recipe element.
Returns:
| Type | Description |
|---|---|
list[string]
|
The list of recipe element call IDs |
setRecipeCalled(id)
¶
Set the recipe element as called.
Marks the recipe associated to the call ID as called.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
string
|
The call ID of the recipe element |
required |
getRecipeCallCondition()
¶
Get recipe call condition.
Retrieves the call condition of the recipe.
Returns:
| Type | Description |
|---|---|
str
|
The recipe call condition |
setRecipeCallCondition(recipeCallCondition)
¶
Set recipe call condition.
Sets the call condition of the recipe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipeCallCondition
|
string
|
The recipe call condition |
required |
getRecipeCallState()
¶
Get recipe call states.
Retrieves the states of recipe calls.
Returns:
| Type | Description |
|---|---|
dict[string, bool]
|
A map pairing the call ID with the execution state |
getRecipeCallSubRecipes()
¶
Get the recipe elements to notify when this element is called.
Retrieves the list of recipe elements to notify when this element is called.
Returns:
| Type | Description |
|---|---|
list[shared_ptr< RecipeElementSimple >]
|
The list of recipe elements |