Teach Pendant Secondary Development - Rapid Creation of Custom Interfaces

This article is based on the teach pendant secondary development library, and primarily explains how to create a demo program and user-customized process interfaces.

This article is based on the teach pendant secondary development library, and primarily explains how to create a demo program and user-customized process interfaces.

You can download the SDK library files and examples from the following link: https://www.openroboticsalliance.com/pendant/download

img

1. Creating a Demo Program

1.1 Open QtCreator on an Ubuntu (32-bit) system

img

1.2 Click on "Welcome" on the left and then select the "New Project" button

img

1.3 Choose "Application," select "Qt Widgets Application," and click the "Choose" button in the lower right corner

img

1.4 Enter the project name, choose the project path, and click the "Next" button

img

1.5 Choose the compilation tool "Desktop" and click the "Next" button

img

1.6 Click "Next"

img

1.7 Click "Finish" to complete the demo project creation

img

2. Adding Static Library Files to the Demo Program

2.1 Download library files: https://www.openroboticsalliance.com/pendant/download

img

2.2 Create a "nextpLib" folder in the project directory

img

2.3 Inside the "nextpLib" folder, create "include" and "Library" folders

img

2.4 Unzip the SDK, copy the header files to the "include" folder and the library files to the "Library" folder

img
img

2.5 Add static library files to the program configuration. Add the following content to the NextpMode.pro project file

img

2.6 Delete "mainwindow.h," "mainwindow.cpp," and "mainwindow.ui" from the "NextpMode.pro" file and remove the corresponding files from the project directory

img

3. Adding Management Classes and Custom Interfaces to the Demo Program

3.1 Create a C++ class file by right-clicking on the project and selecting "Add New..."

img

3.2 Enter the class name as "WidgetManager," choose "QObject" as the base class, and click "Next"

img

3.3 Create a custom interface by right-clicking and selecting "Add New..."

img

3.4 Choose "Qt," "Qt Designer Form Class," and click "Choose"

img

3.5 Select the template "QStackedWidget" and click "Next"

img

3.6 Enter the class name as "SettingParaWidget" and click "Next"

img

3.7 Click "Finish" to complete the process

img

4. Linking the Interface with the Secondary Development Library

4.1 Adjust the interface size to 714*504 by modifying the "SettingParaWidget"

img

4.2 Bind the SettingParaWidget interface with the development library. Add signal-slot connections in the WidgetManager class. You can refer to the demo example we provided for implementation. The following is the main code snippet that focuses on displaying and hiding the custom interface

img
img

4.3 Final result

img

文档反馈

Teach Pendant Secondary Development - Rapid Creation of Custom Interfaces - iNexBot