Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ControlSystemAdapter-DoocsAdapter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ChimeraTK Mirror
ControlSystemAdapter-DoocsAdapter
Commits
a473da6d
Commit
a473da6d
authored
5 years ago
by
Jens Georg
Browse files
Options
Downloads
Patches
Plain Diff
D_xy: Add support for axis settings
parent
17ef6f8e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/PropertyDescription.h
+8
-0
8 additions, 0 deletions
include/PropertyDescription.h
src/DoocsPVFactory.cc
+15
-2
15 additions, 2 deletions
src/DoocsPVFactory.cc
src/VariableMapper.cc
+30
-0
30 additions, 0 deletions
src/VariableMapper.cc
with
53 additions
and
2 deletions
include/PropertyDescription.h
+
8
−
0
View file @
a473da6d
...
...
@@ -120,9 +120,17 @@ namespace ChimeraTK {
/********************************************************************************************************************/
struct
XyDescription
:
public
PropertyDescription
,
public
PropertyAttributes
{
struct
Axis
{
std
::
string
label
;
int
logarithmic
;
float
start
;
float
stop
;
};
ChimeraTK
::
RegisterPath
xSource
;
ChimeraTK
::
RegisterPath
ySource
;
std
::
string
description
;
std
::
map
<
std
::
string
,
Axis
>
axis
;
XyDescription
(
ChimeraTK
::
RegisterPath
const
&
xSource_
=
""
,
ChimeraTK
::
RegisterPath
const
&
ySource_
=
""
,
std
::
string
const
&
location_
=
""
,
std
::
string
const
&
name_
=
""
,
bool
hasHistory_
=
true
)
...
...
This diff is collapsed.
Click to expand it.
src/DoocsPVFactory.cc
+
15
−
2
View file @
a473da6d
...
...
@@ -220,8 +220,21 @@ namespace ChimeraTK {
getDecorator
<
float
>
(
xProcessVariable
,
DecoratorType
::
C_style_conversion
),
getDecorator
<
float
>
(
yProcessVariable
,
DecoratorType
::
C_style_conversion
),
_updater
));
if
(
not
xyDescription
.
description
.
empty
())
boost
::
dynamic_pointer_cast
<
DoocsXy
>
(
doocsPV
)
->
description
(
xyDescription
.
description
);
auto
xy
=
boost
::
dynamic_pointer_cast
<
DoocsXy
>
(
doocsPV
);
if
(
not
xyDescription
.
description
.
empty
())
xy
->
description
(
xyDescription
.
description
);
auto
const
xIt
=
xyDescription
.
axis
.
find
(
"x"
);
if
(
xIt
!=
xyDescription
.
axis
.
cend
())
{
auto
const
&
axis
=
xIt
->
second
;
xy
->
xegu
(
axis
.
logarithmic
,
axis
.
start
,
axis
.
stop
,
axis
.
label
.
c_str
());
}
auto
const
yIt
=
xyDescription
.
axis
.
find
(
"y"
);
if
(
yIt
!=
xyDescription
.
axis
.
cend
())
{
auto
const
&
axis
=
yIt
->
second
;
xy
->
egu
(
axis
.
logarithmic
,
axis
.
start
,
axis
.
stop
,
axis
.
label
.
c_str
());
}
doocsPV
->
set_ro_access
();
...
...
This diff is collapsed.
Click to expand it.
src/VariableMapper.cc
+
30
−
0
View file @
a473da6d
...
...
@@ -268,6 +268,36 @@ namespace ChimeraTK {
auto
descriptionNode
=
xyXml
->
get_first_child
(
"description"
);
xyDescription
->
description
=
getContentString
(
descriptionNode
);
auto
unitNodes
=
xyXml
->
get_children
(
"unit"
);
for
(
const
auto
unit
:
unitNodes
)
{
auto
unitElement
=
asXmlElement
(
unit
);
auto
axis
=
getAttributeValue
(
unitElement
,
"axis"
);
if
(
axis
!=
"x"
&&
axis
!=
"y"
)
throw
std
::
invalid_argument
(
"Unsupported axis in D_xy, must be
\"
x
\"
or
\"
y
\"
: "
+
axis
);
std
::
string
label
;
if
(
not
unit
->
get_children
().
empty
())
label
=
getContentString
(
unit
);
xyDescription
->
axis
[
axis
].
label
=
label
;
try
{
xyDescription
->
axis
[
axis
].
logarithmic
=
std
::
stoi
(
getAttributeValue
(
unitElement
,
"logarithmic"
));
}
catch
(
std
::
invalid_argument
&
)
{
}
try
{
xyDescription
->
axis
[
axis
].
start
=
std
::
stof
(
getAttributeValue
(
unitElement
,
"start"
));
}
catch
(
std
::
invalid_argument
&
)
{
}
try
{
xyDescription
->
axis
[
axis
].
stop
=
std
::
stof
(
getAttributeValue
(
unitElement
,
"stop"
));
}
catch
(
std
::
invalid_argument
&
)
{
}
}
addDescription
(
xyDescription
,
{
xAbsoluteSource
,
yAbsoluteSource
});
}
...
...
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