Skip to content
Snippets Groups Projects
Unverified Commit ebbd6c13 authored by d-rothe's avatar d-rothe Committed by GitHub
Browse files

partial fix for #9836 (#69)


* partial fix for #9836

This fixes that cleared error codes appear in DOOCS history where error
is not yet cleared.
It is only a partial fix since the history still contains more data than
was intended; intended was only first invalid data point

* remove comments about outdated concept

Co-authored-by: default avatarDietrich Rothe <dietrich.rothe@desy.de>
parent ee5576f0
No related branches found
No related tags found
No related merge requests found
......@@ -47,11 +47,8 @@ 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
......@@ -75,28 +72,9 @@ namespace ChimeraTK {
set_global_timestamp(timestamp);
}
// 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!
//
// 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));
// The timestamp we give with set_and_archive is for the archiver only.
this->set_and_archive(data, archiverStatus, timestamp, eventId);
}
else {
this->set_value(data);
}
// We must set the timestamp again so it is correctly attached to the variable. set_and_archive does not to it.
// This must happen after set_and_archive, otherwise the global time stamp is taken.
this->set_timestamp(timestamp);
if(_macroPulseNumberSource) this->set_mpnum(_macroPulseNumberSource->accessData(0));
doocs::EventId eventId;
if(_macroPulseNumberSource) eventId = doocs::EventId(_macroPulseNumberSource->accessData(0));
this->set_value(data, timestamp, eventId, archiverStatus);
// send data via ZeroMQ if enabled and if DOOCS initialisation is complete
if(_publishZMQ && ChimeraTK::DoocsAdapter::isInitialised) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment