moveit2
The MoveIt Motion Planning Framework for ROS 2.
configuration_files_widget.hpp
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2012, Willow Garage, Inc.
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  * * Neither the name of Willow Garage nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 /* Author: Dave Coleman */
36 
37 #pragma once
38 
42 
43 #include <QList>
44 #include <QLabel>
45 #include <QListWidget>
46 #include <QListWidgetItem>
47 #include <QProgressBar>
48 #include <QPushButton>
49 
50 namespace moveit_setup
51 {
52 namespace core
53 {
54 // Class
56 {
57  Q_OBJECT
58 
59 public:
60  // ******************************************************************************************
61  // Public Functions
62  // ******************************************************************************************
63 
64  void onInit() override;
65 
66  SetupStep& getSetupStep() override
67  {
68  return setup_step_;
69  }
70 
72  void focusGiven() override;
73 
74  // ******************************************************************************************
75  // Qt Components
76  // ******************************************************************************************
77  QPushButton* btn_save_;
79  QProgressBar* progress_bar_;
80  QListWidget* action_list_;
81  QLabel* action_label_;
82  QLabel* success_label_;
83  QList<QString> action_desc_; // Holds the descriptions explaining all performed actions
84 
85 private Q_SLOTS:
86 
87  // ******************************************************************************************
88  // Slot Event Functions
89  // ******************************************************************************************
90 
92  void savePackage();
93 
95  bool generatePackage();
96 
98  void exitSetupAssistant();
99 
101  void changeActionDesc(int id);
102 
104  void changeCheckedState(QListWidgetItem* item);
105 
107  void setCheckSelected(bool checked);
108 
109  // When the configuration path changes
110  void onPackagePathChanged(const QString& path);
111 
112 private:
113  // ******************************************************************************************
114  // Variables
115  // ******************************************************************************************
116 
117  ConfigurationFiles setup_step_;
118 
120  unsigned int action_num_;
121 
123  bool has_generated_pkg_;
124 
125  // ******************************************************************************************
126  // Private Functions
127  // ******************************************************************************************
128 
130  void showGenFiles();
131 
133  bool checkDependencies();
134 
136  void updateProgress();
137 
139  bool noGroupsEmpty();
140 };
141 
142 } // namespace core
143 } // namespace moveit_setup
The GUI code for one SetupStep.
Contains all of the non-GUI code necessary for doing one "screen" worth of setup.
Definition: setup_step.hpp:47
void focusGiven() override
Received when this widget is chosen from the navigation menu.
SetupStep & getSetupStep() override
Return a reference to the SetupStep object.