3 #include "qapplication.h"
10 deactivateSetWaypoint =
new QShortcut(QKeySequence(Qt::LeftButton), this->parent);
11 setWaypoint =
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_S), this->parent);
12 deleteWaypoint =
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_D), this->parent);
13 changeWaypointShortcut =
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this->parent);
14 playPreview =
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_R), this->parent);
15 playPreviewAll =
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_A), this->parent);
16 stopPreview =
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F), this->parent);
17 undoShortcut =
new QShortcut(QKeySequence::Undo, this->parent);
18 redoShortcut =
new QShortcut(QKeySequence::Redo, this->parent);
19 setPerspectiveHighAngle =
new QShortcut(QKeySequence(Qt::Key_1), this->parent);
20 setPerspectiveTop =
new QShortcut(QKeySequence(Qt::Key_2), this->parent);
21 setPerspectiveFront =
new QShortcut(QKeySequence(Qt::Key_3), this->parent);
22 setPerspectiveBack =
new QShortcut(QKeySequence(Qt::Key_4), this->parent);
23 setPerspectiveLeft =
new QShortcut(QKeySequence(Qt::Key_5), this->parent);
24 setPerspectiveRight =
new QShortcut(QKeySequence(Qt::Key_6), this->parent);
25 setWaypoint->setEnabled(
false);
26 deleteWaypoint->setEnabled(
false);
27 changeWaypointShortcut->setEnabled(
false);
28 playPreview->setEnabled(
false);
29 playPreviewAll->setEnabled(
false);
30 stopPreview->setEnabled(
false);
31 shortcutDialog =
new QDialog;
32 ui.setupUi(shortcutDialog);
33 ARMARX_INFO <<
"RobotTrajectoryDesigner: ShortcutController on init";
40 QObject::connect(ui.okButton, SIGNAL(clicked()), shortcutDialog, SLOT(accept()));
42 QObject::connect(deactivateSetWaypoint, SIGNAL(activated()),
this, SLOT(disableSet()));
43 QObject::connect(setWaypoint, SIGNAL(activated()),
this, SLOT(addedWaypointSlot()));
44 QObject::connect(deleteWaypoint, SIGNAL(activated()),
this, SLOT(deletedWaypointSlot()));
46 changeWaypointShortcut, SIGNAL(activated()),
this, SLOT(changeWaypointSlot()));
47 QObject::connect(playPreview, SIGNAL(activated()),
this, SLOT(playPreviewSlot()));
48 QObject::connect(playPreviewAll, SIGNAL(activated()),
this, SLOT(playPreviewAllSlot()));
49 QObject::connect(stopPreview, SIGNAL(activated()),
this, SLOT(stopPreviewSlot()));
51 setPerspectiveTop, SIGNAL(activated()),
this, SLOT(changedPerspectiveTopSlot()));
53 setPerspectiveFront, SIGNAL(activated()),
this, SLOT(changedPerspectiveFrontSlot()));
55 setPerspectiveBack, SIGNAL(activated()),
this, SLOT(changedPerspectiveBackSlot()));
57 setPerspectiveLeft, SIGNAL(activated()),
this, SLOT(changedPerspectiveLeftSlot()));
59 setPerspectiveRight, SIGNAL(activated()),
this, SLOT(changedPerspectiveRightSlot()));
60 QObject::connect(setPerspectiveHighAngle,
63 SLOT(changedPerspectiveHighAngleSlot()));
64 QObject::connect(undoShortcut, SIGNAL(activated()),
this, SLOT(undoOperation()));
65 QObject::connect(redoShortcut, SIGNAL(activated()),
this, SLOT(redoOperation()));
66 ARMARX_INFO <<
"RobotTrajectoryDesigner: ShortcutController on connect";
72 ARMARX_INFO <<
"RobotTrajectoryDesigner: ShortcutController on disconnect";
78 ARMARX_INFO <<
"RobotTrajectoryDesigner: ShortcutController on exit";
84 this->parent = parent;
92 return currentWaypoint;
98 if (currentWaypoint >= 0)
100 this->currentWaypoint = currentWaypoint;
107 shortcutDialog->setModal(
true);
108 shortcutDialog->exec();
114 playPreviewAll->setEnabled(enable);
120 stopPreview->setEnabled(enable);
126 redoShortcut->setEnabled(enable);
132 undoShortcut->setEnabled(enable);
138 deleteWaypoint->setEnabled(enable);
139 changeWaypointShortcut->setEnabled(enable);
145 setWaypoint->setEnabled(enable);
151 playPreview->setEnabled(enable);
155 ShortcutController::addedWaypointSlot()
158 if (QApplication::mouseButtons() == Qt::NoButton)
169 ShortcutController::deletedWaypointSlot()
175 ShortcutController::changeWaypointSlot()
181 ShortcutController::playPreviewSlot()
187 ShortcutController::playPreviewAllSlot()
193 ShortcutController::stopPreviewSlot()
199 ShortcutController::changedPerspectiveHighAngleSlot()
205 ShortcutController::changedPerspectiveTopSlot()
211 ShortcutController::changedPerspectiveFrontSlot()
217 ShortcutController::changedPerspectiveBackSlot()
223 ShortcutController::changedPerspectiveLeftSlot()
229 ShortcutController::changedPerspectiveRightSlot()
235 ShortcutController::undoOperation()
241 ShortcutController::redoOperation()
247 ShortcutController::enableSet()
253 ShortcutController::disableSet()