Examples
This example will demonstrate how to implement a Client Plugin and run it normally on the Rokae HMI.
This example is displayed in the form of a new project. Users can also develop directly in the downloaded project, skipping Step 1 to Step 4 operations.
(This description demonstrates to users using the Windows platform development. The example assumes that the user has already built Qt 5.12 and above versions, and the user has basic C++ development knowledge and skills)
Step1: Create a new user custom project. Note that the project output is a dynamic link library file.
Step2: Put the downloaded plugin package's lib folder and include folder into the newly created PluginDemo project.

Step3: Configure the dynamic library loading environment

Step4: Set macro definition for plugin name (macro definition is used to support log file printing)

Step5: In the created < plugindemo.h >, inherit the public base class < PluginBase >. Implement the data initialization function in it. This operation requires including the base class library file < plugincommon.h>. Put PluginDemo in the Plugin namespace xplugin.

Step6: Initialize the plugin
Call the XPLUGIN_REGISTER macro to initialize the plugin. Parameter 1 is the plugin name, Parameter 2 is the plugin class name.
At this point, the plugin construction is complete. After successful compilation, you can obtain the PluginDemo.dll and PluginDemo.lib library files.

Step7: Create two user custom forms: ShowWidget and ShowStatusBar
ShowWidget form model as shown: (used as a center form display)

ShowStatusBar form model as shown: (used to display the bottom status bar).

Step8: Register the created form to the center form
xplugin::CreateCenterWidget() function is used to register forms;
xplugin::CreateStatusBar(); function is used to register the bottom status bar

Step9: Define data display interface
In the ShowWidget form, instantiate the click event of each button, call various different interfaces to get data.

Step10: Add custom physical button function
Users can customize and register physical buttons, reflected on the shortcut button interface of the HMI interface.

Step11: Add custom auxiliary programming function
Users can customize programming commands and insert them into the auxiliary programming of the RL editing interface.
Usage example:

Process step sequence:
1. Initialize RL management
2. createTypeKey Create command keyword, required
3. createSkeleton Parse string, echo interface, optional
4. createInsDescribe Description information, optional
5. createPattern Parse string, regex match, optional
6. createInsDefault Default output command, optional
7. createInsertWidget Insert interface window, optional
8. createPropertyWidget Property interface window, optional
9. createTypeToGroup Insert keyword command into command group, required
10. createGroups Create command group, required
Among them, the "insert interface" and "property interface" used for display need to uniformly inherit from the base class "RLContentBase". The base class file is located in the "include/rl" folder
Step12: Set insert window and property display window
Insert window example:

Key function introduction:
ToString Generate user custom programming command
CheckInsert Define interface type "Insert Interface"
FillWith Fill format, user parses string and fills it into the custom interface
setType Set keyword value
Property window example:

Key function introduction:
ToString User generates user custom programming command
CheckReplace Define interface type "Property Interface"
FillWith Fill format, user parses string and fills it into the custom interface
setType Set keyword value
Step13: Set language pack
Users can set language packs to translate interface software. According to the path shown in the figure, generate a Chinese language pack "PluginName_cn", which will change with the HMI main language switch.

At this point, the plugin example is complete! Load it to use.
Display effect:

