API Reference
UI Interface
/*
* Description: Register a center form that can be displayed in the HMI interface, controlled by the menu bar.
* Parameter1 pluginName: Plugin name
* Parameter2 widget: User custom form
* Return value int: Registration result 0 Success -1 Plugin name error -2 Plugin initialization error
*/
int CreateCenterWidget(const QString &pluginName, QWidget *widget);
/*
* Description: Register a bottom status bar that can be displayed in the HMI interface
* Parameter1 pluginName: Plugin name
* Parameter2 widget: User custom bottom status bar
* Parameter3 index: Insert index
* Return value int: Registration result 0 Success -1 Plugin name error -2 Plugin initialization error
*/
int CreateStatusBar(const QString &pluginName, QWidget *widget, int index = -1);
/*
* Description: Pop up a window in the lower right corner of the interface to prompt some log text
* Parameter1 pluginName: Plugin name
* Parameter2 level: Popup window level
* Parameter3 msg: Text
* Return value int: Prompt result 0 Success -1 Plugin name error -2 Plugin initialization error
*/
int ThrowLog(const QString &pluginName, enThrowLogLevel level, const QString &msg);
/*
* Description: Create physical buttons
* Parameter1 pluginName: Plugin name
* Parameter2 type: Physical button type
* Parameter3 left_buttons: Left physical button list
* Parameter4 right_buttons: Right physical button list
* Parameter5 center_texts: Center display text
* Return value int: Create success 0 Success -1 Plugin name error -2 Plugin initialization error
*/
int XPLUGIN_EXPORT CreatePhyButtonList(const QString &pluginName, const QString& type, const QList<PhysicalButton>& left_buttons, const QList<PhysicalButton>& right_buttons, QStringList center_texts = QStringList(""));
/*
* Description: Enable/Disable physical buttons
* Parameter1 pluginName: Plugin name
* Parameter2 type: Physical button type
* Parameter3 enable: Physical button enable status
* Return value int: Change status 0 Success -1 Plugin name error -2 Plugin initialization error
*/
int ChangePhyButtonStatus(const QString &pluginName, const QString& type, bool enable);
/*
* Description: Register language pack
* Parameter1 pluginName: Plugin name
* Parameter2 type: Language pack type
* Parameter3 qmPath: Language pack path
* Return value int: Registration result 0 Success -1 Plugin name error -2 Plugin initialization error
*/
int RegistLanguage(const QString &pluginName, enLanguage type, const QString &qmPath);
Auxiliary Programming Interface
/*
* Description: Create a command type, command actions can be added according to the created command type, must be created first. Required
* Parameter1 type: Command type
*/
void createTypeKey(const QString &type);
/*
* Description: Create a command group, required
* Parameter1 lab: Content displayed by the command group in the interface
* Parameter2 groupName: Command group name
*/
void createGroups(const QString &lab, const QString &groupName);
/*
* Description: Insert the created command into the command group, required
* Parameter1 groupName: Command group
* Parameter2 type: Command type
*/
void createTypeToGroup(const QString &groupName, const QString &type);
/*
* Description: Insert the created command into the command group, required
* Parameter1 groupName: Command group
* Parameter2 typeList: Command type list
*/
void createTypeToGroup(const QString &groupName, const QStringList &typeList);
/*
* Description: Add parser matching string to the command, used for echoing interface data, optional
* Parameter1 type: Command type
* Parameter2 str: Parser string
*/
void createSkeleton(const QString &type, const QString &str);
/*
* Description: Customize the default inserted command statement when there is no interface or no parameter input, optional
* Parameter1 type: Command type
* Parameter2 strDef: Default command statement
*/
void createInsDefault(const QString &type, const QString &strDef);
/*
* Description: Participate in regex matching command string, for command reverse parsing, optional
* Parameter1 type: Command type
* Parameter2 str: String
*/
void createPattern (const QString &type, const QString &str);
/*
* Description: Command introduction text, optional
* Parameter1 type: Command type
* Parameter2 str: Introduction text
*/
void createInsDescribe(const QString &type, const QString &str);
/*
* Description: Create a custom form, used as the insert interface for the command, optional
* Parameter1 type: Command type
* Parameter2 func: Create function, return a subclass of RLContentBase class
*/
void createInsertWidget(const QString &type, std::function<RLContentBase* ()> func = []{return nullptr;});
/*
* Description: Create a custom form, used as the property parsing interface for the command, optional
* Parameter1 type: Command type
* Parameter2 func: Create function, return a subclass of RLContentBase class
*/
void createPropertyWidget(const QString &type, std::function<RLContentBase* ()> func = []{return nullptr;});
Communication Interface
/*
* Description: Data communication interface with Controller Plugin (get custom data key value)
* Parameter1 obj: QObject that executes the control
* Parameter2 pluginName: Controller Plugin name
* Parameter3 key: Controller Plugin data
* Return value QJsonArray: Controller Plugin data structure
*/
QJsonArray commandCustomData(QObject *obj, const QString &pluginName, const QString &key);
/*
* Description: Data communication interface with Controller Plugin (set custom data key value)
* Parameter1 obj: QObject that executes the control
* Parameter2 pluginName: Controller Plugin name
* Parameter3 key: Controller Plugin data key
* Parameter4 val: Target value of Controller Plugin data key
* Return value QJsonArray: Controller Plugin data structure
*/
QJsonArray commandCustomData(QObject *obj, const QString &pluginName, const QString &key, const QString &val);
/*
* Description: Data communication interface with Controller Plugin (custom data structure)
* Parameter1 obj: QObject that executes the control
* Parameter2 pluginName: Plugin name
* Parameter3 json: Custom data structure
* Return value QJsonArray: Controller Plugin data structure
*/
QJsonArray commandCustomData(QObject *obj, const QString &pluginName, const QJsonObject& json);
/*
* Description: Data communication interface with Controller Plugin (custom data structure)
* Parameter1 obj: QObject that executes the control
* Parameter2 json: Custom data structure (with plugin name)
* Return value QJsonArray: Controller Plugin data structure
*/
QJsonArray commandCustomData(QObject *obj, const QJsonObject& json);
/*
* Description: Data communication interface with Controller Plugin (custom data structure)
* Parameter1 obj: QObject that executes the control
* Parameter2 arr: Json array composed of custom data structures
* Return value QJsonArray: Controller Plugin data structure
*/
QJsonArray commandCustomData(QObject *obj, const QJsonArray& arr);
Data Interface
/*
* Description: General node data acquisition interface
* key: Node full name
* Return value QJsonValue: Node data
*/
QJsonValue getNodeData(const QString &key);
/*
* Description: Get robot network connection status
* Return value bool: true connected false not connected
*/
bool getRobotConnected();
/*
* Description: Get current user permission level
* Return value int: Level 1~5
*/
int getUserOperateLevel();
/*
* Description: Get Robot ID
* Return value QString: Robot ID
*/
QString getRobotID();
/*
* Description: Get Robot status
* Return value QString: Robot status
*/
QString getRobotPhyStatus();
/*
* Description: Get current tool
* Return value QString: Tool name
*/
QString getCurTool();
/*
* Description: Get current workpiece
* Return value QString: Workpiece name
*/
QString getCurWobj();
/*
* Description: Get tool list
* Return value QStringList: Tool list
*/
QStringList getToolList();
/*
* Description: Get workpiece list
* Return value QStringList: Workpiece list
*/
QStringList getWobjList();
/*
* Description: Get speed list
* Return value QStringList: Speed list
*/
QStringList getSpeedList();
/*
* Description: Get zone list
* Return value QStringList: Zone list
*/
QStringList getZoneList();
/*
* Description: Get variable name list by variable type
* Parameter1 type: Variable type
* Return value QStringList: Variable name list
*/
QStringList getVarDataList(const QString &type = "");
/*
* Description: Create basic variable by variable name and value
* Parameter1 name: Variable name
* Parameter2 value: Variable value
* Return value bool: Create result
*/
bool addVarData(const QString &name, QVariant value);
/*
* Description: Delete basic variable by variable name
* Parameter1 name: Variable name
* Return value bool: Delete result
*/
bool delVarData(const QString &name);
/*
* Description: Update basic variable by variable name and value
* Parameter1 name: Variable name
* Parameter2 value: Variable value
* Return value bool: Update result
*/
bool updateVarData(const QString &name, QVariant value);
/*
* Description: Get variable structure value
* Parameter1 name: Variable name
* Return value QJsonObject: Variable structure value
*/
QJsonObject getVarObjDataByName(const QString &name);
/*
* Description: Get point name list
* Return value QStringList: Point name list
*/
QStringList getPointNameList();
/*
* Description: Get point full structure data
* Parameter1 pointName: Point name
* Return value QJsonObject: Point full structure data
*/
QJsonObject getPointObjDataByName(const QString &pointName);
/*
* Description: Get point data
* Parameter1 pointName: Point name
* Return value QVector<double>: Point data
*/
QVector<double> getPointDataByName(const QString &pointName);
/*
* Description: Create Cartesian point variable from current point
* Parameter1 pointName: Point name
* Parameter2 toolName: Tool name
* Parameter3 wobjName: Workpiece name
* Return value bool: Create result
*/
bool addCurrentCartPoint(const QString& pointName, const QString& toolName, const QString& wobjName);
/*
* Description: Modify Cartesian point value
* Parameter1 pointName: Point name
* Parameter2 xyz_abc: Point value
*/
void changeCartPoint(const QString& name, const QVector<double>& xyz_abc);
/*
* Description: Point reachability check
* Parameter1 pointFrom: Start point
* Parameter2 pointTo: Target point
* Return value int Error code 0 Success 1 Same point -2 Singularity
*/
int checkPointMoveTo(const QString & pointFrom, const QString &pointTo);
/*
* Description: Point consistency check
* Parameter1 pointFrom: Start point
* Parameter2 pointTo: Target point
* Return value int Error code 0 Success 1 Same point -2 Singularity
*/
int checkPointSame (const QString & pointFrom, const QString &pointTo);
/*
* Description: Point motion to start
* Parameter1 errCode: Error code -1 Target point not found
* Parameter2 pointNameTo: Target point
* Parameter3 speed: Speed (1~100)
* Parameter4 isMoveJ: Whether to move with MoveJ
*/
void moveToStart(int &errCode, const QString &pointNameTo, int speed, bool isMoveJ);
/*
* Description: Point motion to start
* Parameter1 errCode: Error code -1 Target point not found
* Parameter2 pointNameTo: Target point
* Parameter3 speed: Speed (1~100)
* Parameter4 confCheck: Whether to enable configuration check
* Parameter5 isMoveJ: Whether to move with MoveJ
*/
void moveToStart(int &errCode, const QString &pointNameTo, int speed, bool confCheck, bool isMoveJ);
/*
* Description: Point motion to stop
*/
void moveToStop();
/*
* Description: Get IO name list and values
* Return value QHash<QString, bool>: IO name list and values
*/
QHash<QString, bool> getIOHash();
/*
* Description: Get all register name list and values
* Return value QHash<QString, QStringList>: Register name list and values
*/
QHash<QString, QStringList> getRegisterHash();
/*
* Description: Create new project
* Parameter1 projectName: Project name
* Parameter2 desc: Project description
* Parameter3 isUsed: Whether to switch project
* Return value int: Create result 0 Success -1 Project name error
*/
int createProject(const QString& projectName, const QString &desc = "", bool isUsed = false);
/*
* Description: Query project list
* Return value QStringList: Project list
*/
QStringList getProjectList();
/*
* Description: Switch project
* Parameter1 projectName: Project name
* Return value int: Switch result 0 Success -1 Project name error
*/
int changeProject(const QString& projectName);
/*
* Description: Delete project
* Parameter1 projectName: Project name
* Return value int: Delete result 0 Success -1 Project name error
*/
int removeProject (const QString& projectName);