ActionController

Inherits IActionController.

Public Member Functions

 ActionController (MVPlugin_t handle)
 
ActionId SelectModeAutomatic () override
 This action triggers the vision system to change from the "Pre-operational" state into the operational mode "OperationalAutomaticMode". More...
 
ActionId PrepareRecipe (MVPlugin::RecipeId const &recipeId) override
 This action triggers the vision system to load a recipe with the specified ID and the vision app (i.e., *.mvapp) that is referenced in the recipe. More...
 
ActionId UnprepareRecipe (std::optional< MVPlugin::RecipeId > const &recipeId) override
 
ActionInfo StartSingleJob (StartJobOptions options) override
 This action is called to trigger a single execution of the vision app (i.e., *.mvapp) where options to parameterize the job are aggregated in the data structure StartJobOptions. More...
 
ActionInfo StartContinuous (StartJobOptions options) override
 This action is called to trigger a continuous execution of the vision app (i.e., *.mvapp) where options to parameterize the job are aggregated in the data structure StartJobOptions. More...
 
ActionId Halt () override
 This action can be called in any of the sub-states of "Operational" or in the state "Pre-operational" to facilitate the transition of the vision system to the "Halted" state. More...
 
ActionId Reset () override
 This action behaves similarly to Halt with the distinction that the vision system will ultimately end up in the "Pre-operational" state. More...
 
ActionId Stop () override
 This action is called to stop the execution of the vision app and may thus only be called in the state "SingleExecution". More...
 
ActionId Abort () override
 This action is currently synonymous to Stop. More...
 
ActionInfo StartSingleJob ()
 This action is called to trigger a single execution of the vision app (i.e., *.mvapp) that is referenced in the currently prepared recipe. More...
 
virtual ActionInfo StartSingleJob (std::optional< RecipeId > const &recipeId, std::vector< VariantScalar > startParams)
 This action is called to trigger a single execution of the vision app (i.e., *.mvapp) but with additional parameters. More...
 
virtual ActionInfo StartSingleJob (StartJobOptions options)=0
 This action is called to trigger a single execution of the vision app (i.e., *.mvapp) where options to parameterize the job are aggregated in the data structure StartJobOptions. More...
 
ActionInfo StartContinuous ()
 This action is called to trigger a continuous execution of the vision app (i.e., *.mvapp) that is referenced in the currently prepared recipe. More...
 
virtual ActionInfo StartContinuous (std::optional< RecipeId > const &recipeId, std::vector< VariantScalar > startParams)
 This action is called to trigger a continuous execution of the vision app (i.e., *.mvapp) but with additional parameters. More...
 
virtual ActionInfo StartContinuous (StartJobOptions options)=0
 This action is called to trigger a continuous execution of the vision app (i.e., *.mvapp) where options to parameterize the job are aggregated in the data structure StartJobOptions. More...
 
- Public Member Functions inherited from IActionController
virtual ActionId UnprepareRecipe (std::optional< RecipeId > const &recipeId)=0
 This action may only be called while the vision system is in the "Ready" state. More...
 
ActionInfo StartSingleJob ()
 This action is called to trigger a single execution of the vision app (i.e., *.mvapp) that is referenced in the currently prepared recipe. More...
 
ActionInfo StartContinuous ()
 This action is called to trigger a continuous execution of the vision app (i.e., *.mvapp) that is referenced in the currently prepared recipe. More...
 
virtual ActionInfo StartSingleJob (std::optional< RecipeId > const &recipeId, std::vector< VariantScalar > startParams)
 This action is called to trigger a single execution of the vision app (i.e., *.mvapp) but with additional parameters. More...
 
virtual ActionInfo StartContinuous (std::optional< RecipeId > const &recipeId, std::vector< VariantScalar > startParams)
 This action is called to trigger a continuous execution of the vision app (i.e., *.mvapp) but with additional parameters. More...
 

Member Function Documentation

◆ Abort()

ActionId Abort ( )
inlineoverridevirtual

This action is currently synonymous to Stop.

Returns
the unique ID of the action when it is enqueued

Implements IActionController.

◆ Halt()

ActionId Halt ( )
inlineoverridevirtual

This action can be called in any of the sub-states of "Operational" or in the state "Pre-operational" to facilitate the transition of the vision system to the "Halted" state.

Note that the system may not change immediately to the "Halted" state but unprepare the currently prepared recipe during which time it will intermediately change to the "Initialized" state. If an execution is in progress while Halt is called, it will finish as usual but the system will change to "Initialized" without intermediately going to "Ready" and no Ready event will be emitted. However, the corresponding ResultReady event will be.

Returns
the unique ID of the action when it is enqueued

Implements IActionController.

◆ PrepareRecipe()

ActionId PrepareRecipe ( MVPlugin::RecipeId const &  recipeId)
inlineoverridevirtual

This action triggers the vision system to load a recipe with the specified ID and the vision app (i.e., *.mvapp) that is referenced in the recipe.

PrepareRecipe is called automatically when MERLIC RTE is started and can be called in either the "Initialized" or "Ready" state. In the latter, it will trigger the unpreparation of the previously prepared recipe. While the recipe is being prepared, the system will change into the "Initialized" state and return to "Ready" once it concluded at which point a RecipePrepared event is emitted

Parameters
recipeIdthe specified recipe ID which should be loaded
Returns
the unique ID of the action when it is enqueued

Implements IActionController.

◆ Reset()

ActionId Reset ( )
inlineoverridevirtual

This action behaves similarly to Halt with the distinction that the vision system will ultimately end up in the "Pre-operational" state.

It can be called in any of the sub-states of "Operational" or in "Halted".

Returns
the unique ID of the action when it is enqueued

Implements IActionController.

◆ SelectModeAutomatic()

ActionId SelectModeAutomatic ( )
inlineoverridevirtual

This action triggers the vision system to change from the "Pre-operational" state into the operational mode "OperationalAutomaticMode".

Note that the vision system triggers the selection of the automatic mode on startup.

Returns
the unique ID of the action when it is enqueued

Implements IActionController.

◆ StartContinuous() [1/4]

ActionInfo StartContinuous
inline

This action is called to trigger a continuous execution of the vision app (i.e., *.mvapp) that is referenced in the currently prepared recipe.

It may only be called in the "Ready" state. The vision system will change to the "ContinuousExecutionState" state and emit a JobStarted event as the execution commences. The continuous execution is a series of single executions with the difference that the vision system only emits a "Ready" event after the execution is stopped.

Returns
the unique ID of the action when it is enqueued and a unique ID of the job. Note that job IDs are assigned regardless of whether or not a job can be started at the time the action is processed by the vision system; if so, a JobStarted event will be emitted which references the job ID.

◆ StartContinuous() [2/4]

ActionInfo StartContinuous ( StartJobOptions  options)
inlineoverridevirtual

This action is called to trigger a continuous execution of the vision app (i.e., *.mvapp) where options to parameterize the job are aggregated in the data structure StartJobOptions.

Parameters
optionsThe parameter contains a data structure which holds all of the additional parameters which can be set when starting a job. All of the parameters have default initializers, so if C++20 is available, designated initializers may be used to only specify a subset. The data structure may be extended in future API versions.

Implements IActionController.

◆ StartContinuous() [3/4]

virtual ActionInfo StartContinuous

This action is called to trigger a continuous execution of the vision app (i.e., *.mvapp) where options to parameterize the job are aggregated in the data structure StartJobOptions.

Parameters
optionsThe parameter contains a data structure which holds all of the additional parameters which can be set when starting a job. All of the parameters have default initializers, so if C++20 is available, designated initializers may be used to only specify a subset. The data structure may be extended in future API versions.

◆ StartContinuous() [4/4]

virtual ActionInfo StartContinuous
inline

This action is called to trigger a continuous execution of the vision app (i.e., *.mvapp) but with additional parameters.

See also StartContinuous().

Parameters
recipeIdThe parameter represents the recipe ID of the recipe that is to be executed. The parameter is optional: If no recipe ID is specified, the currently prepared recipe is executed. If a recipe ID is specified, it must match the ID of the latest prepared recipe.
startParamsThe parameter represents the vector of parameter values that are used for the single execution instead of the parameter values defined in the recipe that is to be executed. When specifying the parameter values in the vector, some requirements must be fulfilled.
  • Correct number of vector elements: The vector size must correspond to the number of parameter values defined in the specified recipe. For each recipe value, a vector element must be defined.
  • Correct order of vector elements: The order of the values defined in the vector must correspond to the order of the parameter values in the recipe. The value of the first vector element overwrites the first parameter value in the recipe and so on.
  • Suitable data type for a lossless conversion: The data type of each vector element must be suitable to enable a lossless conversion of the actual value in the tuple to the data type of the respective recipe value. Either the data type of the vector element corresponds to the one of the recipe value or the data type has a value range in which the actual value of the vector element can be represented. If these requirements are not fulfilled, the action will result in a non-fatal Error event and the parameter values in the vector are ignored. In this case, the parameter values defined in the recipe will be used for the single execution.
