Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LimaGroup
Lima-camera-eiger
Commits
f7f34204
Commit
f7f34204
authored
Dec 09, 2019
by
Alejandro Homs Puron
Committed by
operator for beamline
Dec 10, 2019
Browse files
Support JSON lists of strings
parent
55d1a182
Pipeline
#18279
failed with stages
in 2 minutes and 45 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
sdk/linux/EigerAPI/src/Requests.cpp
View file @
f7f34204
...
...
@@ -495,18 +495,24 @@ Requests::Param::Value Requests::Param::_get(double timeout,bool lock,
if
(
!
reader
.
parse
(
m_data_buffer
,
root
))
THROW_EIGER_EXCEPTION
(
eigerapi
::
JSON_PARSE_FAILED
,
""
);
Value
value
;
if
(
root
.
isArray
())
std
::
string
json_type
;
bool
is_list
=
root
.
isArray
();
if
(
!
is_list
)
{
json_type
=
root
.
get
(
"value_type"
,
"dummy"
).
asString
();
is_list
=
(
json_type
==
"list"
);
}
if
(
is_list
)
{
value
.
type
=
Requests
::
Param
::
STRING_ARRAY
;
int
array_size
=
root
.
size
();
Json
::
Value
&
array
=
root
.
isArray
()
?
root
:
root
[
"value"
];
int
array_size
=
array
.
size
();
for
(
int
i
=
0
;
i
<
array_size
;
++
i
)
value
.
string_array
.
push_back
(
root
[
i
].
asString
());
value
.
string_array
.
push_back
(
array
[
i
].
asString
());
}
else
{
//- supported types by dectris are:
//- bool, float, int, string or a list of float or int
std
::
string
json_type
=
root
.
get
(
"value_type"
,
"dummy"
).
asString
();
if
(
json_type
==
"bool"
)
{
value
.
type
=
Requests
::
Param
::
BOOL
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment