TCPSelectionController.h
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* ArmarX is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License version 2 as
6* published by the Free Software Foundation.
7*
8* ArmarX is distributed in the hope that it will be useful, but
9* WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* \package RobotTrajectoryDesigner::gui-plugins::Controller::TCPSelectionController
17* \author Max Beddies
18* \date 2018
19* \copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22#ifndef TCPSELECTIONCONTROLLER_H
23#define TCPSELECTIONCONTROLLER_H
24#include <QComboBox>
25
27#include "AbstractController.h"
28
29namespace armarx
30{
31 /**
32 * @class TCPSelectionController
33 * @brief Subcontroller which handles all user interaction with the active TCP
34 * selection in the GUI, communicates with other controllers via
35 * signals and slots
36 */
38 {
39 Q_OBJECT
40
41 public:
42 /**
43 * @brief @see AbstractController
44 */
45 void onInitComponent() override;
46
47 /**
48 * @brief @see AbstractController
49 */
50 void onConnectComponent() override;
51
52 /**
53 * @brief @see AbstractController
54 */
55 void onDisconnectComponent() override;
56
57 /**
58 * @brief @see AbstractController
59 */
60 void onExitComponent() override;
61
62 /**
63 * @brief Creates a new TCPSelectionController and assigns a QWidget to handle
64 * @param currentTCPCombobox Pointer to the QComboBox whose user interaction
65 * is handled by the TCPSelectionController
66 */
67 TCPSelectionController(QComboBox* currentTCPCombobox);
68
69 /**
70 * @brief Getter for the QComboBox pointer to currentTCPCombobox
71 * @return A Pointer to the currentTCPCombobox
72 */
73 QComboBox* getCurrentTCPCombobox();
74
75 /**
76 * @brief Setter for the QComboBox pointer to currentTCPCombobox
77 * @param currentTCPCombobox Pointer to the QComboBox whose user interaction
78 * is handled by the TCPSelectionController
79 */
80 void setCurrentTCPCombobox(QComboBox* currentTCPCombobox);
81
82 public slots:
83 /**
84 * @brief Updates the currently displayed trajectory of the corresponding TCP
85 * @param trajectory String identifier of the trajectory
86 */
87 void updateSelectedTCP(QString trajectory);
88
89 /**
90 * @brief Adds a new trajectory to the combobox of available trajectories
91 * @param trajectory String identifier of the trajectory
92 */
93 void addTrajectory(QString trajectory);
94
95 /**
96 * @brief Removes the given trajectory from the TCP selection combo box
97 * @param trajectory String identifier of the trajectory
98 */
99 void removeTrajectory(QString trajectory);
100
101 /**
102 * @brief Enables or disables the selected tcp combobox
103 * @param enable Determines whether to enable or disable the selected tcp combobox
104 */
105 void enableSelectedTCP(bool enable);
106
107 /**
108 * @brief Removes all trajectorie is tcpComboBox
109 */
111
112 private slots:
113 /**
114 * @brief Updates the currently displayed trajectory of the corresponding TCP
115 * @param index Index of the trajectory
116 */
117 void updateSelectedTCP(int index);
118
119
120 signals:
121 /**
122 * @brief Notifies other controllers about changes of the currently displayed trajectory
123 * @param index Index of the trajectory
124 */
126
127 private:
128 QComboBox* currentTCPCombobox;
129 };
130
131 using TCPSelectionControllerPtr = std::shared_ptr<TCPSelectionController>;
132} // namespace armarx
133
134#endif // TCPSELECTIONCONTROLLER_H
uint8_t index
Abstract controller providing a set of methods which must be implemented by every controller.
void setCurrentTCPCombobox(QComboBox *currentTCPCombobox)
Setter for the QComboBox pointer to currentTCPCombobox.
void changedSelectedTCP(QString trajectory)
Notifies other controllers about changes of the currently displayed trajectory.
void removeAllTrajectories()
Removes all trajectorie is tcpComboBox.
void addTrajectory(QString trajectory)
Adds a new trajectory to the combobox of available trajectories.
void updateSelectedTCP(QString trajectory)
Updates the currently displayed trajectory of the corresponding TCP.
void enableSelectedTCP(bool enable)
Enables or disables the selected tcp combobox.
TCPSelectionController(QComboBox *currentTCPCombobox)
Creates a new TCPSelectionController and assigns a QWidget to handle.
QComboBox * getCurrentTCPCombobox()
Getter for the QComboBox pointer to currentTCPCombobox.
void removeTrajectory(QString trajectory)
Removes the given trajectory from the TCP selection combo box.
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< TCPSelectionController > TCPSelectionControllerPtr