19 Star 209 Fork 86

刘文韬/六轴机器人仿真软件

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
parsecode.h 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
刘文韬 提交于 2022-04-14 21:50 +08:00 . no commit message
#ifndef PARSECODE_H
#define PARSECODE_H
#include <QObject>
#include <QVector>
#include <QPoint>
#include "commonfunc.h"
class Element;
class ParseCode
{
public:
ParseCode();
//解析代码入口,返回element数组
QVector<Element*> ParseFrom(const QString &textEdit);
private:
//解析一行代码,生成一个element对象
Element* parseSentence(QString sentence);
//预处理
bool PreProcces(const QString& textEdit);
//获取命令类型
enum CodeType CodeType(const QString &cmd);
//分别创建非图元,直线,弧元素
Element* createNoShapeElement(QString sentence,QStatus status,QPointF lastPoint);
Element* createLineElement(QString sentence,QStatus status,QPointF lastPoint);
Element* createArcElement(QString sentence,QStatus status,QPointF lastPoint);
//提取数值
double extractValFrom(const QString &word);
private:
QString text; //输入文本的内容
QStringList sentenceList; //输入文本的内容按行分解成行列表
QStatus status;
QPointF lastPoint; //记录上一节末点坐标
};
#endif // PARSECODE_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/liuwentao1234/robot-simulation-software.git
git@gitee.com:liuwentao1234/robot-simulation-software.git
liuwentao1234
robot-simulation-software
六轴机器人仿真软件
master

搜索帮助