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
5cdc0a0f
Commit
5cdc0a0f
authored
4 years ago
by
Tomasz Kozak
Browse files
Options
Downloads
Patches
Plain Diff
Store in history only first invalid data. Rest of data is not stored.
parent
bed97419
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/DoocsProcessScalar.h
+12
-3
12 additions, 3 deletions
include/DoocsProcessScalar.h
src/DoocsIfff.cc
+11
-3
11 additions, 3 deletions
src/DoocsIfff.cc
with
23 additions
and
6 deletions
include/DoocsProcessScalar.h
+
12
−
3
View file @
5cdc0a0f
...
...
@@ -47,7 +47,14 @@ namespace ChimeraTK {
// DoocsUpdater
auto
data
=
_processScalar
->
accessData
(
0
);
bool
storeInHistory
=
true
;
auto
archiverStatus
=
ArchiveStatus
::
sts_ok
;
if
(
_processScalar
->
dataValidity
()
!=
ChimeraTK
::
DataValidity
::
ok
)
{
if
(
this
->
d_error
())
// data are alredy invalid, do not store in history
storeInHistory
=
false
;
archiverStatus
=
ArchiveStatus
::
sts_err
;
//set data invalid in DOOCS for current data
this
->
d_error
(
stale_data
);
}
else
{
...
...
@@ -70,14 +77,16 @@ namespace ChimeraTK {
// we must not call set_and_archive if there is no history (otherwise it
// will be activated), but we have to if it is there. -> Abstraction,
// please!
if
(
this
->
get_histPointer
())
{
//
// We should also checked if data should be stored (flag storeInHistory). Invalid data should NOT be stored except first invalid data point.
// (https://github.com/ChimeraTK/ControlSystemAdapter-DoocsAdapter/issues/40)
if
(
this
->
get_histPointer
()
&&
storeInHistory
)
{
// Set eventId
doocs
::
EventId
eventId
;
if
(
_macroPulseNumberSource
)
eventId
=
doocs
::
EventId
(
_macroPulseNumberSource
->
accessData
(
0
));
/*FIXME: The archiver also has a status code. Set it correctly.*/
// The timestamp we give with set_and_archive is for the archiver only.
this
->
set_and_archive
(
data
,
A
rchiveStatus
::
sts_ok
,
timestamp
,
eventId
);
this
->
set_and_archive
(
data
,
a
rchive
r
Status
,
timestamp
,
eventId
);
}
else
{
this
->
set_value
(
data
);
...
...
This diff is collapsed.
Click to expand it.
src/DoocsIfff.cc
+
11
−
3
View file @
5cdc0a0f
...
...
@@ -62,10 +62,16 @@ namespace ChimeraTK {
return
;
}
bool
storeInHistory
=
true
;
auto
archiverStatus
=
ArchiveStatus
::
sts_ok
;
if
(
_i1Value
->
dataValidity
()
!=
ChimeraTK
::
DataValidity
::
ok
||
_f1Value
->
dataValidity
()
!=
ChimeraTK
::
DataValidity
::
ok
||
_f2Value
->
dataValidity
()
!=
ChimeraTK
::
DataValidity
::
ok
||
_f3Value
->
dataValidity
()
!=
ChimeraTK
::
DataValidity
::
ok
)
{
if
(
this
->
d_error
())
// data are alredy invalid, do not store in history
storeInHistory
=
false
;
archiverStatus
=
ArchiveStatus
::
sts_err
;
this
->
d_error
(
stale_data
);
}
else
{
...
...
@@ -85,15 +91,17 @@ namespace ChimeraTK {
set_global_timestamp
(
timestamp
);
}
if
(
this
->
get_histPointer
())
{
// We should also checked if data should be stored (flag storeInHistory). Invalid data should NOT be stored except first invalid data point.
// (https://github.com/ChimeraTK/ControlSystemAdapter-DoocsAdapter/issues/40)
if
(
this
->
get_histPointer
()
&&
storeInHistory
)
{
/*
doocs::EventId eventId =
(_macroPulseNumberSource) ? doocs::EventId(_macroPulseNumberSource->accessData(0)) : doocs::EventId(0);
*/
/*FIXME: The archiver also has a status code. Set it correctly.*/
/*FIXME: This set_and_archive does not support the timestamp yet (only sec and msec, and I guess m is milli?)*/
/*FIXME: This set_and_archive does not support eventIDs yet */
this
->
set_and_archive
(
&
ifff
,
A
rchiveStatus
::
sts_ok
,
0
,
0
/*msec*/
);
this
->
set_and_archive
(
&
ifff
,
a
rchive
r
Status
,
0
,
0
/*msec*/
);
}
else
{
this
->
set_value
(
&
ifff
);
...
...
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