AuboStudio SDK  0.6.3
arcs::aubo_scope::ScriptWriter类 参考

\chinese 脚本写入器 此接口提供生成脚本代码的支持。 \endchinese \english ScriptWriter This interface provides support for generating Script code. 更多...

#include <script_writer.h>

Public 成员函数

 ScriptWriter (ScriptWriter &f)
 ScriptWriter (ScriptWriter &&f)
virtual ~ScriptWriter ()
void setLabel (int lineno, const std::string &comment)
void appendLine (const std::string &script_line)
 \chinese 使用自动缩进添加一行脚本代码。
void appendVectorDouble (const std::vector< double > &value)
void appendRaw (const std::string &script)
 \chinese 按原样追加脚本代码,不使用自动缩进。
std::string generateScript ()
 \chinese 生成包含完整脚本代码的字符串。
void writeChildren ()
 \chinese 当为具有子节点的节点生成脚本代码时使用此方法。让子节点生成代码。 \endchinese \english 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)
 \chinese
void assign (VariablePtr variable, const ExpressionPtr &expression, bool sync=false)
 \chinese
void incrementVariable (const std::string &variable_name)
 \chinese 变量值加1。
void note (const std::string &expression)
 \chinese 添加注释。 \endchinese \english Add a note.
void sleep (double seconds)
 \chinese 休眠指定秒数。 \endchinese \english Sleep for a number of seconds.
void sync ()
 \chinese 用完当前帧剩余时间。 \endchinese \english Sync.
void defineFunction (const std::string &func_name)
 \chinese 定义函数。 \endchinese \english Define a function.
void anonyFunction (const std::string &func_name)
void setRobotIndex (int robot_index)
void returnMethod ()
 \chinese 返回。 \endchinese \english Return from method.
void end ()
 \chinese 插入end。 \endchinese \english Insert an end.
void lineFeed ()
 \chinese 插入空行。 \endchinese \english Insert an empty line.
void setPayload (double mass, double x, double y, double z)
 \chinese 设置负载质量和重心。 \endchinese \english Sets the mass and Center of Gravity of the payload.
void setTcp (const std::vector< double > &pose)
 \chinese 设置TCP。 \endchinese \english Set the Tool Center Point.
void ifCondition (const ExpressionPtr &expression)
 \chinese 开始if条件。 \endchinese \english Start an if-conditional.
void ifNotCondition (const ExpressionPtr &expression)
 \chinese 开始取反的if条件。 \endchinese \english Start a negated if-conditional.
void elseIfCondition (const ExpressionPtr &expression)
 \chinese 添加else-if分支。 \endchinese \english Adds an else-if branch.
void elseCondition ()
 \chinese 添加else分支。 \endchinese \english Adds an else branch.
void forCondition (int count, int step)
 \chinese 开始for循环。 \endchinese \english Starts a for-loop.
void whileTrue ()
 \chinese 开始while true循环。 \endchinese \english Starts a while true loop.
void whileCondition (const ExpressionPtr &expression)
 \chinese 开始while循环。 \endchinese \english Starts a while-loop.
void whileNot (const ExpressionPtr &expression)
 \chinese 开始取反的while循环。 \endchinese \english Starts a negated while-loop.
void defineThread (const std::string &thread_name, bool loop_or_not)
 \chinese 定义线程。 \endchinese \english Start a thread definition.
void runThread (const std::string &thread_name)
 \chinese 启动线程。 \endchinese \english Start a thread.
void killThread (const std::string &thread_name)
 \chinese 终止线程。 \endchinese \english Kill a thread.
std::string getResolvedVariable (const std::string &variable_name)
 \chinese 获取可在脚本中使用的已注册变量名。
void increaseIndent ()
void decreaseIndent ()

Private 成员函数

 ScriptWriter ()

Private 属性

void * d_ { nullptr }

友元

class DataSwitch

详细描述

\chinese 脚本写入器 此接口提供生成脚本代码的支持。 \endchinese \english ScriptWriter This interface provides support for generating Script code.

\endenglish

在文件 script_writer.h23 行定义.

构造及析构函数说明

◆ ScriptWriter() [1/3]

arcs::aubo_scope::ScriptWriter::ScriptWriter ( ScriptWriter & f)

引用了 ScriptWriter().

被这些函数引用 ScriptWriter() , 以及 ScriptWriter().

函数调用图:
这是这个函数的调用关系图:

◆ ScriptWriter() [2/3]

arcs::aubo_scope::ScriptWriter::ScriptWriter ( ScriptWriter && f)

