NJointControllerClassesWidget.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 RobotAPI::gui-plugins::RobotUnitPlugin
17 * \author Raphael Grimm ( raphael dot grimm at kit dot edu )
18 * \date 2017
19 * \copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <atomic>
26#include <mutex>
27
28#include <QCheckBox>
29#include <QComboBox>
30#include <QFormLayout>
31#include <QHBoxLayout>
32#include <QLabel>
33#include <QLineEdit>
34#include <QPushButton>
35#include <QTreeWidget>
36#include <QTreeWidgetItem>
37#include <QWidget>
38
41
42#include <RobotAPI/gui-plugins/RobotUnitPlugin/ui_NJointControllerClassesWidget.h>
43#include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.h>
44
45#include "RobotUnitWidgetBase.h"
46
47namespace armarx
48{
49
51
53 public RobotUnitWidgetTemplateBase<Ui::NJointControllerClassesWidget>
54 {
55 Q_OBJECT
56
57 public:
58 explicit NJointControllerClassesWidget(QWidget* parent = 0);
60
61 virtual void nJointControllerClassAdded(std::string name);
62
63 virtual void updateDefaultNameOnControllerCreated(QString createdName, bool force = false);
64 QString getDefaultName() const;
65
66 void loadSettings(QSettings* settings) override;
67 void saveSettings(QSettings* settings) override;
68
69 protected:
70 void clearAll() override;
71 void doContentUpdate() override;
72 void getResetData() override;
73 bool addOneFromResetData() override;
74
75 private slots:
76 void filterUpdated();
77 void packageEditChanged();
78 void loadLibClicked();
79
80 private:
81 void add(const NJointControllerClassDescription& desc);
82 void addFilter() override;
83
84 std::map<std::string, NJointControllerClassesWidgetEntry*> entries;
85 std::map<std::string, NJointControllerClassDescription> nJointControllerClassDescriptions;
86
87 QComboBox* filterCombination;
88
89 QLineEdit* filterName;
90 QCheckBox* filterNameActive;
91 QCheckBox* filterNameInverted;
92
93 QComboBox* filterRemoteCreation;
94 QCheckBox* filterRemoteCreationActive;
95
96 //selecting libs
97 enum class SelectLibsMode
98 {
99 LineEdit,
100 ComboBox
101 };
102 SelectLibsMode selectLibMode;
103 std::map<std::string, std::string> libShortNameToFileName;
104
105 int defaultControllerName{0};
106 };
107
108 //helper
110 {
111 Q_OBJECT
112 public:
114 QTreeWidget& treeWidget,
115 const NJointControllerClassDescription& desc,
117
118 bool matchName(const QString& name);
119 bool hasRemoteCreation();
120
121 void updateDefaultName(const QString& oldName, const QString& newName);
122
123 public slots:
124 void setVisible(bool vis);
125
126 private slots:
127 void createCtrl();
128
129 public:
130 std::string className;
133 QTreeWidgetItem* header{nullptr};
134 QLineEdit* nameEdit{nullptr};
137 };
138} // namespace armarx
WidgetDescription::DescribedWidgetBase * creator
void updateDefaultName(const QString &oldName, const QString &newName)
NJointControllerClassesWidgetEntry(NJointControllerClassesWidget &parent, QTreeWidget &treeWidget, const NJointControllerClassDescription &desc, RobotUnitInterfacePrx robotUnit)
virtual void updateDefaultNameOnControllerCreated(QString createdName, bool force=false)
virtual void nJointControllerClassAdded(std::string name)
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotUnitInterface > RobotUnitInterfacePrx