NJointControllerGuiPluginBase.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::ArmarXObjects::NJointControllerGuiPluginUtility
17 * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18 * @date 2020
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <mutex>
26
27#include <VirtualRobot/VirtualRobot.h>
28
31
35
36#include <RobotAPI/interface/core/RobotState.h>
39
41{
42 class Base :
44 public virtual RobotUnitComponentPluginUser,
46 {
47 Q_OBJECT
48 public:
49 virtual NJointControllerConfigPtr readFullCFG() const = 0;
50 std::string getControllerName() const;
51 public Q_SLOTS: //for some reason using slots does not work -> use Q_SLOTS
52 virtual void createController();
53 virtual void activateController();
54 virtual void deactivateController();
55 virtual void deleteController();
56 private Q_SLOTS:
57 void doSetupGuiAfterConnect();
58
59 public:
60 Base();
61 ~Base() override;
62
63 void connectCreateAcivateDeactivateDelete(QPushButton* cr,
64 QPushButton* ac,
65 QPushButton* dc,
66 QPushButton* de);
67
68 public:
69 void loadSettings(QSettings* settings) override;
70 void saveSettings(QSettings* settings) override;
71 QPointer<QDialog> getConfigDialog(QWidget* parent) override;
72 void configured() override;
73
74 public:
75 void
76 onInitComponent() override
77 {
78 }
79
80 void
82 {
83 }
84
85 void
87 {
88 }
89
90 void
91 onExitComponent() override
92 {
93 }
94
95 public:
96 virtual void setupGuiAfterConnect();
97
98 protected:
99 void preOnConnectComponent() override;
100 void postOnConnectComponent() override;
101 void postOnDisconnectComponent() override;
102
103 protected:
104 QPointer<SimpleConfigDialog> _dialog;
105
106 mutable std::recursive_mutex _allMutex;
108 };
109} // namespace armarx::detail::_NJointControllerGuiPluginBase
void onInitComponent() override
Pure virtual hook for the subclass.
virtual NJointControllerConfigPtr readFullCFG() const =0
void loadSettings(QSettings *settings) override
Implement to load the settings that are part of the GUI configuration.
void saveSettings(QSettings *settings) override
Implement to save the settings as part of the GUI configuration.
void connectCreateAcivateDeactivateDelete(QPushButton *cr, QPushButton *ac, QPushButton *dc, QPushButton *de)
void onConnectComponent() override
Pure virtual hook for the subclass.
void configured() override
This function must be implemented by the user, if he supplies a config dialog.
QPointer< QDialog > getConfigDialog(QWidget *parent) override
getConfigDialog returns a pointer to the a configuration widget of this controller.
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19