This interface supplies methods to create variable objects.
NOTE: Only use this functionality in a AuboCap program node (not relevant for an installation node).
在文件 variable_factory.h 第 20 行定义.
| FeatureVariablePtr arcs::aubo_scope::VariableFactory::createFeatureVariable |
( |
const std::string & | suggested_name, |
|
|
const std::vector< double > & | pose ) |
Creates a feature variable.
Registering the variable in AuboScope (by storing it in a DataModel instance or using it for the configuration of a built-in AuboScope program node) will make it accessible to all program nodes.
Setting an initial value will make it possible to read from the variable immediately without having to assign a value to it first. This can be useful in various constructs which requires an initial valu.
NOTE: Only use this method in a AuboCap program node (not relevant for an installation node).
- 参数
-
| suggested_name | Suggested name of the variable. Valid names must match regex [a-zA-Z][a-zA-Z0-9_]{0,14} for a total of 15 characters. |
| initialValue | The expression that will be evaluated in order to initialize the value of the variable. This value is assigned before the actual program runs. |
- 返回
- FeatureVariable.
- 异常
-
| VariableException | In case of an illegal name. |
| GlobalVariablePtr arcs::aubo_scope::VariableFactory::createGlobalVariable |
( |
const std::string & | suggested_name, |
|
|
ExpressionPtr | initialValue ) |
Creates a global variable.
Registering the variable in AuboScope (by storing it in a DataModel instance or using it for the configuration of a built-in AuboScope program node) will make it accessible to all program nodes.
Setting an initial value will make it possible to read from the variable immediately without having to assign a value to it first. This can be useful in various constructs which requires an initial value, e.g. 'var_1 = var_1 + 1' or 'if (var_2 =):'.
NOTE: Only use this method in a AuboCap program node (not relevant for an installation node).
- 参数
-
| suggested_name | Suggested name of the variable. Valid names must match regex [a-zA-Z][a-zA-Z0-9_]{0,14} for a total of 15 characters. |
| initialValue | The expression that will be evaluated in order to initialize the value of the variable. This value is assigned before the actual program runs. |
- 返回
- GlobalVariable.
- 异常
-
| VariableException | In case of an illegal name. |