src
widgets
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
#pragma once
37
38
#include <QWidget>
39
class
QComboBox;
40
class
QLabel;
41
class
QLineEdit;
42
class
QPushButton;
43
44
#ifndef Q_MOC_RUN
45
#include <
moveit/setup_assistant/tools/moveit_config_data.h
>
46
#endif
47
48
namespace
moveit_setup_assistant
49
{
50
class
ControllerEditWidget
:
public
QWidget
51
{
52
Q_OBJECT
53
54
public
:
55
// ******************************************************************************************
56
// Public Functions
57
// ******************************************************************************************
58
60
ControllerEditWidget
(QWidget* parent,
const
MoveItConfigDataPtr& config_data);
61
63
void
setSelected
(
const
std::string& controller_name);
64
66
void
loadControllersTypesComboBox
();
67
69
void
hideDelete
();
70
72
void
hideSave
();
73
75
void
hideNewButtonsWidget
();
76
78
void
showDelete
();
79
81
void
showSave
();
82
84
void
showNewButtonsWidget
();
85
87
void
setTitle
(
const
QString& title);
88
90
std::string
getControllerName
();
91
93
std::string
getControllerType
();
94
95
private
Q_SLOTS:
96
97
// ******************************************************************************************
98
// Slot Event Functions
99
// ******************************************************************************************
100
101
Q_SIGNALS:
102
103
// ******************************************************************************************
104
// Emitted Signals
105
// ******************************************************************************************
106
108
void
saveJoints
();
109
111
void
saveJointsGroups
();
112
114
void
save
();
115
117
void
cancelEditing
();
118
120
void
deleteController
();
121
122
private
:
123
// ******************************************************************************************
124
// Qt Components
125
// ******************************************************************************************
126
127
QLabel*
title_
;
// specify the title from the parent widget
128
QLineEdit*
controller_name_field_
;
129
QComboBox*
controller_type_field_
;
130
QPushButton*
btn_delete_
;
// this button is hidden for new controllers
131
QPushButton*
btn_save_
;
// this button is hidden for new controllers
132
QWidget*
new_buttons_widget_
;
// for showing/hiding the new controllers buttons
133
134
// ******************************************************************************************
135
// Variables
136
// ******************************************************************************************
137
138
// For loading default types combo box just once
139
bool
has_loaded_
=
false
;
141
moveit_setup_assistant::MoveItConfigDataPtr
config_data_
;
142
};
143
}
// namespace moveit_setup_assistant
moveit_setup_assistant::ControllerEditWidget::title_
QLabel * title_
Definition:
controller_edit_widget.h:127
moveit_setup_assistant::ControllerEditWidget::saveJoints
void saveJoints()
Button event for new groups, progressing to adding joints.
moveit_setup_assistant::ControllerEditWidget::hideSave
void hideSave()
Hide save controller button.
Definition:
controller_edit_widget.cpp:246
moveit_setup_assistant::ControllerEditWidget::btn_save_
QPushButton * btn_save_
Definition:
controller_edit_widget.h:131
moveit_setup_assistant::ControllerEditWidget::saveJointsGroups
void saveJointsGroups()
Button event for new groups, progressing to adding subgroups.
moveit_setup_assistant::ControllerEditWidget::hideDelete
void hideDelete()
Hide delete controller button.
Definition:
controller_edit_widget.cpp:241
moveit_setup_assistant::ControllerEditWidget::ControllerEditWidget
ControllerEditWidget(QWidget *parent, const MoveItConfigDataPtr &config_data)
Constructor.
Definition:
controller_edit_widget.cpp:84
moveit_setup_assistant::ControllerEditWidget::deleteController
void deleteController()
Event sent when delete is being requested for controller.
moveit_setup_assistant::ControllerEditWidget
Definition:
controller_edit_widget.h:50
moveit_config_data.h
moveit_setup_assistant::ControllerEditWidget::getControllerType
std::string getControllerType()
Get controller type.
Definition:
controller_edit_widget.cpp:281
moveit_setup_assistant::ControllerEditWidget::showNewButtonsWidget
void showNewButtonsWidget()
Show new buttons widget.
Definition:
controller_edit_widget.cpp:266
moveit_setup_assistant::ControllerEditWidget::btn_delete_
QPushButton * btn_delete_
Definition:
controller_edit_widget.h:130
moveit_setup_assistant::ControllerEditWidget::cancelEditing
void cancelEditing()
Event sent when user presses cancel button.
moveit_setup_assistant::ControllerEditWidget::setTitle
void setTitle(const QString &title)
Set widget title.
Definition:
controller_edit_widget.cpp:271
moveit_setup_assistant::ControllerEditWidget::showSave
void showSave()
Show save controller button.
Definition:
controller_edit_widget.cpp:261
moveit_setup_assistant::ControllerEditWidget::setSelected
void setSelected(const std::string &controller_name)
Set the previous data.
Definition:
controller_edit_widget.cpp:192
moveit_setup_assistant::ControllerEditWidget::controller_type_field_
QComboBox * controller_type_field_
Definition:
controller_edit_widget.h:129
moveit_setup_assistant::ControllerEditWidget::hideNewButtonsWidget
void hideNewButtonsWidget()
Hide new buttons widget.
Definition:
controller_edit_widget.cpp:251
moveit_setup_assistant::ControllerEditWidget::controller_name_field_
QLineEdit * controller_name_field_
Definition:
controller_edit_widget.h:128
moveit_setup_assistant::ControllerEditWidget::new_buttons_widget_
QWidget * new_buttons_widget_
Definition:
controller_edit_widget.h:132
moveit_setup_assistant
Definition:
compute_default_collisions.h:46
moveit_setup_assistant::ControllerEditWidget::loadControllersTypesComboBox
void loadControllersTypesComboBox()
Populate the combo dropdown box with controllers types.
Definition:
controller_edit_widget.cpp:221
moveit_setup_assistant::ControllerEditWidget::getControllerName
std::string getControllerName()
Get controller name.
Definition:
controller_edit_widget.cpp:276
moveit_setup_assistant::ControllerEditWidget::showDelete
void showDelete()
Show delete controller button.
Definition:
controller_edit_widget.cpp:256
moveit_setup_assistant::ControllerEditWidget::save
void save()
Button event for just saving, when in edit mode.
moveit_setup_assistant::ControllerEditWidget::config_data_
moveit_setup_assistant::MoveItConfigDataPtr config_data_
Contains all the configuration data for the setup assistant.
Definition:
controller_edit_widget.h:141
moveit_setup_assistant::ControllerEditWidget::has_loaded_
bool has_loaded_
Definition:
controller_edit_widget.h:139
moveit_setup_assistant
Author(s): Dave Coleman
autogenerated on Sat May 3 2025 02:28:04