From c44fe24e4b1ac5818fdd905165078b7ebddc0d23 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Tue, 14 May 2019 16:07:14 +0200 Subject: [PATCH] [occ] Set run number on every transition --- occ/occlib/OccServer.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/occ/occlib/OccServer.cxx b/occ/occlib/OccServer.cxx index 92491887b..fa2823873 100644 --- a/occ/occlib/OccServer.cxx +++ b/occ/occlib/OccServer.cxx @@ -26,6 +26,7 @@ #include "OccServer.h" +#include #include "util/Defer.h" #include #include @@ -33,6 +34,7 @@ #include #include "RuntimeControlledObject.h" +#include "RuntimeControlledObjectPrivate.h" using namespace std::chrono_literals; @@ -220,13 +222,18 @@ t_State OccServer::processStateTransition(const std::string& event, const boost: t_State currentState = m_rco->getState(); t_State newState = currentState; + std::string rns = properties.get("runNumber", "0"); + RunNumber newRunNumber = std::strtoul(rns.c_str(), nullptr, 10); + std::string evt = boost::algorithm::to_lower_copy(event); - printf("Object: %s - processing event %s in state %s\n", + printf("Object: %s - processing event %s in state %s with run number %lu.\n", m_rco->getName().c_str(), evt.c_str(), - getStringFromState(currentState).c_str()); + getStringFromState(currentState).c_str(), + newRunNumber); + m_rco->dPtr->mCurrentRunNumber = newRunNumber; // STANDBY if (currentState==t_State::standby) { if (evt=="configure") {