Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
RobotAPI
Commits
c9d9a33f
Commit
c9d9a33f
authored
1 year ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Update GetValueFromMapVisitor
parent
7e250b03
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!396
Add a named group box for lists if element type not in implementedListDescriptors
Pipeline
#15838
passed
1 year ago
Stage: build-and-test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/RobotAPI/libraries/aron_component_config/RemoteGuiVisitors.cpp
+35
-16
35 additions, 16 deletions
...API/libraries/aron_component_config/RemoteGuiVisitors.cpp
with
35 additions
and
16 deletions
source/RobotAPI/libraries/aron_component_config/RemoteGuiVisitors.cpp
+
35
−
16
View file @
c9d9a33f
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment