Skip to content
Snippets Groups Projects
Commit c89b3d54 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Implement remote lookup of requested MemoryIDs

parent 969459c2
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ namespace armarx::armem::gui
this->statusLabel->clear();
statusLabel->setContextMenuPolicy(Qt::CustomContextMenu);
connect(statusLabel, &QLabel::customContextMenuRequested, [statusLabel](const QPoint& pos)
connect(statusLabel, &QLabel::customContextMenuRequested, [statusLabel](const QPoint & pos)
{
QMenu menu(statusLabel);
menu.addAction("Clear status", [statusLabel]()
......@@ -314,7 +314,7 @@ namespace armarx::armem::gui
ARMARX_IMPORTANT << "Resolving memory ID: " << id;
aron::typenavigator::ObjectNavigatorPtr segmentType;
wm::EntityInstance instance;
std::optional<wm::EntityInstance> instance;
try
{
const wm::Memory* data = getSingleMemoryData(id.memoryName);
......@@ -328,27 +328,36 @@ namespace armarx::armem::gui
}
else if (id.hasTimestamp())
{
const wm::EntitySnapshot& snapshot = data->getEntitySnapshot(id);
instance = snapshot.getInstance(0);
instance = data->getEntitySnapshot(id).getInstance(0);
}
else if (id.hasEntityName())
else
{
const wm::Entity& entity = data->getEntity(id);
instance = entity.getLatestSnapshot().getInstance(0);
instance = data->getEntity(id).getLatestSnapshot().getInstance(0);
}
}
else
{
return;
}
}
catch (const armem::error::ArMemError& e)
{
ARMARX_WARNING << e.what();
statusLabel->setText(e.what());
// May be handled by remote lookup
(void) e;
// ARMARX_WARNING << e.what();
// statusLabel->setText(e.what());
}
instanceGroup->view->addInstanceView(instance, segmentType);
if (!instance)
{
// Resolve remotely (may still fail, returns an optional).
instance = mns.resolveEntityInstance(id);
}
if (instance)
{
instanceGroup->view->addInstanceView(*instance, segmentType);
}
else
{
// ToDo: Propagate error back to highlight selected entry in red
}
}
void MemoryViewer::updateMemoryTree()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment