controller_edit_widget.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2018, Mohamad Ayman.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * The name of Mohamad Ayman may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  *********************************************************************/
33 
34 /* Author: Mohamad Ayman */
35 
36 #ifndef MOVEIT_ROS_MOVEIT_SETUP_ASSISTANT_WIDGETS_CONTROLLER_EDIT_WIDGET_H
37 #define MOVEIT_ROS_MOVEIT_SETUP_ASSISTANT_WIDGETS_CONTROLLER_EDIT_WIDGET_H
38 
39 #include <QWidget>
40 #include <QLabel>
41 #include <QLineEdit>
42 #include <QComboBox>
43 #include <QPushButton>
44 
45 #ifndef Q_MOC_RUN
47 #endif
48 
49 namespace moveit_ros_control
50 {
51 class ControllerEditWidget : public QWidget
52 {
53  Q_OBJECT
54 
55 public:
56  // ******************************************************************************************
57  // Public Functions
58  // ******************************************************************************************
59 
61  ControllerEditWidget(QWidget* parent, moveit_setup_assistant::MoveItConfigDataPtr config_data);
62 
64  void setSelected(const std::string& controller_name);
65 
68 
70  void hideDelete();
71 
73  void hideSave();
74 
76  void hideNewButtonsWidget();
77 
79  void showDelete();
80 
82  void showSave();
83 
85  void showNewButtonsWidget();
86 
88  void setTitle(const QString& title);
89 
91  std::string getControllerName();
92 
94  std::string getControllerType();
95 
96 private Q_SLOTS:
97 
98  // ******************************************************************************************
99  // Slot Event Functions
100  // ******************************************************************************************
101 
102 Q_SIGNALS:
103 
104  // ******************************************************************************************
105  // Emitted Signals
106  // ******************************************************************************************
107 
109  void saveJoints();
110 
112  void saveJointsGroups();
113 
115  void save();
116 
118  void cancelEditing();
119 
121  void deleteController();
122 
123 private:
124  // ******************************************************************************************
125  // Qt Components
126  // ******************************************************************************************
127 
128  QLabel* title_; // specify the title from the parent widget
131  QPushButton* btn_delete_; // this button is hidden for new controllers
132  QPushButton* btn_save_; // this button is hidden for new controllers
133  QWidget* new_buttons_widget_; // for showing/hiding the new controllers buttons
134 
135  // ******************************************************************************************
136  // Variables
137  // ******************************************************************************************
138 
139  // For loading default types combo box just once
140  bool has_loaded_ = false;
142  moveit_setup_assistant::MoveItConfigDataPtr config_data_;
143 };
144 }
145 
146 #endif
moveit_setup_assistant::MoveItConfigDataPtr config_data_
Contains all the configuration data for the setup assistant.
std::string getControllerName()
Get controller name.
void hideSave()
Hide save controller button.
void hideDelete()
Hide delete controller button.
void showSave()
Show save controller button.
void setSelected(const std::string &controller_name)
Set the previous data.
void cancelEditing()
Event sent when user presses cancel button.
void save()
Button event for just saving, when in edit mode.
void saveJointsGroups()
Button event for new groups, progressing to adding subgroups.
void showNewButtonsWidget()
Show new buttons widget.
void saveJoints()
Button event for new groups, progressing to adding joints.
void setTitle(const QString &title)
Set widget title.
void hideNewButtonsWidget()
Hide new buttons widget.
void deleteController()
Event sent when delete is being requested for controller.
std::string getControllerType()
Get controller type.
void showDelete()
Show delete controller button.
ControllerEditWidget(QWidget *parent, moveit_setup_assistant::MoveItConfigDataPtr config_data)
Constructor.
void loadControllersTypesComboBox()
Populate the combo dropdown box with controllers types.


moveit_setup_assistant
Author(s): Dave Coleman
autogenerated on Sun Oct 18 2020 13:19:28