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
71e47aa9
Commit
71e47aa9
authored
3 years ago
by
Jens Georg
Browse files
Options
Downloads
Patches
Plain Diff
D_spectrum: Add possibility to provide EGUs
This will be used unless overriden in doocs server conf
parent
3f678e36
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
+9
-0
9 additions, 0 deletions
include/PropertyDescription.h
src/DoocsPVFactory.cc
+12
-0
12 additions, 0 deletions
src/DoocsPVFactory.cc
src/VariableMapper.cc
+32
-0
32 additions, 0 deletions
src/VariableMapper.cc
with
53 additions
and
0 deletions
include/PropertyDescription.h
+
9
−
0
View file @
71e47aa9
...
...
@@ -121,12 +121,21 @@ namespace ChimeraTK {
/********************************************************************************************************************/
struct
SpectrumDescription
:
public
PropertyDescription
,
public
PropertyAttributes
{
struct
Axis
{
std
::
string
label
;
int
logarithmic
;
float
start
;
float
stop
;
};
ChimeraTK
::
RegisterPath
source
;
ChimeraTK
::
RegisterPath
startSource
;
ChimeraTK
::
RegisterPath
incrementSource
;
float
start
;
float
increment
;
size_t
numberOfBuffers
;
std
::
string
description
;
std
::
map
<
std
::
string
,
Axis
>
axis
;
SpectrumDescription
(
ChimeraTK
::
RegisterPath
const
&
source_
=
""
,
std
::
string
location_
=
""
,
std
::
string
name_
=
""
,
bool
hasHistory_
=
true
,
bool
isWriteable_
=
true
)
...
...
This diff is collapsed.
Click to expand it.
src/DoocsPVFactory.cc
+
12
−
0
View file @
71e47aa9
...
...
@@ -204,6 +204,18 @@ namespace ChimeraTK {
boost
::
dynamic_pointer_cast
<
DoocsSpectrum
>
(
doocsPV
)
->
publishZeroMQ
();
}
auto
const
xIt
=
spectrumDescription
.
axis
.
find
(
"x"
);
if
(
xIt
!=
spectrumDescription
.
axis
.
cend
())
{
auto
const
&
axis
=
xIt
->
second
;
spectrum
->
xegu
(
axis
.
logarithmic
,
axis
.
start
,
axis
.
stop
,
axis
.
label
.
c_str
());
}
auto
const
yIt
=
spectrumDescription
.
axis
.
find
(
"y"
);
if
(
yIt
!=
spectrumDescription
.
axis
.
cend
())
{
auto
const
&
axis
=
yIt
->
second
;
spectrum
->
egu
(
axis
.
logarithmic
,
axis
.
start
,
axis
.
stop
,
axis
.
label
.
c_str
());
}
// set data matching mode (need to call before setMacroPulseNumberSource, as the mode is checked there)
boost
::
dynamic_pointer_cast
<
DoocsSpectrum
>
(
doocsPV
)
->
_consistencyGroup
.
setMatchingMode
(
spectrumDescription
.
dataMatching
);
...
...
This diff is collapsed.
Click to expand it.
src/VariableMapper.cc
+
32
−
0
View file @
71e47aa9
...
...
@@ -279,6 +279,38 @@ namespace ChimeraTK {
usedVariables
.
push_back
(
numberOfBuffers
);
}
auto
descriptionNode
=
spectrumXml
->
get_first_child
(
"description"
);
if
(
descriptionNode
!=
nullptr
)
spectrumDescription
->
description
=
getContentString
(
descriptionNode
);
auto
unitNodes
=
spectrumXml
->
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_spectrum, must be
\"
x
\"
or
\"
y
\"
: "
+
axis
);
std
::
string
label
;
if
(
not
unit
->
get_children
().
empty
())
label
=
getContentString
(
unit
);
spectrumDescription
->
axis
[
axis
].
label
=
label
;
try
{
spectrumDescription
->
axis
[
axis
].
logarithmic
=
std
::
stoi
(
getAttributeValue
(
unitElement
,
"logarithmic"
));
}
catch
(
std
::
invalid_argument
&
)
{
}
try
{
spectrumDescription
->
axis
[
axis
].
start
=
std
::
stof
(
getAttributeValue
(
unitElement
,
"start"
));
}
catch
(
std
::
invalid_argument
&
)
{
}
try
{
spectrumDescription
->
axis
[
axis
].
stop
=
std
::
stof
(
getAttributeValue
(
unitElement
,
"stop"
));
}
catch
(
std
::
invalid_argument
&
)
{
}
}
addDescription
(
spectrumDescription
,
usedVariables
);
}
...
...
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