NSCL DDAS  12.1-001
Support for XIA DDAS at FRIB
Classes | Public Member Functions | Static Protected Member Functions | List of all members
CMyEndCommand Class Reference

Provides an end command to override the SBS one. More...

#include <CMyEndCommand.h>

Inheritance diagram for CMyEndCommand:
Inheritance graph
[legend]
Collaboration diagram for CMyEndCommand:
Collaboration graph
[legend]

Classes

struct  EndEvent
 Struct encapsulating the command and Tcl event to end the run. More...
 

Public Member Functions

 CMyEndCommand (CTCLInterpreter &interp, CMyEventSegment *pSeg, CExperiment *pExp)
 Constructor. More...
 
 ~CMyEndCommand ()
 Destructor. More...
 
int transitionToInactive ()
 
int readOutRemainingData ()
 
int endRun ()
 
void rescheduleEndTransition ()
 
void rescheduleEndRead ()
 
virtual int operator() (CTCLInterpreter &interp, std::vector< CTCLObject > &objv)
 

Static Protected Member Functions

static int handleEndRun (Tcl_Event *pEvt, int flags)
 
static int handleReadOutRemainingData (Tcl_Event *pEvt, int flags)
 

Detailed Description

Provides an end command to override the SBS one.

Constructor & Destructor Documentation

◆ CMyEndCommand()

CMyEndCommand::CMyEndCommand ( CTCLInterpreter &  interp,
CMyEventSegment pSeg,
CExperiment *  pExp 
)

Constructor.

Parameters
interpReference to interpreter.
pSegPointer to the event segment to manipulate.
pExpPointer to the experiment we're reading data from.

◆ ~CMyEndCommand()

CMyEndCommand::~CMyEndCommand ( )

Destructor.

Member Function Documentation

◆ endRun()

int CMyEndCommand::endRun ( )

◆ handleEndRun()

int CMyEndCommand::handleEndRun ( Tcl_Event *  pEvt,
int  flags 
)
staticprotected

Calls the command's endRun function.

◆ handleReadOutRemainingData()

int CMyEndCommand::handleReadOutRemainingData ( Tcl_Event *  pEvt,
int  flags 
)
staticprotected

Calls the command's readOutRemainingData function.

◆ operator()()

int CMyEndCommand::operator() ( CTCLInterpreter &  interp,
std::vector< CTCLObject > &  objv 
)
virtual

Overridden CEndCommand function call operator to be sure that our end run gets called at the right time. If an end run operation is permitted, attempt to read out the remaining data and end the run.

◆ readOutRemainingData()

int CMyEndCommand::readOutRemainingData ( )

After reading out the last of the data, write the run statistics to an end-of-run scalers file.

◆ rescheduleEndRead()

void CMyEndCommand::rescheduleEndRead ( )

◆ rescheduleEndTransition()

void CMyEndCommand::rescheduleEndTransition ( )

◆ transitionToInactive()

int CMyEndCommand::transitionToInactive ( )

Stop run in the director module (module #0) – a SYNC interrupt should be generated to stop the run in all modules simultaneously when running synchronously. We are not running synchronously when in INFINITY_CLOCK mode. If the INFINITY_CLOCK mode is set, we must stop the run in each module individually.

Note
If the end run signal is successfully communicated to the module(s), the transition to an inactive state cannot fail, only report which module(s) failed to properly end their run. One common cause of this failure is a very high input rate to one or more channels on that module.

The documentation for this class was generated from the following files: