RoboDK Plug-In Interface
PluginExample Class Reference

ThePluginExampleclass shows the structure of a RoboDK plugin. A RoboDK plugin must implement theIAppRoboDKand the QObject class.More...

#include <pluginexample.h>

Inheritance diagram for PluginExample:
IAppRoboDK

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...
-Private Member Functions inherited fromIAppRoboDK
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

-Private Types inherited fromIAppRoboDK
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...

Detailed Description

ThePluginExampleclass shows the structure of a RoboDK plugin. A RoboDK plugin must implement theIAppRoboDKand the QObject class.

Definition at line26of filepluginexample.h.

Member Function Documentation

callback_help

void callback_help ( )
slot

当用户选择按钮/行动呼吁help.

Definition at line283of filepluginexample.cpp.

callback_information

void callback_information ( )
slot

Called when the information button/action is selected.

Definition at line186of filepluginexample.cpp.

callback_robotpilot

void callback_robotpilot ( )
slot

Called when the robot pilot button/action is selected.

Definition at line266of filepluginexample.cpp.

callback_robotpilot_closed

void callback_robotpilot_closed ( )
slot

Called when the robot pilot window is closed (event triggered by the dock window)

Definition at line277of filepluginexample.cpp.

PluginCommand()

QString PluginCommand ( const QString & command,
const QString & value
)
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.

Parameters
command
value
Returns

Reimplemented fromIAppRoboDK.

Definition at line119of filepluginexample.cpp.

PluginEvent()

void PluginEvent ( TypeEvent event_type )
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.

Parameters
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.

PluginItemClick()

bool PluginItemClick ( Item item,
QMenu * menu,
TypeClick click_type
)
overrideprivatevirtual

This function is called every time a new context menu is created for an item.

Parameters
item The Item (IItem) clicked
menu Pointer to the context menu
click_type Click type (usually left click)
Returns

Reimplemented fromIAppRoboDK.

Definition at line102of filepluginexample.cpp.

PluginLoad()

QString PluginLoad ( QMainWindow * mw,
QMenuBar * menubar,
QStatusBar * statusbar,
RoboDK* rdk,
const QString & settings=""
)
overrideprivatevirtual

Load the plugin. This function is called only once when the plugin is loaded (or RoboDK is started with the plugin).

Parameters
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.

PluginLoadToolbar()

void PluginLoadToolbar ( QMainWindow * mw,
int iconsize
)
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)

Parameters
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.

PluginUnload()

空白PluginUnload ( )
overrideprivatevirtual

This function is called once only when the plugin is being unloaded.

Reimplemented fromIAppRoboDK.

Definition at line66of filepluginexample.cpp.

Member Data Documentation

action_help

QAction* action_help
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.

action_information

QAction* action_information
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.

action_robotpilot

QAction* action_robotpilot
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.

dock_robotpilot

QDockWidget* dock_robotpilot
private

Pointer to the docked window.

Definition at line89of filepluginexample.h.

form_robotpilot

FormRobotPilot* form_robotpilot
private

Pointer to the robot pilot form.

Definition at line92of filepluginexample.h.

MainWindow

QMainWindow* MainWindow

RoboDK'smain windowpointer.

Definition at line48of filepluginexample.h.

menu1

QMenu* menu1
private

Pointer to the customized menu.

Definition at line77of filepluginexample.h.

RDK

RoboDK* RDK

Pointer to theRoboDK APIinterface.

Definition at line54of filepluginexample.h.

StatusBar

QStatusBar* StatusBar

RoboDK's mainstatus barpointer.

Definition at line51of filepluginexample.h.

toolbar1

QToolBar* toolbar1
private

Pointer to the customized toolbar.

Definition at line74of filepluginexample.h.


The documentation for this class was generated from the following files: