Jpp  18.0.1-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Attributes | Private Member Functions | Private Attributes | List of all members
KM3NETDAQ::JDAQClient Class Reference

Control unit client base class. More...

#include <JDAQClient.hh>

Inheritance diagram for KM3NETDAQ::JDAQClient:
JDAQStateMachine KM3NETDAQ::JDAQClient_t JDAQCHSM AcousticDataFilter JDAQDemoClient KM3NETDAQ::DataQueue KM3NETDAQ::JDAQDriver KM3NETDAQ::JDataFilter KM3NETDAQ::JDataWriter KM3NETDAQ::JDQSimulator KM3NETDAQ::JEventGenerator KM3NETDAQ::MonitorRouter

Public Member Functions

 JDAQClient (const std::string &name, const std::string &server, JLogger *logger, const int level)
 Constructor. More...
 
 JDAQClient (const std::string &name, JLogger *logger, const int level)
 Constructor. More...
 
 JDAQClient (const std::string &name)
 Constructor. More...
 
virtual bool enter (const JArgs &args)
 Enter the state machine. More...
 
virtual bool enter ()
 Enter the state machine. More...
 
virtual bool exit ()
 Exit the state machine. More...
 
bool isRunning () const
 Check if this client is in runnig state. More...
 
void replaceEvent (const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event)
 Replace tag of given event in event table. More...
 
JDAQEvent_tfindEvent (const JTag &tag, const std::string &event_name)
 Find event in event table. More...
 
void addSubscription (const JSubscription &subscription)
 Add custom subscription. More...
 
template<class T >
void addParameter (const char option, T &parameter)
 Add parameter to parser used in method enter(). More...
 
template<class T >
void addParameter (const char option, T &parameter, const T &value)
 Add parameter to parser used in method enter(). More...
 
void setSelect ()
 Set the file descriptor mask for the select call. More...
 
virtual void setSelect (JFileDescriptorMask &mask) const
 Set the file descriptor mask for the select call. More...
 
virtual void actionSelect (const JFileDescriptorMask &mask)
 Action method following last select call. More...
 
virtual void actionRunning ()
 This method is repeatedly called when this client machine is in state Running and the clock interval time is non-zero. More...
 
virtual void actionInput (int length, const char *buffer)
 This method is called at ev_input. More...
 
virtual bool filter (const JTag &tag, int length, const char *buffer)
 Filter message. More...
 
virtual void actionTagged (const JTag &tag, int length, const char *buffer)
 This method is called when a custom tag is encountered. More...
 
void run ()
 Run as run control client following command messages via JNET::JControlHost. More...
 
void run (const int port)
 Run for ever. More...
 
void run (std::istream &in)
 Run client with commands from input stream (e.g. for debugging). More...
 
void A1 (CHSM_ns_alias::event const &)
 
void A2 (CHSM_ns_alias::event const &)
 
void A3 (CHSM_ns_alias::event const &)
 
void A4 (CHSM_ns_alias::event const &)
 
void A5 (CHSM_ns_alias::event const &)
 
void A6 (CHSM_ns_alias::event const &)
 
void A7 (CHSM_ns_alias::event const &)
 
void A8 (CHSM_ns_alias::event const &)
 
void A9 (CHSM_ns_alias::event const &)
 
void A10 (CHSM_ns_alias::event const &)
 
void A11 (CHSM_ns_alias::event const &)
 
void A12 (CHSM_ns_alias::event const &)
 
void A13 (CHSM_ns_alias::event const &)
 
void A14 (CHSM_ns_alias::event const &)
 
void EAM4root (CHSM_ns_alias::state const &, CHSM_ns_alias::event const &)
 
void XAM4root (CHSM_ns_alias::state const &, CHSM_ns_alias::event const &)
 
const std::stringgetName () const
 Get name of state machine. More...
 
const std::stringgetName () const
 Get name of state machine. More...
 
int getDetectorID () const
 Get detector identifier. More...
 
int getDetectorID () const
 Get detector identifier. More...
 
int getRunNumber () const
 Get run number. More...
 
int getRunNumber () const
 Get run number. More...
 
virtual void actionEnter ()
 Interface methods for actions corresponding to state transitions. More...
 
virtual void actionEnter ()
 Interface methods for actions corresponding to state transitions. More...
 
virtual void actionExit ()
 
virtual void actionExit ()
 
virtual void actionInit (int, const char *)
 
virtual void actionInit (int, const char *)
 
virtual void actionConfigure (int, const char *)
 
virtual void actionConfigure (int, const char *)
 
virtual void actionStart (int, const char *)
 
virtual void actionStart (int, const char *)
 
virtual void actionPause (int, const char *)
 
virtual void actionPause (int, const char *)
 
virtual void actionContinue (int, const char *)
 
virtual void actionContinue (int, const char *)
 
virtual void actionStop (int, const char *)
 
virtual void actionStop (int, const char *)
 
virtual void actionReset (int, const char *)
 
virtual void actionReset (int, const char *)
 
virtual void actionQuit (int, const char *)
 
virtual void actionQuit (int, const char *)
 
virtual void actionError ()
 
virtual void actionError ()
 
virtual void actionRecover (int, const char *)
 
virtual void actionRecover (int, const char *)
 
const std::stringgetHostname () const
 Get hostname. More...
 
const std::stringgetFullName () const
 Get full name of this run control client. More...
 
const JTaggetUniqueTag () const
 Get unique tag of this run control client. More...
 
long long int getClockDelay () const
 Get total delay time. More...
 
long long int getClockInterval () const
 Get interval time. More...
 
void setClockInterval (const long long int interval_us)
 Set interval time. More...
 
void resetClock ()
 Reset clock. More...
 
const std::stringgetEventInfo () const
 Get last event information. More...
 
void setEventInfo (const std::string &info)
 Set last event information. More...
 

Public Attributes

JDAQStateMachine::state_root root
 
JDAQStateMachine::state_Main Main
 
JDAQStateMachine::ev_daq_event ev_daq
 
char ev_daq_param_block [sizeof(ev_daq_event::param_block)]
 
JDAQStateMachine::ev_init_event ev_init
 
char ev_init_param_block [sizeof(ev_init_event::param_block)]
 
JDAQStateMachine::ev_configure_event ev_configure
 
char ev_configure_param_block [sizeof(ev_configure_event::param_block)]
 
JDAQStateMachine::ev_start_event ev_start
 
char ev_start_param_block [sizeof(ev_start_event::param_block)]
 
JDAQStateMachine::ev_pause_event ev_pause
 
char ev_pause_param_block [sizeof(ev_pause_event::param_block)]
 
JDAQStateMachine::ev_continue_event ev_continue
 
char ev_continue_param_block [sizeof(ev_continue_event::param_block)]
 
JDAQStateMachine::ev_stop_event ev_stop
 
char ev_stop_param_block [sizeof(ev_stop_event::param_block)]
 
JDAQStateMachine::ev_reset_event ev_reset
 
char ev_reset_param_block [sizeof(ev_reset_event::param_block)]
 
JDAQStateMachine::ev_quit_event ev_quit
 
char ev_quit_param_block [sizeof(ev_quit_event::param_block)]
 
JDAQStateMachine::ev_off_event ev_off
 
char ev_off_param_block [sizeof(ev_off_event::param_block)]
 