引用了 ScriptWriter().

函数调用图:

◆ ~ScriptWriter()

virtual arcs::aubo_scope::ScriptWriter::~ScriptWriter ( )
virtual

◆ ScriptWriter() [3/3]

arcs::aubo_scope::ScriptWriter::ScriptWriter ( )
private

成员函数说明

◆ anonyFunction()

void arcs::aubo_scope::ScriptWriter::anonyFunction ( const std::string & func_name)

◆ appendLine()

void arcs::aubo_scope::ScriptWriter::appendLine ( const std::string & script_line)

\chinese 使用自动缩进添加一行脚本代码。

参数
script_line要追加的脚本代码行。 \endchinese \english Adds a single line of script code using auto-indentation.
script_linesingle line of script code to append. \endenglish

◆ appendRaw()

void arcs::aubo_scope::ScriptWriter::appendRaw ( const std::string & script)

\chinese 按原样追加脚本代码,不使用自动缩进。

参数
script要追加的脚本代码。 \endchinese \english Adds script code appending the script code as is without using auto-indentation.
scriptscript code to append. \endenglish

◆ appendVectorDouble()

void arcs::aubo_scope::ScriptWriter::appendVectorDouble ( const std::vector< double > & value)

◆ assign() [1/3]

void arcs::aubo_scope::ScriptWriter::assign ( const std::string & variableName,
const ExpressionPtr & expression,
bool sync = false )

\chinese

变量赋值。在无local或global限定符的情况下赋值。

参数
variableName变量名称。
expression赋给变量的表达式。 \endchinese \english

Variable assignment. Assigns the variable without a local or global qualifier.

参数
variableNamename of the variable, not null.
expressionexpression that is assigned to the variable, not null. \endenglish

引用了 sync().

函数调用图:

◆ assign() [2/3]

void arcs::aubo_scope::ScriptWriter::assign ( VariablePtr variable,
const ExpressionPtr & expression,
bool sync = false )

\chinese

变量赋值。

参数
variable变量。
expression表达式。 \endchinese \english

Variable assignment.

参数
variablethe variable to assign an expression to, not null.
expressionexpression that is assigned to the variable, not null. \endenglish

引用了 sync().

函数调用图:

◆ assign() [3/3]

void arcs::aubo_scope::ScriptWriter::assign ( VariablePtr variable,
const std::string & expression,
bool sync = false )

引用了 sync().

函数调用图:

◆ decreaseIndent()

void arcs::aubo_scope::ScriptWriter::decreaseIndent ( )

◆ defineFunction()

void arcs::aubo_scope::ScriptWriter::defineFunction ( const std::string & func_name)

\chinese 定义函数。 \endchinese \english Define a function.

参数
func_namefunction name. \endenglish

◆ defineThread()

void arcs::aubo_scope::ScriptWriter::defineThread ( const std::string & thread_name,
bool loop_or_not )

\chinese 定义线程。 \endchinese \english Start a thread definition.

参数
thread_namethe thread name,
loop_or_notwhether loops. \endenglish

◆ elseCondition()

void arcs::aubo_scope::ScriptWriter::elseCondition ( )

\chinese 添加else分支。 \endchinese \english Adds an else branch.

\endenglish

◆ elseIfCondition()

void arcs::aubo_scope::ScriptWriter::elseIfCondition ( const ExpressionPtr & expression)

\chinese 添加else-if分支。 \endchinese \english Adds an else-if branch.

参数
expressionthe expression. \endenglish

◆ end()

void arcs::aubo_scope::ScriptWriter::end ( )

\chinese 插入end。 \endchinese \english Insert an end.

\endenglish

◆ forCondition()

void arcs::aubo_scope::ScriptWriter::forCondition ( int count,
int step )

\chinese 开始for循环。 \endchinese \english Starts a for-loop.

参数
countloop count,
steploop step. \endenglish

◆ generateScript()

std::string arcs::aubo_scope::ScriptWriter::generateScript ( )

\chinese 生成包含完整脚本代码的字符串。

返回
生成的脚本字符串。 \endchinese \english Generate a string with the full script code.
the resulting script as a string. \endenglish

◆ getResolvedVariable()

std::string arcs::aubo_scope::ScriptWriter::getResolvedVariable ( const std::string & variable_name)

\chinese 获取可在脚本中使用的已注册变量名。

参数
variable_name变量名称。
返回
可在脚本中使用的变量名。 \endchinese \english Returns a registered variable name that can be used in a script.
参数
variable_namea variable name.
返回
variable name that can be used in a script. \endenglish

