#include <CReadoutMain.h>
Inheritance diagram for CReadoutMain:
Public Methods | |
CReadoutMain () | |
Default constructor. | |
~CReadoutMain () | |
Destructor. | |
bool | getWindowed () const |
bool | getServer () const |
unsigned short | getPort () const |
bool | getVmeTrigger () const |
string | getTitle () const |
unsigned int | getScalerPeriod () const |
CInterpreterShell * | getInterpreter () |
CRunState * | getRunState () |
CExperiment * | getExperiment () |
CTimer & | getClock () |
virtual void | SetupRunVariables (CExperiment &rExperiment, CInterpreterStartup &rStartup, CInterpreterCore &rCore) |
virtual void | SetupStateVariables (CExperiment &rExperiment, CInterpreterStartup &rStartup, CInterpreterCore &rCore) |
virtual void | AddUserCommands (CExperiment &rExperiment, CInterpreterStartup &rStartup, CInterpreterCore &rCore) |
void | Exit () |
Static Public Methods | |
CReadoutMain * | getInstance () |
Protected Methods | |
virtual int | operator() (int argc, char **argv) |
void | ParseSwitches (int argc, char **argv) |
void | CreateInterpreter () |
void | CreateExperiment () |
virtual void | SetupReadout (CExperiment &rExperiment) |
virtual void | SetupScalers (CExperiment &rExperiment) |
Private Methods | |
CReadoutMain (const CReadoutMain &rhs) | |
Copy constructor. | |
CReadoutMain & | operator= (const CReadoutMain &rhs) |
Assignment. | |
int | operator== (const CReadoutMain &rhs) const |
Comparison for equality. | |
int | operator!= (const CReadoutMain &rhs) const |
Private Attributes | |
bool | m_fWindowed |
True if Tk interpreter is started. | |
bool | m_fServer |
True if system runs a Tcl Server. | |
bool | m_fExit |
True if should exit. | |
unsigned short | m_nPort |
Number of Tcl server port if enabled. | |
bool | m_fVmeTrigger |
True if trigger is VME based. | |
CInterpreterShell * | m_pInterpreter |
Command interpreter wrapper. | |
CTimer | m_TimerQueue |
Managed queue of timed events. | |
CRunState | m_RunState |
Run State Transition manager.. | |
CExperiment | m_Experiment |
Experiment specific code container. |
-w - Requests a windowed interface. -pnum - Requests that the server run a TclServer on port num. -c - Requests that trigger management be via the NSCL standard CAMAC setup. Default is to use the NSCL standard VME trigger setup.
Definition at line 325 of file CReadoutMain.h.
|
Default constructor. Default constructor. This member is called for the single instance of the object.. which is statically declared. Definition at line 341 of file CReadoutMain.cpp. |
|
Destructor. Destructor. Race conditions make it safer to not destroy anything. Definition at line 356 of file CReadoutMain.cpp. |
|
Copy constructor.
|
|
Must be overridden if you want to add additional readout specific commands:
Reimplemented in CMyExperiment, and CMyExperiment. Definition at line 571 of file CReadoutMain.cpp. Referenced by CMyExperiment::AddUserCommands(), and CInterpreterCore::RegisterExtensions(). |
|
Based on the member data m_fVmeTrigger creates an experiment object and configures it with the appropriate trigger/clear modules. The experiment object configures the rest of itself based on the experiment's Initialize callout which performs experiment specific initialization including and not limited to configuring the EventReader component. Definition at line 474 of file CReadoutMain.cpp. References CExperiment::EstablishBusy(), CExperiment::EstablishTrigger(), m_Experiment, SetupReadout(), and SetupScalers(). Referenced by operator()(). |
|
Based on the member data: m_fWindowed - true selects a Tk based interpreter, and schedules it to start up. The startup will register standard Readout Tcl extensions and variables, and then callback our members to register custom extensions. Definition at line 449 of file CReadoutMain.cpp. References m_pInterpreter. Referenced by operator()(). |
|
Definition at line 415 of file CReadoutMain.h. References m_fExit. Referenced by CExitCommand::operator()(). |
|
Definition at line 388 of file CReadoutMain.h. Referenced by CExperiment::GetElapsedTime(), CExperiment::SetupTimedEvent(), CExperiment::Start(), and CExperiment::Stop(). |
|
Definition at line 385 of file CReadoutMain.h. Referenced by CResumeCommand::operator()(), CPauseCommand::operator()(), CEndCommand::operator()(), CBeginCommand::operator()(), and CInterpreterCore::RegisterExtensions(). |
|
Get a pointer to the single instance of a ReadoutMain object which can exist in the system. Definition at line 663 of file CReadoutMain.cpp. Referenced by CStateVariable::CStateVariable(), CTCLListener::CTCLListener(), CExperiment::GetRunNumber(), initevt(), CResumeCommand::operator()(), CPauseCommand::operator()(), CExitCommand::operator()(), CEndCommand::operator()(), CBeginCommand::operator()(), CExperiment::ReadEvent(), CInterpreterCore::RegisterExtensions(), and CExperiment::Start(). |
|
Definition at line 379 of file CReadoutMain.h. Referenced by CTCLListener::CTCLListener(), CExperiment::GetRunNumber(), initevt(), CExperiment::ReadEvent(), CExperiment::Start(), CExperiment::TriggerRunVariableBuffer(), and CExperiment::TriggerStateVariableBuffer(). |
|
Definition at line 364 of file CReadoutMain.h. References m_nPort. Referenced by CInterpreterCore::RegisterExtensions(). |
|
Definition at line 382 of file CReadoutMain.h. Referenced by CStateVariable::CStateVariable(), CResumeCommand::operator()(), CPauseCommand::operator()(), CEndCommand::operator()(), and CBeginCommand::operator()(). |
|
Returns the scaler readout period in seconds.
Definition at line 622 of file CReadoutMain.cpp. References CStateVariableCommand::end(), CStateVariableCommand::find(), CInterpreterShell::getInterpreterCore(), CInterpreterCore::getStateVariables(), m_pInterpreter, and StateVariableIterator. Referenced by CExperiment::Start(). |
|
Definition at line 360 of file CReadoutMain.h. References m_fServer. Referenced by CInterpreterCore::RegisterExtensions(). |
|
Returns the current run title. This is the value of the title run state variable. If that run state variable is not yet set we return -not set-. Definition at line 584 of file CReadoutMain.cpp. References CStateVariableCommand::end(), CStateVariableCommand::find(), CInterpreterShell::getInterpreterCore(), CInterpreterCore::getStateVariables(), m_pInterpreter, and StateVariableIterator. Referenced by CExperiment::EmitEnd(), CExperiment::EmitPause(), CExperiment::EmitResume(), and CExperiment::EmitStart(). |
|
Definition at line 368 of file CReadoutMain.h. References m_fVmeTrigger. |
|
Definition at line 356 of file CReadoutMain.h. References m_fWindowed. Referenced by CInterpreterCore::RegisterExtensions(). |
|
|
|
Entry point to the program. The flow is relatively simple: We parse the switches, Create the interpreter, Create the experiment and Create the timer manager, and then block to let the child threads run.
Definition at line 382 of file CReadoutMain.cpp. References CreateExperiment(), CreateInterpreter(), CReaper::getInstance(), m_fExit, and ParseSwitches(). |
|
Assignment.
|
|
Comparison for equality.
|
|
Parses the command line switches into the member variables. Switches supported are described in the CReadoutMain class description.
We make use of the gnu getgetopts cmdline parser. Our parse 'grammer' is in options.ggo Definition at line 423 of file CReadoutMain.cpp. References gengetopt_args_info::camac_trigger_flag, cmdline_parser(), m_fServer, m_fVmeTrigger, m_fWindowed, m_nPort, gengetopt_args_info::port_arg, gengetopt_args_info::port_given, and gengetopt_args_info::window_flag. Referenced by operator()(). |
|
This must be overridden to create the user's readout procedures
Reimplemented in CMyExperiment, and CMyExperiment. Definition at line 499 of file CReadoutMain.cpp. Referenced by CreateExperiment(), and CMyExperiment::SetupReadout(). |
|
This must be overridden if the experimenter wants to provide any initial run variables.
Reimplemented in CMyExperiment, and CMyExperiment. Definition at line 527 of file CReadoutMain.cpp. Referenced by CInterpreterCore::RegisterExtensions(), and CMyExperiment::SetupRunVariables(). |
|
This must be overridden to create the user's scaler readout procedure.
Reimplemented in CMyExperiment, and CMyExperiment. Definition at line 509 of file CReadoutMain.cpp. Referenced by CreateExperiment(), and CMyExperiment::SetupScalers(). |
|
This must be overridden if the experimenter wants to provide any run state variables. If you override this be sure to call the base class member e.g.: CReadoutMain::SetupStateVariables(rExperiment, Interp) as the first executable line.
Reimplemented in CMyExperiment, and CMyExperiment. Definition at line 550 of file CReadoutMain.cpp. Referenced by CInterpreterCore::RegisterExtensions(), and CMyExperiment::SetupStateVariables(). |
|
Experiment specific code container.
Definition at line 337 of file CReadoutMain.h. Referenced by CreateExperiment(). |
|
True if should exit.
Definition at line 330 of file CReadoutMain.h. Referenced by Exit(), and operator()(). |
|
True if system runs a Tcl Server.
Definition at line 329 of file CReadoutMain.h. Referenced by getServer(), and ParseSwitches(). |
|
True if trigger is VME based.
Definition at line 332 of file CReadoutMain.h. Referenced by getVmeTrigger(), and ParseSwitches(). |
|
True if Tk interpreter is started.
Definition at line 328 of file CReadoutMain.h. Referenced by getWindowed(), and ParseSwitches(). |
|
Number of Tcl server port if enabled.
Definition at line 331 of file CReadoutMain.h. Referenced by getPort(), and ParseSwitches(). |
|
Command interpreter wrapper.
Definition at line 334 of file CReadoutMain.h. Referenced by CreateInterpreter(), getScalerPeriod(), and getTitle(). |
|
Run State Transition manager..
Definition at line 336 of file CReadoutMain.h. |
|
Managed queue of timed events.
Definition at line 335 of file CReadoutMain.h. |