JDAQStateMachine::ev_check_event ev_check
 
char ev_check_param_block [sizeof(ev_check_event::param_block)]
 
JDAQStateMachine::ev_input_event ev_input
 
char ev_input_param_block [sizeof(ev_input_event::param_block)]
 
JDAQStateMachine::ev_recover_event ev_recover
 
char ev_recover_param_block [sizeof(ev_recover_event::param_block)]
 
JDAQStateMachine::ev_error_event ev_error
 
char ev_error_param_block [sizeof(ev_error_event::param_block)]
 

Static Public Attributes

static const int TIMEOUT_S = 1
 time out of update [s] More...
 

Protected Types

typedef void(JDAQCHSM::* action )(int, const char *)
 Type definition of action method. More...
 
typedef void(JDAQCHSM::* action )(int, const char *)
 Type definition of action method. More...
 

Protected Attributes

JSharedPointer< JControlHostserver
 message server More...
 
JMessageLogger logger
 message logger More...
 
std::string name
 
int detector_id
 
int run_number
 
JEventTable eventTable
 event table More...
 
std::string hostname
 
std::string fullname
 
JTag unique_tag
 
JTimekeeper clock
 central clock More...
 
std::string event_info
 event information More...
 

Private Member Functions

void update ()
 Update state machine. More...
 
void update (const JTag &tag, int length, const char *buffer)
 Update state machine. More...
 
void configure ()
 Configure client. More...
 
std::string getMessage (const CHSM::state &state, const CHSM::event &event) const
 Get event message. More...
 
virtual void enterState (const CHSM::state &state, const CHSM::event &event)
 Action when entering state. More...
 
virtual void actionCheck (int length, const char *buffer)
 This method is called at ev_check and reports a system check by mimicing an enter state action. More...
 
void execute (action __action, const CHSM::event &__event)
 The method to execute the action. More...
 
const CHSM::state * getState () const
 Get current state. More...
 

Private Attributes

JSelectReader select
 select call More...
 
JParser parser
 parser method enter() More...
 
JSubscriptionList subscription
 custom subscription More...
 

Detailed Description

Control unit client base class.

This base class implements the protocol for the communication with the control unit.
This protocol is based on ControlHost tags and CHSM event names.
Normally, the primary input is provided to the constructor of this base class, e.g. via command line options of the application based on a derived class hereof.
By calling the default method enter(),

The method run() can then be used to process command messages which will acoordingly update the state machine.
For each state transition, a corresponding action method is called which could be re-implemented in the derived class (see JDAQCHSM).
Optionally, a designated action method is repeatedly called in state Running.

A state transition is triggered by a valid command message.
The command message consists of a tag and some contents.
The tag can be used to address all processes, a group of processes or an individual process.
The contents of a command message must start with the name on the event and can contain additional data (separated by KM3NETDAQ::TOKEN_DELIMETER).
A successful transition is certified by a reply message which is sent upon entering the targeted state.
The reply message has tag "RC_REPLY" and the contents include the names of the original event as well as that of the final state.
Optionally, information can be added to an event (separated by KM3NETDAQ::EVENTNAME_DELIMETER).
This information is included in the following reply messages, until there is a command message with (other) information.

Following a request for a state transition via a command message, four scenarios should be anticipated, namely:

  1. the process successfully completed the transition, a corresponding reply message is then send back;
  2. the process couldn't make the transition and goes to error state, a corresponding reply message is then send back,
  3. the process crashed, the process disappears from the process list and the server broadcasts a corresponding died message;
  4. the process takes longer than foreseen, leading to a timeout.

The followup action after a timeout should be customised.
In case of an invalid command message (e.g. request for a state transition that does not exist), no reply message will be sent.
Instead, a message with tag "RC_FAIL" is sent.

The default list of tags includes "RC_CMD" and a client specific tag.
The latter is composed of the hexadecimal formatted IP sub-address of the client's host CPU (see JSYSTEM::getSubaddress(const int)) and
the client's name extension (part following KM3NETDAQ::CLIENTNAME_DELIMETER), if any.
The list of tags and the various delimiters are maintained in include file JDAQTags.hh.

For client specific events requiring a different tag, the corresponding entry in the event table should be replaced.
This should be done in the constructor of the derived class using method replaceEvent().

The virtual method filter() can be re-implemented so that a specific action is made before the corresponding message is processed.
The message is ignored if this method returns true, else it is normally processed.

The method setSelect() can be used to set the file descriptor mask of the general select call.
In conjunction, the method actionSelect() can be used to take client specific actions following the select call.

If the clock interval is non-zero, the method actionRunning() is repeatedly called according the specified interval time when the client is in state Running.
The clock interval can be set using method setClockInterval().

Some input can be redefined during operation.
For example the debug level can be set via the following command message.

  JPutMessage -H <host name> -t <tag> -m "debug=\<level\>;"

where

In this, the tag "RC_CMD" applies to all applications and the client specific tag to an individual application.

Additional custom tags can be added to the general list using method addSubscription().
The method actionTagged() is then called when a command message is received with the specified tag.

For tests and possible other setups, the base class can be configured to run stand-alone or forever.
In stand-alone mode, the client can be steered from an regular input stream.
When the client runs forever, it waits for a connection before going to the normal mode of operation.
The primary input should then be sent via this connection.
The method addParameter() can be used to add parameters of the derived class to the list that is parsed in method enter().

Definition at line 298 of file JDAQClient.hh.

Member Typedef Documentation

typedef void(JDAQCHSM::* JDAQCHSM::action)(int, const char *)
protectedinherited

Type definition of action method.

Definition at line 141 of file JDAQCHSM.chsm.

typedef void(JDAQCHSM::* JDAQCHSM::action)(int, const char *)
protectedinherited

Type definition of action method.

Definition at line 152 of file JDAQCHSM.hh.

Constructor & Destructor Documentation

KM3NETDAQ::JDAQClient::JDAQClient ( const std::string name,
const std::string server,
JLogger logger,
const int  level 
)
inline

Constructor.

This constructor should be used in normal mode.
The following methods methods should subsequently be called.

Parameters
namename of client
servername of command message server
loggerpointer to logger
leveldebug level

Definition at line 316 of file JDAQClient.hh.

319  :
321  JDAQClient_t (this)
322  {
323  this->logger = JMessageLogger(logger, name, level);
324 
325  try {
326  this->server.reset(new JControlHost(server));
327  }
328  catch(JControlHostException& error) {
329  JErrorStream(this->logger) << error;
330  }
331 
332  std::string buffer;
333 
335 
336  if (buffer != "") {
337  JErrorStream(this->logger) << "Process with nick name \"" << getFullName() << "\" already running on host(s) " << buffer;
338  }
339  }
std::string name
Definition: JDAQCHSM.chsm:154
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
JDAQStateMachine(const std::string)
Definition: JDAQCHSM.cc:300
JDAQClient_t(JDAQStateMachine *chsm)
Constructor.
Definition: JDAQClient.hh:71
then awk string
const std::string & getFullName() const
Get full name of this run control client.
Definition: JDAQClient.hh:120
static int WhereIs(const std::string &host_name, const std::string &nick_name, std::string &answer)
Locate ControlHost client(s).
KM3NETDAQ::JDAQClient::JDAQClient ( const std::string name,
JLogger logger,
const int  level 
)
inline

Constructor.

This constructor should be used when running stand-alone.
The following methods methods should subsequently be called.

Parameters
namename of client
loggerpointer to logger
leveldebug level

Definition at line 354 of file JDAQClient.hh.

356  :
358  JDAQClient_t (this)
359  {
360  this->logger = JMessageLogger(logger, name, level);
361  }
std::string name
Definition: JDAQCHSM.chsm:154
JDAQStateMachine(const std::string)
Definition: JDAQCHSM.cc:300
JDAQClient_t(JDAQStateMachine *chsm)
Constructor.
Definition: JDAQClient.hh:71
KM3NETDAQ::JDAQClient::JDAQClient ( const std::string name)
inline

Constructor.

This constructor should be used when running forever.
The following method should subsequently be called.

Parameters
namename of client

Definition at line 373 of file JDAQClient.hh.

373  :
375  JDAQClient_t (this)
376  {}
std::string name
Definition: JDAQCHSM.chsm:154
JDAQStateMachine(const std::string)
Definition: JDAQCHSM.cc:300
JDAQClient_t(JDAQStateMachine *chsm)
Constructor.
Definition: JDAQClient.hh:71

Member Function Documentation

virtual bool KM3NETDAQ::JDAQClient::enter ( const JArgs args)
inlinevirtual

Enter the state machine.

This overloaded method enter reproduces the constructor. All necessary input is parsed from the list of arguments. In case of an error, the state machine is not entered.

Parameters
argsarray of command line arguments
Returns
true if okay; else false

Definition at line 389 of file JDAQClient.hh.

390  {
391  using namespace std;
392 
393  string server;
394  string logger;
395  int level;
396  bool use_cout;
397 
398  try {
399 
400  parser['H'] = make_field(server) = "localhost";
401  parser['M'] = make_field(logger) = "localhost";
402  parser['d'] = make_field(level) = 0;
403  parser['c'] = make_field(use_cout);
404 
405  if (parser.read(args) != 0) {
406  return false;
407  }
408  }
409  catch(const exception &error) {
410  cerr << error.what() << endl;
411  return false;
412  }
413 
414  try {
415 
416  JLogger* out = NULL;
417 
418  if (use_cout)
419  out = new JStreamLogger(cout);
420  else
421  out = new JControlHostLogger(logger);
422 
423  this->logger = JMessageLogger(out, getName(), level);
424 
425  this->server.reset(new JControlHost(server));
426 
427  return enter();
428  }
429  catch(const JControlHostException& error) {
430  cerr << error << endl;
431  return false;
432  }
433  }
JParser parser
parser method enter()
Definition: JDAQClient.hh:1057
Message logging based on std::ostream.
Interface for logging messages.
Definition: JLogger.hh:22
Message logging based on ControlHost.
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
virtual bool enter()
Enter the state machine.
Definition: JDAQClient.hh:444
int read(const int argc, const char *const argv[])
Parse the program&#39;s command line options.
Definition: JParser.hh:1811
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
const std::string & getName() const
Get name of state machine.
Definition: JDAQCHSM.chsm:78
virtual bool KM3NETDAQ::JDAQClient::enter ( )
inlinevirtual

Enter the state machine.

This method activates the subscription to JNET::JControlHost messages. In case of an error, the state machine is not entered.

Returns
true if okay; else false

Reimplemented in KM3NETDAQ::JDAQDriver.

Definition at line 444 of file JDAQClient.hh.

445  {
446  using namespace std;
447  using namespace JPP;
448 
449  if (server.is_valid() && logger.is_valid()) {
450 
451  const JSubscriptionList buffer = getSubscription(eventTable) + subscription;
452 
453  try {
454 
455  server->Subscribe(buffer);
456  server->SendMeAlways();
457  server->MyId(getFullName());
458 
459  JStatusStream(logger) << "Process with nick name \"" << getFullName() << "\" version \"" << getGITVersion() << "\" subscription: " << buffer.toString();
460 
461  return CHSM::machine::enter();
462  }
463  catch(const JControlHostException& error) {
464  JErrorStream(logger) << error;
465  }
466 
467  } else {
468  cerr << "Message server or logger not properly initialised." << endl;
469  }
470 
471  return false;
472  }
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
std::string getGITVersion(const std::string &tag)
Get GIT version for given GIT tag.
JSubscriptionList subscription
custom subscription
Definition: JDAQClient.hh:1058
JEventTable eventTable
event table
Definition: JDAQClient.hh:203
bool is_valid() const
Check validity of logger object.
const std::string & getFullName() const
Get full name of this run control client.
Definition: JDAQClient.hh:120
JSubscriptionList getSubscription(const JEventTable &event_table)
Convert event table to ControlHost subscription.
Definition: JEventTable.hh:129
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
virtual bool KM3NETDAQ::JDAQClient::exit ( )
inlinevirtual

Exit the state machine.

This method releases the various resources.

Returns
true if okay; else false

Definition at line 482 of file JDAQClient.hh.

483  {
484  try {
485  if (server.is_valid()) { server.reset(NULL); }
486  }
487  catch(const JControlHostException& error) {
488  }
489 
490  try {
491  if (logger.is_valid()) { logger.reset(NULL); }
492  }
493  catch(const JControlHostException& error) {
494  }
495 
496  return CHSM::machine::exit();
497  }
void reset(JLogger *__logger=NULL)
Reset logger.
exit
Definition: JPizza.sh:36
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
bool is_valid() const
Check validity of logger object.
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
bool KM3NETDAQ::JDAQClient::isRunning ( ) const
inline

Check if this client is in runnig state.

Returns
true if running; else false

Definition at line 505 of file JDAQClient.hh.

506  {
507  return Main.RunControl.Operational.Running.active();
508  }
JDAQStateMachine::state_Main Main
JDAQStateMachine::state_Main::state_RunControl::state_Operational Operational
JDAQStateMachine::state_Main::state_RunControl RunControl
void KM3NETDAQ::JDAQClient::replaceEvent ( const JTag oldTag,
const JTag newTag,
JDAQEvent_t event 
)
inline

Replace tag of given event in event table.

Parameters
oldTagold tag
newTagnew tag
eventevent

Definition at line 518 of file JDAQClient.hh.

521  {
522  eventTable.replace(oldTag, newTag, event);
523  }
void replace(const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event)
Replace entry in table.
Definition: JEventTable.hh:96
JEventTable eventTable
event table
Definition: JDAQClient.hh:203
JDAQEvent_t* KM3NETDAQ::JDAQClient::findEvent ( const JTag tag,
const std::string event_name 
)
inline

Find event in event table.

Parameters
tagtag
event_nameevent name
Returns
pointer to event or NULL

Definition at line 533 of file JDAQClient.hh.

534  {
535  JEventTable::const_iterator i = eventTable.find(tag, event_name);
536 
537  if (i != eventTable.end())
538  return i->second;
539  else
540  return NULL;
541  }
JEventTable eventTable
event table
Definition: JDAQClient.hh:203
const_iterator find(const JTag &tag, const std::string &event_name) const
Find entry.
Definition: JEventTable.hh:116
void KM3NETDAQ::JDAQClient::addSubscription ( const JSubscription subscription)
inline

Add custom subscription.

Parameters
subscriptionsubscription

Definition at line 549 of file JDAQClient.hh.

550  {
552  }
JSubscriptionList & add(const JSubscription &subscription)
Add subscription.
JSubscriptionList subscription
custom subscription
Definition: JDAQClient.hh:1058
template<class T >
void KM3NETDAQ::JDAQClient::addParameter ( const char  option,
T parameter 
)
inline

Add parameter to parser used in method enter().

Parameters
optionoption
parameterparameter

Definition at line 562 of file JDAQClient.hh.

563  {
564  parser[option] = make_field(parameter);
565  }
JParser parser
parser method enter()
Definition: JDAQClient.hh:1057
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
template<class T >
void KM3NETDAQ::JDAQClient::addParameter ( const char  option,
T parameter,
const T value 
)
inline

Add parameter to parser used in method enter().

Parameters
optionoption
parameterparameter
valuedefault value

Definition at line 576 of file JDAQClient.hh.

577  {
578  parser[option] = make_field(parameter) = value;
579  }
JParser parser
parser method enter()
Definition: JDAQClient.hh:1057
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
void KM3NETDAQ::JDAQClient::setSelect ( )
inline

Set the file descriptor mask for the select call.

Definition at line 585 of file JDAQClient.hh.

586  {
587  select.reset();
588 
590 
592  }
JSelectReader select
select call
Definition: JDAQClient.hh:1056
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
JFileDescriptorMask & getReaderMask()
Get reader mask.
void setReaderMask(const JAbstractFile &file)
Set reader mask.
void reset()
Reset.
void setSelect()
Set the file descriptor mask for the select call.
Definition: JDAQClient.hh:585
virtual void KM3NETDAQ::JDAQClient::setSelect ( JFileDescriptorMask mask) const
inlinevirtual

Set the file descriptor mask for the select call.

This implementation does nothing but may be redefined by the derived class.

Parameters
maskfile descriptor mask

Reimplemented in KM3NETDAQ::JDataFilter, KM3NETDAQ::JDataWriter, and KM3NETDAQ::MonitorRouter.

Definition at line 601 of file JDAQClient.hh.

602  {}
virtual void KM3NETDAQ::JDAQClient::actionSelect ( const JFileDescriptorMask mask)
inlinevirtual

Action method following last select call.

This implementation does nothing but may be redefined by the derived class.

Parameters
maskfile descriptor mask

Reimplemented in KM3NETDAQ::JDataFilter, KM3NETDAQ::DataQueue, KM3NETDAQ::JDataWriter, and KM3NETDAQ::MonitorRouter.

Definition at line 611 of file JDAQClient.hh.

612  {}
virtual void KM3NETDAQ::JDAQClient::actionRunning ( )
inlinevirtual

This method is repeatedly called when this client machine is in state Running and the clock interval time is non-zero.

This implementation does nothing but may be redefined by the derived class. Care has to be taken so that the time needed to execute this method should be less than the specified clock interval time (see method setClockInterval()).

Reimplemented in KM3NETDAQ::JDataFilter, KM3NETDAQ::JDataWriter, KM3NETDAQ::JDQSimulator, KM3NETDAQ::DataQueue, KM3NETDAQ::JEventGenerator, KM3NETDAQ::MonitorRouter, and AcousticDataFilter.

Definition at line 622 of file JDAQClient.hh.

623  {}
virtual void KM3NETDAQ::JDAQClient::actionInput ( int  length,
const char *  buffer 
)
inlinevirtual

This method is called at ev_input.

Parameters
lengthlength of data
bufferpointer to data

Reimplemented from JDAQCHSM.

Reimplemented in KM3NETDAQ::DataQueue, and AcousticDataFilter.

Definition at line 632 of file JDAQClient.hh.

633  {
634  using namespace std;
635 
636  JProperties properties(JEquationParameters("=", ";", "", ""), 1);
637 
638  int level = this->logger.getLevel();
639 
640  properties["debug"] = level;
641 
642  properties.read(string(buffer, length));
643 
644  this->logger.setLevel(level);
645  }
Utility class to parse parameter values.
Definition: JProperties.hh:496
Simple data structure to support I/O of equations (see class JLANG::JEquation).
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
void setLevel(const int __level)
Set debug level.
JLevel_t getLevel()
Get debug level.
virtual bool KM3NETDAQ::JDAQClient::filter ( const JTag tag,
int  length,
const char *  buffer 
)
inlinevirtual

Filter message.

The filter method can be overwritten so that a specific action is made before the corresponding message is processed by the state machine. The message is ignored if true is returned, else it is normally processed.

Parameters
tagtag
lengthnumber of characters
buffermessage
Returns
skip message or not

Definition at line 659 of file JDAQClient.hh.

660  {
661  return false;
662  }
virtual void KM3NETDAQ::JDAQClient::actionTagged ( const JTag tag,
int  length,
const char *  buffer 
)
inlinevirtual

This method is called when a custom tag is encountered.

Parameters
tagtag
lengthlength of data
bufferpointer to data

Reimplemented in KM3NETDAQ::JDataFilter.

Definition at line 672 of file JDAQClient.hh.

673  {
674  }
void KM3NETDAQ::JDAQClient::run ( )
inline

Run as run control client following command messages via JNET::JControlHost.

This method can be called once the state machine is entered. It returns when the state machine is exited. If the clock interval is non-zero, the method actionRunning() is repeatedly called when this client machine is in state Running. The file descriptor mask can be set to interrupt the timeout of the select call and clock method wait() in this calling sequence (see methods setSelect() and actionSelect()).

Definition at line 687 of file JDAQClient.hh.

688  {
689  using namespace std;
690 
691  while (active()) {
692 
693  try {
694 
695  setSelect();
696 
697  if (select(JTimeval(TIMEOUT_S,0)) > 0) {
698 
699  if (select.hasReaderMask(*server)) {
700  update();
701  }
702 
704 
705  } else {
706 
707  continue;
708  }
709 
710 
711  if (isRunning() && clock.getInterval() != 0LL) {
712 
713  long long int numberOfCalls = 0;
714 
715  clock.reset();
716 
717  do {
718 
719  ++numberOfCalls;
720 
721  setSelect();
722 
723  if (clock.wait(select.getReaderMask())) {
724 
725  if (select.hasReaderMask(*server)) {
726  update();
727  }
728 
730 
731  } else {
732 
733  try {
734  actionRunning();
735  }
736  catch(const exception& error) {
737  logger.error(error.what());
738  }
739  }
740 
741  } while (isRunning());
742 
743  if (numberOfCalls != 0) {
744  JNoticeStream(logger) << "Delay per call " << clock.getDelay() / numberOfCalls / 1000 << " ms";
745  }
746  }
747  }
748  catch(const exception& error) {
749  JErrorStream(logger) << "method run(): " << error.what();
750  }
751  }
752  }
long long int getDelay() const
Get total delay time.
Definition: JTimekeeper.hh:78
JTimekeeper clock
central clock
Definition: JDAQClient.hh:207
static const int TIMEOUT_S
time out of update [s]
Definition: JDAQClient.hh:63
JSelectReader select
select call
Definition: JDAQClient.hh:1056
void reset(const long long int t0)
Reset time.
Definition: JTimekeeper.hh:100
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
JFileDescriptorMask & getReaderMask()
Get reader mask.
void wait() const
Wait until the number of time intervals has elapsed since the last call to the reset method...
Definition: JTimekeeper.hh:145
virtual void actionRunning()
This method is repeatedly called when this client machine is in state Running and the clock interval ...
Definition: JDAQClient.hh:622
bool isRunning() const
Check if this client is in runnig state.
Definition: JDAQClient.hh:505
void update()
Update state machine.
Definition: JDAQClient.hh:834
long long int getInterval() const
Get interval time.
Definition: JTimekeeper.hh:67
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
void error(const JMessage_t &message)
void setSelect()
Set the file descriptor mask for the select call.
Definition: JDAQClient.hh:585
virtual void actionSelect(const JFileDescriptorMask &mask)
Action method following last select call.
Definition: JDAQClient.hh:611
bool hasReaderMask(const JAbstractFile &file) const
Has reader file.
void KM3NETDAQ::JDAQClient::run ( const int  port)
inline

