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

Update GetValueFromMapVisitor

parent 7e250b03
No related branches found
No related tags found
1 merge request!396Add a named group box for lists if element type not in implementedListDescriptors
Pipeline #15838 passed
......@@ -511,36 +511,55 @@ namespace armarx::aron::component_config
GetValueFromMapVisitor::visitListOnEnter(DataInput& o, TypeInput& t)
{
in_list_ = true;
auto data = data::List::DynamicCastAndCheck(o);
auto type = type::List::DynamicCast(t)->getAcceptedType()->getDescriptor();
if (std::find(implementedListDescriptors.begin(), implementedListDescriptors.end(), type) ==
if (std::find(implementedListDescriptors.begin(), implementedListDescriptors.end(), type) !=
implementedListDescriptors.end())
{
return;
}
const auto& elements = data->getElements();
for (const auto& [idx, el] : armarx::MakeIndexedContainer(elements))
{
if (proxy_->getButtonClicked(pathToName(el) + "_button"))
auto data = data::List::DynamicCastAndCheck(o);
const auto& elements = data->getElements();
for (const auto& [idx, el] : armarx::MakeIndexedContainer(elements))
{
data->removeElement(idx);
if (proxy_->getButtonClicked(pathToName(el) + "_button"))
{
data->removeElement(idx);
tab_rebuild_required_ = true;
}
auto gui_value = proxy_->getValue<std::string>(pathToName(el)).get();
factories::VariantHelper::make(type)->set_value_from_string(el, gui_value);
}
if (proxy_->getButtonClicked(pathToName(o) + "_add"))
{
data->addElement(factories::VariantHelper::make(type)->from_string(
"", o->getPath().withIndex(data->childrenSize())));
tab_rebuild_required_ = true;
}
auto gui_value = proxy_->getValue<std::string>(pathToName(el)).get();
factories::VariantHelper::make(type)->set_value_from_string(el, gui_value);
}
if (proxy_->getButtonClicked(pathToName(o) + "_add"))
else
{
data->addElement(factories::VariantHelper::make(type)->from_string(
"", o->getPath().withIndex(data->childrenSize())));
tab_rebuild_required_ = true;
// TODO? Adapt to additional GroupBoxBuilder added by
// MakeConfigGuiVisitor::visitListOnEnter in this case?
}
}
void
GetValueFromMapVisitor::visitListOnExit(DataInput&, TypeInput&)
GetValueFromMapVisitor::visitListOnExit(DataInput&, TypeInput& t)
{
in_list_ = false;
auto type = type::List::DynamicCast(t)->getAcceptedType()->getDescriptor();
if (std::find(implementedListDescriptors.begin(), implementedListDescriptors.end(), type) !=
implementedListDescriptors.end())
{
}
else
{
// TODO? Adapt to additional GroupBoxBuilder added by
// MakeConfigGuiVisitor::visitListOnEnter in this case?
}
}
bool
......
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