TCPInformationController.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::TCPInformationController
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 TCPINFORMATIONCONTROLLER_H
23 #define TCPINFORMATIONCONTROLLER_H
24 #include <memory>
25 
26 #include <QLayoutItem>
27 #include <QLineEdit>
28 
29 #include <Eigen/Core>
30 
31 #include "../View/TCPInformationTab.h"
32 #include "AbstractController.h"
33 
34 namespace armarx
35 {
36 
37  /**
38  * @class TCPInformationController
39  * @brief Subcontroller which handles all user interaction with the tcp
40  * information tab in the GUI, communicates with other controllers
41  * via signals and slots
42  */
44  {
45  Q_OBJECT
46  public:
47  /**
48  * @brief @see AbstractController
49  */
50  void onInitComponent() override;
51 
52  /**
53  * @brief @see AbstractController
54  */
55  void onConnectComponent() override;
56 
57  /**
58  * @brief @see AbstractController
59  */
60  void onDisconnectComponent() override;
61 
62  /**
63  * @brief @see AbstractController
64  */
65  void onExitComponent() override;
66 
67  /**
68  * @brief Creates a new TCPInformationController and assigns a TCPInformationTab
69  * to handle
70  * @param guiTCPInformation Pointer to the TCPInformationTab whose user
71  * interaction is handled by the
72  * TCPInformationController
73  */
75 
76  /**
77  * @brief Getter for the TCPInformationTab pointer to guiTCPInformation
78  * @return A Pointer to the guiTCPInformation
79  */
81 
82  /**
83  * @brief Setter for the TCPInformationTab pointer to guiTCPInformation
84  * @param guiTCPInformation Pointer to the TCPInformationTab whose user interaction
85  * is handled by the TCPInformationController
86  */
87  void setGuiTCPInformation(TCPInformationPtr guiTCPInformation);
88 
89  public slots:
90  /**
91  * @brief Sets all values of the current pose
92  * @param pose A list of strings containing all values of the current
93  * pose
94  */
96 
97  /**
98  * @brief Sets all values of the desired pose
99  * @param pose A list of strings containing all values of the desired
100  * pose
101  */
102  void setDesiredPose(Eigen::Matrix4f pose);
103 
104  /**
105  * @brief setReachable set the label isReachable to "reachable" if true and "not reachable" if false
106  * @param reachable
107  */
108  void setReachable(bool reachable);
109 
110  /**
111  * @brief Resets the labels of current and desired pose to zeroes
112  */
113  void clearPoseLabels();
114 
115  /**
116  * @brief Retranslates the guiTCPInformation
117  */
118  void retranslateGui();
119 
120  private:
121  TCPInformationPtr guiTCPInformation;
122 
123  /**
124  * @brief Sets the text on all line edits of a given grid layout from
125  * a given line edit.
126  * @param gridLayout Grid layout containing line edits to access
127  * @param pose List of strings containing data of a pose
128  */
129  void setLineEditText(QGridLayout* gridLayout, Eigen::Matrix4f pose);
130  };
131 
132  using TCPInformationControllerPtr = std::shared_ptr<TCPInformationController>;
133 } // namespace armarx
134 
135 
136 #endif // TCPINFORMATIONCONTROLLER_H
armarx::TCPInformationController::setReachable
void setReachable(bool reachable)
setReachable set the label isReachable to "reachable" if true and "not reachable" if false
Definition: TCPInformationController.cpp:90
armarx::TCPInformationController::onInitComponent
void onInitComponent() override
Definition: TCPInformationController.cpp:31
armarx::TCPInformationController::setCurrentPose
void setCurrentPose(Eigen::Matrix4f pose)
Sets all values of the current pose.
Definition: TCPInformationController.cpp:78
armarx::TCPInformationController::setGuiTCPInformation
void setGuiTCPInformation(TCPInformationPtr guiTCPInformation)
Setter for the TCPInformationTab pointer to guiTCPInformation.
Definition: TCPInformationController.cpp:69
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:650
armarx::TCPInformationController::onExitComponent
void onExitComponent() override
Definition: TCPInformationController.cpp:50
TCPInformationPtr
std::shared_ptr< TCPInformationTab > TCPInformationPtr
Definition: TCPInformationTab.h:52
armarx::TCPInformationController::getGuiTCPInformation
TCPInformationPtr getGuiTCPInformation()
Getter for the TCPInformationTab pointer to guiTCPInformation.
Definition: TCPInformationController.cpp:63
armarx::TCPInformationControllerPtr
std::shared_ptr< TCPInformationController > TCPInformationControllerPtr
Definition: TCPInformationController.h:132
armarx::TCPInformationController::retranslateGui
void retranslateGui()
Retranslates the guiTCPInformation.
Definition: TCPInformationController.cpp:114
AbstractController.h
armarx::TCPInformationController::TCPInformationController
TCPInformationController(TCPInformationPtr guiTCPInformation)
Creates a new TCPInformationController and assigns a TCPInformationTab to handle.
Definition: TCPInformationController.cpp:55
armarx::TCPInformationController::onConnectComponent
void onConnectComponent() override
Definition: TCPInformationController.cpp:38
armarx::TCPInformationController::setDesiredPose
void setDesiredPose(Eigen::Matrix4f pose)
Sets all values of the desired pose.
Definition: TCPInformationController.cpp:84
armarx::TCPInformationController::clearPoseLabels
void clearPoseLabels()
Resets the labels of current and desired pose to zeroes.
Definition: TCPInformationController.cpp:106
armarx::TCPInformationController
Subcontroller which handles all user interaction with the tcp information tab in the GUI,...
Definition: TCPInformationController.h:43
armarx::TCPInformationController::onDisconnectComponent
void onDisconnectComponent() override
Definition: TCPInformationController.cpp:44
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::AbstractController
Abstract controller providing a set of methods which must be implemented by every controller.
Definition: AbstractController.h:37