Returns
the unique ID of the action when it is enqueued and a unique ID of the job.

◆ StartSingleJob() [1/4]

ActionInfo StartSingleJob
inline

This action is called to trigger a single execution of the vision app (i.e., *.mvapp) that is referenced in the currently prepared recipe.

It may only be called in the "Ready" state. The vision system will change to the state "SingleExecution" and emit a JobStarted event as the execution commences. Upon the execution's completion, the system returns to the "Ready" state and emits a Ready event unless preempted by way of Halt or Reset actions during the ongoing execution.

Returns
the unique ID of the action when it is enqueued and a unique ID of the job. Note that job IDs are assigned regardless of whether or not a job can be started at the time the action is processed by the vision system; if so, a JobStarted event will be emitted which references the job ID.

◆ StartSingleJob() [2/4]

ActionInfo StartSingleJob ( StartJobOptions  options)
inlineoverridevirtual

This action is called to trigger a single execution of the vision app (i.e., *.mvapp) where options to parameterize the job are aggregated in the data structure StartJobOptions.

Parameters
optionsThe parameter contains a data structure holding all of the additional parameters which can be set when starting a job. All of the parameters have default initializers, so if C++20 is available, designated initializers may be used to only specify a subset. The data structure may be extended in future API versions.

Implements IActionController.

◆ StartSingleJob() [3/4]

virtual ActionInfo StartSingleJob

This action is called to trigger a single execution of the vision app (i.e., *.mvapp) where options to parameterize the job are aggregated in the data structure StartJobOptions.

Parameters
optionsThe parameter contains a data structure holding all of the additional parameters which can be set when starting a job. All of the parameters have default initializers, so if C++20 is available, designated initializers may be used to only specify a subset. The data structure may be extended in future API versions.

◆ StartSingleJob() [4/4]

virtual ActionInfo StartSingleJob
inline

This action is called to trigger a single execution of the vision app (i.e., *.mvapp) but with additional parameters.

See also StartSingleJob().

Parameters
recipeIdThe parameter represents the recipe ID of the recipe that is to be executed. The parameter is optional: If no recipe ID is specified, the currently prepared recipe is executed. If a recipe ID is specified, it must match the ID of the latest prepared recipe.
startParamsThe parameter represents the vector of parameter values that are used for the single execution instead of the parameter values defined in the recipe that is to be executed. When specifying the parameter values in the vector, some requirements must be fulfilled.
  • Correct number of vector elements: The vector size must correspond to the number of parameter values defined in the specified recipe. For each recipe value, a vector element must be defined.
  • Correct order of vector elements: The order of the values defined in the vector must correspond to the order of the parameter values in the recipe. The value of the first vector element overwrites the first parameter value in the recipe and so on.
  • Suitable data type for a lossless conversion: The data type of each vector element must be suitable to enable a lossless conversion of the actual value in the tuple to the data type of the respective recipe value. Either the data type of the vector element corresponds to the one of the recipe value or the data type has a value range in which the actual value of the vector element can be represented. If these requirements are not fulfilled, the action will result in a non-fatal Error event and the parameter values in the vector are ignored. In this case, the parameter values defined in the recipe will be used for the single execution.
Returns
the unique ID of the action when it is enqueued and a unique ID of the job.

◆ Stop()

ActionId Stop ( )
inlineoverridevirtual

This action is called to stop the execution of the vision app and may thus only be called in the state "SingleExecution".

Currently, calling Stop will not stop the execution any sooner than it would by simply waiting for the single execution to finish. However, once the execution concludes, the resulting Ready and StateChanged events will reference the ID of the Stop action as their cause.

Returns
the unique ID of the action when it is enqueued

Implements IActionController.


The documentation for this class was generated from the following file: