Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/movementwidget.h
Show All 18 Lines | |||||
19 | 19 | | |||
20 | #include <QComboBox> | 20 | #include <QComboBox> | ||
21 | #include <QDoubleSpinBox> | 21 | #include <QDoubleSpinBox> | ||
22 | #include <QWidget> | 22 | #include <QWidget> | ||
23 | 23 | | |||
24 | #include "atcorewidgets_export.h" | 24 | #include "atcorewidgets_export.h" | ||
25 | /* Usage: | 25 | /* Usage: | ||
26 | * | 26 | * | ||
27 | * Create a instance of the movement widget. | 27 | * Create a instance of the movement widget. This widget will provide Basic Movement Controls. Create it with "showHomeAndDisableWidgets" false if your client provides its own actions for homing and disabling the motors. | ||
28 | */ | 28 | */ | ||
29 | 29 | | |||
30 | class ATCOREWIDGETS_EXPORT MovementWidget : public QWidget | 30 | class ATCOREWIDGETS_EXPORT MovementWidget : public QWidget | ||
31 | { | 31 | { | ||
32 | Q_OBJECT | 32 | Q_OBJECT | ||
33 | public: | 33 | public: | ||
34 | MovementWidget(QWidget *parent = nullptr); | 34 | /** | ||
35 | * @brief Create a Movement Widget | ||||
36 | * @param showHomeAndDisableWidgets: set False to hide the Home and Disable Motors buttons [default = true] | ||||
37 | * @param parent: Parent of this widget. | ||||
38 | */ | ||||
39 | MovementWidget(bool showHomeAndDisableWidgets = true, QWidget *parent = nullptr); | ||||
35 | 40 | | |||
36 | signals: | 41 | signals: | ||
42 | /** | ||||
43 | * @brief The Home All button was clicked. | ||||
44 | * This should be connected to AtCore::home() | ||||
45 | */ | ||||
37 | void homeAllPressed(); | 46 | void homeAllPressed(); | ||
47 | | ||||
48 | /** | ||||
49 | * @brief The Home X button was clicked. | ||||
50 | * This should be connected to AtCore::home(AtCore::X) | ||||
51 | */ | ||||
38 | void homeXPressed(); | 52 | void homeXPressed(); | ||
53 | | ||||
54 | /** | ||||
55 | * @brief The Home Y button was clicked. | ||||
56 | * This should be connected to AtCore::home(AtCore::Y) | ||||
57 | */ | ||||
39 | void homeYPressed(); | 58 | void homeYPressed(); | ||
59 | | ||||
60 | /** | ||||
61 | * @brief The Home Z button was clicked. | ||||
62 | * This should be connected to AtCore::home(AtCore::Z) | ||||
63 | */ | ||||
40 | void homeZPressed(); | 64 | void homeZPressed(); | ||
65 | | ||||
66 | /** | ||||
67 | * @brief The Disable Motors button was clicked. | ||||
68 | * This should be connected to AtCore::disableMotors(0) | ||||
69 | */ | ||||
70 | void disableMotorsPressed(); | ||||
71 | | ||||
72 | /** | ||||
73 | * @brief An absoluteMove was requested | ||||
74 | * This should be connected to AtCore::move(axis,value) | ||||
75 | * @param axis: the axis to move | ||||
76 | * @param value: where to move | ||||
77 | */ | ||||
41 | void absoluteMove(const QLatin1Char &axis, const double &value); | 78 | void absoluteMove(const QLatin1Char &axis, const double &value); | ||
79 | | ||||
80 | /** | ||||
81 | * @brief A relativeMove was requested. | ||||
82 | * This should connect to a function that does the following | ||||
83 | * AtCore::setRelativePosition() | ||||
84 | * AtCore::move(axis, value) | ||||
85 | * AtCore::setAbsolutePosition() | ||||
86 | * @param axis: the axis to move. | ||||
87 | * @param value: the value to move it by. | ||||
88 | */ | ||||
42 | void relativeMove(const QLatin1Char &axis, const double &value); | 89 | void relativeMove(const QLatin1Char &axis, const double &value); | ||
43 | void disableMotorsPressed(); | | |||
44 | 90 | | |||
45 | private: | 91 | private: | ||
46 | QComboBox *comboMoveAxis = nullptr; | 92 | QComboBox *comboMoveAxis = nullptr; | ||
47 | QDoubleSpinBox *sbMoveAxis = nullptr; | 93 | QDoubleSpinBox *sbMoveAxis = nullptr; | ||
48 | }; | 94 | }; |