Commit 3a9bb68c authored by Dainius Simelevicius's avatar Dainius Simelevicius
Browse files

references #282: adding dip quality flag together with data

parent 34f10f35
......@@ -32,7 +32,7 @@ namespace dipbridge
//topic name
std::string topicname() const;
//extract dipdata to xdata::Table
xdata::Table::Reference getAll(const DipData& dipdata);
xdata::Table::Reference getAll(const DipData& dipdata, const DipQuality& dipquality);
private:
std::string m_topicname;
};
......
/*************************************************************************
* XDAQ Components for Distributed Data Acquisition *
* Copyright (C) 2000-2021, CERN. *
* Copyright (C) 2000-2022, CERN. *
* All rights reserved. *
* Authors: Zhen Xie, Luciano Orsini, Dainius Simelevicius *
* For the licensing terms see LICENSE. *
......@@ -15,7 +15,7 @@
// !!! Edit this line to reflect the latest package version !!!
#define WORKSUITE_DIPBRIDGE_VERSION_MAJOR 3
#define WORKSUITE_DIPBRIDGE_VERSION_MINOR 3
#define WORKSUITE_DIPBRIDGE_VERSION_MINOR 4
#define WORKSUITE_DIPBRIDGE_VERSION_PATCH 0
// If any previous versions available E.g. #define ESOURCE_PREVIOUS_VERSIONS "3.8.0,3.8.1"
#define DIPBRIDGE_PREVIOUS_VERSIONS
......
......@@ -354,13 +354,6 @@ void dipbridge::Application::handleMessage(DipSubscription * dipsub, DipData & m
LOG4CPLUS_DEBUG(getApplicationLogger(), "handleMessage from " + subname);
DipQuality dipq = message.extractDataQuality();
if( dipq != DipQuality::DIP_QUALITY_GOOD )
{
LOG4CPLUS_INFO(getApplicationLogger(), subname + ": no good quality data, skipping");
XCEPT_DECLARE(dipbridge::exception::Exception, err, subname + ": no good quality data, skipping");
this->notifyQualified("warning", err);
return;
}
if( message.isEmpty() )
{
......@@ -375,7 +368,7 @@ void dipbridge::Application::handleMessage(DipSubscription * dipsub, DipData & m
try
{
dipmessage = e.getAll(message);
dipmessage = e.getAll(message, dipq);
}
catch(dipbridge::exception::dipExtractError& e)
{
......
......@@ -18,6 +18,7 @@
#include "xdata/Double.h"
#include "xdata/Float.h"
#include "xdata/String.h"
#include "xdata/Integer.h"
#include "xdata/Integer8.h"
#include "xdata/Integer16.h"
#include "xdata/Integer32.h"
......@@ -35,7 +36,7 @@ std::string dipbridge::dipDataExtract::topicname() const
return m_topicname;
}
xdata::Table::Reference dipbridge::dipDataExtract::getAll( const DipData& dipdata )
xdata::Table::Reference dipbridge::dipDataExtract::getAll( const DipData& dipdata, const DipQuality& dipquality )
{
std::stringstream ss;
int nfields;
......@@ -47,6 +48,11 @@ xdata::Table::Reference dipbridge::dipDataExtract::getAll( const DipData& dipdat
xdata::Integer64 fieldvalue(dipt.getAsMillis());
data->setValueAt(0, "DipTimestamp", fieldvalue);
//Adding quality
data->addColumn("DipQuality", "int");
xdata::Integer qualityvalue(dipquality);
data->setValueAt(0, "DipQuality", qualityvalue);
const char** allfields = dipdata.getTags(nfields);
for(int i=0; i<nfields; ++i)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment