Extends SessionObject to accept transition commands from run control, but has no interrupt capability. More...
#include <RunObject.hxx>
Public Member Functions | |
RunObject (const string &UDL, const string &name, const string &descr, const string &codaClass="USER", const cMsgSubscriptionConfig *scfg=NULL) throw (CodaException) | |
RunObject constructor, invokes SessionObject constructor. | |
virtual | ~RunObject (void) throw () |
RunObject destructor deletes all callback dispatchers, kills run statistics thread. | |
int | getRunNumber (void) const throw () |
Returns current run number. | |
string | getRunType (void) const throw () |
Returns current run type. | |
virtual void | startProcessing (void) throw (CodaException) |
Called to start processing. | |
Public Attributes | |
int | eventNumber |
Current event count. | |
double | eventRate |
Current event rate. | |
int | dataCount |
Current data count in 4-byte words. | |
double | dataRate |
Current event rate. | |
float | liveTime |
Current live time. | |
Protected Member Functions | |
virtual void | setDllUserArg (void *arg) throw () |
Sets dll user arg. | |
virtual void | handleConfigure (const cMsgMessage *msg) throw (CodaException) |
Handles configure request. | |
virtual void | handleDownload (const cMsgMessage *msg) throw (CodaException) |
Handles download request. | |
virtual void | handlePrestart (const cMsgMessage *msg) throw (CodaException) |
Handles prestart request. | |
virtual void | handleGo (const cMsgMessage *msg) throw (CodaException) |
Handles go request. | |
virtual void | handlePause (const cMsgMessage *msg) throw (CodaException) |
Handles pause request. | |
virtual void | handleResume (const cMsgMessage *msg) throw (CodaException) |
Handles resume request. | |
virtual void | handleEnd (const cMsgMessage *msg) throw (CodaException) |
Handles end request. | |
virtual void | handleReset (const cMsgMessage *msg) throw (CodaException) |
Handles reset request. | |
virtual void | handleSetSession (const string &newSession) throw (CodaException) |
Handles set session request. | |
virtual void | handleSetSession (const cMsgMessage *msg) throw (CodaException) |
Handles set session request. | |
virtual bool | download (const string &s) throw (CodaException) |
Implements download transition, dispatches to user routine. | |
virtual bool | prestart (const string &s) throw (CodaException) |
Implements prestart transition, dispatches to user routine. | |
virtual bool | go (const string &s) throw (CodaException) |
Implements go transition, dispatches to user routine. | |
virtual bool | pause (const string &s) throw (CodaException) |
Implements pause transition, dispatches to user routine. | |
virtual bool | resume (const string &s) throw (CodaException) |
Implements resume transition, dispatches to user routine. | |
virtual bool | end (const string &s) throw (CodaException) |
Implements end transition, dispatches to user routine. | |
virtual bool | reset (const string &s) throw (CodaException) |
Implements reset, dispatches to user routine, overrides superclass version. | |
virtual bool | configure (const cMsgMessage *msg) throw (CodaException) |
Calls userConfigure. | |
virtual bool | userConfigure (const string &runConfig) throw (CodaException) |
Default user configure method. | |
virtual bool | userDownload (const string &s) throw (CodaException) |
Default user download method. | |
virtual bool | userPrestart (const string &s) throw (CodaException) |
Default user prestart method. | |
virtual bool | userGo (const string &s) throw (CodaException) |
Default user go method. | |
virtual bool | userPause (const string &s) throw (CodaException) |
Default user pause method. | |
virtual bool | userResume (const string &s) throw (CodaException) |
Default user resume method. | |
virtual bool | userEnd (const string &s) throw (CodaException) |
Default user end method. | |
virtual bool | userReset (const string &s) throw (CodaException) |
Default user reset method. | |
virtual void | fillReport (cMsgMessage *m) throw () |
fills rc/report/status message | |
virtual void | daLogMsgFill (cMsgMessage &msg) const throw (CodaException) |
Fills daLogMsg with run-specific information. | |
Protected Attributes | |
int | runNumber |
Current run number. | |
string | runType |
Current run type. | |
int | runStatisticsInterval |
Run statistics calculation interval. | |
bool | hasDLL |
True if has dll library containing transition functions. | |
string | dllFileName |
dll file name. | |
void * | dllHandle |
dll handle. | |
dllSysStruct | dllSysArg |
For passing information into dll functions. | |
void * | dllUserArg |
dll user arg. | |
dllFuncPtr | dllDownload |
Pointer to download function in dll. | |
dllFuncPtr | dllPrestart |
Pointer to prestart function in dll. | |
dllFuncPtr | dllGo |
Pointer to go function in dll. | |
dllFuncPtr | dllPause |
Pointer to pause function in dll. | |
dllFuncPtr | dllResume |
Pointer to resume function in dll. | |
dllFuncPtr | dllEnd |
Pointer to end function in dll. | |
dllFuncPtr | dllReset |
Pointer to reset function in dll. | |
cMsgCallback * | runControlCBD |
Run control message callback dispatcher. | |
cMsgCallback * | runTransitionCBD |
Run transition message callback dispatcher. | |
pthread_mutex_t | runResetMutex |
Mutex for reset command. | |
pthread_mutex_t | runTransitionMutex |
Mutex for run transitions. | |
pthread_t | transitionThreadId |
Transition thread id. | |
pthread_t | runStatisticsThreadId |
Run statistics thread id. | |
pthreadDispatcher< RunObject, void *, void * > * | statisticsThreadDispatcher |
Run statistics pthread dispatcher. |
Extends SessionObject to accept transition commands from run control, but has no interrupt capability.
If interrupt capability is needed use InterruptibleObject.
User customizes a RunObject via override of some of download,prestart,go,pause,resume,end methods. Alternatively, can specify dll containing download,etc. functions.
If dealing with events, user must set eventCount and dataCount as events are sent to the DAQ system.
Definition at line 48 of file RunObject.hxx.
RunObject::RunObject | ( | const string & | udl, | |
const string & | Name, | |||
const string & | Descr, | |||
const string & | cClass = "USER" , |
|||
const cMsgSubscriptionConfig * | scfg = NULL | |||
) | throw (CodaException) |
RunObject constructor, invokes SessionObject constructor.
Subscribes to additional run-specific subjects.
udl | Main cMsg connection udl | |
name | Object name | |
descr | Object description | |
cClass | Coda class of object | |
scfg | cMsg subscription config |
Definition at line 52 of file RunObject.cc.
References DALOG_ERROR.
RunObject::~RunObject | ( | void | ) | throw () [virtual] |
RunObject destructor deletes all callback dispatchers, kills run statistics thread.
Definition at line 107 of file RunObject.cc.
References codaObject::CodaObject::debug, runControlCBD, runStatisticsThreadId, runTransitionCBD, and statisticsThreadDispatcher.
bool RunObject::configure | ( | const cMsgMessage * | msg | ) | throw (CodaException) [protected, virtual] |
Calls userConfigure.
msg | cMsgMessage |
Definition at line 603 of file RunObject.cc.
void RunObject::daLogMsgFill | ( | cMsgMessage & | m | ) | const throw (CodaException) [protected, virtual] |
Fills daLogMsg with run-specific information.
msg | Message |
Reimplemented from codaObject::SessionObject.
Definition at line 914 of file RunObject.cc.
References codaObject::SessionObject::daLogMsgFill().
bool RunObject::download | ( | const string & | s | ) | throw (CodaException) [protected, virtual] |
Implements download transition, dispatches to user routine.
s | String from run control |
Reimplemented in codaObject::InterruptibleObject.
Definition at line 636 of file RunObject.cc.
References DALOG_ERROR, and DALOG_INFO.
Referenced by codaObject::InterruptibleObject::download(), and handleDownload().
bool RunObject::end | ( | const string & | s | ) | throw (CodaException) [protected, virtual] |
Implements end transition, dispatches to user routine.
s | String from run control |
Reimplemented in codaObject::InterruptibleObject.
Definition at line 835 of file RunObject.cc.
References DALOG_INFO.
Referenced by codaObject::InterruptibleObject::end(), and handleEnd().
void RunObject::fillReport | ( | cMsgMessage * | m | ) | throw () [protected, virtual] |
fills rc/report/status message
m | message |
Reimplemented from codaObject::SessionObject.
Definition at line 561 of file RunObject.cc.
References codaObject::SessionObject::fillReport().
int RunObject::getRunNumber | ( | void | ) | const throw () |
Returns current run number.
Definition at line 578 of file RunObject.cc.
string RunObject::getRunType | ( | void | ) | const throw () |
Returns current run type.
Definition at line 591 of file RunObject.cc.
References runType.
bool RunObject::go | ( | const string & | s | ) | throw (CodaException) [protected, virtual] |
Implements go transition, dispatches to user routine.
s | String from run control |
Reimplemented in codaObject::InterruptibleObject.
Definition at line 741 of file RunObject.cc.
References DALOG_INFO.
Referenced by handleGo().
void RunObject::handleConfigure | ( | const cMsgMessage * | msg | ) | throw (CodaException) [protected, virtual] |
Handles configure request.
msg | Request message |
Definition at line 294 of file RunObject.cc.
void RunObject::handleDownload | ( | const cMsgMessage * | msg | ) | throw (CodaException) [protected, virtual] |
Handles download request.
msg | Incoming message |
Definition at line 313 of file RunObject.cc.
References download().
void RunObject::handleEnd | ( | const cMsgMessage * | msg | ) | throw (CodaException) [protected, virtual] |
Handles end request.
msg | Incoming message |
Definition at line 378 of file RunObject.cc.
References end().
void RunObject::handleGo | ( | const cMsgMessage * | msg | ) | throw (CodaException) [protected, virtual] |
Handles go request.
msg | Incoming message |
Definition at line 339 of file RunObject.cc.
References go().
void RunObject::handlePause | ( | const cMsgMessage * | msg | ) | throw (CodaException) [protected, virtual] |
Handles pause request.
msg | Incoming message |
Definition at line 352 of file RunObject.cc.
References pause().
void RunObject::handlePrestart | ( | const cMsgMessage * | msg | ) | throw (CodaException) [protected, virtual] |
Handles prestart request.
msg | Incoming message |
Definition at line 326 of file RunObject.cc.
References prestart().
void RunObject::handleReset | ( | const cMsgMessage * | msg | ) | throw (CodaException) [protected, virtual] |
Handles reset request.
msg | Incoming message |
Definition at line 391 of file RunObject.cc.
void RunObject::handleResume | ( | const cMsgMessage * | msg | ) | throw (CodaException) [protected, virtual] |
Handles resume request.
msg | Incoming message |
Definition at line 365 of file RunObject.cc.
References resume().
void RunObject::handleSetSession | ( | const cMsgMessage * | msg | ) | throw (CodaException) [protected, virtual] |
Handles set session request.
msg | cMsg request message |
Reimplemented from codaObject::SessionObject.
Definition at line 514 of file RunObject.cc.
void RunObject::handleSetSession | ( | const string & | newSession | ) | throw (CodaException) [protected, virtual] |
Handles set session request.
newSession | New session name |
Reimplemented from codaObject::SessionObject.
Definition at line 436 of file RunObject.cc.
References DALOG_ERROR, DALOG_INFO, and codaObject::SessionObject::handleSetSession().
bool RunObject::pause | ( | const string & | s | ) | throw (CodaException) [protected, virtual] |
Implements pause transition, dispatches to user routine.
s | String from run control |
Reimplemented in codaObject::InterruptibleObject.
Definition at line 773 of file RunObject.cc.
References DALOG_INFO.
Referenced by handlePause(), and codaObject::InterruptibleObject::pause().
bool RunObject::prestart | ( | const string & | s | ) | throw (CodaException) [protected, virtual] |
Implements prestart transition, dispatches to user routine.
s | String from run control |
Reimplemented in codaObject::InterruptibleObject.
Definition at line 702 of file RunObject.cc.
References DALOG_INFO.
Referenced by handlePrestart(), and codaObject::InterruptibleObject::prestart().
bool RunObject::reset | ( | const string & | s | ) | throw (CodaException) [protected, virtual] |
Implements reset, dispatches to user routine, overrides superclass version.
s | String from run control |
Reimplemented in codaObject::InterruptibleObject.
Definition at line 866 of file RunObject.cc.
References DALOG_INFO.
Referenced by codaObject::InterruptibleObject::reset().
bool RunObject::resume | ( | const string & | s | ) | throw (CodaException) [protected, virtual] |
Implements resume transition, dispatches to user routine.
s | String from run control |
Reimplemented in codaObject::InterruptibleObject.
Definition at line 804 of file RunObject.cc.
References DALOG_INFO.
Referenced by handleResume().
void RunObject::setDllUserArg | ( | void * | arg | ) | throw () [protected, virtual] |
Sets dll user arg.
Definition at line 620 of file RunObject.cc.
void RunObject::startProcessing | ( | void | ) | throw (CodaException) [virtual] |
Called to start processing.
Launches run statistics thread, then calls SessionObject::startProcessing.
Reimplemented from codaObject::CodaObject.
Definition at line 139 of file RunObject.cc.
References DALOG_ERROR, codaObject::CodaObject::daLogMsg(), codaObject::CodaObject::debug, runStatisticsThreadId, and statisticsThreadDispatcher.
bool RunObject::userConfigure | ( | const string & | runConfig | ) | throw (CodaException) [protected, virtual] |
bool RunObject::userDownload | ( | const string & | s | ) | throw (CodaException) [protected, virtual] |
bool RunObject::userEnd | ( | const string & | s | ) | throw (CodaException) [protected, virtual] |
bool RunObject::userGo | ( | const string & | s | ) | throw (CodaException) [protected, virtual] |
bool RunObject::userPause | ( | const string & | s | ) | throw (CodaException) [protected, virtual] |
bool RunObject::userPrestart | ( | const string & | s | ) | throw (CodaException) [protected, virtual] |
bool RunObject::userReset | ( | const string & | s | ) | throw (CodaException) [protected, virtual] |
bool RunObject::userResume | ( | const string & | s | ) | throw (CodaException) [protected, virtual] |
Current data count in 4-byte words.
Definition at line 119 of file RunObject.hxx.
Current event rate.
Definition at line 120 of file RunObject.hxx.
dllFuncPtr codaObject::RunObject::dllDownload [protected] |
Pointer to download function in dll.
Definition at line 130 of file RunObject.hxx.
dllFuncPtr codaObject::RunObject::dllEnd [protected] |
Pointer to end function in dll.
Definition at line 135 of file RunObject.hxx.
string codaObject::RunObject::dllFileName [protected] |
dll file name.
Definition at line 126 of file RunObject.hxx.
dllFuncPtr codaObject::RunObject::dllGo [protected] |
Pointer to go function in dll.
Definition at line 132 of file RunObject.hxx.
void* codaObject::RunObject::dllHandle [protected] |
dll handle.
Definition at line 127 of file RunObject.hxx.
dllFuncPtr codaObject::RunObject::dllPause [protected] |
Pointer to pause function in dll.
Definition at line 133 of file RunObject.hxx.
dllFuncPtr codaObject::RunObject::dllPrestart [protected] |
Pointer to prestart function in dll.
Definition at line 131 of file RunObject.hxx.
dllFuncPtr codaObject::RunObject::dllReset [protected] |
Pointer to reset function in dll.
Definition at line 136 of file RunObject.hxx.
dllFuncPtr codaObject::RunObject::dllResume [protected] |
Pointer to resume function in dll.
Definition at line 134 of file RunObject.hxx.
dllSysStruct codaObject::RunObject::dllSysArg [protected] |
For passing information into dll functions.
Definition at line 128 of file RunObject.hxx.
void* codaObject::RunObject::dllUserArg [protected] |
dll user arg.
Definition at line 129 of file RunObject.hxx.
Current event count.
Definition at line 117 of file RunObject.hxx.
Current event rate.
Definition at line 118 of file RunObject.hxx.
bool codaObject::RunObject::hasDLL [protected] |
True if has dll library containing transition functions.
Definition at line 125 of file RunObject.hxx.
Current live time.
Definition at line 121 of file RunObject.hxx.
cMsgCallback* codaObject::RunObject::runControlCBD [protected] |
Run control message callback dispatcher.
Definition at line 140 of file RunObject.hxx.
Referenced by ~RunObject().
int codaObject::RunObject::runNumber [protected] |
Current run number.
Definition at line 111 of file RunObject.hxx.
pthread_mutex_t codaObject::RunObject::runResetMutex [protected] |
Mutex for reset command.
Definition at line 145 of file RunObject.hxx.
int codaObject::RunObject::runStatisticsInterval [protected] |
Run statistics calculation interval.
Definition at line 113 of file RunObject.hxx.
pthread_t codaObject::RunObject::runStatisticsThreadId [protected] |
Run statistics thread id.
Definition at line 148 of file RunObject.hxx.
Referenced by startProcessing(), and ~RunObject().
cMsgCallback* codaObject::RunObject::runTransitionCBD [protected] |
Run transition message callback dispatcher.
Definition at line 141 of file RunObject.hxx.
Referenced by ~RunObject().
pthread_mutex_t codaObject::RunObject::runTransitionMutex [protected] |
Mutex for run transitions.
Definition at line 146 of file RunObject.hxx.
string codaObject::RunObject::runType [protected] |
pthreadDispatcher<RunObject,void*,void*>* codaObject::RunObject::statisticsThreadDispatcher [protected] |
Run statistics pthread dispatcher.
Definition at line 150 of file RunObject.hxx.
Referenced by startProcessing(), and ~RunObject().
pthread_t codaObject::RunObject::transitionThreadId [protected] |
Transition thread id.
Definition at line 147 of file RunObject.hxx.