Skip to content

API Reference

Secondary Development Static Library Introduction

Feature Overview

Provides complete teach pendant functionality, supports adding user-defined custom interfaces, and supports communication with the control system for specific fields.

Static Library Directory Structure

Static library folder structure of the nextpLib package showing the Include folder with header files and the Library folder with Linux and ARM platform static library files

nextpLib is the root folder;

Include folder contains header files;

Library folder contains static library files including library files for Linux platform and ARM platform (programs cross-compiled using the ARM platform are only applicable for use on Nabot's T30 Teach Pendant);

Static Library Structure Description

1. nextp.h Header File Interface Description:

cpp
// Create Nextp class object
static QPointer<Nextp> getInstance();
// Get system font
QString getSystemFont();
// Transfer user-defined form to the main program
void setWidgetParentLocation(QPointer <QWidget> widget);
// Send message to controller
void sendMessage(const quint16 &command,const QByteArray &data);
// Notify the teach pendant program that the custom form has been opened
widgetShowFinish()
// Receive controller message signal
void signal_receiveMessage(const quint16 &command,const QByteArray &data);
// Open custom form signal
void signal_openWidget();
// Close custom form signal
void signal_closeWidget();
// Hide other buttons on the process main interface except custom buttons
void hideTechnologyToolbuttons();
// Static library supported controller communication command words
 enum CommandList
 {
    SetFirstUserParaCommand = 0x9200,
    GetFirstUserCommand = 0x9201,
    ReceivedFirstUserCommand = 0x9202,
    SetSecondUserParaCommand = 0x9203,
    GetSecondUserCommand = 0x9204,
    ReceivedSecondUserCommand = 0x9205,
    SetThirdUserParaCommand = 0x9206,
    GetThirdUserCommand = 0x9207,
    ReceivedThirdUserCommand = 0x92,
    ReceivedThirdUserCommand = 0x9208,
    SetFourthUserParaCommand = 0x9209,
    GetFourthUserCommand = 0x920a,
    ReceivedFourthUserCommand = 0x920b,
    SetFifthUserParaCommand = 0x920c,
    GetFifthUserCommand = 0x920d,
    ReceivedFifthUserCommand = 0x920e,
};

2. json/json.h Header File Provides JSON Data Format Assembly and Parsing

JSON data assembly example:

cpp
Json::Value root;
Json::FastWriter wt;
root["robot"] =1;
root["booldata"] =true;
root["data"] = 1.1;
root["name"] ="nihao";

JSON data parsing example:

cpp
QByteArray jsonData // Data sent by controller
Json::Value root;
Json::Reader reader;
QString jsonData = param.data();
if(reader.parse(jsonData.toStdString(), root))
{
    int robot = root["robot"].asInt();
    bool booldata= root["booldata"].asBool();
    Int data= root["data"].asDouble();
    Std::string name = root["name "].asString();
}

3. digitallineedit.h Provides Numeric Input Box

Supports promoting QLineEdit control to a numeric input box.

Promotion method: Right-click a QLineEdit control --->Promote to--->DigitalLineEdit

Qt Designer right-click context menu showing the "Promote to" submenu used to promote a QLineEdit control to the DigitalLineEdit numeric input box widget

You can see in the right tree structure that the control's Class property changes to DigitLineEdit:

Qt Designer object tree highlighting the promoted QLineEdit control with its Class property set to DigitLineEdit in the property panel

Control effect after program runs. Clicking the control will pop up a numeric keypad:

Numeric keypad popup shown when the promoted DigitLineEdit input box is clicked at runtime, used for entering numeric values

4. lineeditwidget.h Provides Numeric and Text Input Box

Supports promoting QLineEdit control to a numeric and text input box. Promotion method: Right-click a QLineEdit control --->Promote to--->lineEditWidget

Qt Designer right-click context menu showing the "Promote to" submenu used to promote a QLineEdit control to the lineEditWidget numeric and text input box widget

You can see in the right tree structure that the control's Class property changes to lineEditWidget:

Qt Designer object tree highlighting the promoted QLineEdit control with its Class property set to lineEditWidget in the property panel

Control effect after program runs. Clicking the control will pop up a numeric and alphabetic keypad:

Numeric and alphabetic keypad popup shown when the promoted lineEditWidget input box is clicked at runtime, used for entering mixed numeric and text values

Demo Instructions

NextpMode demo folder structure diagram showing the settingparawidget source files, widgetmanager management class, and the nextplib static library folder required by the demo

  • Demo structure diagram. Demo folder name: NextpMode

2.1 settingparawidget.h settingparawidget.cpp settingparawidget.ui These three files are the user-defined form

Setting parameter user-defined form rendered from settingparawidget.ui, used as the demo's custom widget for entering parameter values

2.2 widgetmanager.h widgetmanager.cpp is the management class connecting the user-defined form and the static library

2.2 The static library folder nextplib needs to be placed under the NextpMode folder of demod

2.3 Run Demo (Use QtCreator to directly open the NextpMode.pro file under the NextpMode folder)

Run Demo program, click [Operator] > Select Administrator > Enter password 123456 to log in

Teach pendant login screen showing the Operator role selection with Administrator option and the password entry field for demo access

Click [Process] button on the left > User to enter the custom form

Teach pendant main menu with the Process entry highlighted on the left toolbar used to open the custom parameter form

Teach pendant custom parameter form launched from the Process menu, displaying the user-defined widget defined in settingparawidget.ui

Click the modify button to modify parameters. Click save to send parameters to the controller

Teach pendant custom parameter form showing the Modify button used to switch input fields into edit mode and the Save button used to send the values to the controller

The QtCreator console will print the data sent to the controller

QtCreator application output panel printing the JSON message sent to the controller after clicking Save on the custom parameter form

JSON message details logged in the QtCreator console, showing the robot number, booldata, data, and name fields assembled for the controller

If the function void hideTechnologyToolbuttons(); is called, it will hide all process buttons except custom buttons on the process main interface

Teach pendant Process main interface with all built-in technology tool buttons hidden, leaving only the user-defined custom buttons visible after calling hideTechnologyToolbuttons

  • Demo file class description