Run for ever.

This method can be used when the run control client is started before the run control (e.g. at boot time of the host processor). This method should be called before the state machine is entered. It launches a server which accepts a JNET::JControlHost connection from a designated application e.g. the JDAQClientStarter.cc program. The state machine is entered using the available data in the JNET::JControlHost message. After the state machine is exited, it accepts a new a JNET::JControlHost connection.

Parameters
portport number

Definition at line 767 of file JDAQClient.hh.

768  {
769  JControlHostServer local_server(port);
770 
771  for ( ; ; ) {
772 
773  JControlHost* ps = local_server.AcceptClient();
774 
775  ps->Connected();
776 
777  JNET::JPrefix prefix;
778 
779  ps->WaitHead(prefix);
780 
781  const int length = prefix.getSize();
782 
783  char* buffer = new char[length];
784 
785  ps->GetFullData(buffer, length);
786  ps->PutFullData(prefix.toString(), buffer, length);
787 
788  delete ps;
789 
790  enter(JArgs(std::string(buffer, length)));
791 
792  delete [] buffer;
793 
794  run();
795 
796  exit();
797  }
798  }
ControlHost prefix.
Definition: JPrefix.hh:31
void run()
Run as run control client following command messages via JNET::JControlHost.
Definition: JDAQClient.hh:687
int getSize() const
Get size.
Definition: JPrefix.hh:62
virtual bool enter()
Enter the state machine.
Definition: JDAQClient.hh:444
then awk string
virtual bool exit()
Exit the state machine.
Definition: JDAQClient.hh:482
std::string toString() const
Convert tag to string.
Definition: JTag.hh:171
void KM3NETDAQ::JDAQClient::run ( std::istream &  in)
inline

Run client with commands from input stream (e.g. for debugging).

Example input format:

