ThePluginExampleclass shows the structure of a RoboDK plugin. A RoboDK plugin must implement theIAppRoboDKand the QObject class.More...
#include <pluginexample.h>
Public Slots |
|
void | callback_information() |
Called when the information button/action is selected.More... |
|
void | callback_robotpilot() |
Called when the robot pilot button/action is selected.More... |
|
void | callback_robotpilot_closed() |
Called when the robot pilot window is closed (event triggered by the dock window)More... |
|
void | callback_help() |
当用户选择按钮/行动呼吁help.More... |
|
Public Attributes |
|
QMainWindow * | MainWindow |
RoboDK'smain windowpointer.More... |
|
QStatusBar * | StatusBar |
RoboDK's mainstatus barpointer.More... |
|
RoboDK* | RDK |
Pointer to theRoboDK APIinterface.More... |
|
Private Member Functions |
|
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 with the plugin).More... |
|
virtual void | PluginUnload() override |
This function is called once only when the plugin is being unloaded.More... |
|
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 afterPluginLoadand it can be called when the user changes the view settings (such as changing from cinema to normal mode) or changes the default toolbar layout (in Tools-Toolbar Layout)More... |
|
virtual bool | PluginItemClick(Itemitem, QMenu *menu,TypeClickclick_type) override |
This function is called every time a new context menu is created for an item.More... |
|
virtual QString | PluginCommand(const QString &command, const QString &value) override |
Specific commands can be passed from the RoboDK API. For example, a parent application can rely on a plugin for certain operations (for example, to create native windows within RoboDK application or take advantage of the RoboDK API speed within the plugin). Use the RoboDK API (PluginCommand(plugin_name, command, value) to send specific commands to your plugin from an external application.More... |
|
virtual void | PluginEvent(TypeEventevent_type) override |
This function is called every time there is a new RoboDK event such as rendering the screen, adding/removing items or changing the active station. If event_type isEventRenderyou can render your own graphics here usingIRoboDK::DrawGeometry.More... |
|
![]() |
|
virtual QString | PluginName()=0 |
Return the plugin name. Try to be creative and make sure the name is unique. |
|
virtual bool | PluginItemClickMulti(QList<Item> &item_list, QMenu *menu,TypeClickclick_type) |
This function is called every time a new context menu is created for a list of items.More... |
|
Private Attributes |
|
QToolBar * | toolbar1 |
Pointer to the customized toolbar.More... |
|
QMenu * | menu1 |
Pointer to the customized menu.More... |
|
QAction * | action_information |
Information action. callback_information is triggered with this action. Actions are required to populate toolbars and menus and allows getting callbacks.More... |
|
QAction * | action_robotpilot |
Open robot pilot form action. callback_robotpilot is triggered with this action. Actions are required to populate toolbars and menus and allows getting callbacks.More... |
|
QAction * | action_help |
Open help action. callback_help is triggered with this action. Actions are required to populate toolbars and menus and allows getting callbacks.More... |
|
QDockWidget * | dock_robotpilot |
Pointer to the docked window.More... |
|
FormRobotPilot* | form_robotpilot |
Pointer to the robot pilot form.More... |
|
Additional Inherited Members |
|
![]() |
|
enum | TypeClick{ ClickNone=-1 ,ClickLeft=0 ,ClickCtrlLeft=1 ,ClickRight=2 , ClickDouble=3 } |
Types of clicks forPluginItemClickfunction.More... |
|
enum | TypeEvent{ EventRender=1 ,EventMoved=2 ,EventChanged=3 ,EventChangedStation=4 , EventAbout2Save=5 ,EventAbout2ChangeStation=6 ,EventAbout2CloseStation=7 ,EventTrajectoryStep=8 } |
Event types forPluginEventfunction.More... |
|
ThePluginExampleclass shows the structure of a RoboDK plugin. A RoboDK plugin must implement theIAppRoboDKand the QObject class.
Definition at line26of filepluginexample.h.
|
slot |
当用户选择按钮/行动呼吁help.
Definition at line283of filepluginexample.cpp.
|
slot |
Called when the information button/action is selected.
Definition at line186of filepluginexample.cpp.
|
slot |
Called when the robot pilot button/action is selected.
Definition at line266of filepluginexample.cpp.
|
slot |
Called when the robot pilot window is closed (event triggered by the dock window)
Definition at line277of filepluginexample.cpp.
|
overrideprivatevirtual |
Specific commands can be passed from the RoboDK API. For example, a parent application can rely on a plugin for certain operations (for example, to create native windows within RoboDK application or take advantage of the RoboDK API speed within the plugin). Use the RoboDK API (PluginCommand(plugin_name, command, value) to send specific commands to your plugin from an external application.
command | |
value |
Reimplemented fromIAppRoboDK.
Definition at line119of filepluginexample.cpp.
|
overrideprivatevirtual |
This function is called every time there is a new RoboDK event such as rendering the screen, adding/removing items or changing the active station. If event_type isEventRenderyou can render your own graphics here usingIRoboDK::DrawGeometry.
event_type | type of event (EventRender, EventMoved, EventChanged) |
Display/Render the 3D scene. At this moment we can call RDK->DrawGeometry to customize the displayed scene
qDebug() << "Something has moved, such as a robot, reference frame, object or tool. It is very likely that an EventRender will be triggered immediately after this event qDebug() << "==== EventMoved ===="; qDebug() << "An item has been added or deleted. Current station: " << RDK->getActiveStation()->Name(); If we added a new item (for example, a reference frame) it is very likely that an EventMoved will follow with the updated position of the newly added item(s) This event is also triggered when we change the active station and a new station gains focus. Example to check if the station changed and to load settings The user requested to save the project and the RDK file will be saved to disk. It is recommended to save all station-specific settings at this moment. For example, you can use RDK.setParam("ParameterName", "ParameterValue") or RDK.setData("ParameterName", bytearray)
The user requested to open a new RoboDK station (RDK file) or the user is navigating among different stations. This event is triggered before the current station looses focus.
The user requested to close the currently open RoboDK station (RDK file). The RDK file may be saved if the user and the corresponding event will be triggered.
Reimplemented fromIAppRoboDK.
Definition at line132of filepluginexample.cpp.
This function is called every time a new context menu is created for an item.
item | The Item (IItem) clicked |
menu | Pointer to the context menu |
click_type | Click type (usually left click) |
Reimplemented fromIAppRoboDK.
Definition at line102of filepluginexample.cpp.
|
overrideprivatevirtual |
Load the plugin. This function is called only once when the plugin is loaded (or RoboDK is started with the plugin).
mw | RoboDK's QMainwindow. Use this object to add menus in the main window. |
menubar | Pointer to RoboDK's main menu bar |
statusbar | Pointer to RoboDK's main status bar |
statusbar | Pointer RoboDK's interface (implementation of the RoboDK API):IRoboDKandIItem |
settings | Additional settings (reserved for future compatibility) |
Reimplemented fromIAppRoboDK.
Definition at line27of filepluginexample.cpp.
|
overrideprivatevirtual |
This function is called every time the toolbar is set up. This function is called at least once right afterPluginLoadand it can be called when the user changes the view settings (such as changing from cinema to normal mode) or changes the default toolbar layout (in Tools-Toolbar Layout)
mw | Pointer to RoboDK's main window. |
iconsize | 的大小toolbar icons. The size may differ depending on the screen's DPI. It can also be set in Tools-Options-Display menu. |
Reimplemented fromIAppRoboDK.
Definition at line87of filepluginexample.cpp.
|
overrideprivatevirtual |
This function is called once only when the plugin is being unloaded.
Reimplemented fromIAppRoboDK.
Definition at line66of filepluginexample.cpp.
|
private |
Open help action. callback_help is triggered with this action. Actions are required to populate toolbars and menus and allows getting callbacks.
Definition at line86of filepluginexample.h.
|
private |
Information action. callback_information is triggered with this action. Actions are required to populate toolbars and menus and allows getting callbacks.
Definition at line80of filepluginexample.h.
|
private |
Open robot pilot form action. callback_robotpilot is triggered with this action. Actions are required to populate toolbars and menus and allows getting callbacks.
Definition at line83of filepluginexample.h.
|
private |
Pointer to the docked window.
Definition at line89of filepluginexample.h.
|
private |
Pointer to the robot pilot form.
Definition at line92of filepluginexample.h.
QMainWindow* MainWindow |
RoboDK'smain windowpointer.
Definition at line48of filepluginexample.h.
|
private |
Pointer to the customized menu.
Definition at line77of filepluginexample.h.
RoboDK* RDK |
Pointer to theRoboDK APIinterface.
Definition at line54of filepluginexample.h.
QStatusBar* StatusBar |
RoboDK's mainstatus barpointer.
Definition at line51of filepluginexample.h.
|
private |
Pointer to the customized toolbar.
Definition at line74of filepluginexample.h.