diff --git a/source/RobotAPI/gui-plugins/ArMemMemoryViewer/ArMemMemoryViewerWidgetController.cpp b/source/RobotAPI/gui-plugins/ArMemMemoryViewer/ArMemMemoryViewerWidgetController.cpp index c9f8912b988594519a3eee648f4af65d8866ecd1..068cbacfef2563bc4bb34c6988da0ca8049ad706 100644 --- a/source/RobotAPI/gui-plugins/ArMemMemoryViewer/ArMemMemoryViewerWidgetController.cpp +++ b/source/RobotAPI/gui-plugins/ArMemMemoryViewer/ArMemMemoryViewerWidgetController.cpp @@ -131,7 +131,10 @@ namespace armarx } armem::Time start = armem::Time::now(); - armem::MemoryPtr queryResult = memoryReader.getAllData(); + armem::MemoryPtr queryResult = + //memoryReader.getAllData() + memoryReader.getLatestSnapshots() + ; ARMARX_VERBOSE << "Memory query took " << (armem::Time::now() - start).toMilliSecondsDouble() << " ms."; if (debugObserver) diff --git a/source/RobotAPI/libraries/armem/client/MemoryReader.cpp b/source/RobotAPI/libraries/armem/client/MemoryReader.cpp index 42b5dbe880a00edd52f8a748b72d8690dbd9b66f..ab1c6c5f5865a10d86e172298ca77c9c80107ab6 100644 --- a/source/RobotAPI/libraries/armem/client/MemoryReader.cpp +++ b/source/RobotAPI/libraries/armem/client/MemoryReader.cpp @@ -22,6 +22,16 @@ namespace armarx::armem return queryToCpp(memoryQuery); } + MemoryPtr MemoryReader::getLatestSnapshots() + { + armem::query::EntityQueryPtr entityQuery = new armem::query::entity::Single(); + armem::query::ProviderSegmentQueryPtr providerQuery = new armem::query::provider::All({entityQuery}); + armem::query::CoreSegmentQueryPtr coreQuery = new armem::query::core::All({providerQuery}); + armem::query::MemoryQueryPtr memoryQuery = new armem::query::memory::All({coreQuery}); + + return queryToCpp(memoryQuery); + } + MemoryPtr MemoryReader::getAllData() { armem::query::EntityQueryPtr entityQuery = new armem::query::entity::All(); @@ -51,6 +61,10 @@ namespace armarx::armem { ARMARX_ERROR << "Memory query failed.\nReason: " << e.what(); } + catch (const Ice::NotRegisteredException& e) + { + ARMARX_ERROR << "Memory query failed.\nReason: " << e.what(); + } return nullptr; } diff --git a/source/RobotAPI/libraries/armem/client/MemoryReader.h b/source/RobotAPI/libraries/armem/client/MemoryReader.h index 708935ee312d934f393907c5098818b6735f4aed..d489e43c0c8a5f80628dda4158b1535952f88a98 100644 --- a/source/RobotAPI/libraries/armem/client/MemoryReader.h +++ b/source/RobotAPI/libraries/armem/client/MemoryReader.h @@ -24,6 +24,7 @@ namespace armarx::armem MemoryPtr getEntityHistories(); + MemoryPtr getLatestSnapshots(); MemoryPtr getAllData(); data::MemoryPtr query(query::MemoryQueryPtr query);