Recovering run state and run variable data |
SpecTcl Home General Information User Guide Programmer's Guide Obtaining and Installing
This page describes how to recover run state and run variable data produced by the production readout software. Run state and run variables are TCL variables. Within production readout, run state variables are write locked while a run is in progress. Run variables, by contrast may change.
The software described on this page analyzes the NSCL data buffers created by the production readout software, recreating the run state and run variables.
The remainder of this document:
The run state and run variable processing is implemented as callbacks within the NSCL buffer processing framework used by the scaler buffer processing software. The simplest way to enable run statne and run variable processing is to:
To add runstate and run variable processing to scaler buffer processing you must make modifications to your MySpecTclApp.cpp file that:
The code fragment below shows additional header files that must be included in your MySpecTclApp.cpp file:
#include <buftypes.h> #include <Globals.h> #include <DocumentationCallback.h>
Globals.h enables you to locate the TCL interpreter used by SpecTcl. DocumentationCallback.h defines the callbackthat decodes the documentation buffers containing runstate and run variables.
The code fragment below taken from CMySpecTclApp::CreateAnalysisPipline shows how to add the documentation buffer processing callback to the scaler analysis framework.
CDocumentationCallback* pDocCallback = new CDocumentationCallback(gpInterpreter); CBufferProcessor* pProcessor = ScalerStage.getProcessor(); pProcessor->addCallback(STATEVARBF, *pDocCallback); pProcessor->addCallback(RUNVARBF, *pDocCallback); RegisterEventProcessor(ScalerStage); // Pre-existing for scaler analysis.
The first line creates a documentation callback object. This object will actually analyze the buffers. Next the scaler event processor is asked to give its Buffer processing object (see the buffer processor man page for more information about this). Finally,the documentation callback is registered to process both STATEVARBF (run state variable), and RUNVARBF (run variable) buffers before the scaler event processor is registered on the analysis pipeline.
TopIf you maintain a pointer to the CDocumentationCallback object you created, you can access the services of this object from within your own C++ application specific code. The member functions below are available for your use:
class CDocumentationCallback { public: STD(string) getValue(STD(string) name) const; STD(string) getElementValue(STD(string) name, STD(string) element) const; void addChangeHandler(STD(string) name, CVariableTraceCallback& callback); void removeChangeHandler(STD(string) name, CVariableTraceCallback& callback); };
Last modified: Fri Feb 25, 2005 by Ron Fox:
fox@nscl.msu.edu
© Copyright NSCL 1999, All rights reserved