2 #include "qapplication.h"
7 deactivateSetWaypoint =
new QShortcut(QKeySequence(Qt::LeftButton), this->parent);
8 setWaypoint =
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_S), this->parent);
9 deleteWaypoint =
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_D), this->parent);
10 changeWaypointShortcut =
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this->parent);
11 playPreview =
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_R), this->parent);
12 playPreviewAll =
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_A), this->parent);
13 stopPreview =
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F), this->parent);
14 undoShortcut =
new QShortcut(QKeySequence::Undo, this->parent);
15 redoShortcut =
new QShortcut(QKeySequence::Redo, this->parent);
16 setPerspectiveHighAngle =
new QShortcut(QKeySequence(Qt::Key_1), this->parent);
17 setPerspectiveTop =
new QShortcut(QKeySequence(Qt::Key_2), this->parent);
18 setPerspectiveFront =
new QShortcut(QKeySequence(Qt::Key_3), this->parent);
19 setPerspectiveBack =
new QShortcut(QKeySequence(Qt::Key_4), this->parent);
20 setPerspectiveLeft =
new QShortcut(QKeySequence(Qt::Key_5), this->parent);
21 setPerspectiveRight =
new QShortcut(QKeySequence(Qt::Key_6), this->parent);
22 setWaypoint->setEnabled(
false);
23 deleteWaypoint->setEnabled(
false);
24 changeWaypointShortcut->setEnabled(
false);
25 playPreview->setEnabled(
false);
26 playPreviewAll->setEnabled(
false);
27 stopPreview->setEnabled(
false);
28 shortcutDialog =
new QDialog;
29 ui.setupUi(shortcutDialog);
30 ARMARX_INFO <<
"RobotTrajectoryDesigner: ShortcutController on init";
36 QObject::connect(ui.okButton, SIGNAL(clicked()), shortcutDialog, SLOT(accept()));
38 QObject::connect(deactivateSetWaypoint, SIGNAL(activated()),
this, SLOT(disableSet()));
39 QObject::connect(setWaypoint, SIGNAL(activated()),
this, SLOT(addedWaypointSlot()));
40 QObject::connect(deleteWaypoint, SIGNAL(activated()),
this, SLOT(deletedWaypointSlot()));
41 QObject::connect(changeWaypointShortcut, SIGNAL(activated()),
this, SLOT(changeWaypointSlot()));
42 QObject::connect(playPreview, SIGNAL(activated()),
this, SLOT(playPreviewSlot()));
43 QObject::connect(playPreviewAll, SIGNAL(activated()),
this, SLOT(playPreviewAllSlot()));
44 QObject::connect(stopPreview, SIGNAL(activated()),
this, SLOT(stopPreviewSlot()));
45 QObject::connect(setPerspectiveTop, SIGNAL(activated()),
this, SLOT(changedPerspectiveTopSlot()));
46 QObject::connect(setPerspectiveFront, SIGNAL(activated()),
this, SLOT(changedPerspectiveFrontSlot()));
47 QObject::connect(setPerspectiveBack, SIGNAL(activated()),
this, SLOT(changedPerspectiveBackSlot()));
48 QObject::connect(setPerspectiveLeft, SIGNAL(activated()),
this, SLOT(changedPerspectiveLeftSlot()));
49 QObject::connect(setPerspectiveRight, SIGNAL(activated()),
this, SLOT(changedPerspectiveRightSlot()));
50 QObject::connect(setPerspectiveHighAngle, SIGNAL(activated()),
this, SLOT(changedPerspectiveHighAngleSlot()));
51 QObject::connect(undoShortcut, SIGNAL(activated()),
this, SLOT(undoOperation()));
52 QObject::connect(redoShortcut, SIGNAL(activated()),
this, SLOT(redoOperation()));
53 ARMARX_INFO <<
"RobotTrajectoryDesigner: ShortcutController on connect";
58 ARMARX_INFO <<
"RobotTrajectoryDesigner: ShortcutController on disconnect";
63 ARMARX_INFO <<
"RobotTrajectoryDesigner: ShortcutController on exit";
69 this->parent = parent;
76 return currentWaypoint;
81 if (currentWaypoint >= 0)
83 this->currentWaypoint = currentWaypoint;
89 shortcutDialog->setModal(
true);
90 shortcutDialog->exec();
95 playPreviewAll->setEnabled(enable);
100 stopPreview->setEnabled(enable);
105 redoShortcut->setEnabled(enable);
110 undoShortcut->setEnabled(enable);
115 deleteWaypoint->setEnabled(enable);
116 changeWaypointShortcut->setEnabled(enable);
121 setWaypoint->setEnabled(enable);
126 playPreview->setEnabled(enable);
129 void ShortcutController::addedWaypointSlot()
132 if (QApplication::mouseButtons() == Qt::NoButton)
142 void ShortcutController::deletedWaypointSlot()
147 void ShortcutController::changeWaypointSlot()
152 void ShortcutController::playPreviewSlot()
157 void ShortcutController::playPreviewAllSlot()
162 void ShortcutController::stopPreviewSlot()
167 void ShortcutController::changedPerspectiveHighAngleSlot()
172 void ShortcutController::changedPerspectiveTopSlot()
177 void ShortcutController::changedPerspectiveFrontSlot()
182 void ShortcutController::changedPerspectiveBackSlot()
187 void ShortcutController::changedPerspectiveLeftSlot()
192 void ShortcutController::changedPerspectiveRightSlot()
197 void ShortcutController::undoOperation()
202 void ShortcutController::redoOperation()
207 void ShortcutController::enableSet()
212 void ShortcutController::disableSet()