RoboDK Plug-In Interface
pluginexample.h
1 #ifndef PLUGINEXAMPLE_H
2 #define PLUGINEXAMPLE_H
3
4
5 #include
6 #include
7 #include
8 # include“iapprobodk.h”
9 #include "robodktypes.h"
10
11
12
13 classQToolBar;
14 classQMenu;
15 classQAction;
16 class IRoboDK;
17 class IItem;
18 class FormRobotPilot;
19
26 class PluginExample:publicQObject,IAppRoboDK
27{
28Q_OBJECT
29Q_PLUGIN_METADATA(IID"RoboDK.IAppRoboDK")// FILE "metadatalugin.json")
30Q_INTERFACES(IAppRoboDK)
31
32 public:
33 //------------------------------- RoboDK Plug-in Interface commands ------------------------------
34
35QStringPluginName(void)override;
36 virtualQStringPluginLoad(QMainWindow *mw, QMenuBar *menubar, QStatusBar *statusbar,RoboDK*rdk,constQString &settings="")override;
37 virtual void PluginUnload()override;
38 virtual void PluginLoadToolbar(QMainWindow *mw,inticon_size)override;
39 virtual bool PluginItemClick(Itemitem, QMenu *menu,TypeClickclick_type)override;
40 virtualQStringPluginCommand(constQString &command,constQString &value)override;
41 virtual void PluginEvent(TypeEventevent_type)override;
42
43 //----------------------------------------------------------------------------------
44
45 // Recommended pointers to use in your plugin:
46 public:
48QMainWindow *MainWindow;
49
51QStatusBar *StatusBar;
52
55
56 publicslots:
57 // define button callbacks (or slots) here. They are triggered automatically when the button is selected.
58
61
64
67
69 void callback_help();
70
71 // define your actions: usually, one action per button
72 private:
74QToolBar *toolbar1;
75
77QMenu *menu1;
78
81
84
86QAction *action_help;
87
89QDockWidget *dock_robotpilot;
90
93};
95
96
97 #endif // PLUGINEXAMPLE_H
Interface to RoboDK. Each plugin must implement this class to establish the interface to RoboDK....
Definition: iapprobodk.h:189
TypeEvent
Event types for PluginEvent function.
Definition: iapprobodk.h:212
virtual QString PluginName()=0
Return the plugin name. Try to be creative and make sure the name is unique.
TypeClick
Types of clicks for PluginItemClick function.
Definition: iapprobodk.h:193
The Item class represents an item in RoboDK station. An item can be a robot, a frame,...
Definition: iitem.h:14
This class is the iterface to the RoboDK API. With the RoboDK API you can automate certain tasks and ...
Definition: irobodk.h:14
The PluginExample class shows the structure of a RoboDK plugin. A RoboDK plugin must implement the IA...
Definition: pluginexample.h:27
virtual void PluginEvent(TypeEvent event_type) override
This function is called every time there is a new RoboDK event such as rendering the screen,...
Definition: pluginexample.cpp:132
void callback_information()
Called when the information button/action is selected.
Definition: pluginexample.cpp:186
QDockWidget * dock_robotpilot
Pointer to the docked window.
Definition: pluginexample.h:89
void callback_robotpilot()
Called when the robot pilot button/action is selected.
Definition: pluginexample.cpp:266
FormRobotPilot * form_robotpilot
Pointer to the robot pilot form.
Definition: pluginexample.h:92
QToolBar * toolbar1
Pointer to the customized toolbar.
Definition: pluginexample.h:74
空白callback_help ()
Called when the user select the button/action for help.
Definition: pluginexample.cpp:283
virtual void PluginUnload() override
This function is called once only when the plugin is being unloaded.
Definition: pluginexample.cpp:66
QMainWindow * MainWindow
RoboDK's main window pointer.
Definition: pluginexample.h:48
QStatusBar * StatusBar
RoboDK's main status bar pointer.
Definition: pluginexample.h:51
void callback_robotpilot_closed()
Called when the robot pilot window is closed (event triggered by the dock window)
Definition: pluginexample.cpp:277
QAction * action_robotpilot
Open robot pilot form action. callback_robotpilot is triggered with this action. Actions are required...
Definition: pluginexample.h:83
QMenu * menu1
Pointer to the customized menu.
Definition: pluginexample.h:77
RoboDK * RDK
Pointer to the RoboDK API interface.
Definition: pluginexample.h:54
虚拟QString PluginCommand (const QString逗号nd, const QString &value) override
Specific commands can be passed from the RoboDK API. For example, a parent application can rely on a ...
Definition: pluginexample.cpp:119
virtual bool PluginItemClick(Item item, QMenu *menu, TypeClick click_type) override
This function is called every time a new context menu is created for an item.
Definition: pluginexample.cpp:102
QAction * action_help
Open help action. callback_help is triggered with this action. Actions are required to populate toolb...
Definition: pluginexample.h:86
virtual Q_PLUGIN_METADATA(IID "RoboDK.IAppRoboDK") public QString PluginLoad(QMainWindow *mw, QMenuBar *menubar, QStatusBar *statusbar, RoboDK *rdk, const QString &settings="") override
Load the plugin. This function is called only once when the plugin is loaded (or RoboDK is started wi...
Definition: pluginexample.cpp:27
virtual void PluginLoadToolbar(QMainWindow *mw, int icon_size) override
This function is called every time the toolbar is set up. This function is called at least once right...
Definition: pluginexample.cpp:87
QAction * action_information
Information action. callback_information is triggered with this action. Actions are required to popul...
Definition: pluginexample.h:80