diff --git a/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp b/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp index b295a9bb94d10437eda7a26b4b7faa3bd66364dc..78097af1a7a40ca0e8c46f1e75d8ce72783e06ab 100644 --- a/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp +++ b/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp @@ -49,8 +49,8 @@ namespace armarx::armem::gui ARMARX_CHECK_NULL(_instanceGroupBox); - connect(this, &This::connected, this, &This::updateMemory); - connect(updateWidget, &armem::gui::PeriodicUpdateWidget::update, this, &This::updateMemory); + connect(this, &This::connected, this, &This::updateMemories); + connect(updateWidget, &armem::gui::PeriodicUpdateWidget::update, this, &This::updateMemories); connect(this, &This::memoryDataChanged, this, &This::updateMemoryTree); connect(memoryGroup->tree(), &armem::gui::MemoryTreeWidget::selectedItemChanged, this, &This::updateInstanceTree); @@ -108,7 +108,7 @@ namespace armarx::armem::gui } - void MemoryViewer::updateMemory() // Todo: plural + void MemoryViewer::updateMemories() { memoryReaders.clear(); memoryData.clear(); @@ -119,6 +119,8 @@ namespace armarx::armem::gui memoryReaders[name] = memoryReader; } + bool dataChanged = false; + for (auto& [name, reader] : memoryReaders) { TIMING_START(MemoryQuery); @@ -146,7 +148,7 @@ namespace armarx::armem::gui if (memoryData[name]) { - emit memoryDataChanged(name); + dataChanged = true; } else { @@ -156,6 +158,11 @@ namespace armarx::armem::gui } } } + + if (dataChanged) + { + emit memoryDataChanged(); + } } @@ -218,7 +225,7 @@ namespace armarx::armem::gui } } - void MemoryViewer::updateMemoryTree(const std::string& name) + void MemoryViewer::updateMemoryTree() { std::map<std::string, const armem::Memory*> convMap; for (auto& [name, data] : memoryData) @@ -271,8 +278,3 @@ namespace armarx::armem::gui } } - - - - - diff --git a/source/RobotAPI/libraries/armem_gui/MemoryViewer.h b/source/RobotAPI/libraries/armem_gui/MemoryViewer.h index 81abdf33376aca69166488487c21624a58d86d3d..5c8f4b2f182f798a3c076a89e6a30ff24d10050c 100644 --- a/source/RobotAPI/libraries/armem_gui/MemoryViewer.h +++ b/source/RobotAPI/libraries/armem_gui/MemoryViewer.h @@ -62,7 +62,7 @@ namespace armarx::armem::gui public slots: - void updateMemory(); + void updateMemories(); void updateInstanceTree(const armem::MemoryID& selectedID); @@ -78,11 +78,11 @@ namespace armarx::armem::gui private slots: - void updateMemoryTree(const std::string&); + void updateMemoryTree(); signals: - void memoryDataChanged(const std::string&); + void memoryDataChanged(); private: @@ -120,5 +120,3 @@ namespace armarx::armem::gui }; } - -