RemoteGuiWidgetController.cpp
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 ArmarXGui::gui-plugins::RemoteGuiWidgetController
17  * \author Fabian Paus ( fabian dot paus at kit dot edu )
18  * \date 2018
19  * \copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
24 
27 
29 
30 #include <QSpacerItem>
31 #include <QLayout>
32 #include <QGridLayout>
33 #include <QStyledItemDelegate>
34 #include <QScrollArea>
35 
36 namespace armarx
37 {
38  void clearLayout(QLayout* layout)
39  {
40  QLayoutItem* item;
41  while ((item = layout->takeAt(0)))
42  {
43  if (item->layout())
44  {
45  clearLayout(item->layout());
46  delete item->layout();
47  }
48  if (item->widget())
49  {
50  delete item->widget();
51  }
52  delete item;
53  }
54  }
55 
56  namespace
57  {
58 
59  const char* const REMOTE_TAB_ID = "remote.tab_id";
60  const char* const REMOTE_WIDGET_NAME = "remote.widget_name";
61 
62  struct InternalUpdateGuard
63  {
64  InternalUpdateGuard(std::atomic<bool>* enabled)
65  : enabled(enabled)
66  {
67  *enabled = true;
68  }
69 
70  ~InternalUpdateGuard()
71  {
72  *enabled = false;
73  }
74 
75  std::atomic<bool>* enabled;
76  };
77  }
78 
80  {
81  widget.setupUi(getWidget());
82  widget.remoteTabWidget->clear();
83 
84  widget.comboBoxTabGroups->setVisible(false);
85  widget.comboBoxTabGroups->addItem(groupAll);
86  widget.comboBoxTabGroups->addItem(groupUngrouped);
87 
88  connect(widget.sendRemoteValuesButton, &QPushButton::clicked,
90  connect(widget.checkBoxGroupTabs, &QCheckBox::clicked,
92  connect(widget.comboBoxTabGroups, QOverload<const QString&>::of(&QComboBox::currentIndexChanged),
94 
97  Qt::QueuedConnection);
100  Qt::QueuedConnection);
103  Qt::QueuedConnection);
106  Qt::QueuedConnection);
107 
108  widget.comboBoxTabGroups->setCurrentIndex(0);
109  }
110 
111 
113  {
114 
115  }
116 
117  QPointer<QDialog> RemoteGuiWidgetController::getConfigDialog(QWidget* parent)
118  {
119  if (!dialog)
120  {
121  dialog = new SimpleConfigDialog(parent);
122  dialog->addProxyFinder<RemoteGuiInterfacePrx>({"RemoteGuiProvider", "", "RemoteGui*"});
123  }
124  return qobject_cast<SimpleConfigDialog*>(dialog);
125  }
126 
128  {
129  remoteGuiProviderName = dialog->getProxyName("RemoteGuiProvider");
130  }
131 
132 
133  void RemoteGuiWidgetController::loadSettings(QSettings* settings)
134  {
135  remoteGuiProviderName = settings->value("remoteGuiProviderName", "RemoteGuiProvider").toString().toStdString();
136  }
137 
138  void RemoteGuiWidgetController::saveSettings(QSettings* settings)
139  {
140  settings->setValue("remoteGuiProviderName", QString::fromStdString(remoteGuiProviderName));
141  }
142 
143 
145  {
146  usingProxy(remoteGuiProviderName);
147  }
148 
149 
151  {
152  remoteGuiProvider = getProxy<RemoteGuiInterfacePrx>(remoteGuiProviderName);
153 
154  // Setup data structures
155  {
156  std::unique_lock<std::mutex> lock(stateMutex);
157  tabs = remoteGuiProvider->getTabs();
158  tabWidgetStates = remoteGuiProvider->getTabStates();
159  tabValueMap = remoteGuiProvider->getValuesForAllTabs();
160  }
161 
162  // Load initial values into GUI
163  emit tabsChanged();
164 
165  // Subscribe to updates
166  usingTopic(remoteGuiProvider->getTopicName());
167  }
168 
169  void RemoteGuiWidgetController::reportTabChanged(const std::string& tab, const Ice::Current&)
170  {
171  {
172  std::unique_lock<std::mutex> lock(stateMutex);
173  tabs = remoteGuiProvider->getTabs();
174  tabWidgetStates = remoteGuiProvider->getTabStates();
175  tabValueMap = remoteGuiProvider->getValuesForAllTabs();
176  }
177  QString qTabId = QString::fromStdString(tab);
178  emit tabChanged(qTabId);
179  }
180 
181 
183  {
184  // Setup data structures
185  {
186  std::unique_lock<std::mutex> lock(stateMutex);
187  tabs = remoteGuiProvider->getTabs();
188  tabWidgetStates = remoteGuiProvider->getTabStates();
189  tabValueMap = remoteGuiProvider->getValuesForAllTabs();
190  }
191  emit tabsChanged();
192  }
193 
194  void RemoteGuiWidgetController::reportWidgetChanged(const std::string& tab, const RemoteGui::WidgetStateMap& widgetState, const Ice::Current&)
195  {
196  {
197  std::unique_lock<std::mutex> lock(stateMutex);
198  tabWidgetStates[tab] = widgetState;
199  }
200  QString qTabId = QString::fromStdString(tab);
201  emit widgetChanged(qTabId);
202  }
203 
204  void RemoteGuiWidgetController::reportStateChanged(const std::string& tab, const RemoteGui::ValueMap& delta, const Ice::Current&)
205  {
206  {
207  std::unique_lock<std::mutex> lock(stateMutex);
208  for (const auto& pair : delta)
209  {
210  tabValueMap[tab][pair.first] = pair.second;
211  tabDirtyMap[tab][pair.first] = pair.second;
212  }
213  }
214  QString qTabId = QString::fromStdString(tab);
215  emit stateChanged(qTabId);
216  }
217 
219  {
220  // The root widget of a tab was changed, so we have to create everything from scratch
221  std::string id = RemoteGui::toUtf8(qid);
222 
223  std::unique_lock<std::mutex> lock(stateMutex);
224 
225  createTab(id);
226  updateWidgets(id);
227 
228  removeObsoleteTabs();
229  }
230 
232  {
233  std::unique_lock<std::mutex> lock(stateMutex);
234 
235  // Add or update existing tabs
236  for (auto& tabWidget : tabs)
237  {
238  QString qid = QString::fromStdString(tabWidget.first);
239  std::string id = RemoteGui::toUtf8(qid);
240  createTab(id);
241  updateWidgets(id);
242  }
243 
244  removeObsoleteTabs();
245  }
246 
248  {
249  // The display options of some widgets changed (e.g. enabled, hidden)
250  std::string id = RemoteGui::toUtf8(qid);
251 
252  std::unique_lock<std::mutex> lock(stateMutex);
253 
254  updateWidgets(id);
255  }
256 
258  {
259  // The remotely stored values changed => update the displayed values
260  std::string id = RemoteGui::toUtf8(qid);
261  updateState(id);
262  }
263 
265  {
266  if (internalUpdate)
267  {
268  return;
269  }
270 
271  QWidget* widget = qobject_cast<QWidget*>(sender());
272  if (!widget)
273  {
274  ARMARX_WARNING << "Expected a widget as sender of onGuiStateChanged()";
275  return;
276  }
277 
278  std::string id = widget->property(REMOTE_TAB_ID).toString().toStdString();
279  std::string name = widget->property(REMOTE_WIDGET_NAME).toString().toStdString();
280 
281  std::unique_lock<std::mutex> lock(stateMutex);
282 
283  auto varinfodump = ARMARX_STREAM_PRINTER
284  {
285  out << '\n' << VAROUT(id)
286  << '\n' << VAROUT(name)
287  << '\n' << VAROUT(GetTypeString(*widget));
288  };
289 
290  ARMARX_CHECK_EXPRESSION(tabValueMap.count(id)) << varinfodump;
291  ARMARX_CHECK_EXPRESSION(tabValueMap.at(id).count(name)) << varinfodump;
292  ARMARX_CHECK_EXPRESSION(guiDescriptions.count(id)) << varinfodump;
293  ARMARX_CHECK_EXPRESSION(guiDescriptions.at(id).count(name)) << varinfodump;
294 
295  RemoteGui::ValueVariant& currentValue = tabValueMap.at(id).at(name);
296 
297  RemoteGui::WidgetPtr const& desc = guiDescriptions.at(id).at(name);
298  RemoteGui::WidgetHandler const& widgetHandler = RemoteGui::getWidgetHandler(desc);
299  RemoteGui::ValueVariant newValue = widgetHandler.handleGuiChange(*desc, widget);
300 
301  if (newValue != currentValue)
302  {
303  currentValue = newValue;
304  doAutoUpdate(id);
305  }
306  }
307 
309  {
310  const int index = widget.remoteTabWidget->currentIndex();
311  QString currentTabText = widget.remoteTabWidget->tabText(index);
312  std::string tabId = RemoteGui::toUtf8(currentTabText);
313 
314  remoteGuiProvider->setValues(tabId, tabValueMap[tabId]);
315  }
316 
317  void RemoteGuiWidgetController::createTab(std::string const& tabId)
318  {
319  RemoteGui::WidgetPtr widgetP = tabs.at(tabId);
320  ARMARX_CHECK_EXPRESSION(widgetP);
321 
322  ARMARX_INFO << "Updating GUI for tab '" << tabId << "'";
323 
324  // Build UI elements
325  QString qTabId = QString::fromStdString(tabId);
326  QWidget* tabHolder = nullptr;
327  for (const auto& pair : qtTabs)
328  {
329  TabData const& data = pair.second;
330  if (data.fullName() == tabId)
331  {
332  tabHolder = data.w;
333  break;
334  }
335  }
336  QGridLayout* layout = nullptr;
337  if (tabHolder)
338  {
339  // Delete all the children
340  QScrollArea* scrollArea = qobject_cast<QScrollArea*>(tabHolder);
341  if (scrollArea && scrollArea->widget())
342  {
343  layout = qobject_cast<QGridLayout*>(scrollArea->widget()->layout());
344  if (layout)
345  {
346  clearLayout(layout);
347  }
348  }
349  }
350  else
351  {
352  {
353  QScrollArea* scrollArea = new QScrollArea(widget.remoteTabWidget);
354  scrollArea->setObjectName(qTabId);
355  scrollArea->setWidgetResizable(true);
356  layout = new QGridLayout(scrollArea);
357  layout->setContentsMargins(0, 0, 0, 0);
358  QWidget* scrollAreaWidgetContents = new QWidget;
359  scrollArea->setWidget(scrollAreaWidgetContents);
360  scrollAreaWidgetContents->setLayout(layout);
361  tabHolder = scrollArea;
362  }
363 
364  auto& data = qtTabs[tabId];
365  data.w = tabHolder;
366  // extract groups
367  {
368  const auto fname = data.fullName();
369  std::size_t idx = fname.find('_');
370  while (idx != std::string::npos)
371  {
372  data.groups.emplace(fname.substr(0, idx));
373  idx = fname.find('_', idx + 1);
374  }
375  }
376  // maybe add tab
377  if (activeGroup == groupAll ||
378  (data.groups.empty() && activeGroup == groupUngrouped))
379  {
380  //ungrouped / all group uses full names
381  widget.remoteTabWidget->addTab(tabHolder, qTabId);
382  }
383  else if (data.groups.count(activeGroup))
384  {
385  widget.remoteTabWidget->addTab(tabHolder, QString::fromStdString(data.name(activeGroup)));
386  }
387  // inc group count
388  for (const auto& group : data.groups)
389  {
390  if (tabsPerGroup.count(group))
391  {
392  ++tabsPerGroup.at(group);
393  }
394  else
395  {
396  tabsPerGroup[group] = 1;
397  const auto box = widget.comboBoxTabGroups;
398  box->blockSignals(true);
399  box->addItem(QString::fromStdString(group));
400  box->blockSignals(false);
401  }
402  ARMARX_DEBUG << VAROUT(tabsPerGroup);
403  ARMARX_DEBUG << VAROUT(widget.comboBoxTabGroups->maxVisibleItems());
404  }
405  }
406 
407  guiWidgets[tabId].clear();
408  QWidget* newTab = createWidgetFromDescription(tabId, widgetP);
409 
410  newTab->setParent(tabHolder);
411  layout->addWidget(newTab, 0, 0);
412  layout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding), 1, 1);
413  layout->addItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
414  }
415 
416  void RemoteGuiWidgetController::removeObsoleteTabs()
417  {
418  for (auto iter = qtTabs.begin(); iter != qtTabs.end();)
419  {
420  std::string const& tabId = iter->first;
421  TabData const& data = iter->second;
422 
423  if (tabs.count(tabId) > 0)
424  {
425  ++iter;
426  continue;
427  }
428 
429  ARMARX_INFO << "Removing tab: " << tabId;
430  QString qTabId = QString::fromStdString(tabId);
431 
432  QWidget* tabHolder = data.w;
433  tabHolder->deleteLater();
434  QTabWidget* tab = widget.remoteTabWidget;
435  int i = data.findTabIndex(tab);
436  if (i > 0)
437  {
438  tab->removeTab(i);
439  }
440 
441  for (const std::string& group : data.groups)
442  {
443  std::size_t& tabCount = tabsPerGroup.at(group);
444  tabCount -= 1;
445  if (tabCount == 0)
446  {
447  tabsPerGroup.erase(group);
448  QComboBox* box = widget.comboBoxTabGroups;
449  int boxIdx = box->findText(QString::fromStdString(group));
450  ARMARX_DEBUG << group << ' ' << VAROUT(boxIdx);
451  if (boxIdx > 1)
452  {
453  box->blockSignals(true);
454  box->setCurrentIndex(0);
455  box->removeItem(boxIdx);
456  box->blockSignals(false);
457  ARMARX_DEBUG << "REMOVING entry " << group << ' ' << VAROUT(boxIdx);
458  }
459  box->setCurrentIndex(0);
460  }
461  }
462 
463  iter = qtTabs.erase(iter);
464  guiWidgets.erase(tabId);
465 
466  ARMARX_DEBUG << VAROUT(tabsPerGroup);
467  }
468  }
469 
470  void RemoteGuiWidgetController::updateWidgets(std::string const& tabId)
471  {
472  // External widget state update received
473  RemoteGui::WidgetStateMap const& states = tabWidgetStates.at(tabId);
474  std::map<std::string, QWidget*> const& widgets = guiWidgets.at(tabId);
475 
476  for (auto& nameState : states)
477  {
478  std::string const& name = nameState.first;
479  RemoteGui::WidgetState const& state = nameState.second;
480  QWidget* widget = widgets.at(name);
481 
482  widget->setHidden(state.hidden);
483  widget->setDisabled(state.disabled);
484  }
485  }
486 
487  void RemoteGuiWidgetController::updateState(std::string const& tabId)
488  {
489  // External state update received
490  std::unique_lock<std::mutex> lock(stateMutex);
491 
492  // Do not handle GUI updates triggered by this method (internal update only)
493  InternalUpdateGuard guard(&internalUpdate);
494 
495  RemoteGui::ValueMap& values = tabDirtyMap.at(tabId);
496  std::map<std::string, QWidget*> const& widgets = guiWidgets.at(tabId);
497  RemoteGui::WidgetMap const& widgetDesc = guiDescriptions.at(tabId);
498 
499  for (auto& pair : values)
500  {
501  std::string const& name = pair.first;
502  RemoteGui::ValueVariant const& value = pair.second;
503  RemoteGui::WidgetPtr const& desc = widgetDesc.at(name);
504  QWidget* widget = widgets.at(name);
505 
506  auto& widgetHandler = RemoteGui::getWidgetHandler(desc);
507  widgetHandler.updateGui(*desc, widget, value);
508  }
509  tabDirtyMap.at(tabId).clear();
510  }
511 
512  static void setNameProp(QWidget* w, QString const& name, QString const& id)
513  {
514  if (w->property(REMOTE_WIDGET_NAME).toString() == "")
515  {
516  w->setProperty(REMOTE_WIDGET_NAME, name);
517  w->setProperty(REMOTE_TAB_ID, id);
518  for (auto child : w->findChildren<QWidget*>(QString{}, Qt::FindDirectChildrenOnly))
519  {
520  setNameProp(child, name, id);
521  }
522  }
523  }
524 
525  QWidget* RemoteGuiWidgetController::createWidgetFromDescription(const std::string& tabId, const RemoteGui::WidgetPtr& desc)
526  {
527  ARMARX_TRACE;
528  QWidget* widget = nullptr;
529 
530  RemoteGui::ValueMap& values = tabValueMap[tabId];
531  bool useDefaultValue = values.count(desc->name) == 0;
532  RemoteGui::ValueVariant const& initialValue = useDefaultValue ? desc->defaultValue : values[desc->name];
533 
534  RemoteGui::CreateWidgetCallback createChild = [this, tabId](RemoteGui::WidgetPtr const & desc) -> QWidget *
535  {
536  ARMARX_TRACE;
537  return this->createWidgetFromDescription(tabId, desc);
538  };
539 
540  {
541  ARMARX_TRACE;
542  // Do not trigger external updates when initial values are set
543  InternalUpdateGuard guard(&internalUpdate);
544 
545  auto& widgetHandler = RemoteGui::getWidgetHandler(desc);
546  widget = widgetHandler.createWidget(*desc, initialValue, createChild,
547  this, SLOT(onGuiStateChanged()));
548  }
549 
550  ARMARX_CHECK_EXPRESSION(widget != nullptr);
551 
552  setNameProp(widget, QString::fromStdString(desc->name), QString::fromStdString(tabId));
553 
554  // Widgets without a name cannot be referred to later
555  if (!desc->name.empty())
556  {
557  ARMARX_TRACE;
558  auto result = guiWidgets[tabId].emplace(desc->name, widget);
559  bool inserted = result.second;
560  if (inserted)
561  {
562  guiDescriptions[tabId][desc->name] = desc;
563  values[desc->name] = initialValue;
564  }
565  else
566  {
567  ARMARX_TRACE;
568  ARMARX_WARNING << "Tried to add a widget with duplicate name '" << desc->name
569  << "' to remote tab ID '" << tabId << "'";
570  }
571  }
572 
573  return widget;
574  }
575 
577  {
578  widget.widgetTopBar->setVisible(false);
579  widget.remoteTabWidget->tabBar()->setVisible(false);
580  }
581 
583  {
584  widget.widgetTopBar->setVisible(true);
585  widget.remoteTabWidget->tabBar()->setVisible(true);
586  }
587 
588  void RemoteGuiWidgetController::doAutoUpdate(std::string const& id)
589  {
590  if (widget.autoUpdateCheckBox->checkState() == Qt::Checked)
591  {
592  remoteGuiProvider->setValues(id, tabValueMap[id]);
593  }
594  }
595 
597  {
598  widget.comboBoxTabGroups->setEnabled(checked);
599  widget.comboBoxTabGroups->setVisible(checked);
600  widget.comboBoxTabGroups->setCurrentIndex(0);
601  }
602 
604  {
605  activeGroup = group.toStdString();
606  auto tab = widget.remoteTabWidget;
607  // Remove all without running their destructor
608  while (tab->count())
609  {
610  tab->removeTab(0);
611  }
612  // Readd tabs
613  for (const auto& pair : qtTabs)
614  {
615  TabData const& data = pair.second;
616 
617  if (activeGroup == groupAll ||
618  (data.groups.empty() && activeGroup == groupUngrouped))
619  {
620  // Ungrouped / all group uses full names
621  tab->addTab(data.w, QString::fromStdString(data.fullName()));
622  }
623  else if (!data.groups.empty() && data.groups.count(activeGroup))
624  {
625  tab->addTab(data.w, QString::fromStdString(data.name(activeGroup)));
626  }
627  }
628  }
629 
630  std::string RemoteGuiWidgetController::TabData::fullName() const
631  {
632  return w->objectName().toStdString();
633  }
634 
635  std::string RemoteGuiWidgetController::TabData::name(const std::string& pre) const
636  {
637  return fullName().substr(pre.size() + 1);
638  }
639 
640  int RemoteGuiWidgetController::TabData::findTabIndex(QTabWidget* tab) const
641  {
642  for (auto idx = 0; idx < tab->count(); ++idx)
643  {
644  if (w == tab->widget(idx))
645  {
646  return idx;
647  }
648  }
649  return -1;
650  }
651 }
armarx::RemoteGuiWidgetController::getConfigDialog
QPointer< QDialog > getConfigDialog(QWidget *parent=0) override
getConfigDialog returns a pointer to the a configuration widget of this controller.
Definition: RemoteGuiWidgetController.cpp:117
armarx::RemoteGuiWidgetController::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: RemoteGuiWidgetController.cpp:150
armarx::RemoteGuiWidgetController::onCheckBoxGroupTabsClicked
void onCheckBoxGroupTabsClicked(bool checked)
Definition: RemoteGuiWidgetController.cpp:596
armarx::RemoteGuiWidgetController::onTabsChanged
void onTabsChanged()
Definition: RemoteGuiWidgetController.cpp:231
armarx::RemoteGuiWidgetController::onSendButtonClicked
void onSendButtonClicked()
Definition: RemoteGuiWidgetController.cpp:308
index
uint8_t index
Definition: EtherCATFrame.h:59
RemoteGuiWidgetController.h
armarx::RemoteGuiWidgetController::stateChanged
void stateChanged(QString id)
armarx::RemoteGuiWidgetController::reportTabsRemoved
void reportTabsRemoved(const Ice::Current &) override
Definition: RemoteGuiWidgetController.cpp:182
armarx::RemoteGuiWidgetController::onStateChanged
void onStateChanged(QString id)
Definition: RemoteGuiWidgetController.cpp:257
ProsthesisInterface.values
values
Definition: ProsthesisInterface.py:190
armarx::RemoteGuiWidgetController::onLockWidget
void onLockWidget() override
Definition: RemoteGuiWidgetController.cpp:576
Storage.h
armarx::RemoteGuiWidgetController::widgetChanged
void widgetChanged(QString id)
armarx::RemoteGuiWidgetController::onUnlockWidget
void onUnlockWidget() override
Definition: RemoteGuiWidgetController.cpp:582
armarx::RemoteGui::ValueMap
std::map< std::string, ValueVariant > ValueMap
Definition: RemoteGuiVisitors.h:41
armarx::RemoteGuiWidgetController::tabsChanged
void tabsChanged()
armarx::RemoteGui::WidgetHandler::handleGuiChange
virtual RemoteGui::ValueVariant handleGuiChange(Widget const &desc, QWidget *widget) const =0
armarx::RemoteGui::toUtf8
std::string toUtf8(QString const &qstring)
Definition: WidgetHandler.cpp:7
armarx::RemoteGuiWidgetController::~RemoteGuiWidgetController
virtual ~RemoteGuiWidgetController()
Controller destructor.
Definition: RemoteGuiWidgetController.cpp:112
armarx::RemoteGuiWidgetController::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: RemoteGuiWidgetController.cpp:144
armarx::RemoteGuiWidgetController::reportStateChanged
void reportStateChanged(const std::string &tab, const RemoteGui::ValueMap &delta, const Ice::Current &) override
Definition: RemoteGuiWidgetController.cpp:204
ARMARX_TRACE
#define ARMARX_TRACE
Definition: trace.h:69
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
armarx::RemoteGuiWidgetController::onComboBoxTabGroupsCurrentIndexChanged
void onComboBoxTabGroupsCurrentIndexChanged(const QString &group)
Definition: RemoteGuiWidgetController.cpp:603
WidgetRegister.h
armarx::RemoteGui::WidgetHandler
Definition: WidgetHandler.h:22
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
ARMARX_DEBUG
#define ARMARX_DEBUG
Definition: Logging.h:177
armarx::RemoteGuiWidgetController::onTabChanged
void onTabChanged(QString id)
Definition: RemoteGuiWidgetController.cpp:218
enabled
std::atomic< bool > * enabled
Definition: RemoteGuiWidgetController.cpp:75
armarx::GetTypeString
std::string GetTypeString(const std::type_info &tinf, bool withoutNamespaceSpecifier=false)
Definition: GetTypeString.h:36
armarx::WidgetDescription::WidgetPtr
::IceInternal::Handle<::armarx::WidgetDescription::Widget > WidgetPtr
Definition: NJointControllerBase.h:66
armarx::RemoteGuiWidgetController::onGuiStateChanged
void onGuiStateChanged()
Definition: RemoteGuiWidgetController.cpp:264
ExpressionException.h
armarx::ManagedIceObject::usingTopic
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
Definition: ManagedIceObject.cpp:248
ARMARX_CHECK_EXPRESSION
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
Definition: ExpressionException.h:73
armarx::RemoteGui::getWidgetHandler
const WidgetHandler & getWidgetHandler(WidgetPtr const &desc)
Definition: WidgetRegister.cpp:60
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::RemoteGuiWidgetController::saveSettings
void saveSettings(QSettings *settings) override
Definition: RemoteGuiWidgetController.cpp:138
armarx::RemoteGuiWidgetController::RemoteGuiWidgetController
RemoteGuiWidgetController()
Controller Constructor.
Definition: RemoteGuiWidgetController.cpp:79
VAROUT
#define VAROUT(x)
Definition: StringHelpers.h:182
armarx::ArmarXWidgetController::getWidget
virtual QPointer< QWidget > getWidget()
getWidget returns a pointer to the a widget of this controller.
Definition: ArmarXWidgetController.cpp:54
armarx::RemoteGuiWidgetController::reportTabChanged
void reportTabChanged(const std::string &tab, const Ice::Current &) override
Definition: RemoteGuiWidgetController.cpp:169
armarx::RemoteGuiWidgetController::onWidgetChanged
void onWidgetChanged(QString id)
Definition: RemoteGuiWidgetController.cpp:247
armarx::RemoteGuiWidgetController::loadSettings
void loadSettings(QSettings *settings) override
Definition: RemoteGuiWidgetController.cpp:133
armarx::RemoteGuiWidgetController::reportWidgetChanged
void reportWidgetChanged(const std::string &tab, const RemoteGui::WidgetStateMap &widgetState, const Ice::Current &) override
Definition: RemoteGuiWidgetController.cpp:194
armarx::RemoteGuiWidgetController::configured
void configured() override
This function must be implemented by the user, if he supplies a config dialog.
Definition: RemoteGuiWidgetController.cpp:127
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::RemoteGui::CreateWidgetCallback
std::function< QWidgetPtr(WidgetPtr const &)> CreateWidgetCallback
Definition: WidgetHandler.h:20
armarx::ManagedIceObject::usingProxy
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Definition: ManagedIceObject.cpp:151
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::RemoteGuiWidgetController::tabChanged
void tabChanged(QString id)
armarx::clearLayout
void clearLayout(QLayout *layout)
Clear a layout.
Definition: RemoteGuiWidgetController.cpp:38
armarx::SimpleConfigDialog
A config-dialog containing one (or multiple) proxy finders.
Definition: SimpleConfigDialog.h:84
ARMARX_STREAM_PRINTER
#define ARMARX_STREAM_PRINTER
use this macro to write output code that is executed when printed and thus not executed if the debug ...
Definition: Logging.h:304