Skip to content
Snippets Groups Projects
Commit bcef6b8f authored by Christian Dreher's avatar Christian Dreher
Browse files

fix: Proper signal handling, refactor method name.

parent c36e32f0
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
}
......@@ -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
};
}
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