Update IRoboDK interface · RoboDK/Plug-In-Interface@dada252 · GitHub
Skip to content

Commit dada252

Browse files
committed
Update IRoboDK interface
Update PluginExample Suppress unused variable warnings with Q_UNUSED
1 parent 8ca1b77 commit dada252

16 files changed

Lines changed: 271 additions & 38 deletions

File tree

Plug-In-Interface.pro

Lines changed: 1 addition & 0 deletions

Plugin-OPC-UA/pluginopcua.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ void PluginOPCUA::PluginLoadToolbar(QMainWindow *mw, int icon_size){
214214

215215

216216
bool PluginOPCUA::PluginItemClick(Item item, QMenu *menu, TypeClick click_type){
217+
Q_UNUSED(menu)
218+
217219
qDebug() << "Selected item: " << item->Name() << " of type " << item->Type() << " click type: " << click_type;
218220
/*
219221
if (item->Type() == IItem::ITEM_TYPE_OBJECT){

PluginAttachObject/pluginattachobject.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ QString PluginAttachObject::PluginName() {
2828
}
2929

3030
QString PluginAttachObject::PluginLoad(QMainWindow *mw, QMenuBar *menubar, QStatusBar *statusbar, RoboDK *rdk, const QString &settings) {
31+
Q_UNUSED(menubar)
32+
3133
RDK = rdk;
3234
MainWindow = mw;
3335
StatusBar = statusbar;

PluginAttachView/pluginattachview.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ QString PluginAttachView::PluginName(){
174174

175175

176176
QString PluginAttachView::PluginLoad(QMainWindow *mw, QMenuBar *menubar, QStatusBar *statusbar, RoboDK *rdk, const QString &settings){
177+
Q_UNUSED(menubar)
178+
177179
RDK = rdk;
178180
MainWindow = mw;
179181
StatusBar = statusbar;
@@ -222,6 +224,8 @@ void PluginAttachView::PluginUnload(){
222224

223225

224226
void PluginAttachView::PluginLoadToolbar(QMainWindow *mw, int icon_size){
227+
Q_UNUSED(mw)
228+
Q_UNUSED(icon_size)
225229
}
226230

227231

PluginBallbarTracker/PluginBallbarTracker.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ QString PluginBallbarTracker::PluginName(){
171171

172172

173173
QString PluginBallbarTracker::PluginLoad(QMainWindow *mw, QMenuBar *menubar, QStatusBar *statusbar, RoboDK *rdk, const QString &settings){
174+
Q_UNUSED(menubar)
175+
174176
RDK = rdk;
175177
MainWindow = mw;
176178
StatusBar = statusbar;

PluginCollisionSensor/plugincollisionsensor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ QString PluginCollisionSensor::PluginName() {
2828

2929

3030
QString PluginCollisionSensor::PluginLoad(QMainWindow *mw, QMenuBar *menubar, QStatusBar *statusbar, RoboDK *rdk, const QString &settings) {
31+
Q_UNUSED(menubar)
32+
3133
RDK = rdk;
3234
MainWindow = mw;
3335
StatusBar = statusbar;

PluginExample/pluginexample.cpp

Lines changed: 122 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,21 @@ QString PluginExample::PluginCommand(const QString &command, const QString &valu
129129
return "";
130130
}
131131

132-
void PluginExample::PluginEvent(TypeEvent event_type){
133-
switch (event_type) {
132+
void PluginExample::PluginEvent(TypeEvent event_type) {
133+
switch (event_type)
134+
{
134135
case EventRender:
135136
/// Display/Render the 3D scene.
136137
/// At this moment we can call RDK->DrawGeometry to customize the displayed scene
137-
//qDebug() << "(EventRender)";
138+
/// qDebug() << "==== EventRender ====";
138139
break;
140+
139141
case EventMoved:
140142
/// qDebug() << "Something has moved, such as a robot, reference frame, object or tool.
141143
/// It is very likely that an EventRender will be triggered immediately after this event
142144
/// qDebug() << "==== EventMoved ====";
143145
break;
146+
144147
case EventChanged:
145148
/// qDebug() << "An item has been added or deleted. Current station: " << RDK->getActiveStation()->Name();
146149
/// 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)
@@ -153,30 +156,143 @@ void PluginExample::PluginEvent(TypeEvent event_type){
153156
// LoadSettings(); // will select the robot if there are settings.
154157
//}
155158
qDebug() << "==== EventChanged ====";
156-
if (form_robotpilot != nullptr){
159+
if (form_robotpilot != nullptr) {
157160
form_robotpilot->SelectRobot();
158161
}
159162
break;
163+
164+
case EventChangedStation:
165+
qDebug() << "==== EventChangedStation ====";
166+
break;
167+
160168
case EventAbout2Save:
161169
qDebug() << "==== EventAbout2Save ====";
162170
/// 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.
163171
/// For example, you can use RDK.setParam("ParameterName", "ParameterValue") or RDK.setData("ParameterName", bytearray)
164172
//SaveSettings();
165173
break;
174+
166175
case EventAbout2ChangeStation:
167176
/// 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.
168177
qDebug() << "==== EventAbout2ChangeStation ====";
169178
//SaveSettings();
170179
break;
180+
171181
case EventAbout2CloseStation:
172182
/// 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.
173183
qDebug() << "==== EventAbout2CloseStation ====";
174184
//SaveSettings();
175185
//ROBOT = nullptr;
176186
break;
187+
188+
case EventTrajectoryStep:
189+
qDebug() << "==== EventTrajectoryStep ====";
190+
break;
191+
177192
default:
178-
qDebug() << "Unknown/future event: " << event_type;
193+
if (event_type < EventApiMask) {
194+
qDebug() << "Unknown/future event: " << event_type;
195+
return;
196+
}
197+
break;
198+
}
199+
200+
if (event_type < EventApiMask) {
201+
return;
202+
}
203+
204+
int apiEvent = event_type & (EventApiMask - 1);
205+
206+
// API Events
207+
switch (apiEvent)
208+
{
209+
case EVENT_SELECTIONTREE_CHANGED:
210+
qDebug() << "EVENT_SELECTIONTREE_CHANGED";
211+
break;
212+
213+
case EVENT_ITEM_MOVED:
214+
qDebug() << "EVENT_ITEM_MOVED";
215+
break;
216+
217+
case EVENT_REFERENCE_PICKED:
218+
qDebug() << "EVENT_REFERENCE_PICKED";
219+
break;
220+
221+
case EVENT_REFERENCE_RELEASED:
222+
qDebug() << "EVENT_REFERENCE_RELEASED";
223+
break;
224+
225+
case EVENT_TOOL_MODIFIED:
226+
qDebug() << "EVENT_TOOL_MODIFIED";
227+
break;
228+
229+
case EVENT_CREATED_ISOCUBE:
230+
qDebug() << "EVENT_CREATED_ISOCUBE";
231+
break;
232+
233+
case EVENT_SELECTION3D_CHANGED:
234+
qDebug() << "EVENT_SELECTION3D_CHANGED";
235+
break;
179236

237+
case EVENT_VIEWPOSE_CHANGED:
238+
qDebug() << "EVENT_VIEWPOSE_CHANGED";
239+
break;
240+
241+
case EVENT_ROBOT_MOVED:
242+
qDebug() << "EVENT_ROBOT_MOVED";
243+
break;
244+
245+
case EVENT_KEY:
246+
qDebug() << "EVENT_KEY";
247+
break;
248+
249+
case EVENT_ITEM_MOVED_POSE:
250+
qDebug() << "EVENT_ITEM_MOVED_POSE";
251+
break;
252+
253+
case EVENT_COLLISIONMAP_RESET:
254+
qDebug() << "EVENT_COLLISIONMAP_RESET";
255+
break;
256+
257+
case EVENT_COLLISIONMAP_TOO_LARGE:
258+
qDebug() << "EVENT_COLLISIONMAP_TOO_LARGE";
259+
break;
260+
261+
case EVENT_CALIB_MEASUREMENT:
262+
qDebug() << "EVENT_CALIB_MEASUREMENT";
263+
break;
264+
265+
case EVENT_SELECTION3D_CLICK:
266+
qDebug() << "EVENT_SELECTION3D_CLICK";
267+
break;
268+
269+
case EVENT_CHANGED:
270+
qDebug() << "EVENT_CHANGED";
271+
break;
272+
273+
case EVENT_RENAME:
274+
qDebug() << "EVENT_RENAME";
275+
break;
276+
277+
case EVENT_SETVISIBLE:
278+
qDebug() << "EVENT_SETVISIBLE";
279+
break;
280+
281+
case EVENT_STATIONCHANGED:
282+
qDebug() << "EVENT_STATIONCHANGED";
283+
break;
284+
285+
case EVENT_PROGSLIDER_CHANGED:
286+
qDebug() << "EVENT_PROGSLIDER_CHANGED";
287+
break;
288+
289+
case EVENT_PROGSLIDER_SET:
290+
qDebug() << "EVENT_PROGSLIDER_SET";
291+
break;
292+
293+
default:
294+
qDebug() << "Unknown/future API event: " << apiEvent;
295+
break;
180296
}
181297
}
182298

@@ -254,13 +370,9 @@ void PluginExample::callback_information(){
254370

255371

256372
QTextEdit *text_editor = new QTextEdit("Plugin timing summary");
257-
QDockWidget *dockwidget = AddDockWidget(MainWindow, text_editor, "Dock Plugin timing summary");
258373
text_editor->setHtml(text_message_html);
259-
//text_editor->show();
260-
261-
// close the dock:
262-
//dockwidget->close();
263374

375+
AddDockWidget(MainWindow, text_editor, "Dock Plugin timing summary");
264376
}
265377

266378
void PluginExample::callback_robotpilot(){

PluginLVDT/pluginlvdt.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ QString PluginLVDT::PluginName(){
2828

2929

3030
QString PluginLVDT::PluginLoad(QMainWindow *mw, QMenuBar *menubar, QStatusBar *statusbar, RoboDK *rdk, const QString &settings){
31+
Q_UNUSED(menubar)
32+
3133
RDK = rdk;
3234
MainWindow = mw;
3335
StatusBar = statusbar;
@@ -67,6 +69,8 @@ void PluginLVDT::PluginUnload(){
6769

6870

6971
void PluginLVDT::PluginLoadToolbar(QMainWindow *mw, int icon_size){
72+
Q_UNUSED(mw)
73+
Q_UNUSED(icon_size)
7074
}
7175

7276

PluginLockTCP/PluginLockTCP.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ QString PluginLockTCP::PluginName(){
1313

1414

1515
QString PluginLockTCP::PluginLoad(QMainWindow *mw, QMenuBar *menubar, QStatusBar *statusbar, RoboDK *rdk, const QString &settings){
16+
Q_UNUSED(menubar)
17+
1618
RDK = rdk;
1719
MainWindow = mw;
1820
StatusBar = statusbar;

PluginOpenGL-Shaders/pluginchip8.cpp

Lines changed: 5 additions & 0 deletions

0 commit comments

Comments
 (0)