NJointControllerGuiPluginBase.cpp
Go to the documentation of this file.
2 
3 #include <QPushButton>
4 
6 
8 {
9  std::string
11  {
12  return getName() + "_controller";
13  }
14 
15  void
17  {
18  }
19  void
21  {
22  }
23  void
25  {
26  }
27  void
29  {
30  }
31 
33  {
34  }
35 
37  {
38  }
39 
40  void
42  QPushButton* ac,
43  QPushButton* dc,
44  QPushButton* de)
45  {
46  if (cr)
47  {
48  connect(cr, &QPushButton::clicked, this, &Base::createController);
49  }
50  if (ac)
51  {
52  connect(ac, &QPushButton::clicked, this, &Base::activateController);
53  }
54  if (dc)
55  {
56  connect(dc, &QPushButton::clicked, this, &Base::deactivateController);
57  }
58  if (de)
59  {
60  connect(de, &QPushButton::clicked, this, &Base::deleteController);
61  }
62  }
63 
64  void
65  Base::loadSettings(QSettings* settings)
66  {
68  std::lock_guard g{_allMutex};
70  settings->value("rsc", "Armar6StateComponent").toString().toStdString());
72  settings->value("ru", "Armar6Unit").toString().toStdString());
73  }
74 
75  void
76  Base::saveSettings(QSettings* settings)
77  {
79  std::lock_guard g{_allMutex};
80  settings->setValue(
81  "rsc",
82  QString::fromStdString(getRobotStateComponentPlugin().getRobotStateComponentName()));
83  settings->setValue(
84  "ru", QString::fromStdString(getRobotUnitComponentPlugin().getRobotUnitName()));
85  }
86 
87  QPointer<QDialog>
88  Base::getConfigDialog(QWidget* parent)
89  {
91  std::lock_guard g{_allMutex};
92  if (!_dialog)
93  {
94  _dialog = new SimpleConfigDialog(parent);
95  _dialog->addProxyFinder<RobotUnitInterfacePrx>({"ru", "Robot Unit", "*Unit"});
97  {"rsc", "Robot State Component", "*Component"});
98  }
99  return qobject_cast<SimpleConfigDialog*>(_dialog);
100  }
101 
102  void
104  {
105  ARMARX_TRACE;
106  std::lock_guard g{_allMutex};
109  }
110 
111  void
113  {
114  ARMARX_TRACE;
118  std::lock_guard g{_allMutex};
119  _robot = addRobot("state robot", VirtualRobot::RobotIO::eStructure);
120  }
121  void
123  {
124  ARMARX_TRACE;
128  QMetaObject::invokeMethod(this, "doSetupGuiAfterConnect", Qt::QueuedConnection);
129  }
130  void
132  {
133  ARMARX_TRACE;
137  std::lock_guard g{_allMutex};
139  }
140 
141  void
142  Base::doSetupGuiAfterConnect()
143  {
144  ARMARX_TRACE;
145  std::lock_guard g{_allMutex};
146  if (_robot)
147  {
149  }
150  ARMARX_IMPORTANT << "call setupGuiAfterConnect";
152  }
153 
154  void
156  {
157  }
158 } // namespace armarx::detail::_NJointControllerGuiPluginBase
NJointControllerGuiPluginBase.h
RemoteRobot.h
armarx::detail::_NJointControllerGuiPluginBase::Base::getControllerName
std::string getControllerName() const
Definition: NJointControllerGuiPluginBase.cpp:10
armarx::plugins::RobotUnitComponentPlugin::setRobotUnitName
void setRobotUnitName(const std::string &name)
Definition: RobotUnitComponentPlugin.cpp:118
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:183
armarx::detail::_NJointControllerGuiPluginBase::Base::activateController
virtual void activateController()
Definition: NJointControllerGuiPluginBase.cpp:20
armarx::ManagedIceObject::postOnDisconnectComponent
virtual void postOnDisconnectComponent()
Definition: ManagedIceObject.h:565
armarx::detail::_NJointControllerGuiPluginBase::Base::postOnConnectComponent
void postOnConnectComponent() override
Definition: NJointControllerGuiPluginBase.cpp:122
armarx::detail::_NJointControllerGuiPluginBase::Base::~Base
~Base() override
Definition: NJointControllerGuiPluginBase.cpp:36
armarx::detail::_NJointControllerGuiPluginBase::Base::loadSettings
void loadSettings(QSettings *settings) override
Implement to load the settings that are part of the GUI configuration.
Definition: NJointControllerGuiPluginBase.cpp:65
armarx::detail::_NJointControllerGuiPluginBase::Base::createController
virtual void createController()
Definition: NJointControllerGuiPluginBase.cpp:16
armarx::detail::_NJointControllerGuiPluginBase::Base::_allMutex
std::recursive_mutex _allMutex
Definition: NJointControllerGuiPluginBase.h:104
armarx::plugins::RobotStateComponentPlugin::setRobotStateComponentName
void setRobotStateComponentName(const std::string &name)
Definition: RobotStateComponentPlugin.cpp:272
armarx::RobotStateComponentPluginUser::addRobot
VirtualRobot::RobotPtr addRobot(const std::string &id, const VirtualRobot::RobotPtr &robot, const VirtualRobot::RobotNodeSetPtr &rns={}, const VirtualRobot::RobotNodePtr &node={})
Definition: RobotStateComponentPlugin.cpp:331
armarx::RobotStateComponentPluginUser::synchronizeLocalClone
bool synchronizeLocalClone(const VirtualRobot::RobotPtr &robot) const
Definition: RobotStateComponentPlugin.cpp:371
armarx::detail::_NJointControllerGuiPluginBase::Base::getConfigDialog
QPointer< QDialog > getConfigDialog(QWidget *parent) override
getConfigDialog returns a pointer to the a configuration widget of this controller.
Definition: NJointControllerGuiPluginBase.cpp:88
ARMARX_TRACE
#define ARMARX_TRACE
Definition: trace.h:69
armarx::ManagedIceObject::postOnConnectComponent
virtual void postOnConnectComponent()
Definition: ManagedIceObject.h:554
armarx::detail::_NJointControllerGuiPluginBase::Base::deleteController
virtual void deleteController()
Definition: NJointControllerGuiPluginBase.cpp:28
armarx::detail::_NJointControllerGuiPluginBase::Base::connectCreateAcivateDeactivateDelete
void connectCreateAcivateDeactivateDelete(QPushButton *cr, QPushButton *ac, QPushButton *dc, QPushButton *de)
Definition: NJointControllerGuiPluginBase.cpp:41
armarx::detail::_NJointControllerGuiPluginBase::Base::saveSettings
void saveSettings(QSettings *settings) override
Implement to save the settings as part of the GUI configuration.
Definition: NJointControllerGuiPluginBase.cpp:76
armarx::RobotStateComponentPluginUser::getRobotStateComponentPlugin
const RobotStateComponentPlugin & getRobotStateComponentPlugin() const
Definition: RobotStateComponentPlugin.cpp:307
armarx::detail::_NJointControllerGuiPluginBase::Base::preOnConnectComponent
void preOnConnectComponent() override
Definition: NJointControllerGuiPluginBase.cpp:112
armarx::ManagedIceObject::preOnConnectComponent
virtual void preOnConnectComponent()
Definition: ManagedIceObject.h:553
armarx::detail::_NJointControllerGuiPluginBase::Base::deactivateController
virtual void deactivateController()
Definition: NJointControllerGuiPluginBase.cpp:24
armarx::detail::_NJointControllerGuiPluginBase
Definition: NJointControllerGuiPluginBase.cpp:7
armarx::detail::_NJointControllerGuiPluginBase::Base::Base
Base()
Definition: NJointControllerGuiPluginBase.cpp:32
armarx::detail::_NJointControllerGuiPluginBase::Base::_dialog
QPointer< SimpleConfigDialog > _dialog
Definition: NJointControllerGuiPluginBase.h:102
IceInternal::ProxyHandle<::IceProxy::armarx::RobotUnitInterface >
armarx::RobotUnitComponentPluginUser::getRobotUnitComponentPlugin
plugins::RobotUnitComponentPlugin & getRobotUnitComponentPlugin()
Definition: RobotUnitComponentPlugin.cpp:191
armarx::Component::preOnConnectComponent
virtual void preOnConnectComponent() override
Definition: Component.cpp:131
armarx::ManagedIceObject::getName
std::string getName() const
Retrieve name of object.
Definition: ManagedIceObject.cpp:107
armarx::detail::_NJointControllerGuiPluginBase::Base::_robot
VirtualRobot::RobotPtr _robot
Definition: NJointControllerGuiPluginBase.h:105
armarx::detail::_NJointControllerGuiPluginBase::Base::setupGuiAfterConnect
virtual void setupGuiAfterConnect()
Definition: NJointControllerGuiPluginBase.cpp:155
armarx::detail::_NJointControllerGuiPluginBase::Base::postOnDisconnectComponent
void postOnDisconnectComponent() override
Definition: NJointControllerGuiPluginBase.cpp:131
armarx::detail::_NJointControllerGuiPluginBase::Base::configured
void configured() override
This function must be implemented by the user, if he supplies a config dialog.
Definition: NJointControllerGuiPluginBase.cpp:103
armarx::SimpleConfigDialog
A config-dialog containing one (or multiple) proxy finders.
Definition: SimpleConfigDialog.h:84