Commit 2e875d47 authored by Andrea Petrucci's avatar Andrea Petrucci
Browse files

references #251: fix un/subscribe and increase log level to warn for DIP debug messages

parent af8bff8f
......@@ -77,9 +77,10 @@ evb::readoutunit::MetaDataRetrieverDIPBridge::~MetaDataRetrieverDIPBridge()
topic.second = masked;
else if ( topic.second != okay ) {
xdata::Properties plist;
plist.setProperty("urn:dip:action", "register");
plist.setProperty("urn:dip:action", "unregister");
plist.setProperty("urn:dip:topicname", topic.first.c_str());
this->getEventingBus(eventingBusName_).publish("urn:dip:metacontrol", 0, plist);
LOG4CPLUS_WARN(logger_,toolbox::toString("urn:dip:action=unregister, urn:dip:topicname=%s",topic.first.c_str()));
}
} catch(eventing::api::exception::Exception& e)
{
......@@ -103,9 +104,10 @@ void evb::readoutunit::MetaDataRetrieverDIPBridge::subscribeToDip(const std::str
topic.second = masked;
else if (topic.second != okay) {
xdata::Properties plist;
plist.setProperty("urn:dip:action", "unregister");
plist.setProperty("urn:dip:action", "register");
plist.setProperty("urn:dip:topicname", topic.first.c_str());
this->getEventingBus(eventingBusName_).publish("urn:dip:metacontrol", 0, plist);
LOG4CPLUS_WARN(logger_,toolbox::toString("urn:dip:action=register, urn:dip:topicname=%s",topic.first.c_str()));
}
} catch(eventing::api::exception::Exception& e)
{
......@@ -160,7 +162,7 @@ void evb::readoutunit::MetaDataRetrieverDIPBridge::handleMessage(toolbox::mem::R
if ( action == "notify" && ref!=0 )
{
const std::string topicName = plist.getProperty("urn:b2in-eventing:topic");
LOG4CPLUS_INFO(logger_,"received topic "+topicName);
LOG4CPLUS_WARN(logger_,"received topic "+topicName);
//parse table message
xdata::Table table;
std::cout<<"Message buffer size "<<ref->getDataSize()<<std::endl;
......@@ -202,7 +204,7 @@ void evb::readoutunit::MetaDataRetrieverDIPBridge::handleMessage(toolbox::mem::R
//lastLuminosity_.avgPileUp = dipData.extractFloat("AvgPileUp");
p = table.getValueAt(0, "AvgPileUp");
lastLuminosity_.avgPileUp = dynamic_cast<xdata::Float*>(p)->value_;
LOG4CPLUS_INFO(logger_,
LOG4CPLUS_WARN(logger_,
toolbox::toString(
"Got a dip/CMS/BRIL/Luminosity notification: diptime=%, lumiSection=%, LumiNibble=%, InstLumi=%f, AvgPileUp=%f",
dipTime, lastLuminosity_.lumiSection, lastLuminosity_.lumiNibble,lastLuminosity_.instLumi,lastLuminosity_.avgPileUp));
......@@ -290,7 +292,7 @@ void evb::readoutunit::MetaDataRetrieverDIPBridge::handleMessage(toolbox::mem::R
lastBeamSpot_.errDydz = dynamic_cast<xdata::Float*>(p)->value_;
msg << ", dxdz=" << lastBeamSpot_.dxdz << ", dydz=" << lastBeamSpot_.dydz << ", err_dxdz="<< lastBeamSpot_.errDxdz << ", err_dydz="<< lastBeamSpot_.errDydz;
LOG4CPLUS_INFO(logger_,msg.str());
LOG4CPLUS_WARN(logger_,msg.str());
}
else if ( topicName == "dip/CMS/CTPPS/detectorFSM" )
{
......@@ -308,7 +310,7 @@ void evb::readoutunit::MetaDataRetrieverDIPBridge::handleMessage(toolbox::mem::R
uint64_t status = static_cast<uint64_t>(dynamic_cast<xdata::Integer32*>(p)->value_);
lastCTPPS_.status |= (status & 0x3) << (i*2);
}
LOG4CPLUS_INFO(logger_, toolbox::toString(
LOG4CPLUS_WARN(logger_, toolbox::toString(
"Got a dip/CMS/CTPPS/detectorFSM notification: diptime=%, status=%",
dipTime, lastCTPPS_.status));
......@@ -325,7 +327,7 @@ void evb::readoutunit::MetaDataRetrieverDIPBridge::handleMessage(toolbox::mem::R
// TODO check if the DIP default value is mapped as follow in the DIPbridge
p = table.getValueAt(0, "__DIP_DEFAULT__");
lastDCS_.magnetCurrent = dynamic_cast<xdata::Float*>(p)->value_;
LOG4CPLUS_INFO(logger_, toolbox::toString(
LOG4CPLUS_WARN(logger_, toolbox::toString(
"Got a dip/CMS/MCS/Current notification: diptime=%, status=%f",
dipTime, lastDCS_.magnetCurrent));
}
......@@ -346,7 +348,7 @@ void evb::readoutunit::MetaDataRetrieverDIPBridge::handleMessage(toolbox::mem::R
//const uint64_t dipTime = dipData.extractDipTime().getAsMillis();
lastDCS_.timeStamp = std::max(lastDCS_.timeStamp,dipTime);
LOG4CPLUS_INFO(logger_, toolbox::toString(
LOG4CPLUS_WARN(logger_, toolbox::toString(
"Got a %s notification: diptime=%, status=%f",
topicName, dipTime, lastDCS_.highVoltageReady));
......
Markdown is supported
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