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