|
AuboStudio SDK
0.6.3
|
|
|
|
|
ScriptWriter This interface provides support for generating Script code. More...
#include <script_writer.h>
Public Member Functions | |
| ScriptWriter (ScriptWriter &f) | |
| ScriptWriter (ScriptWriter &&f) | |
| virtual | ~ScriptWriter () |
| void | setLabel (int lineno, const std::string &comment) |
| void | appendLine (const std::string &script_line) |
| Adds a single line of script code using auto-indentation. | |
| void | appendVectorDouble (const std::vector< double > &value) |
| void | appendRaw (const std::string &script) |
| Adds script code appending the script code as is without using auto-indentation. | |
| std::string | generateScript () |
| Generate a string with the full script code. | |
| void | writeChildren () |
| Use this method when generating script code for a node that has children nodes. | |
| void | assign (VariablePtr variable, const std::string &expression, bool sync=false) |
| void | assign (const std::string &variableName, const ExpressionPtr &expression, bool sync=false) |
| void | assign (VariablePtr variable, const ExpressionPtr &expression, bool sync=false) |
| void | incrementVariable (const std::string &variable_name) |
| Add 1 to the variable value. | |
| void | note (const std::string &expression) |
| Add a note. | |
| void | sleep (double seconds) |
| Sleep for a number of seconds. | |
| void | sync () |
| Sync. | |
| void | defineFunction (const std::string &func_name) |
| Define a function. | |
| void | anonyFunction (const std::string &func_name) |
| void | setRobotIndex (int robot_index) |
| void | returnMethod () |
| Return from method. | |
| void | end () |
| Insert an end. | |
| void | lineFeed () |
| Insert an empty line. | |
| void | setPayload (double mass, double x, double y, double z) |
| Sets the mass and Center of Gravity of the payload. | |
| void | setTcp (const std::vector< double > &pose) |
| Set the Tool Center Point. | |
| void | ifCondition (const ExpressionPtr &expression) |
| Start an if-conditional. | |
| void | ifNotCondition (const ExpressionPtr &expression) |
| Start a negated if-conditional. | |
| void | elseIfCondition (const ExpressionPtr &expression) |
| Adds an else-if branch. | |
| void | elseCondition () |
| Adds an else branch. | |
| void | forCondition (int count, int step) |
| Starts a for-loop. | |
| void | whileTrue () |
| Starts a while true loop. | |
| void | whileCondition (const ExpressionPtr &expression) |
| Starts a while-loop. | |
| void | whileNot (const ExpressionPtr &expression) |
| Starts a negated while-loop. | |
| void | defineThread (const std::string &thread_name, bool loop_or_not) |
| Start a thread definition. | |
| void | runThread (const std::string &thread_name) |
| Start a thread. | |
| void | killThread (const std::string &thread_name) |
| Kill a thread. | |
| std::string | getResolvedVariable (const std::string &variable_name) |
| Returns a registered variable name that can be used in a script. | |
| void | increaseIndent () |
| void | decreaseIndent () |
Private Member Functions | |
| ScriptWriter () | |
Private Attributes | |
| void * | d_ { nullptr } |
Friends | |
| class | DataSwitch |
ScriptWriter This interface provides support for generating Script code.
Definition at line 23 of file script_writer.h.
| arcs::aubo_scope::ScriptWriter::ScriptWriter | ( | ScriptWriter & | f | ) |
References ScriptWriter().
Referenced by ScriptWriter(), and ScriptWriter().


