MemoryViewer.cpp
Go to the documentation of this file.
1 #include "MemoryViewer.h"
2 
3 #include <QApplication>
4 #include <QBoxLayout>
5 #include <QCheckBox>
6 #include <QClipboard>
7 #include <QDialog>
8 #include <QGroupBox>
9 #include <QLabel>
10 #include <QLayout>
11 #include <QMenu>
12 #include <QSettings>
13 #include <QTimer>
14 
15 #include <Ice/Exception.h>
16 
17 #include <SimoxUtility/algorithm/get_map_keys_values.h>
18 
23 
25 
26 #include <RobotAPI/interface/armem/actions.h>
27 #include <RobotAPI/interface/armem/memory.h>
28 #include <RobotAPI/interface/armem/mns/MemoryNameSystemInterface.h>
38 
39 namespace armarx::armem::gui
40 {
41  MemoryViewer::MemoryViewer(QBoxLayout* updateWidgetLayout,
42  QGroupBox* memoryGroupBox,
43  QLayout* memoryGroupBoxParentLayout,
44  QGroupBox* instanceGroupBox,
45  QLayout* instanceGroupBoxParentLayout,
46  QBoxLayout* diskControlWidgetLayout,
47  QLabel* statusLabel)
48  {
49  Logging::setTag("MemoryViewer");
50 
51  this->statusLabel = statusLabel;
52  this->statusLabel->clear();
53 
54  statusLabel->setContextMenuPolicy(Qt::CustomContextMenu);
55  connect(statusLabel,
56  &QLabel::customContextMenuRequested,
57  [statusLabel](const QPoint& pos)
58  {
59  QMenu menu(statusLabel);
60  menu.addAction("Copy to clipboard",
61  [statusLabel]()
62  { QApplication::clipboard()->setText(statusLabel->text()); });
63  menu.addAction("Clear status", [statusLabel]() { statusLabel->clear(); });
64  menu.exec(statusLabel->mapToGlobal(pos));
65  });
66 
67 
68  // Update timer
69  this->updateWidgetLayout = updateWidgetLayout;
71  updateWidgetLayout->insertWidget(0, updateWidget);
72 
73  periodicUpdateTimer = new QTimer(this);
74  periodicUpdateTimer->setInterval(1000 / 60); // Keep this stable.
75 
76  // Memory View
77  auto retrieveEntityInfo = [this](const MemoryID& entityID) -> PredictionWidget::EntityInfo
78  {
79  client::Reader reader = memoryReaders.at(entityID.memoryName);
80  if (!reader.predictionPrx)
81  {
82  std::stringstream sstream;
83  sstream << "Predictions are not available for memory '" << entityID.memoryName
84  << "'.";
85  this->statusLabel->setText(QString::fromStdString(sstream.str()));
86  return {};
87  }
88 
89  std::map<MemoryID, std::vector<PredictionEngine>> predictionEngines;
90  client::QueryResult queryResult;
91  try
92  {
93  predictionEngines = reader.getAvailablePredictionEngines();
94  queryResult = reader.queryMemoryIDs({entityID}, armem::query::DataMode::NoData);
95  }
96  catch (const Ice::LocalException& e)
97  {
98  std::stringstream sstream;
99  sstream << "Could not get prediction engines and type from memory: " << e.what();
100  this->statusLabel->setText(QString::fromStdString(sstream.str()));
101  return {nullptr, {}};
102  }
103 
104  aron::type::ObjectPtr entityType;
105  if (queryResult.success)
106  {
107  auto* providerSegment = queryResult.memory.findProviderSegment(entityID);
108  if (providerSegment != nullptr)
109  {
110  entityType = providerSegment->aronType();
111  }
112  }
114  .type = entityType,
115  .engines = armem::accumulateEntriesContainingID(predictionEngines, entityID)};
116  };
117  memoryGroup = new armem::gui::MemoryGroupBox(std::move(retrieveEntityInfo));
118 
119  armarx::gui::replaceWidget(memoryGroupBox, memoryGroup, memoryGroupBoxParentLayout);
120  ARMARX_CHECK_NULL(memoryGroupBox);
121 
122  // Instance View
124  armarx::gui::replaceWidget(instanceGroupBox, instanceGroup, instanceGroupBoxParentLayout);
125  this->instanceGroup->setStatusLabel(statusLabel);
126  ARMARX_CHECK_NULL(instanceGroupBox);
127 
128  // Disk Control
129  if (diskControlWidgetLayout)
130  {
131  this->diskControlLayout = diskControlWidgetLayout;
133  diskControlWidgetLayout->addWidget(diskControl);
134  }
135 
136  // Connections
137  connect(diskControl,
139  this,
141  connect(diskControl,
143  this,
145 
146  connect(this, &This::connected, this, &This::startQueries);
147  connect(this, &This::connected, this, &This::startPeriodicUpdateTimer);
148  connect(updateWidget, &armem::gui::PeriodicUpdateWidget::update, this, &This::startQueries);
149  connect(
150  updateWidget, &armem::gui::PeriodicUpdateWidget::collapseAll, this, &This::collapseAll);
151 
152  connect(periodicUpdateTimer, &QTimer::timeout, this, &This::updateListOfActiveMemories);
153  connect(periodicUpdateTimer, &QTimer::timeout, this, &This::processQueryResults);
154 
155  connect(memoryGroup->queryWidget(),
157  this,
159  connect(memoryGroup->queryWidget(),
161  this,
163  connect(memoryGroup->queryWidget(),
165  this,
167 
168  connect(memoryGroup->predictionWidget(),
170  this,
172  connect(
174 
175  connect(this, &This::memoryDataChanged, this, &This::updateMemoryTree);
176  connect(memoryGroup->tree(),
178  this,
180 
181  connect(memoryGroup->tree(),
183  this,
185  connect(memoryGroup->tree(),
187  this,
189  connect(instanceGroup,
191  this,
193  connect(instanceGroup->view,
195  this,
197  connect(instanceGroup->view,
199  this,
201  }
202 
203  void
204  MemoryViewer::setLogTag(const std::string& _tag) // Leading _ silences a warning
205  {
206  Logging::setTag(_tag);
207  }
208 
209  void
211  {
212  if (mnsName.size() > 0)
213  {
214  component.usingProxy(mnsName);
215  }
216  if (debugObserverName.size() > 0)
217  {
218  component.usingProxy(debugObserverName);
219  }
220 
221  is_initialized = true;
222  emit initialized();
223  }
224 
225  void
226  MemoryViewer::onConnect(ManagedIceObject& component)
227  {
228  if (not mnsName.empty())
229  {
230  armem::mns::MemoryNameSystemInterfacePrx mnsProxy;
231  component.getProxy(mnsProxy, mnsName);
232  mns = client::MemoryNameSystem(mnsProxy);
233 
234  const bool update = true;
237  }
238  // DebugObserver is optional (check for null on every call)
239  if (not debugObserverName.empty())
240  {
241  component.getProxy(debugObserver, debugObserverName, false, "", false);
242  }
243 
245 
246  is_connected = true;
247  emit connected();
248  }
249 
250  void
251  MemoryViewer::onDisconnect(ManagedIceObject&)
252  {
253  periodicUpdateTimer->stop();
255 
256  is_connected = false;
257 
258  emit disconnected();
259  }
260 
261  void
262  MemoryViewer::collapseAll()
263  {
264  memoryGroup->tree()->collapseAll();
265  }
266 
267  void
268  MemoryViewer::startPeriodicUpdateTimer()
269  {
270  periodicUpdateTimer->start();
271  }
272 
273  const armem::wm::Memory*
274  MemoryViewer::getSingleMemoryData(const std::string& memoryName)
275  {
276  auto it = memoryData.find(memoryName);
277  if (it == memoryData.end())
278  {
279  std::stringstream ss;
280  ss << "Memory name '" << memoryName << "' is unknown. Known are: "
281  << simox::alg::join(simox::alg::get_keys(memoryData), ", ");
282  statusLabel->setText(QString::fromStdString(ss.str()));
283  return nullptr;
284  }
285  /*else if (not it->second.has_value())
286  {
287  return nullptr;
288  }*/
289  else
290  {
291  //return &it->second.value();
292  return &it->second;
293  }
294  }
295 
296  void
298  {
299  TIMING_START(MemoryStore);
300 
301  auto enabledMemories = memoryGroup->queryWidget()->getEnabledMemories();
302  for (auto& [name, reader] : memoryReaders)
303  {
304  // skip if memory should not be queried
305  if (std::find(enabledMemories.begin(), enabledMemories.end(), name) ==
306  enabledMemories.end())
307  {
308  continue;
309  }
310 
311  // Query memory
312  auto q_res = reader.query(memoryGroup->queryInput());
313  if (q_res.success)
314  {
315  server::dto::DirectlyStoreInput input;
316  input.memory = q_res.toIce().memory;
317  reader.directlyStore(input);
318  }
319  else
320  {
321  std::string s = "Query of memory " + name + " was unsuccessful.";
322  statusLabel->setText(QString::fromStdString(s));
323  }
324  }
325 
326  TIMING_END_STREAM(MemoryStore, ARMARX_VERBOSE);
327  }
328 
329  void
331  {
332 
333  TIMING_START(MemoryStartRecording);
334 
335  auto enabledMemories = memoryGroup->queryWidget()->getEnabledMemories();
336  for (auto& [name, reader] : memoryReaders)
337  {
338  // skip if memory should not be queried
339  if (std::find(enabledMemories.begin(), enabledMemories.end(), name) ==
340  enabledMemories.end())
341  {
342  continue;
343  }
344  reader.startRecording();
345  }
346 
347  TIMING_END_STREAM(MemoryStartRecording, ARMARX_VERBOSE);
348  }
349 
350  void
352  {
353 
354  TIMING_START(MemoryStopRecording);
355 
356  auto enabledMemories = memoryGroup->queryWidget()->getEnabledMemories();
357  for (auto& [name, reader] : memoryReaders)
358  {
359  // skip if memory should not be queried
360  if (std::find(enabledMemories.begin(), enabledMemories.end(), name) ==
361  enabledMemories.end())
362  {
363  continue;
364  }
365  reader.stopRecording();
366  }
367 
368  TIMING_END_STREAM(MemoryStopRecording, ARMARX_VERBOSE);
369  }
370 
371  void
373  {
374 
376  auto now = armem::Time::Now();
377 
378  const std::string memoryIDStr = memoryGroup->commitWidget()->getMemoryID();
379  const std::string aronJSONStr = memoryGroup->commitWidget()->getAronJSON();
380 
381  ARMARX_INFO << "Committing to " << memoryIDStr << " the data: " << aronJSONStr;
382 
383  MemoryID memId(memoryIDStr);
384 
385  if (!memId.hasEntityName())
386  {
387  ARMARX_WARNING << "The entered MemoryID '" << memoryIDStr
388  << "' does not contain an entity.";
389  }
390  else
391  {
392 
393  nlohmann::json json = nlohmann::json::parse(aronJSONStr);
394 
395  // ToDo: multiple objects
396  auto aron =
398  json);
399 
400  if (const auto& it = memoryWriters.find(memId.memoryName); it == memoryWriters.end())
401  {
402  ARMARX_WARNING << "No memory with name '" << memId.memoryName
403  << "' available for commit.";
404  }
405  else
406  {
407  armem::Commit comm;
408  auto& entityUpdate = comm.add();
409  entityUpdate.entityID = memId;
410  entityUpdate.confidence = 1.0;
411  entityUpdate.instancesData = {aron};
412  entityUpdate.referencedTime = now;
413  it->second.commit(comm);
414  }
415  }
416 
418  }
419 
420  void
421  MemoryViewer::storeOnDisk(QString directory)
422  {
423  TIMING_START(MemoryExport)
424 
425  std::string status;
426  std::vector<wm::Memory> memoryDataVec = simox::alg::get_values(memoryData);
427  diskControl->storeOnDisk(directory, memoryDataVec, &status);
428 
429  statusLabel->setText(QString::fromStdString(status));
430  TIMING_END_STREAM(MemoryExport, ARMARX_VERBOSE)
431  }
432 
433  void
434  MemoryViewer::loadFromDisk(QString directory)
435  {
436 
437  std::string status;
438  std::map<std::filesystem::path, wm::Memory> data =
440 
441  for (auto& [path, memory] : data)
442  {
443  std::string name = memory.id().memoryName;
444 
445  if (memoryWriters.count(name) > 0)
446  {
447  // we need to merge the current memory with the one from the disk.
448  // Please note that this may ignores coresegments, if not already existent
449  auto commit = armem::toCommit(memory);
450  memoryWriters.at(name).commit(commit);
451  }
452  else
453  {
454  ARMARX_INFO << "No memory with name '" << name
455  << "' available for commit. Create new virtual memory.";
456 
457  // Please note: Here we assume that a memory server with the same name does not exist.
458  // I think this assumption is ok, since nobody should use filepaths as memory name.
459  // Nonetheless, we did not restrict the user to do so...
460  std::string virtualMemoryName = name;// + " (at " + path.string() + ")";
461  memory.id().memoryName = virtualMemoryName;
462  memoryData[virtualMemoryName] = std::move(memory);
463  }
464  }
465 
466  statusLabel->setText(QString::fromStdString(status));
467 
468  emit memoryDataChanged();
469  }
470 
471  void
472  MemoryViewer::startQueries()
473  {
474  startDueQueries();
475  }
476 
477  void
478  MemoryViewer::processQueryResults()
479  {
480  const std::map<std::string, client::QueryResult> results = collectQueryResults();
481 
482  int errorCount = 0;
483  applyQueryResults(results, &errorCount);
484 
485  emit memoryDataChanged();
486  updateStatusLabel(errorCount);
487  }
488 
489  void
490  MemoryViewer::updateStatusLabel(int errorCount)
491  {
492  // Code to output status label information
493  if (statusLabel and errorCount > 0)
494  {
495  auto now = std::chrono::system_clock::now();
496  auto in_time_t = std::chrono::system_clock::to_time_t(now);
497 
498  std::stringstream ss;
499  ss << "Last update: " << std::put_time(std::localtime(&in_time_t), "%Y-%m-%d %X");
500  ss << "\nThe query produced " << errorCount << " errors! Please check log.";
501 
502  statusLabel->setText(QString::fromStdString(ss.str()));
503  }
504  }
505 
506  void
507  MemoryViewer::startDueQueries()
508  {
509 
510  armem::client::QueryInput input = memoryGroup->queryInput();
511  int recursionDepth = memoryGroup->queryWidget()->queryLinkRecursionDepth();
512 
513  // Can't use a structured binding here because you can't capture those in a lambda
514  // according to the C++ standard.
515  auto enabledMemories = memoryGroup->queryWidget()->getEnabledMemories();
516  for (const auto& pair : memoryReaders)
517  {
518  // skip if memory should not be queried
519  if (std::find(enabledMemories.begin(), enabledMemories.end(), pair.first) ==
520  enabledMemories.end())
521  {
522  continue;
523  }
524 
525  const auto& name = pair.first;
526  const auto& reader = pair.second;
527 
528  // skip if query already running
529  if (runningQueries.count(name) != 0)
530  {
531  continue;
532  }
533 
534  // You could pass the query function itself to async here,
535  // but that caused severe template headaches when I tried it.
536  runningQueries[name] = std::async(
537  std::launch::async,
538  [reader, input, recursionDepth, this]()
539  {
540  // Can't resolve MemoryLinks without data
541  return recursionDepth == 0 || input.dataMode == armem::query::DataMode::NoData
542  ? reader.query(input.toIce())
543  : reader.query(input.toIce(), mns, recursionDepth);
544  });
545  }
546  }
547 
548  std::map<std::string, client::QueryResult>
549  MemoryViewer::collectQueryResults()
550  {
551 
552  TIMING_START(tCollectQueryResults)
553 
554  std::map<std::string, client::QueryResult> results;
555  for (auto it = runningQueries.begin(); it != runningQueries.end();)
556  {
557  const std::string& name = it->first;
558  std::future<armem::query::data::Result>* queryPromise = &it->second;
559 
560  if (queryPromise->wait_for(std::chrono::seconds(0)) == std::future_status::ready)
561  {
562  if (auto jt = memoryReaders.find(name); jt != memoryReaders.end())
563  {
564  try
565  {
566  results[name] = client::QueryResult::fromIce(queryPromise->get());
567  }
568  catch (const Ice::ConnectionRefusedException&)
569  {
570  // Server is gone (MNS did not know about it yet) => Skip result.
571  }
572  }
573  // else: Server is gone (MNS knew about it) => Skip result.
574 
575  // Promise is completed => Clean up in any case.
576  it = runningQueries.erase(it);
577  }
578  else
579  {
580  ++it; // Uncompleted => Keep.
581  }
582  }
583 
584  TIMING_END_STREAM(tCollectQueryResults, ARMARX_VERBOSE)
585  if (debugObserver)
586  {
587  debugObserver->begin_setDebugChannel(
589  {
590  {"t Collect Query Results [ms]",
591  new Variant(tCollectQueryResults.toMilliSecondsDouble())},
592  {"# Collected Query Results", new Variant(static_cast<int>(results.size()))},
593  });
594  }
595 
596  return results;
597  }
598 
599  void
600  MemoryViewer::applyQueryResults(const std::map<std::string, client::QueryResult>& results,
601  int* outErrorCount)
602  {
603  TIMING_START(tProcessQueryResults)
604  for (const auto& [name, result] : results)
605  {
606  if (result.success)
607  {
608  memoryData[name] = std::move(result.memory);
609  }
610  else
611  {
612  ARMARX_WARNING << "Querying memory server '" << name << "' produced an error: \n"
613  << result.errorMessage;
614  if (outErrorCount)
615  {
616  outErrorCount++;
617  }
618  }
619  }
620 
621  // Perhaps remove entries
622  auto enabledMemories = memoryGroup->queryWidget()->getEnabledMemories();
623  for (auto it = memoryData.begin(); it != memoryData.end();)
624  {
625  // Drop all entries in memoryData which are not in memoryReaders anymore.
626  if (memoryReaders.count(it->first) == 0)
627  {
629  {
630  it = memoryData.erase(it);
631  }
632  else
633  {
634  ++it;
635  }
636  continue;
637  }
638 
639  // Drop all entries that are not enabled by user (which means that there is no query result)
640  if (std::find(enabledMemories.begin(), enabledMemories.end(), it->first) ==
641  enabledMemories.end())
642  {
644  {
645  it = memoryData.erase(it);
646  }
647  else
648  {
649  ++it;
650  }
651  continue;
652  }
653 
654  // Memory found
655  ++it;
656  }
657 
658  TIMING_END_STREAM(tProcessQueryResults, ARMARX_VERBOSE)
659  if (debugObserver)
660  {
661  debugObserver->begin_setDebugChannel(
663  {
664  {"t Process Query Results [ms]",
665  new Variant(tProcessQueryResults.toMilliSecondsDouble())},
666  {"# Processed Query Results", new Variant(static_cast<int>(results.size()))},
667  });
668  }
669  }
670 
671  void
673  {
674  const armem::wm::Memory* data = getSingleMemoryData(selectedID.memoryName);
675  if (data)
676  {
677  if (not selectedID.hasEntityName())
678  {
679  return;
680  }
681  armem::MemoryID id = selectedID;
682  const armem::wm::EntitySnapshot* snapshot = nullptr;
683  if (not id.hasTimestamp())
684  {
685  const armem::wm::Entity& entity = data->getEntity(id);
686  if (entity.empty())
687  {
688  return;
689  }
690  snapshot = &entity.getLatestSnapshot();
691  id.timestamp = snapshot->time();
692  }
693  if (not id.hasInstanceIndex())
694  {
695  if (not snapshot)
696  {
697  try
698  {
699  snapshot = &data->getSnapshot(id);
700  }
701  catch (const armem::error::ArMemError& e)
702  {
703  if (statusLabel)
704  {
705  statusLabel->setText(e.what());
706  }
707  }
708  }
709  if (snapshot && snapshot->size() > 0)
710  {
711  id.instanceIndex = 0;
712  }
713  }
714  if (id.hasInstanceIndex())
715  {
716  instanceGroup->view->update(id, *data);
717  }
718  }
719  }
720 
721  void
723  {
724  // ARMARX_IMPORTANT << "Resolving memory ID: " << id;
725 
726  auto handleError = [this](const std::string& msg)
727  {
728  statusLabel->setText(QString::fromStdString(msg));
729  ARMARX_WARNING << msg;
730  };
731 
732  if (id.memoryName.empty())
733  {
734  handleError("Memory name is empty.");
735  }
736 
737  aron::type::ObjectPtr segmentType;
738  std::optional<wm::EntityInstance> instance;
739  try
740  {
741  if (const wm::Memory* data = getSingleMemoryData(id.memoryName))
742  {
743  segmentType = data->getProviderSegment(id).aronType();
744 
745  if (id.hasInstanceIndex())
746  {
747  instance = data->getInstance(id);
748  }
749  else if (id.hasTimestamp())
750  {
751  instance = data->getSnapshot(id).getInstance(0);
752  }
753  else
754  {
755  instance = data->getEntity(id).getLatestSnapshot().getInstance(0);
756  }
757  }
758  }
759  catch (const armem::error::ArMemError&)
760  {
761  // May be handled by remote lookup
762  }
763 
764  if (not instance)
765  {
766  try
767  {
768  // Resolve remotely (may still fail, returns an optional).
769  instance = mns.resolveEntityInstance(id);
770  }
771  catch (const armem::error::ArMemError& e)
772  {
773  ARMARX_WARNING << e.what();
774  statusLabel->setText(e.what());
775  }
776  }
777 
778  if (instance)
779  {
780  auto* view = new InstanceView();
782  view->update(*instance, segmentType);
783  //instanceGroup->view->addInstanceView(*instance, segmentType);
784  }
785  else
786  {
787  // ToDo: Propagate error back to highlight selected entry in red
788  }
789  }
790 
791  void
792  MemoryViewer::updateListOfActiveMemories()
793  {
794  if (is_connected and mns) // mns must be connected and mns must be available
795  {
796  try
797  {
800 
801  std::vector<std::string> activeMemoryNames;
802 
803  // add all active memories to update list
805  memoryReaders.end(),
806  std::back_inserter(activeMemoryNames),
807  [](const auto& p) { return p.first; });
808 
809  TIMING_START(GuiUpdateAvailableMemories);
810  memoryGroup->queryWidget()->update(activeMemoryNames);
811  TIMING_END_STREAM(GuiUpdateAvailableMemories, ARMARX_VERBOSE);
812  }
813  catch (...)
814  {
815  // MNS was killed/stopped
816  // ignore?!
817  }
818  }
819  else
820  {
822  << deactivateSpam()
823  << "MNS not ready yet. Skip update of available memories in query widget.";
824  }
825  }
826 
827  void
828  MemoryViewer::updateMemoryTree()
829  {
830  std::map<std::string, const armem::wm::Memory*> memoriesToUpdate;
831 
832  //auto checkboxStates = memoryGroup->queryWidget()->getAvailableMemoryStates();
833  for (auto& [name, data] : memoryData)
834  {
835  memoriesToUpdate[name] = &data;
836  }
837 
838  TIMING_START(GuiUpdateMemoryTree)
839  memoryGroup->tree()->update(memoriesToUpdate);
840  TIMING_END_STREAM(GuiUpdateMemoryTree, ARMARX_VERBOSE)
841 
842  if (debugObserver)
843  {
844  try
845  {
846  debugObserver->setDebugDatafield(
848  "GUI Update [ms]",
849  new Variant(GuiUpdateMemoryTree.toMilliSecondsDouble()));
850  }
851  catch (const Ice::Exception&)
852  {
853  // Ignore ...
854  }
855  }
856  }
857 
858  void
860  QWidget* parent,
861  const QPoint& pos,
862  QMenu* menu)
863  {
864  // Called if we have to stop because of an error.
865  auto showMenu = [menu, pos]()
866  {
867  if (menu)
868  menu->exec(pos);
869  };
870 
871  if (memoryID == MemoryID())
872  {
873  // Empty MemoryID, don't try to generate actions.
874  showMenu();
875  return;
876  }
877 
878  mns::dto::MemoryServerInterfaces prx;
879  try
880  {
881  prx = mns.resolveServer(memoryID);
882  }
883  catch (const error::CouldNotResolveMemoryServer& e)
884  {
885  statusLabel->setText(
886  QString::fromStdString(e.makeMsg(memoryID, "Could not resolve memory server.")));
887  showMenu();
888  return;
889  }
890 
891  if (!prx.actions)
892  {
893  std::stringstream ss;
894  ss << "Memory server " << memoryID << " does not support actions or is offline.";
895  statusLabel->setText(QString::fromStdString(ss.str()));
896  showMenu();
897  return;
898  }
899 
900  actions::GetActionsOutputSeq result;
901  try
902  {
903  result = prx.actions->getActions({{armarx::toIce<data::MemoryID>(memoryID)}});
904  }
905  catch (const Ice::LocalException& e)
906  {
907  std::stringstream ss;
908  ss << "Could not get actions for " << memoryID << ".";
909  statusLabel->setText(QString::fromStdString(ss.str()));
910  showMenu();
911  return;
912  }
913 
914  if (result.size() == 0)
915  {
916  showMenu();
917  return;
918  }
919  auto builder = ActionsMenuBuilder(
920  memoryID,
921  parent,
922  [this, prx](const MemoryID& memoryID, const actions::ActionPath& path)
923  {
924  actions::data::ExecuteActionOutputSeq result;
925  try
926  {
927  result = prx.actions->executeActions(
928  {{armarx::toIce<armem::data::MemoryID>(memoryID), path}});
929  }
930  catch (const Ice::LocalException& e)
931  {
932  std::stringstream ss;
933  ss << "Failed to execute action: " << e.what();
934  statusLabel->setText(QString::fromStdString(ss.str()));
935  }
936 
937  for (const auto& [success, errorMessage] : result)
938  {
939  if (not success)
940  {
941  std::stringstream ss;
942  ss << "Failed to execute action: " << errorMessage;
943  statusLabel->setText(QString::fromStdString(ss.str()));
944  ARMARX_WARNING << ss.str();
945  }
946  }
947  });
948 
949  QMenu* actionsMenu = builder.buildActionsMenu(result[0]);
950  if (menu == nullptr)
951  {
952  actionsMenu->exec(pos);
953  }
954  else
955  {
956  menu->addMenu(actionsMenu);
957  menu->exec(pos);
958  }
959  }
960 
961  void
963  const aron::type::ObjectPtr& entityType,
964  const armarx::DateTime& timestamp,
965  const std::string& engineID)
966  {
967 
968  std::stringstream errorStream;
969  auto showError = [this, &errorStream]()
970  { statusLabel->setText(QString::fromStdString(errorStream.str())); };
971 
972  if (!entityID.hasEntityName() || entityID.hasGap())
973  {
974  errorStream << "Could not convert " << entityID << " to valid entity ID.";
975  showError();
976  return;
977  }
978  if (memoryReaders.find(entityID.memoryName) == memoryReaders.end())
979  {
980  errorStream << "Not connected to memory '" << entityID.memoryName
981  << "', cannot make prediction.";
982  showError();
983  return;
984  }
985  client::Reader reader = memoryReaders.at(entityID.memoryName);
986  if (!reader.predictionPrx)
987  {
988  errorStream << "Predictions are not available for memory '" << entityID.memoryName
989  << "'.";
990  showError();
991  return;
992  }
993  PredictionRequest request;
994  request.snapshotID = entityID.withTimestamp(timestamp);
995  request.predictionSettings.predictionEngineID = engineID;
996  PredictionResult result;
997  try
998  {
999  result = reader.predict({request}).at(0);
1000  }
1001  catch (const Ice::LocalException& e)
1002  {
1003  errorStream << "Could not make prediction request: " << e.what();
1004  showError();
1005  return;
1006  }
1007 
1008  if (!result.success)
1009  {
1010  errorStream << "Prediction failed: " << result.errorMessage;
1011  showError();
1012  return;
1013  }
1014 
1015  auto* view = new AronDataView();
1016  instanceGroup->view->addDataView(view);
1017  view->update(result.prediction, entityType);
1018  }
1019 
1020  const static std::string CONFIG_KEY_MEMORY = "MemoryViewer.MemoryNameSystem";
1021  const static std::string CONFIG_KEY_DEBUG_OBSERVER = "MemoryViewer.DebugObserverName";
1022 
1023  void
1024  MemoryViewer::loadSettings(QSettings* settings)
1025  {
1026  mnsName = settings->value(QString::fromStdString(CONFIG_KEY_MEMORY), "MemoryNameSystem")
1027  .toString()
1028  .toStdString();
1030  settings->value(QString::fromStdString(CONFIG_KEY_DEBUG_OBSERVER), "DebugObserver")
1031  .toString()
1032  .toStdString();
1033  }
1034 
1035  void
1036  MemoryViewer::saveSettings(QSettings* settings)
1037  {
1038  settings->setValue(QString::fromStdString(CONFIG_KEY_MEMORY),
1039  QString::fromStdString(mnsName));
1040  settings->setValue(QString::fromStdString(CONFIG_KEY_DEBUG_OBSERVER),
1041  QString::fromStdString(debugObserverName));
1042  }
1043 
1044  void
1046  {
1047  dialog->addProxyFinder<armarx::armem::mns::MemoryNameSystemInterfacePrx>(
1048  {CONFIG_KEY_MEMORY, "MemoryNameSystem", "MemoryNameSystem"});
1050  {CONFIG_KEY_DEBUG_OBSERVER, "Debug Observer", "DebugObserver"});
1051  }
1052 
1053  void
1055  {
1056  mnsName = dialog->getProxyName(CONFIG_KEY_MEMORY);
1057  if (mnsName.empty())
1058  {
1059  mnsName = "MemoryNameSystem";
1060  }
1061  debugObserverName = dialog->getProxyName(CONFIG_KEY_DEBUG_OBSERVER);
1062  }
1063 
1064 } // namespace armarx::armem::gui
armarx::armem::detail::SuccessHeader::success
bool success
Definition: SuccessHeader.h:20
armarx::armem::client::MemoryNameSystem::resolveServer
mns::dto::MemoryServerInterfaces resolveServer(const MemoryID &memoryID)
Resolve the given memory server for the given memory ID.
Definition: MemoryNameSystem.cpp:97
armarx::armem::gui::disk::ControlWidget::storeOnDisk
void storeOnDisk(QString directory, const std::vector< wm::Memory > memoryData, std::string *outStatus=nullptr)
Definition: ControlWidget.cpp:78
armarx::armem::gui::disk::ControlWidget
Definition: ControlWidget.h:17
armarx::armem::base::detail::MemoryContainerBase::empty
bool empty() const
Definition: MemoryContainerBase.h:44
armarx::armem::client::Reader
Reads data from a memory server.
Definition: Reader.h:24
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:180
TIMING_START
#define TIMING_START(name)
Definition: TimeUtil.h:280
armarx::armem::gui::PeriodicUpdateWidget::collapseAll
void collapseAll()
armarx::armem::gui::MemoryViewer::updateWidget
armem::gui::PeriodicUpdateWidget * updateWidget
Definition: MemoryViewer.h:151
armarx::armem::PredictionRequest
Definition: Prediction.h:49
armarx::armem::gui::instance::InstanceView::update
void update(const MemoryID &id, const wm::Memory &memory)
Definition: InstanceView.cpp:62
armarx::armem::client::QueryResult::memory
wm::Memory memory
The slice of the memory that matched the query.
Definition: Query.h:58
armarx::armem::base::detail::GetFindProviderSegmentMixin::findProviderSegment
auto * findProviderSegment(const MemoryID &providerSegmentID)
Retrieve a provider segment.
Definition: lookup_mixins.h:474
armarx::armem::gui::PredictionWidget::EntityInfo::type
aron::type::ObjectPtr type
Definition: PredictionWidget.h:54
armarx::gui::LifecycleClient::onDisconnect
virtual void onDisconnect()
Definition: lifecycle.cpp:84
ActionsMenuBuilder.h
armarx::armem::Commit
A bundle of updates to be sent to the memory.
Definition: Commit.h:89
armarx::ProxyType::component
@ component
armarx::armem::gui::MemoryViewer::updateInstanceTree
void updateInstanceTree(const armem::MemoryID &selectedID)
Definition: MemoryViewer.cpp:672
armarx::armem::gui::instance::DataView::memoryIdResolutionRequested
void memoryIdResolutionRequested(const MemoryID &id)
armarx::armem::gui::MemoryViewer::is_connected
std::atomic_bool is_connected
Definition: MemoryViewer.h:171
armarx::armem::gui::MemoryViewer::debugObserver
DebugObserverInterfacePrx debugObserver
Definition: MemoryViewer.h:164
armarx::armem::accumulateEntriesContainingID
std::vector< ValueT > accumulateEntriesContainingID(const std::map< MemoryID, ValueT > &idMap, const MemoryID &id)
Return all values of keys containing the given ID.
Definition: container_maps.h:265
armarx::armem::base::detail::GetLatestSnapshotMixin::getLatestSnapshot
auto & getLatestSnapshot(int snapshotIndex=0)
Retrieve the latest entity snapshot.
Definition: lookup_mixins.h:199
armarx::armem::gui::MemoryViewer::startLTMRecording
void startLTMRecording()
Definition: MemoryViewer.cpp:330
armarx::core::time::DateTime::Now
static DateTime Now()
Definition: DateTime.cpp:55
armarx::armem::gui::QueryWidget::storeInLTM
void storeInLTM()
armarx::armem::gui::MemoryViewer::readConfigDialog
void readConfigDialog(SimpleConfigDialog *dialog)
Definition: MemoryViewer.cpp:1054
armarx::armem::gui::MemoryViewer::connected
void connected()
armarx::armem::gui::InstanceGroupBox
instance::GroupBox InstanceGroupBox
Definition: GroupBox.h:50
armarx::armem::gui::MemoryViewer::diskControlLayout
QLayout * diskControlLayout
Definition: MemoryViewer.h:153
armarx::armem::PredictionRequest::predictionSettings
PredictionSettings predictionSettings
Definition: Prediction.h:52
armarx::armem::gui::memory::GroupBox::queryInput
armem::client::QueryInput queryInput() const
Definition: GroupBox.cpp:102
armarx::aron::data::converter::AronNlohmannJSONConverter::ConvertFromNlohmannJSONObject
static data::DictPtr ConvertFromNlohmannJSONObject(const nlohmann::json &, const armarx::aron::Path &p={})
Definition: NLohmannJSONConverter.cpp:25
armarx::armem::gui::QueryWidget::stopRecording
void stopRecording()
armarx::armem::client::Reader::predictionPrx
server::PredictingMemoryInterfacePrx predictionPrx
Definition: Reader.h:210
armarx::armem::gui::MemoryViewer::commit
void commit()
Definition: MemoryViewer.cpp:372
armarx::armem::gui::PeriodicUpdateWidget
Definition: PeriodicUpdateWidget.h:14
armarx::armem::error::ArMemError
Base class for all exceptions thrown by the armem library.
Definition: ArMemError.h:18
armarx::armem::gui::disk::ControlWidget::requestedStoreOnDisk
void requestedStoreOnDisk(QString directory)
armarx::armem::client::MemoryNameSystem::resolveEntityInstance
std::optional< wm::EntityInstance > resolveEntityInstance(const MemoryID &id)
Resolve a memory ID to an EntityInstance.
Definition: MemoryNameSystem.cpp:316
armarx::armem::gui::ActionsMenuBuilder
Definition: ActionsMenuBuilder.h:11
ltm.h
armarx::armem::gui::MemoryViewer::resolveMemoryID
void resolveMemoryID(const MemoryID &id)
Definition: MemoryViewer.cpp:722
armarx::armem::client::QueryResult
Result of a QueryInput.
Definition: Query.h:50
armarx::armem::gui::MemoryViewer::runningQueries
std::map< std::string, std::future< armem::query::data::Result > > runningQueries
Definition: MemoryViewer.h:144
armarx::armem::gui::PeriodicUpdateWidget::update
void update()
armarx::armem::PredictionResult
Definition: Prediction.h:58
armarx::armem::gui::ActionsMenuBuilder::buildActionsMenu
QMenu * buildActionsMenu(actions::data::GetActionsOutput &actionsOutput)
Definition: ActionsMenuBuilder.cpp:17
SimpleConfigDialog.h
armarx::armem::gui::MemoryViewer::instanceTreeUpdated
void instanceTreeUpdated()
armarx::armem::gui::instance::DataView::actionsMenuRequested
void actionsMenuRequested(const MemoryID &memoryID, QWidget *parent, const QPoint &pos, QMenu *menu)
armarx::gui::replaceWidget
void replaceWidget(WidgetT *&old, QWidget *neu, QLayout *parentLayout)
Definition: gui_utils.h:36
MemoryViewer.h
armarx::memory
Brief description of class memory.
Definition: memory.h:39
armarx::armem::gui::MemoryViewer::writeConfigDialog
void writeConfigDialog(SimpleConfigDialog *dialog)
Definition: MemoryViewer.cpp:1045
armarx::gui::LifecycleClient::onInit
virtual void onInit()
Definition: lifecycle.cpp:76
armarx::armem::gui::MemoryViewer::storeOnDisk
void storeOnDisk(QString directory)
Definition: MemoryViewer.cpp:421
TIMING_END_STREAM
#define TIMING_END_STREAM(name, os)
Definition: TimeUtil.h:300
NLohmannJSONConverter.h
armarx::armem::gui::instance::GroupBox::setStatusLabel
void setStatusLabel(QLabel *statusLabel)
Definition: GroupBox.cpp:37
armarx::armem::gui::MemoryViewer::mnsName
std::string mnsName
Definition: MemoryViewer.h:136
armarx::armem::gui::InstanceView
instance::InstanceView InstanceView
Definition: InstanceView.h:60
armarx::armem::client::Reader::queryMemoryIDs
QueryResult queryMemoryIDs(const std::vector< MemoryID > &ids, armem::query::DataMode dataMode=armem::query::DataMode::WithData) const
Query a specific set of memory IDs.
Definition: Reader.cpp:290
armarx::armem::client::Reader::predict
std::vector< PredictionResult > predict(const std::vector< PredictionRequest > &requests) const
Get a prediction for the state of multiple entity instances in the future.
Definition: Reader.cpp:482
armarx::status
status
Definition: FiniteStateMachine.h:259
armarx::armem::server::wm::Memory
Definition: memory_definitions.h:136
armarx::armem::gui::memory::TreeWidget::updated
void updated()
Tree contents have changed.
armarx::armem::error::CouldNotResolveMemoryServer::makeMsg
static std::string makeMsg(const MemoryID &memoryID, const std::string &errorMessage="")
Definition: mns.cpp:34
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
armarx::armem::gui::memory::GroupBox::queryWidget
QueryWidget * queryWidget() const
Definition: GroupBox.cpp:72
ManagedIceObject.h
armarx::armem::PredictionResult::prediction
aron::data::DictPtr prediction
Definition: Prediction.h:64
armarx::armem::client::MemoryNameSystem::getAllReaders
std::map< std::string, Reader > getAllReaders(bool update=true)
Get Readers for all registered servers.
Definition: MemoryNameSystem.cpp:253
armarx::armem::gui::instance::DataView::addDataView
void addDataView(DataView *dataView)
Definition: DataView.cpp:79
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::armem::gui::memory::GroupBox::predictionWidget
PredictionWidget * predictionWidget() const
Definition: GroupBox.cpp:87
armarx::aron::input
ReaderT::InputType & input
Definition: rw.h:19
TreeTypedJSONConverter.h
armarx::armem::gui::MemoryGroupBox
memory::GroupBox MemoryGroupBox
Definition: GroupBox.h:62
armarx::armem::wm::Memory
Client-side working memory.
Definition: memory_definitions.h:133
wm.h
armarx::armem::gui::MemoryViewer::setLogTag
void setLogTag(const std::string &tag)
Definition: MemoryViewer.cpp:204
armarx::armem::client::Reader::getAvailablePredictionEngines
std::map< MemoryID, std::vector< PredictionEngine > > getAvailablePredictionEngines() const
Get the list of prediction engines supported by the memory.
Definition: Reader.cpp:526
armarx::armem::gui::MemoryViewer::statusLabel
QLabel * statusLabel
Definition: MemoryViewer.h:160
AronDataView.h
armarx::armem::gui::MemoryViewer::instanceGroup
armem::gui::InstanceGroupBox * instanceGroup
Definition: MemoryViewer.h:158
armarx::armem::gui::MemoryViewer::mns
armem::client::MemoryNameSystem mns
Definition: MemoryViewer.h:137
armarx::armem::gui::MemoryViewer::saveSettings
void saveSettings(QSettings *settings)
Definition: MemoryViewer.cpp:1036
armarx::armem::gui::AronDataView
instance::AronDataView AronDataView
Definition: AronDataView.h:40
armarx::armem::gui::PredictionWidget::EntityInfo
Definition: PredictionWidget.h:52
armarx::control::hardware_config::tagName
std::string tagName(ConfigTag tag)
Definition: Config.cpp:302
armarx::armem::wm::EntitySnapshot
Client-side working memory entity snapshot.
Definition: memory_definitions.h:80
armarx::armem::MemoryID::hasGap
bool hasGap() const
Indicate whether this ID has a gap such as in 'Memory//MyProvider' (no core segment name).
Definition: MemoryID.cpp:158
armarx::armem::gui::memory::TreeWidget::actionsMenuRequested
void actionsMenuRequested(const MemoryID &memoryID, QWidget *parent, const QPoint &pos, QMenu *menu)
armarx::armem::gui::QueryWidget::update
void update(const std::vector< std::string > &memoryNames)
Definition: QueryWidget.cpp:150
armarx::armem::gui::MemoryViewer::memoryData
std::map< std::string, armem::wm::Memory > memoryData
Definition: MemoryViewer.h:142
armarx::armem::gui::MemoryViewer::makePrediction
void makePrediction(const MemoryID &entityID, const aron::type::ObjectPtr &entityType, const armarx::DateTime &timestamp, const std::string &engineID)
Definition: MemoryViewer.cpp:962
armarx::armem::gui::PredictionWidget::makePrediction
void makePrediction(const MemoryID &entityID, const aron::type::ObjectPtr &entityType, const armarx::DateTime &timestamp, const std::string &engineID)
armarx::armem::server::ltm::util::mongodb::detail::update
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
Definition: mongodb.cpp:67
armarx::armem::gui::MemoryViewer::showActionsMenu
void showActionsMenu(const MemoryID &memoryID, QWidget *parent, const QPoint &pos, QMenu *menu)
Definition: MemoryViewer.cpp:859
armarx::SimpleConfigDialog::addProxyFinder
void addProxyFinder(const std::vector< EntryData > &entryData)
Definition: SimpleConfigDialog.h:104
armarx::armem::MemoryID::hasEntityName
bool hasEntityName() const
Definition: MemoryID.h:121
armarx::armem::MemoryID::memoryName
std::string memoryName
Definition: MemoryID.h:50
armarx::armem::gui::CommitWidget::getAronJSON
std::string getAronJSON() const
Definition: CommitWidget.cpp:56
armarx::armem::gui::CommitWidget::commit
void commit()
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::armem::gui::MemoryViewer::debugObserverName
std::string debugObserverName
Definition: MemoryViewer.h:163
armarx::armem::gui::MemoryViewer::disconnected
void disconnected()
armarx::armem::gui::QueryWidget::startRecording
void startRecording()
armarx::gui::LifecycleClient::onConnect
virtual void onConnect()
Definition: lifecycle.cpp:80
armarx::ManagedIceObject
The ManagedIceObject is the base class for all ArmarX objects.
Definition: ManagedIceObject.h:163
armarx::armem::gui::disk::ControlWidget::loadFromDisk
std::map< std::filesystem::path, wm::Memory > loadFromDisk(QString directory, const armem::client::QueryInput &queryInput, std::string *outStatus=nullptr)
Definition: ControlWidget.cpp:121
armarx::armem::base::EntitySnapshotBase::time
Time & time()
Definition: EntitySnapshotBase.h:59
armarx::armem::Commit::add
EntityUpdate & add()
Definition: Commit.cpp:81
armarx::armem::gui::MemoryViewer::memoryGroup
armem::gui::MemoryGroupBox * memoryGroup
Definition: MemoryViewer.h:156
armarx::armem::gui::MemoryViewer::loadFromDisk
void loadFromDisk(QString directory)
Definition: MemoryViewer.cpp:434
armarx::armem::gui::QueryWidget::dropRemovedMemories
bool dropRemovedMemories() const
Definition: QueryWidget.cpp:208
armarx::armem::PredictionResult::errorMessage
std::string errorMessage
Definition: Prediction.h:61
armarx::armem::gui::MemoryViewer::periodicUpdateTimer
QTimer * periodicUpdateTimer
Periodically triggers query result collection and updates the available memories.
Definition: MemoryViewer.h:147
TimeUtil.h
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::armem::gui::disk::ControlWidget::requestedLoadFromDisk
void requestedLoadFromDisk(QString directory)
armarx::armem::gui::MemoryViewer::queryAndStoreInLTM
void queryAndStoreInLTM()
Definition: MemoryViewer.cpp:297
armarx::armem::gui::QueryWidget::getEnabledMemories
std::vector< std::string > getEnabledMemories() const
Definition: QueryWidget.cpp:248
armarx::armem::gui::instance::GroupBox::viewUpdated
void viewUpdated()
armarx::armem::laser_scans::constants::memoryName
const std::string memoryName
Definition: constants.h:28
armarx::armem::gui::MemoryViewer::MemoryViewer
MemoryViewer(QBoxLayout *updateWidgetLayout, QGroupBox *memoryGroupBox, QLayout *memoryGroupBoxParentLayout, QGroupBox *instanceGroupBox, QLayout *instanceGroupBoxParentLayout, QBoxLayout *diskControlWidgetLayout, QLabel *statusLabel)
Definition: MemoryViewer.cpp:41
armarx::armem::gui
Definition: ActionsMenuBuilder.cpp:6
armarx::transform
auto transform(const Container< InputT, Alloc > &in, OutputT(*func)(InputT const &)) -> Container< OutputT, typename std::allocator_traits< Alloc >::template rebind_alloc< OutputT > >
Convenience function (with less typing) to transform a container of type InputT into the same contain...
Definition: algorithm.h:315
armarx::armem::index::memoryID
const MemoryID memoryID
Definition: memory_ids.cpp:29
IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface >
armarx::armem::query::DataMode::NoData
@ NoData
Just get the structure, but no ARON data.
armarx::Logging::tag
LogTag tag
Definition: Logging.h:271
armarx::armem::gui::MemoryViewer::diskControl
armem::gui::disk::ControlWidget * diskControl
Definition: MemoryViewer.h:154
armarx::armem::gui::instance::GroupBox::view
InstanceView * view
Definition: GroupBox.h:41
ARMARX_CHECK_NULL
#define ARMARX_CHECK_NULL(ptr)
Definition: ExpressionException.h:212
armarx::armem::MemoryID::withTimestamp
MemoryID withTimestamp(Time time) const
Definition: MemoryID.cpp:428
armarx::armem::gui::MemoryViewer::memoryReaders
std::map< std::string, armem::client::Reader > memoryReaders
Definition: MemoryViewer.h:139
armarx::armem::error::CouldNotResolveMemoryServer
Indicates that a query to the Memory Name System failed.
Definition: mns.h:26
armarx::Logging::deactivateSpam
SpamFilterDataPtr deactivateSpam(float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
disables the logging for the current line for the given amount of seconds.
Definition: Logging.cpp:92
armarx::armem::gui::memory::TreeWidget::selectedItemChanged
void selectedItemChanged(const MemoryID &id)
The selected item or its contents have changed.
ice_conversions_templates.h
armarx::armem::wm::Entity
Client-side working memory entity.
Definition: memory_definitions.h:93
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
armarx::Logging::setTag
void setTag(const LogTag &tag)
Definition: Logging.cpp:55
armarx::armem::gui::MemoryViewer::loadSettings
void loadSettings(QSettings *settings)
Definition: MemoryViewer.cpp:1024
armarx::armem::PredictionResult::success
bool success
Definition: Prediction.h:60
armarx::armem::gui::MemoryViewer::memoryWriters
std::map< std::string, armem::client::Writer > memoryWriters
Definition: MemoryViewer.h:140
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::armem::gui::MemoryViewer::initialized
void initialized()
armarx::armem::gui::MemoryViewer::is_initialized
std::atomic_bool is_initialized
Definition: MemoryViewer.h:170
armarx::armem::gui::QueryWidget::queryLinkRecursionDepth
int queryLinkRecursionDepth() const
Definition: QueryWidget.cpp:269
armarx::armem::gui::PeriodicUpdateWidget::stopTimer
void stopTimer()
Definition: PeriodicUpdateWidget.cpp:106
armarx::armem::client::QueryResult::fromIce
static QueryResult fromIce(const armem::query::data::Result &ice)
Definition: Query.cpp:25
armarx::armem::gui::MemoryViewer::memoryTreeUpdated
void memoryTreeUpdated()
armarx::armem::gui::QueryWidget::dropDisabledMemories
bool dropDisabledMemories() const
Definition: QueryWidget.cpp:214
armarx::armem::gui::CommitWidget::getMemoryID
std::string getMemoryID() const
Definition: CommitWidget.cpp:61
armarx::armem::EntityUpdate::entityID
MemoryID entityID
The entity's ID.
Definition: Commit.h:30
armarx::armem::gui::MemoryViewer::memoryDataChanged
void memoryDataChanged()
Variant.h
armarx::armem::gui::MemoryViewer::updateWidgetLayout
QLayout * updateWidgetLayout
Definition: MemoryViewer.h:150
armarx::armem::gui::MemoryViewer::stopLTMRecording
void stopLTMRecording()
Definition: MemoryViewer.cpp:351
armarx::armem::toCommit
Commit toCommit(const ContainerT &container)
Definition: operations.h:27
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
armarx::SimpleConfigDialog::getProxyName
std::string getProxyName(const std::string &entryName) const
Definition: SimpleConfigDialog.cpp:49
armarx::armem::PredictionRequest::snapshotID
armem::MemoryID snapshotID
Definition: Prediction.h:51
armarx::armem::gui::memory::GroupBox::tree
TreeWidget * tree() const
Definition: GroupBox.cpp:97
gui_utils.h
armarx::armem::gui::memory::TreeWidget::update
void update(const armem::wm::Memory &memory)
Definition: TreeWidget.cpp:153
armarx::armem::client::MemoryNameSystem::getAllWriters
std::map< std::string, Writer > getAllWriters(bool update=true)
Get Writers for all registered servers.
Definition: MemoryNameSystem.cpp:300
armarx::status::success
@ success
container_maps.h
ice_conversions.h
armarx::armem::PredictionSettings::predictionEngineID
std::string predictionEngineID
Definition: Prediction.h:43
armarx::armem::gui::PeriodicUpdateWidget::startTimerIfEnabled
void startTimerIfEnabled()
Definition: PeriodicUpdateWidget.cpp:88
armarx::armem::gui::memory::GroupBox::commitWidget
CommitWidget * commitWidget() const
Definition: GroupBox.cpp:92
armarx::SimpleConfigDialog
A config-dialog containing one (or multiple) proxy finders.
Definition: SimpleConfigDialog.h:84
armarx::human::MemoryID
const armem::MemoryID MemoryID
Definition: memory_ids.cpp:29