Skip to content

Commit

Permalink
Add a run_number property to workspaces from the live event listener
Browse files Browse the repository at this point in the history
Refs #5857
  • Loading branch information
rgmiller committed Sep 13, 2012
1 parent 55f6ec4 commit 92580e9
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ namespace DataHandling
// Exactly what we have to do depends on the status field
if (pkt.status() == ADARA::RunStatus::NEW_RUN)
{
// Starting a new run: update m_status and add the run_start property
// Starting a new run: update m_status and add the run_start & run_number properties

if (runStatus() != NoRun)
{
Expand All @@ -356,6 +356,17 @@ namespace DataHandling

m_buffer->mutableRun().addProperty("run_start", std::string( timeString) );

// Add the run_number property
if ( m_buffer->mutableRun().hasProperty("run_number") )
{
m_buffer->mutableRun().removeProperty( "run_number"); // remove to old run_start value
}

// Oddly, the run number property needs to be a string....
std::ostringstream runNum;
runNum << pkt.runNumber();
m_buffer->mutableRun().addProperty( "run_number", runNum.str());

}
else if (pkt.status() == ADARA::RunStatus::END_RUN)
{
Expand Down

0 comments on commit 92580e9

Please sign in to comment.