Skip to content
Snippets Groups Projects
Commit b6d452c6 authored by Fabian Tërnava's avatar Fabian Tërnava
Browse files

allow loading of memories to the viewer, that are not active. The memory...

allow loading of memories to the viewer, that are not active. The memory viewer indicates that those memories have been loaded from the filesystem and are not available in the MNS by adding their path to the memory name.
parent 96ca16d5
No related branches found
No related tags found
1 merge request!326Allow loading of LTM exports to the Viewer, although the memory servers have not been started
......@@ -428,15 +428,23 @@ namespace armarx::armem::gui
for (auto& [path, memory] : data)
{
std::string name = memory.id().memoryName;
auto commit = armem::toCommit(memory);
if (memoryWriters.count(name) > 0)
{
auto commit = armem::toCommit(memory);
memoryWriters.at(name).commit(commit);
}
else
{
ARMARX_WARNING << "No memory with name " << name << " available for commit.";
ARMARX_INFO << "No memory with name " << name << " available for commit. Create new virtual memory.";
// Please note: Here we assume that a memory server with the same name does not exist.
// I think this assumption is ok, since nobody should use filepaths as memory name.
// Nontheless, we did not restrict the user to do so...
std::string virtualMemoryName = name + " (at " + path.string() + ")";
wm::Memory virtualMemory(virtualMemoryName);
virtualMemory.update(commit, true, false);
memoryData[virtualMemoryName] = virtualMemory;
}
}
......
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