| arcs::aubo_scope::ScriptWriter::ScriptWriter | ( | ScriptWriter && | f | ) |
|
virtual |
|
private |
| void arcs::aubo_scope::ScriptWriter::anonyFunction | ( | const std::string & | func_name | ) |
| void arcs::aubo_scope::ScriptWriter::appendLine | ( | const std::string & | script_line | ) |
Adds a single line of script code using auto-indentation.
| script_line | single line of script code to append. |
| void arcs::aubo_scope::ScriptWriter::appendRaw | ( | const std::string & | script | ) |
Adds script code appending the script code as is without using auto-indentation.
| script | script code to append. |
| void arcs::aubo_scope::ScriptWriter::appendVectorDouble | ( | const std::vector< double > & | value | ) |
| void arcs::aubo_scope::ScriptWriter::assign | ( | const std::string & | variableName, |
| const ExpressionPtr & | expression, | ||
| bool | sync = false ) |
| void arcs::aubo_scope::ScriptWriter::assign | ( | VariablePtr | variable, |
| const ExpressionPtr & | expression, | ||
| bool | sync = false ) |
| void arcs::aubo_scope::ScriptWriter::assign | ( | VariablePtr | variable, |
| const std::string & | expression, | ||
| bool | sync = false ) |
| void arcs::aubo_scope::ScriptWriter::decreaseIndent | ( | ) |
| void arcs::aubo_scope::ScriptWriter::defineFunction | ( | const std::string & | func_name | ) |
Define a function.
| func_name | function name. |
| void arcs::aubo_scope::ScriptWriter::defineThread | ( | const std::string & | thread_name, |
| bool | loop_or_not ) |
Start a thread definition.
| thread_name | the thread name, |
| loop_or_not | whether loops. |
| void arcs::aubo_scope::ScriptWriter::elseCondition | ( | ) |
Adds an else branch.
| void arcs::aubo_scope::ScriptWriter::elseIfCondition | ( | const ExpressionPtr & | expression | ) |
Adds an else-if branch.
| expression | the expression. |
| void arcs::aubo_scope::ScriptWriter::end | ( | ) |
Insert an end.
| void arcs::aubo_scope::ScriptWriter::forCondition | ( | int | count, |
| int | step ) |
Starts a for-loop.
| count | loop count, |
| step | loop step. |
| std::string arcs::aubo_scope::ScriptWriter::generateScript | ( | ) |
Generate a string with the full script code.
| std::string arcs::aubo_scope::ScriptWriter::getResolvedVariable | ( | const std::string & | variable_name | ) |
Returns a registered variable name that can be used in a script.
| variable_name | a variable name. |
| void arcs::aubo_scope::ScriptWriter::ifCondition | ( | const ExpressionPtr & | expression | ) |
Start an if-conditional.
| expression | the expression. |
| void arcs::aubo_scope::ScriptWriter::ifNotCondition | ( | const ExpressionPtr & | expression | ) |
Start a negated if-conditional.
| expression | the expression. |
| void arcs::aubo_scope::ScriptWriter::increaseIndent | ( | ) |
| void arcs::aubo_scope::ScriptWriter::incrementVariable | ( | const std::string & | variable_name | ) |
Add 1 to the variable value.
| variable_name | the variable to increment. |
| void arcs::aubo_scope::ScriptWriter::killThread | ( | const std::string & | thread_name | ) |
Kill a thread.
| thread_name | the thread name. |
| void arcs::aubo_scope::ScriptWriter::lineFeed | ( | ) |
Insert an empty line.
| void arcs::aubo_scope::ScriptWriter::note | ( | const std::string & | expression | ) |
Add a note.
| expression | the note expression. |
| void arcs::aubo_scope::ScriptWriter::returnMethod | ( | ) |
Return from method.
| void arcs::aubo_scope::ScriptWriter::runThread | ( | const std::string & | thread_name | ) |
Start a thread.
| thread_name | the thread name. |
| void arcs::aubo_scope::ScriptWriter::setLabel | ( | int | lineno, |
| const std::string & | comment ) |
| void arcs::aubo_scope::ScriptWriter::setPayload | ( | double | mass, |
| double | x, | ||
| double | y, | ||
| double | z ) |
Sets the mass and Center of Gravity of the payload.
| void arcs::aubo_scope::ScriptWriter::setRobotIndex | ( | int | robot_index | ) |
| void arcs::aubo_scope::ScriptWriter::setTcp | ( | const std::vector< double > & | pose | ) |
Set the Tool Center Point.
| void arcs::aubo_scope::ScriptWriter::sleep | ( | double | seconds | ) |
Sleep for a number of seconds.
| seconds | amount of time to sleep in seconds. |
| void arcs::aubo_scope::ScriptWriter::sync | ( | ) |
| void arcs::aubo_scope::ScriptWriter::whileCondition | ( | const ExpressionPtr & | expression | ) |
Starts a while-loop.
| expression | the loop invariant. |
| void arcs::aubo_scope::ScriptWriter::whileNot | ( | const ExpressionPtr & | expression | ) |
Starts a negated while-loop.
| expression | the loop invariant. |
| void arcs::aubo_scope::ScriptWriter::whileTrue | ( | ) |
Starts a while true loop.
| void arcs::aubo_scope::ScriptWriter::writeChildren | ( | ) |
Use this method when generating script code for a node that has children nodes.
Let children nodes generate code.
|
friend |
|
private |
Definition at line 225 of file script_writer.h.