<tag> <event name>[#data];
<tag> <event name>[#data];
Parameters
ininput stream

Definition at line 812 of file JDAQClient.hh.

813  {
814  using namespace std;
815 
816  string tag;
817  string buffer;
818 
819  while (in >> tag && in >> skipws && getline(in, buffer, ';')) {
820  update(tag, buffer.length(), buffer.data());
821  }
822  }
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition: JString.hh:478
void update()
Update state machine.
Definition: JDAQClient.hh:834
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
void KM3NETDAQ::JDAQClient::update ( )
inlineprivate

Update state machine.

This method waits for a message from JNET::JControlHost server.

Definition at line 834 of file JDAQClient.hh.

835  {
836  JNET::JPrefix prefix;
837 
838  server->WaitHead(prefix);
839 
840  const int length = prefix.getSize();
841 
842  char* buffer = new char[length];
843 
844  server->GetFullData(buffer, length);
845 
846  update(prefix.getTag(), length, buffer);
847 
848  delete [] buffer;
849  }
ControlHost prefix.
Definition: JPrefix.hh:31
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
int getSize() const
Get size.
Definition: JPrefix.hh:62
const JTag & getTag() const
Get tag.
Definition: JTag.hh:86
void update()
Update state machine.
Definition: JDAQClient.hh:834
void KM3NETDAQ::JDAQClient::update ( const JTag tag,
int  length,
const char *  buffer 
)
inlineprivate

Update state machine.

Parameters
tagtag
lengthnumber of characters
buffermessage

Definition at line 859 of file JDAQClient.hh.

860  {
861  using namespace std;
862  using namespace JPP;
863 
864  if (filter(tag, length, buffer)) {
865  return;
866  }
867 
868  if (getSubscription(eventTable)->count(JSubscriptionAny(tag)) == 0 &&
869  getSubscription(eventTable)->count(JSubscriptionAll(tag)) == 0) {
870 
871  actionTagged(tag, length, buffer);
872 
873  return;
874  }
875 
876 
877  string::size_type pos = 0;
878 
879  while (pos != (string::size_type) length && TOKEN_DELIMETER.find(*(buffer + pos)) == string::npos) {
880  ++pos;
881  }
882 
883  const JEvent_t event = JEvent_t::toValue(string(buffer, pos));
884 
885  if (event.hasInfo()) {
886  setEventInfo(event.getInfo());
887  }
888 
889  while (pos != (string::size_type) length && TOKEN_DELIMETER.find(*(buffer + pos)) != string::npos) {
890  ++pos;
891  }
892 
893 
894  JEventTable::const_iterator i = eventTable.find(tag, event.getName());
895 
896  if (i != eventTable.end()) {
897 
898  const CHSM::state* const s0 = getState();
899 
900  if (!i->second->active()) {
901 
902  JWarningStream(logger) << "Event " << i->second->name() << " not active (" << (s0 != NULL ? s0->name() : "") << ")";
903 
904  if (server.is_valid() && s0 != NULL) {
905  server->PutFullString(RC_FAIL, getMessage(*s0, *i->second));
906  }
907  }
908 
909  // redirect all I/O
910 
911  {
913  JErrorStream error(logger);
914 
915  JRedirectStream rs_cin (cin, JLANG::null);
916  JRedirectStream rs_cout(cout, debug);
917  JRedirectStream rs_cerr(cerr, error);
918 
919  if (rs_cin &&
920  rs_cout &&
921  rs_cerr) {
922 
923  (*(i->second))(length - pos, buffer + pos);
924  }
925  }
926 
927  const CHSM::state* const s1 = getState();
928 
929  JStatusStream(logger) << "Transition "
930  << (s0 != NULL ? s0->name() : "")
931  << "->(" << i->second->name() << ")->"
932  << (s1 != NULL ? s1->name() : "");
933  } else {
934 
935  JErrorStream(logger) << "Unknown key <" << tag << "," << event.getName() << ">";
936  }
937  }
void setEventInfo(const std::string &info)
Set last event information.
Definition: JDAQClient.hh:196
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
static const std::string TOKEN_DELIMETER
Definition: JDAQTags.hh:50
virtual bool filter(const JTag &tag, int length, const char *buffer)
Filter message.
Definition: JDAQClient.hh:659
static JEvent_t toValue(const std::string &buffer)
Convert string to event.
Definition: JEvent_t.hh:99
const CHSM::state * getState() const
Get current state.
Definition: JDAQClient.hh:1040
virtual void actionTagged(const JTag &tag, int length, const char *buffer)
This method is called when a custom tag is encountered.
Definition: JDAQClient.hh:672
Level specific message streamers.
JEventTable eventTable
event table
Definition: JDAQClient.hh:203
std::string getMessage(const CHSM::state &state, const CHSM::event &event) const
Get event message.
Definition: JDAQClient.hh:956
JSubscriptionList getSubscription(const JEventTable &event_table)
Convert event table to ControlHost subscription.
Definition: JEventTable.hh:129
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
static JNullStream null
Null I/O stream.
Definition: JNullStream.hh:51
const_iterator find(const JTag &tag, const std::string &event_name) const
Find entry.
Definition: JEventTable.hh:116
static const JNET::JTag RC_FAIL
Definition: JDAQTags.hh:60
int debug
debug level
void KM3NETDAQ::JDAQClient::configure ( )
inlineprivate

Configure client.

This method is used to setup the event table.

Definition at line 944 of file JDAQClient.hh.

945  {
946  }
std::string KM3NETDAQ::JDAQClient::getMessage ( const CHSM::state &  state,
const CHSM::event &  event 
) const
inlineprivate

Get event message.

Parameters
statestate
eventevent
Returns
message

Definition at line 956 of file JDAQClient.hh.

957  {
958  std::ostringstream os;
959 
960  os << getFullName()
961  << getTokenDelimeter()
962  << (getEventInfo() != "" ?
963  JEvent_t(event.name(), getEventInfo()) :
964  JEvent_t(event.name()))
965  << getTokenDelimeter()
966  << getStateName(state.name());
967 
968  return os.str();
969  }
const std::string & getEventInfo() const
Get last event information.
Definition: JDAQClient.hh:185
std::string getStateName(const std::string &name)
Get name of state.
char getTokenDelimeter()
Get the token delimeter for command messages.
const std::string & getFullName() const
Get full name of this run control client.
Definition: JDAQClient.hh:120
virtual void KM3NETDAQ::JDAQClient::enterState ( const CHSM::state &  state,
const CHSM::event &  event 
)
inlineprivatevirtual

Action when entering state.

This method provides for the hand shaking with the run control program.

Parameters
stateentered state
eventevent that triggered transition

Implements JDAQCHSM.

Reimplemented in KM3NETDAQ::JDAQDriver.

Definition at line 979 of file JDAQClient.hh.

980  {
981  if (server.is_valid()) {
982  server->PutFullString(RC_REPLY, getMessage(state, event));
983  }
984  }
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
static const JNET::JTag RC_REPLY
Definition: JDAQTags.hh:59
std::string getMessage(const CHSM::state &state, const CHSM::event &event) const
Get event message.
Definition: JDAQClient.hh:956
virtual void KM3NETDAQ::JDAQClient::actionCheck ( int  length,
const char *  buffer 
)
inlineprivatevirtual

This method is called at ev_check and reports a system check by mimicing an enter state action.

Parameters
lengthnumber of characters
buffermessage

Reimplemented from JDAQCHSM.

Definition at line 993 of file JDAQClient.hh.

994  {
995  if (Main.RunControl.Error.active()) {
996 
998 
999  } else {
1000 
1001  for (CHSM::parent::iterator state = Main.RunControl.Operational.begin(); state != Main.RunControl.Operational.end(); ++state) {
1002 
1003  if (state->active()) {
1004 
1005  // mimic enter state
1006 
1007  enterState(*state, ev_check);
1008  }
1009  }
1010  }
1011  }
JDAQStateMachine::state_Main Main
virtual void enterState(const CHSM::state &state, const CHSM::event &event)
Action when entering state.
Definition: JDAQClient.hh:979
JDAQStateMachine::ev_check_event ev_check
JDAQStateMachine::state_Main::state_RunControl::state_Operational Operational
JDAQStateMachine::state_Main::state_RunControl RunControl
void KM3NETDAQ::JDAQClient::execute ( action  __action,
const CHSM::event &  __event 
)
inlineprivatevirtual

The method to execute the action.

Parameters
__actionpointer to action method
__eventevent that triggered the action

Implements JDAQCHSM.

Definition at line 1020 of file JDAQClient.hh.

1021  {
1022  try {
1023 
1024  const JDAQStateMachine::ev_daq_event& event = dynamic_cast<const JDAQStateMachine::ev_daq_event&>(__event);
1025 
1026  (this->*__action)(event->length, event->buffer);
1027  }
1028  catch(const std::exception& error) {
1029  JErrorStream(logger) << "Error at event " << __event.name() << " \"" << error.what() << "\"; trigger ev_error.";
1030  ev_error();
1031  }
1032  }
JDAQStateMachine::ev_error_event ev_error
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
const CHSM::state* KM3NETDAQ::JDAQClient::getState ( ) const
inlineprivate

Get current state.

Returns
state

Definition at line 1040 of file JDAQClient.hh.

1041  {
1042  for (CHSM::parent::const_iterator state = Main.RunControl.Operational.begin(); state != Main.RunControl.Operational.end(); ++state) {
1043  if (state->active()) {
1044  return &(*state);
1045  }
1046  }
1047 
1048  if (Main.RunControl.Error.active()) {
1049  return &Main.RunControl.Error;
1050  }
1051 
1052  return NULL;
1053  }
JDAQStateMachine::state_Main Main
JDAQStateMachine::state_Main::state_RunControl::state_Operational Operational
JDAQStateMachine::state_Main::state_RunControl RunControl
void JDAQStateMachine::A1 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 344 of file JDAQCHSM.cc.

344 { actionError(); }
virtual void actionError()
Definition: JDAQCHSM.chsm:124
void JDAQStateMachine::A2 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 346 of file JDAQCHSM.cc.

346 { execute(&JDAQCHSM::actionInit, event); }
virtual void actionInit(int, const char *)
Definition: JDAQCHSM.chsm:112
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A3 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 348 of file JDAQCHSM.cc.

348 { JDAQCHSM::exit(); }
exit
Definition: JPizza.sh:36
void JDAQStateMachine::A4 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 350 of file JDAQCHSM.cc.

virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
virtual void actionConfigure(int, const char *)
Definition: JDAQCHSM.chsm:113
void JDAQStateMachine::A5 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 352 of file JDAQCHSM.cc.

352 { execute(&JDAQCHSM::actionReset, event); }
virtual void actionReset(int, const char *)
Definition: JDAQCHSM.chsm:118
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A6 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 354 of file JDAQCHSM.cc.

354  {
355 
356  std::istringstream is(std::string(ev_start->buffer, ev_start->length));
357 
358  is >> run_number >> detector_id;
359 
361 
362  }
JDAQStateMachine::ev_start_event ev_start
int run_number
Definition: JDAQCHSM.chsm:156
is
Definition: JDAQCHSM.chsm:167
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
then awk string
virtual void actionStart(int, const char *)
Definition: JDAQCHSM.chsm:114
int detector_id
Definition: JDAQCHSM.chsm:155
void JDAQStateMachine::A7 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 364 of file JDAQCHSM.cc.

364 { execute(&JDAQCHSM::actionQuit, event); }
virtual void actionQuit(int, const char *)
Definition: JDAQCHSM.chsm:119
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A8 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 366 of file JDAQCHSM.cc.

366 { execute(&JDAQCHSM::actionContinue, event); }
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
virtual void actionContinue(int, const char *)
Definition: JDAQCHSM.chsm:116
void JDAQStateMachine::A9 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 368 of file JDAQCHSM.cc.

368 { execute(&JDAQCHSM::actionStop, event); }
virtual void actionStop(int, const char *)
Definition: JDAQCHSM.chsm:117
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A10 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 370 of file JDAQCHSM.cc.

370 { execute(&JDAQCHSM::actionPause, event); }
virtual void actionPause(int, const char *)
Definition: JDAQCHSM.chsm:115
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A11 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 372 of file JDAQCHSM.cc.

372 { execute(&JDAQCHSM::actionRecover, event); }
virtual void actionRecover(int, const char *)
Definition: JDAQCHSM.chsm:125
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A12 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 374 of file JDAQCHSM.cc.

374 { JDAQCHSM::exit(); }
exit
Definition: JPizza.sh:36
void JDAQStateMachine::A13 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 376 of file JDAQCHSM.cc.

376 { execute(&JDAQCHSM::actionCheck, event); }
virtual void actionCheck(int, const char *)
Definition: JDAQCHSM.chsm:121
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A14 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 378 of file JDAQCHSM.cc.

378 { execute(&JDAQCHSM::actionInput, event); }
virtual void actionInput(int, const char *)
Definition: JDAQCHSM.chsm:122
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::EAM4root ( CHSM_ns_alias::state const &  chsm_state_,
CHSM_ns_alias::event const &  event 
)
inherited

Definition at line 337 of file JDAQCHSM.cc.

337  {
338 #line 164 "JDAQCHSM.chsm"
339  CHSM_ns_alias::cluster const &state = (CHSM_ns_alias::cluster const&)chsm_state_; actionEnter(); }
virtual void actionEnter()
Interface methods for actions corresponding to state transitions.
Definition: JDAQCHSM.chsm:109
void JDAQStateMachine::XAM4root ( CHSM_ns_alias::state const &  chsm_state_,
CHSM_ns_alias::event const &  event 
)
inherited

Definition at line 340 of file JDAQCHSM.cc.

340  {
341 #line 165 "JDAQCHSM.chsm"
342  CHSM_ns_alias::cluster const &state = (CHSM_ns_alias::cluster const&)chsm_state_; actionExit(); }
virtual void actionExit()
Definition: JDAQCHSM.chsm:110
const std::string& JDAQCHSM::getName ( ) const
inlineinherited

Get name of state machine.

Returns
name

Definition at line 78 of file JDAQCHSM.chsm.

79  {
80  return name;
81  }
std::string name
Definition: JDAQCHSM.chsm:154
const std::string& JDAQCHSM::getName ( ) const
inlineinherited

Get name of state machine.

Returns
name

Definition at line 89 of file JDAQCHSM.hh.

90  {
91  return name;
92  }
std::string name
Definition: JDAQCHSM.chsm:154
int JDAQCHSM::getDetectorID ( ) const
inlineinherited

Get detector identifier.

Returns
detector identifier.

Definition at line 89 of file JDAQCHSM.chsm.

90  {
91  return detector_id;
92  }
int detector_id
Definition: JDAQCHSM.chsm:155
int JDAQCHSM::getDetectorID ( ) const
inlineinherited

Get detector identifier.

Returns
detector identifier.

Definition at line 100 of file JDAQCHSM.hh.

101  {
102  return detector_id;
103  }
int detector_id
Definition: JDAQCHSM.chsm:155
int JDAQCHSM::getRunNumber ( ) const
inlineinherited

Get run number.

Returns
run number

Definition at line 100 of file JDAQCHSM.chsm.

101  {
102  return run_number;
103  }
int run_number
Definition: JDAQCHSM.chsm:156
int JDAQCHSM::getRunNumber ( ) const
inlineinherited

Get run number.

Returns
run number

Definition at line 111 of file JDAQCHSM.hh.

112  {
113  return run_number;
114  }
int run_number
Definition: JDAQCHSM.chsm:156
virtual void JDAQCHSM::actionEnter ( )
inlinevirtualinherited

Interface methods for actions corresponding to state transitions.

Reimplemented in KM3NETDAQ::JDataFilter, KM3NETDAQ::DataQueue, JDAQDemoClient, AcousticDataFilter, and KM3NETDAQ::MonitorRouter.

Definition at line 109 of file JDAQCHSM.chsm.

109 {}
virtual void JDAQCHSM::actionEnter ( )
inlinevirtualinherited

Interface methods for actions corresponding to state transitions.

Reimplemented in KM3NETDAQ::JDataFilter, KM3NETDAQ::DataQueue, JDAQDemoClient, AcousticDataFilter, and KM3NETDAQ::MonitorRouter.

Definition at line 120 of file JDAQCHSM.hh.

120 {}
virtual void JDAQCHSM::actionExit ( )
inlinevirtualinherited
virtual void JDAQCHSM::actionExit ( )
inlinevirtualinherited
virtual void JDAQCHSM::actionInit ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionInit ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionConfigure ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionConfigure ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionStart ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionStart ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionPause ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionPause ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionContinue ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionContinue ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionStop ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionStop ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionReset ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionReset ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionQuit ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionQuit ( int  ,
const char *   
)
inlinevirtualinherited
virtual void JDAQCHSM::actionError ( )
inlinevirtualinherited

Definition at line 124 of file JDAQCHSM.chsm.

124 {}
virtual void JDAQCHSM::actionError ( )
inlinevirtualinherited

Definition at line 135 of file JDAQCHSM.hh.

135 {}
virtual void JDAQCHSM::actionRecover ( int  ,
const char *   
)
inlinevirtualinherited

Definition at line 125 of file JDAQCHSM.chsm.

125 {}
virtual void JDAQCHSM::actionRecover ( int  ,
const char *   
)
inlinevirtualinherited

Definition at line 136 of file JDAQCHSM.hh.

136 {}
const std::string& KM3NETDAQ::JDAQClient_t::getHostname ( ) const
inlineinherited

Get hostname.

Returns
host name

Definition at line 109 of file JDAQClient.hh.

110  {
111  return hostname;
112  }
const std::string& KM3NETDAQ::JDAQClient_t::getFullName ( ) const
inlineinherited

Get full name of this run control client.

Returns
full name

Definition at line 120 of file JDAQClient.hh.

121  {
122  return fullname;
123  }
const JTag& KM3NETDAQ::JDAQClient_t::getUniqueTag ( ) const
inlineinherited

Get unique tag of this run control client.

Returns
unique tag

Definition at line 131 of file JDAQClient.hh.

132  {
133  return unique_tag;
134  }
long long int KM3NETDAQ::JDAQClient_t::getClockDelay ( ) const
inlineinherited

Get total delay time.

Returns
delay time [us]

Definition at line 142 of file JDAQClient.hh.

143  {
144  return clock.getDelay();
145  }
long long int getDelay() const
Get total delay time.
Definition: JTimekeeper.hh:78
JTimekeeper clock
central clock
Definition: JDAQClient.hh:207
long long int KM3NETDAQ::JDAQClient_t::getClockInterval ( ) const
inlineinherited

Get interval time.

Returns
interval time [us]

Definition at line 154 of file JDAQClient.hh.

155  {
156  return clock.getInterval();
157  }
JTimekeeper clock
central clock
Definition: JDAQClient.hh:207
long long int getInterval() const
Get interval time.
Definition: JTimekeeper.hh:67
void KM3NETDAQ::JDAQClient_t::setClockInterval ( const long long int  interval_us)
inlineinherited

Set interval time.

Parameters
interval_usinterval time [us]

Definition at line 165 of file JDAQClient.hh.

166  {
167  clock.setInterval(interval_us);
168  }
JTimekeeper clock
central clock
Definition: JDAQClient.hh:207
void setInterval(const long long int interval_us)
Set interval time.
Definition: JTimekeeper.hh:89
void KM3NETDAQ::JDAQClient_t::resetClock ( )
inlineinherited

Reset clock.

Definition at line 174 of file JDAQClient.hh.

175  {
176  clock.reset();
177  }
JTimekeeper clock
central clock
Definition: JDAQClient.hh:207
void reset(const long long int t0)
Reset time.
Definition: JTimekeeper.hh:100
const std::string& KM3NETDAQ::JDAQClient_t::getEventInfo ( ) const
inlineinherited

Get last event information.

Returns
event information

Definition at line 185 of file JDAQClient.hh.

186  {
187  return event_info;
188  }
std::string event_info
event information
Definition: JDAQClient.hh:208
void KM3NETDAQ::JDAQClient_t::setEventInfo ( const std::string info)
inlineinherited

Set last event information.

Parameters
infoevent information

Definition at line 196 of file JDAQClient.hh.

197  {
198  this->event_info = info;
199  }
std::string event_info
event information
Definition: JDAQClient.hh:208

Member Data Documentation

JSharedPointer<JControlHost> KM3NETDAQ::JDAQClient::server
protected

message server

Definition at line 826 of file JDAQClient.hh.

JMessageLogger KM3NETDAQ::JDAQClient::logger
protected

message logger

Definition at line 827 of file JDAQClient.hh.

JSelectReader KM3NETDAQ::JDAQClient::select
private

select call

Definition at line 1056 of file JDAQClient.hh.

JParser KM3NETDAQ::JDAQClient::parser
private

parser method enter()

Definition at line 1057 of file JDAQClient.hh.

JSubscriptionList KM3NETDAQ::JDAQClient::subscription
private

custom subscription

Definition at line 1058 of file JDAQClient.hh.

JDAQStateMachine::state_root JDAQStateMachine::root
inherited
JDAQStateMachine::state_Main JDAQStateMachine::Main
inherited
JDAQStateMachine::ev_daq_event JDAQStateMachine::ev_daq
inherited
char JDAQStateMachine::ev_daq_param_block[sizeof(ev_daq_event::param_block)]
inherited

Definition at line 238 of file JDAQCHSM.hh.

JDAQStateMachine::ev_init_event JDAQStateMachine::ev_init
inherited
char JDAQStateMachine::ev_init_param_block[sizeof(ev_init_event::param_block)]
inherited

Definition at line 258 of file JDAQCHSM.hh.

JDAQStateMachine::ev_configure_event JDAQStateMachine::ev_configure
inherited
char JDAQStateMachine::ev_configure_param_block[sizeof(ev_configure_event::param_block)]
inherited

Definition at line 278 of file JDAQCHSM.hh.

JDAQStateMachine::ev_start_event JDAQStateMachine::ev_start
inherited
char JDAQStateMachine::ev_start_param_block[sizeof(ev_start_event::param_block)]
inherited

Definition at line 298 of file JDAQCHSM.hh.

JDAQStateMachine::ev_pause_event JDAQStateMachine::ev_pause
inherited
char JDAQStateMachine::ev_pause_param_block[sizeof(ev_pause_event::param_block)]
inherited

Definition at line 318 of file JDAQCHSM.hh.

JDAQStateMachine::ev_continue_event JDAQStateMachine::ev_continue
inherited
char JDAQStateMachine::ev_continue_param_block[sizeof(ev_continue_event::param_block)]
inherited

Definition at line 338 of file JDAQCHSM.hh.

JDAQStateMachine::ev_stop_event JDAQStateMachine::ev_stop
inherited
char JDAQStateMachine::ev_stop_param_block[sizeof(ev_stop_event::param_block)]
inherited

Definition at line 358 of file JDAQCHSM.hh.

JDAQStateMachine::ev_reset_event JDAQStateMachine::ev_reset
inherited
char JDAQStateMachine::ev_reset_param_block[sizeof(ev_reset_event::param_block)]
inherited

Definition at line 378 of file JDAQCHSM.hh.

JDAQStateMachine::ev_quit_event JDAQStateMachine::ev_quit
inherited
char JDAQStateMachine::ev_quit_param_block[sizeof(ev_quit_event::param_block)]
inherited

Definition at line 398 of file JDAQCHSM.hh.

JDAQStateMachine::ev_off_event JDAQStateMachine::ev_off
inherited
char JDAQStateMachine::ev_off_param_block[sizeof(ev_off_event::param_block)]
inherited

Definition at line 418 of file JDAQCHSM.hh.

JDAQStateMachine::ev_check_event JDAQStateMachine::ev_check
inherited
char JDAQStateMachine::ev_check_param_block[sizeof(ev_check_event::param_block)]
inherited

Definition at line 438 of file JDAQCHSM.hh.

JDAQStateMachine::ev_input_event JDAQStateMachine::ev_input
inherited
char JDAQStateMachine::ev_input_param_block[sizeof(ev_input_event::param_block)]
inherited

Definition at line 458 of file JDAQCHSM.hh.

JDAQStateMachine::ev_recover_event JDAQStateMachine::ev_recover
inherited
char JDAQStateMachine::ev_recover_param_block[sizeof(ev_recover_event::param_block)]
inherited

Definition at line 478 of file JDAQCHSM.hh.

JDAQStateMachine::ev_error_event JDAQStateMachine::ev_error
inherited
char JDAQStateMachine::ev_error_param_block[sizeof(ev_error_event::param_block)]
inherited

Definition at line 495 of file JDAQCHSM.hh.

std::string JDAQCHSM::name
protectedinherited

Definition at line 154 of file JDAQCHSM.chsm.

int JDAQCHSM::detector_id
protectedinherited

Definition at line 155 of file JDAQCHSM.chsm.

int JDAQCHSM::run_number
protectedinherited

Definition at line 156 of file JDAQCHSM.chsm.

const int KM3NETDAQ::JDAQClient_t::TIMEOUT_S = 1
staticinherited

time out of update [s]

Definition at line 63 of file JDAQClient.hh.

JEventTable KM3NETDAQ::JDAQClient_t::eventTable
protectedinherited

event table

Definition at line 203 of file JDAQClient.hh.

std::string KM3NETDAQ::JDAQClient_t::hostname
protectedinherited

Definition at line 204 of file JDAQClient.hh.

std::string KM3NETDAQ::JDAQClient_t::fullname
protectedinherited

Definition at line 205 of file JDAQClient.hh.

JTag KM3NETDAQ::JDAQClient_t::unique_tag
protectedinherited

Definition at line 206 of file JDAQClient.hh.

JTimekeeper KM3NETDAQ::JDAQClient_t::clock
protectedinherited

central clock

Definition at line 207 of file JDAQClient.hh.

std::string KM3NETDAQ::JDAQClient_t::event_info
protectedinherited

event information

Definition at line 208 of file JDAQClient.hh.


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