◆ ifCondition()

void arcs::aubo_scope::ScriptWriter::ifCondition ( const ExpressionPtr & expression)

\chinese 开始if条件。 \endchinese \english Start an if-conditional.

参数
expressionthe expression. \endenglish

◆ ifNotCondition()

void arcs::aubo_scope::ScriptWriter::ifNotCondition ( const ExpressionPtr & expression)

\chinese 开始取反的if条件。 \endchinese \english Start a negated if-conditional.

参数
expressionthe expression. \endenglish

◆ increaseIndent()

void arcs::aubo_scope::ScriptWriter::increaseIndent ( )

◆ incrementVariable()

void arcs::aubo_scope::ScriptWriter::incrementVariable ( const std::string & variable_name)

\chinese 变量值加1。

参数
variable_name要递增的变量名称。 \endchinese \english Add 1 to the variable value.
variable_namethe variable to increment. \endenglish

◆ killThread()

void arcs::aubo_scope::ScriptWriter::killThread ( const std::string & thread_name)

\chinese 终止线程。 \endchinese \english Kill a thread.

参数
thread_namethe thread name. \endenglish

◆ lineFeed()

void arcs::aubo_scope::ScriptWriter::lineFeed ( )

\chinese 插入空行。 \endchinese \english Insert an empty line.

\endenglish

◆ note()

void arcs::aubo_scope::ScriptWriter::note ( const std::string & expression)

\chinese 添加注释。 \endchinese \english Add a note.

参数
expressionthe note expression. \endenglish

◆ returnMethod()

void arcs::aubo_scope::ScriptWriter::returnMethod ( )

\chinese 返回。 \endchinese \english Return from method.

\endenglish

◆ runThread()

void arcs::aubo_scope::ScriptWriter::runThread ( const std::string & thread_name)

\chinese 启动线程。 \endchinese \english Start a thread.

参数
thread_namethe thread name. \endenglish

◆ setLabel()

void arcs::aubo_scope::ScriptWriter::setLabel ( int lineno,
const std::string & comment )

◆ setPayload()

void arcs::aubo_scope::ScriptWriter::setPayload ( double mass,
double x,
double y,
double z )

\chinese 设置负载质量和重心。 \endchinese \english Sets the mass and Center of Gravity of the payload.

\endenglish

◆ setRobotIndex()

void arcs::aubo_scope::ScriptWriter::setRobotIndex ( int robot_index)

◆ setTcp()

void arcs::aubo_scope::ScriptWriter::setTcp ( const std::vector< double > & pose)

\chinese 设置TCP。 \endchinese \english Set the Tool Center Point.

\endenglish

◆ sleep()

void arcs::aubo_scope::ScriptWriter::sleep ( double seconds)

\chinese 休眠指定秒数。 \endchinese \english Sleep for a number of seconds.

参数
secondsamount of time to sleep in seconds. \endenglish

◆ sync()

void arcs::aubo_scope::ScriptWriter::sync ( )

\chinese 用完当前帧剩余时间。 \endchinese \english Sync.

\endenglish

被这些函数引用 assign(), assign() , 以及 assign().

这是这个函数的调用关系图:

◆ whileCondition()

void arcs::aubo_scope::ScriptWriter::whileCondition ( const ExpressionPtr & expression)

\chinese 开始while循环。 \endchinese \english Starts a while-loop.

参数
expressionthe loop invariant. \endenglish

◆ whileNot()

void arcs::aubo_scope::ScriptWriter::whileNot ( const ExpressionPtr & expression)

\chinese 开始取反的while循环。 \endchinese \english Starts a negated while-loop.

参数
expressionthe loop invariant. \endenglish

◆ whileTrue()

void arcs::aubo_scope::ScriptWriter::whileTrue ( )

\chinese 开始while true循环。 \endchinese \english Starts a while true loop.

\endenglish

◆ writeChildren()

void arcs::aubo_scope::ScriptWriter::writeChildren ( )

\chinese 当为具有子节点的节点生成脚本代码时使用此方法。让子节点生成代码。 \endchinese \english Use this method when generating script code for a node that has children nodes.

Let children nodes generate code. \endenglish

◆ DataSwitch

friend class DataSwitch
friend

在文件 script_writer.h223 行定义.

引用了 DataSwitch.

被这些函数引用 DataSwitch.

类成员变量说明

◆ d_

void* arcs::aubo_scope::ScriptWriter::d_ { nullptr }
private

在文件 script_writer.h225 行定义.


该类的文档由以下文件生成: