Simple driver for run control clients.
More...
#include <JDAQDriver.hh>
|
| JDAQDriver (const std::string &name, const std::string &server, JLogger *logger, const int level, const int timeout_s) |
| Constructor. More...
|
|
virtual bool | enter () |
| Enter the state machine. More...
|
|
void | actionExit () |
| Exit the state machine. More...
|
|
virtual void | enterState (const CHSM::state &state, const CHSM::event &event) |
| Action when entering state. More...
|
|
bool | update (const bool no_wait) |
| Update client list with incoming ControlHost message. More...
|
|
virtual void | actionStart (int, const char *) |
|
virtual void | actionStop (int, const char *) |
|
void | run () |
| Run driver with user input. More...
|
|
void | run (std::istream &in) |
| Run driver. More...
|
|
void | update () |
| Update client list with incoming ControlHost messages until the client list is synchronised with the current state or until the timeout. More...
|
|
void | synchronise () |
| Synchronise clients. More...
|
|
void | filter (const std::string &target="") |
| Filter client list by putting failing clients to sleep. More...
|
|
virtual bool | enter (const JArgs &args) |
| 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_t * | findEvent (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 ¶meter) |
| Add parameter to parser used in method enter(). More...
|
|
template<class T > |
void | addParameter (const char option, T ¶meter, 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 (const int port) |
| Run for ever. 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::string & | getName () const |
| Get name of state machine. More...
|
|
int | getDetectorID () const |
| Get detector identifier. More...
|
|
int | getRunNumber () const |
| Get run number. More...
|
|
virtual void | actionEnter () |
| Interface methods for actions corresponding to state transitions. More...
|
|
virtual void | actionInit (int, const char *) |
|
virtual void | actionConfigure (int, const char *) |
|
virtual void | actionPause (int, const char *) |
|
virtual void | actionContinue (int, const char *) |
|
virtual void | actionReset (int, const char *) |
|
virtual void | actionQuit (int, const char *) |
|
virtual void | actionError () |
|
virtual void | actionRecover (int, const char *) |
|
const std::string & | getHostname () const |
| Get hostname. More...
|
|
const std::string & | getFullName () const |
| Get full name of this run control client. More...
|
|
const JTag & | getUniqueTag () 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...
|
|
int | getEventNumber () const |
| Get last event number. More...
|
|
void | setEventNumber (const int event_number) |
| Set last event number. More...
|
|
|
typedef void(JDAQCHSM::* | action) (int, const char *) |
| Type definition of action method. More...
|
|
|
static void | copy (std::istream &in, std::ostream &out, const char eol='\n') |
| Copy data from input to output stream. More...
|
|
|
void | configure () |
| Configure client. More...
|
|
std::string | getMessage (const CHSM::state &state, const CHSM::event &event) const |
| Get event message. 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...
|
|
Simple driver for run control clients.
This class can be used to start a set of run control clients, trigger events and eventually stop the clients.
Definition at line 35 of file JDAQDriver.hh.
◆ action
typedef void(JDAQCHSM::* JDAQCHSM::action) (int, const char *) |
|
protectedinherited |
Type definition of action method.
Definition at line 152 of file JDAQCHSM.hh.
◆ JDAQDriver()
KM3NETDAQ::JDAQDriver::JDAQDriver |
( |
const std::string & |
name, |
|
|
const std::string & |
server, |
|
|
JLogger * |
logger, |
|
|
const int |
level, |
|
|
const int |
timeout_s |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
name | name of driver |
server | name of command message server |
logger | logger |
level | debug level |
timeout_s | timeout_s [s] |
Definition at line 48 of file JDAQDriver.hh.
◆ enter() [1/2]
virtual bool KM3NETDAQ::JDAQDriver::enter |
( |
| ) |
|
|
inlinevirtual |
Enter the state machine.
The driver will subscribe to the ControlHost tags corresponding to born, died and reply messages of the clients instead of the standard tags for run control commands. The clients are started after the driver is ready to receive ControlHost messages. In case of an error, a message is printed on the terminal and the state machine is not entered.
Reimplemented from KM3NETDAQ::JDAQClient.
Definition at line 67 of file JDAQDriver.hh.
70 using namespace JLANG;
111 if (i->isActive() && i->getBorn() <= i->getDied()) {
112 JWarningStream(
logger) <<
"client " << i->getFullName() <<
" did not start.";
117 return CHSM::machine::enter();
120 cerr <<
"Timeout at subscription." << endl;
124 cerr << error << endl;
128 cerr <<
"Message server or logger not properly initialised." << endl;
◆ actionExit()
void KM3NETDAQ::JDAQDriver::actionExit |
( |
| ) |
|
|
inlinevirtual |
Exit the state machine.
This method waits for the clients to terminate using the died message generated by ControlHost. In case of a timeout, the process is terminated by calling the method stop() of the corresponding client.
Reimplemented from JDAQCHSM.
Definition at line 141 of file JDAQDriver.hh.
144 using namespace JLANG;
157 JWarningStream(
logger) <<
"Timeout at transition " <<
"exit(); forced stop.";
◆ enterState()
virtual void KM3NETDAQ::JDAQDriver::enterState |
( |
const CHSM::state & |
state, |
|
|
const CHSM::event & |
event |
|
) |
| |
|
inlinevirtual |
Action when entering state.
This method waits for all clients to produce the enter state message. In case of a timeout, no specific action is taken but an error message is logged.
- Parameters
-
state | entered state |
event | event that triggered transition |
Reimplemented from KM3NETDAQ::JDAQClient.
Definition at line 172 of file JDAQDriver.hh.
182 JWarningStream(
logger) <<
"Timeout at transition " <<
event.name() <<
" to state " << state.name();
◆ update() [1/2]
bool KM3NETDAQ::JDAQDriver::update |
( |
const bool |
no_wait | ) |
|
|
inline |
Update client list with incoming ControlHost message.
This method receives and processes a message. The client list is updated accordingly. If the no-wait option is set to true, it returns in the absence of a pending message immediately. The return value is then false. If the no-wait option is set to false, it waits until the next message is received.
- Parameters
-
- Returns
- true if message received; else false
Definition at line 198 of file JDAQDriver.hh.
201 using namespace JNET;
207 long long int length = 0;
209 if ( no_wait &&
server->CheckHead(tag, length) <= 0) {
return false; }
210 if (!no_wait &&
server->WaitHead (tag, length) < 0) {
return false; }
212 char* data=
new char[length];
214 server->GetFullData(data, length);
216 const string buffer(data, length);
220 JDebugStream(
logger) <<
"Got message " << tag <<
' ' << buffer;
226 }
else if (buffer.find(
getFullName()) != string::npos) {
235 JClientList::iterator i =
clientList.find(buffer);
239 i->update(tag, buffer);
243 JErrorStream(
logger) <<
"Message fom illegal client " << buffer;
253 istringstream is(buffer);
263 client.update(tag, buffer);
264 client.setMode(JClient::ILLEGAL);
268 JWarningStream(
logger) <<
"Added illegal client " << client.getFullName();
276 JErrorStream(
logger) << error;
284 JErrorStream(
logger) << error;
◆ actionStart()
virtual void KM3NETDAQ::JDAQDriver::actionStart |
( |
int |
, |
|
|
const char * |
|
|
) |
| |
|
inlinevirtual |
◆ actionStop()
virtual void KM3NETDAQ::JDAQDriver::actionStop |
( |
int |
, |
|
|
const char * |
|
|
) |
| |
|
inlinevirtual |
◆ run() [1/3]
void KM3NETDAQ::JDAQDriver::run |
( |
| ) |
|
|
inline |
◆ run() [2/3]
void KM3NETDAQ::JDAQDriver::run |
( |
std::istream & |
in | ) |
|
|
inline |
Run driver.
Example input format:
# comment line.
process <process name> <host name> [<start command>];
# The following tokens in <start command> will be substituted:
# $HOST$ by <host name>;
# $NAME$ by <process name>;
# $SERVER$ by JClient::SERVER;
# $LOGGER$ by JClient::LOGGER;
# $ARGS$ by part following '/' in <process name>;
# enter state machine.
enter
# trigger event
# data can be provided online and mixed with data from a separate file (optional).
# multiple tags should be separated by a new line.
event <event name> {
[<tag 1> [data]]
[<tag 2> [data][%<file name>%][data]]
}
# optionally quit before end of input
[quit]
# optionally kill processes that did not properly terminate.
[exit]
- Parameters
-
Definition at line 350 of file JDAQDriver.hh.
354 for (
string key; in >> key; ) {
358 in.ignore(numeric_limits<streamsize>::max(),
'\n');
360 }
else if (key ==
"enter") {
365 cerr <<
"State machine not entered; abort." << endl;
369 }
else if (key ==
"exit") {
374 }
else if (key ==
"quit") {
378 }
else if (key ==
"sleep") {
386 }
else if (key ==
"process") {
392 istringstream is(buffer);
398 client.setMode(JClient::ACTIVE);
401 JWarningStream(
logger) <<
"Process already exists " << client;
405 JErrorStream(
logger) <<
"Error reading key word process.";
408 }
else if (key ==
"event" || key ==
"event*") {
413 const char eol =
'\n';
415 if (in >> event >> c && c ==
'{' &&
getline(in, buffer,
'}')) {
423 if (pev->active() || key ==
"event*") {
425 istringstream is(buffer);
427 for (
string tag; is >> tag; ) {
435 server->PutFullString(tag, os.str());
438 if (key !=
"event*") {
443 JErrorStream(
logger) <<
"Inactive event " << event;
447 JErrorStream(
logger) <<
"Unknown event " << event;
451 JErrorStream(
logger) <<
"No active client to trigger event.";
455 JErrorStream(
logger) <<
"Error reading key word event.";
458 }
else if (key ==
"message") {
463 if (in >> tag &&
getline(in, buffer,
';'))
464 server->PutFullString(tag, buffer);
466 JErrorStream(
logger) <<
"Invalid message: <" << tag <<
"> \"" << buffer <<
"\"";
468 }
else if (key ==
"print") {
471 JNoticeStream(
logger) << i->getFullName() <<
' '
472 << i->getStartCommand() <<
' '
473 << i->getAlive() <<
' '
474 << i->getStatename();
477 }
else if (key ==
"filter") {
484 for (istringstream is(buffer); is >> client; ) {
488 }
else if (key ==
"sync") {
494 JErrorStream(
logger) <<
"Unknown key: " << key;
496 in.ignore(numeric_limits<streamsize>::max(),
'\n');
◆ update() [2/2]
void KM3NETDAQ::JDAQDriver::update |
( |
| ) |
|
|
inline |
Update client list with incoming ControlHost messages until the client list is synchronised with the current state or until the timeout.
Definition at line 506 of file JDAQDriver.hh.
510 const CHSM::parent& parent = static_cast<const CHSM::parent&>(
Main.
RunControl);
512 for (CHSM::parent::const_iterator state = parent.begin(); state != parent.end(); ++state) {
514 if (state->active()) {
◆ synchronise()
void KM3NETDAQ::JDAQDriver::synchronise |
( |
| ) |
|
|
inline |
Synchronise clients.
Definition at line 529 of file JDAQDriver.hh.
533 const CHSM::parent& parent = static_cast<const CHSM::parent&>(
Main.
RunControl);
535 for (CHSM::parent::const_iterator state = parent.begin(); state != parent.end(); ++state) {
537 if (state->active()) {
541 JDebugStream(
logger) <<
"Synchronising " << state->name();
545 if (i->getMode() == JClient::ACTIVE) {
547 if (!i->getAlive()) {
557 if (buffer.find(i->getHostname()) == string::npos) {
558 JErrorStream(
logger) << i->getFullName() <<
" running on " << buffer <<
" but not alive.";
563 JErrorStream(
logger) << error;
567 if (i->getAlive() && i->getStatename() != state->name()) {
582 JWarningStream(
logger) <<
"Timeout at synchronisation.";
◆ filter() [1/2]
void KM3NETDAQ::JDAQDriver::filter |
( |
const std::string & |
target = "" | ) |
|
|
inline |
Filter client list by putting failing clients to sleep.
In this, only clients with names that contain the given character sequence are considered.
- Parameters
-
target | target name of client(s) |
Definition at line 596 of file JDAQDriver.hh.
598 const CHSM::parent& parent = static_cast<const CHSM::parent&>(
Main.
RunControl);
600 for (CHSM::parent::const_iterator state = parent.begin(); state != parent.end(); ++state) {
602 if (state->active()) {
606 if (target ==
"" || i->getName().find(target) != std::string::npos) {
608 if (!i->getAlive() || i->getStatename() != state->name()) {
610 JNoticeStream(
logger) <<
"Put to sleep " << i->getFullName();
612 i->setMode(JClient::SLEEP);
◆ copy()
static void KM3NETDAQ::JDAQDriver::copy |
( |
std::istream & |
in, |
|
|
std::ostream & |
out, |
|
|
const char |
eol = '\n' |
|
) |
| |
|
inlinestaticprotected |
Copy data from input to output stream.
Tagged file names are recursively expanded.
- Parameters
-
in | input stream |
out | output stream |
eol | end of line |
Definition at line 636 of file JDAQDriver.hh.
642 if (
getline(in, buffer, eol)) {
644 for (string::size_type pos = 0; pos < buffer.length(); ) {
649 if (lpos != string::npos &&
650 rpos != string::npos) {
652 out << buffer.substr(pos, lpos);
657 ifstream file(buffer.substr(pos, rpos - lpos).c_str());
659 copy(file, out,
'\0');
666 out << buffer.substr(pos);
668 pos += buffer.substr(pos).length();
◆ enter() [2/2]
virtual bool KM3NETDAQ::JDAQClient::enter |
( |
const JArgs & |
args | ) |
|
|
inlinevirtualinherited |
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
-
args | array of command line arguments |
- Returns
- true if okay; else false
Definition at line 363 of file JDAQClient.hh.
383 catch(
const exception &error) {
384 cerr << error.what() << endl;
399 this->server.reset(
new JControlHost(
server));
403 catch(
const JControlHostException& error) {
404 cerr << error << endl;
◆ exit()
virtual bool KM3NETDAQ::JDAQClient::exit |
( |
| ) |
|
|
inlinevirtualinherited |
Exit the state machine.
This method releases the various resources.
- Returns
- true if okay; else false
Definition at line 456 of file JDAQClient.hh.
461 catch(
const JControlHostException& error) {
467 catch(
const JControlHostException& error) {
470 return CHSM::machine::exit();
◆ isRunning()
bool KM3NETDAQ::JDAQClient::isRunning |
( |
| ) |
const |
|
inlineinherited |
Check if this client is in runnig state.
- Returns
- true if running; else false
Definition at line 479 of file JDAQClient.hh.
◆ replaceEvent()
void KM3NETDAQ::JDAQClient::replaceEvent |
( |
const JTag & |
oldTag, |
|
|
const JTag & |
newTag, |
|
|
JDAQEvent_t & |
event |
|
) |
| |
|
inlineinherited |
Replace tag of given event in event table.
- Parameters
-
oldTag | old tag |
newTag | new tag |
event | event |
Definition at line 492 of file JDAQClient.hh.
◆ findEvent()
JDAQEvent_t* KM3NETDAQ::JDAQClient::findEvent |
( |
const JTag & |
tag, |
|
|
const std::string & |
event_name |
|
) |
| |
|
inlineinherited |
Find event in event table.
- Parameters
-
tag | tag |
event_name | event name |
- Returns
- pointer to event or NULL
Definition at line 507 of file JDAQClient.hh.
◆ addSubscription()
void KM3NETDAQ::JDAQClient::addSubscription |
( |
const JSubscription & |
subscription | ) |
|
|
inlineinherited |
Add custom subscription.
- Parameters
-
Definition at line 523 of file JDAQClient.hh.
◆ addParameter() [1/2]
template<class T >
void KM3NETDAQ::JDAQClient::addParameter |
( |
const char |
option, |
|
|
T & |
parameter |
|
) |
| |
|
inlineinherited |
Add parameter to parser used in method enter().
- Parameters
-
option | option |
parameter | parameter |
Definition at line 536 of file JDAQClient.hh.
◆ addParameter() [2/2]
template<class T >
void KM3NETDAQ::JDAQClient::addParameter |
( |
const char |
option, |
|
|
T & |
parameter, |
|
|
const T & |
value |
|
) |
| |
|
inlineinherited |
Add parameter to parser used in method enter().
- Parameters
-
option | option |
parameter | parameter |
value | default value |
Definition at line 550 of file JDAQClient.hh.
◆ setSelect() [1/2]
void KM3NETDAQ::JDAQClient::setSelect |
( |
| ) |
|
|
inlineinherited |
Set the file descriptor mask for the select call.
Definition at line 559 of file JDAQClient.hh.
◆ setSelect() [2/2]
◆ actionSelect()
◆ actionRunning()
virtual void KM3NETDAQ::JDAQClient::actionRunning |
( |
| ) |
|
|
inlinevirtualinherited |
◆ actionInput()
virtual void KM3NETDAQ::JDAQClient::actionInput |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtualinherited |
◆ filter() [2/2]
virtual bool KM3NETDAQ::JDAQClient::filter |
( |
const JTag & |
tag, |
|
|
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtualinherited |
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
-
tag | tag |
length | number of characters |
buffer | message |
- Returns
- skip message or not
Definition at line 633 of file JDAQClient.hh.
◆ actionTagged()
virtual void KM3NETDAQ::JDAQClient::actionTagged |
( |
const JTag & |
tag, |
|
|
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtualinherited |
This method is called when a custom tag is encountered.
- Parameters
-
tag | tag |
length | length of data |
buffer | pointer to data |
Reimplemented in KM3NETDAQ::JDataFilter.
Definition at line 646 of file JDAQClient.hh.
◆ run() [3/3]
void KM3NETDAQ::JDAQClient::run |
( |
const int |
port | ) |
|
|
inlineinherited |
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
-
Definition at line 741 of file JDAQClient.hh.
743 JControlHostServer local_server(port);
747 JControlHost* ps = local_server.AcceptClient();
753 ps->WaitHead(prefix);
755 const int length = prefix.
getSize();
757 char* buffer =
new char[length];
759 ps->GetFullData(buffer, length);
760 ps->PutFullData(prefix.
toString(), buffer, length);
◆ configure()
void KM3NETDAQ::JDAQClient::configure |
( |
| ) |
|
|
inlineprivateinherited |
Configure client.
This method is used to setup the event table.
Definition at line 916 of file JDAQClient.hh.
◆ getMessage()
std::string KM3NETDAQ::JDAQClient::getMessage |
( |
const CHSM::state & |
state, |
|
|
const CHSM::event & |
event |
|
) |
| const |
|
inlineprivateinherited |
Get event message.
- Parameters
-
- Returns
- message
Definition at line 928 of file JDAQClient.hh.
930 std::ostringstream os;
◆ actionCheck()
virtual void KM3NETDAQ::JDAQClient::actionCheck |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlineprivatevirtualinherited |
This method is called at ev_check
and reports a system check by mimicing an enter state action.
- Parameters
-
length | number of characters |
buffer | message |
Reimplemented from JDAQCHSM.
Definition at line 963 of file JDAQClient.hh.
973 if (state->active()) {
◆ execute()
void KM3NETDAQ::JDAQClient::execute |
( |
action |
__action, |
|
|
const CHSM::event & |
__event |
|
) |
| |
|
inlineprivatevirtualinherited |
The method to execute the action.
- Parameters
-
__action | pointer to action method |
__event | event that triggered the action |
Implements JDAQCHSM.
Definition at line 990 of file JDAQClient.hh.
996 (this->*__action)(event->length, event->buffer);
998 catch(
const std::exception& error) {
999 JErrorStream(
logger) <<
"Error at event " << __event.name() <<
" \"" << error.what() <<
"\"; trigger ev_error.";
◆ getState()
const CHSM::state* KM3NETDAQ::JDAQClient::getState |
( |
| ) |
const |
|
inlineprivateinherited |
Get current state.
- Returns
- state
Definition at line 1010 of file JDAQClient.hh.
1013 if (state->active()) {
◆ A1()
void JDAQStateMachine::A1 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A2()
void JDAQStateMachine::A2 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A3()
void JDAQStateMachine::A3 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A4()
void JDAQStateMachine::A4 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A5()
void JDAQStateMachine::A5 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A6()
void JDAQStateMachine::A6 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A7()
void JDAQStateMachine::A7 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A8()
void JDAQStateMachine::A8 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A9()
void JDAQStateMachine::A9 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A10()
void JDAQStateMachine::A10 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A11()
void JDAQStateMachine::A11 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A12()
void JDAQStateMachine::A12 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A13()
void JDAQStateMachine::A13 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A14()
void JDAQStateMachine::A14 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ EAM4root()
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.
338 #line 164 "JDAQCHSM.chsm"
339 CHSM_ns_alias::cluster
const &state = (CHSM_ns_alias::cluster
const&)chsm_state_;
actionEnter(); }
◆ XAM4root()
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.
341 #line 165 "JDAQCHSM.chsm"
342 CHSM_ns_alias::cluster
const &state = (CHSM_ns_alias::cluster
const&)chsm_state_;
actionExit(); }
◆ getName()
const std::string& JDAQCHSM::getName |
( |
| ) |
const |
|
inlineinherited |
Get name of state machine.
- Returns
- name
Definition at line 89 of file JDAQCHSM.hh.
◆ getDetectorID()
int JDAQCHSM::getDetectorID |
( |
| ) |
const |
|
inlineinherited |
Get detector identifier.
- Returns
- detector identifier.
Definition at line 100 of file JDAQCHSM.hh.
◆ getRunNumber()
int JDAQCHSM::getRunNumber |
( |
| ) |
const |
|
inlineinherited |
Get run number.
- Returns
- run number
Definition at line 111 of file JDAQCHSM.hh.
◆ actionEnter()
virtual void JDAQCHSM::actionEnter |
( |
| ) |
|
|
inlinevirtualinherited |
◆ actionInit()
virtual void JDAQCHSM::actionInit |
( |
int |
, |
|
|
const char * |
|
|
) |
| |
|
inlinevirtualinherited |
◆ actionConfigure()
virtual void JDAQCHSM::actionConfigure |
( |
int |
, |
|
|
const char * |
|
|
) |
| |
|
inlinevirtualinherited |
◆ actionPause()
virtual void JDAQCHSM::actionPause |
( |
int |
, |
|
|
const char * |
|
|
) |
| |
|
inlinevirtualinherited |
◆ actionContinue()
virtual void JDAQCHSM::actionContinue |
( |
int |
, |
|
|
const char * |
|
|
) |
| |
|
inlinevirtualinherited |
◆ actionReset()
virtual void JDAQCHSM::actionReset |
( |
int |
, |
|
|
const char * |
|
|
) |
| |
|
inlinevirtualinherited |
◆ actionQuit()
virtual void JDAQCHSM::actionQuit |
( |
int |
, |
|
|
const char * |
|
|
) |
| |
|
inlinevirtualinherited |
◆ actionError()
virtual void JDAQCHSM::actionError |
( |
| ) |
|
|
inlinevirtualinherited |
◆ actionRecover()
virtual void JDAQCHSM::actionRecover |
( |
int |
, |
|
|
const char * |
|
|
) |
| |
|
inlinevirtualinherited |
◆ getHostname()
const std::string& KM3NETDAQ::JDAQClient_t::getHostname |
( |
| ) |
const |
|
inlineinherited |
◆ getFullName()
const std::string& KM3NETDAQ::JDAQClient_t::getFullName |
( |
| ) |
const |
|
inlineinherited |
Get full name of this run control client.
- Returns
- full name
Definition at line 119 of file JDAQClient.hh.
◆ getUniqueTag()
const JTag& KM3NETDAQ::JDAQClient_t::getUniqueTag |
( |
| ) |
const |
|
inlineinherited |
Get unique tag of this run control client.
- Returns
- unique tag
Definition at line 130 of file JDAQClient.hh.
◆ getClockDelay()
long long int KM3NETDAQ::JDAQClient_t::getClockDelay |
( |
| ) |
const |
|
inlineinherited |
Get total delay time.
- Returns
- delay time [us]
Definition at line 141 of file JDAQClient.hh.
◆ getClockInterval()
long long int KM3NETDAQ::JDAQClient_t::getClockInterval |
( |
| ) |
const |
|
inlineinherited |
Get interval time.
- Returns
- interval time [us]
Definition at line 153 of file JDAQClient.hh.
◆ setClockInterval()
void KM3NETDAQ::JDAQClient_t::setClockInterval |
( |
const long long int |
interval_us | ) |
|
|
inlineinherited |
Set interval time.
- Parameters
-
interval_us | interval time [us] |
Definition at line 164 of file JDAQClient.hh.
◆ resetClock()
void KM3NETDAQ::JDAQClient_t::resetClock |
( |
| ) |
|
|
inlineinherited |
◆ getEventNumber()
int KM3NETDAQ::JDAQClient_t::getEventNumber |
( |
| ) |
const |
|
inlineinherited |
Get last event number.
- Returns
- event number
Definition at line 184 of file JDAQClient.hh.
◆ setEventNumber()
void KM3NETDAQ::JDAQClient_t::setEventNumber |
( |
const int |
event_number | ) |
|
|
inlineinherited |
◆ timeout_s
int KM3NETDAQ::JDAQDriver::timeout_s |
◆ clientList
◆ is_alive
bool KM3NETDAQ::JDAQDriver::is_alive |
|
protected |
◆ rc_log
std::string KM3NETDAQ::JDAQDriver::rc_log |
|
protected |
◆ server
◆ logger
◆ select
◆ parser
JParser KM3NETDAQ::JDAQClient::parser |
|
privateinherited |
◆ subscription
◆ root
◆ Main
◆ ev_daq_transitions
const int JDAQStateMachine::ev_daq_transitions |
|
staticprivateinherited |
◆ ev_daq
◆ ev_daq_param_block
char JDAQStateMachine::ev_daq_param_block[sizeof(ev_daq_event::param_block)] |
|
inherited |
◆ ev_init_transitions
const int JDAQStateMachine::ev_init_transitions |
|
staticprivateinherited |
◆ ev_init
◆ ev_init_param_block
char JDAQStateMachine::ev_init_param_block[sizeof(ev_init_event::param_block)] |
|
inherited |
◆ ev_configure_transitions
const int JDAQStateMachine::ev_configure_transitions |
|
staticprivateinherited |
◆ ev_configure
◆ ev_configure_param_block
char JDAQStateMachine::ev_configure_param_block[sizeof(ev_configure_event::param_block)] |
|
inherited |
◆ ev_start_transitions
const int JDAQStateMachine::ev_start_transitions |
|
staticprivateinherited |
◆ ev_start
◆ ev_start_param_block
char JDAQStateMachine::ev_start_param_block[sizeof(ev_start_event::param_block)] |
|
inherited |
◆ ev_pause_transitions
const int JDAQStateMachine::ev_pause_transitions |
|
staticprivateinherited |
◆ ev_pause
◆ ev_pause_param_block
char JDAQStateMachine::ev_pause_param_block[sizeof(ev_pause_event::param_block)] |
|
inherited |
◆ ev_continue_transitions
const int JDAQStateMachine::ev_continue_transitions |
|
staticprivateinherited |
◆ ev_continue
◆ ev_continue_param_block
char JDAQStateMachine::ev_continue_param_block[sizeof(ev_continue_event::param_block)] |
|
inherited |
◆ ev_stop_transitions
const int JDAQStateMachine::ev_stop_transitions |
|
staticprivateinherited |
◆ ev_stop
◆ ev_stop_param_block
char JDAQStateMachine::ev_stop_param_block[sizeof(ev_stop_event::param_block)] |
|
inherited |
◆ ev_reset_transitions
const int JDAQStateMachine::ev_reset_transitions |
|
staticprivateinherited |
◆ ev_reset
◆ ev_reset_param_block
char JDAQStateMachine::ev_reset_param_block[sizeof(ev_reset_event::param_block)] |
|
inherited |
◆ ev_quit_transitions
const int JDAQStateMachine::ev_quit_transitions |
|
staticprivateinherited |
◆ ev_quit
◆ ev_quit_param_block
char JDAQStateMachine::ev_quit_param_block[sizeof(ev_quit_event::param_block)] |
|
inherited |
◆ ev_off_transitions
const int JDAQStateMachine::ev_off_transitions |
|
staticprivateinherited |
◆ ev_off
◆ ev_off_param_block
char JDAQStateMachine::ev_off_param_block[sizeof(ev_off_event::param_block)] |
|
inherited |
◆ ev_check_transitions
const int JDAQStateMachine::ev_check_transitions |
|
staticprivateinherited |
◆ ev_check
◆ ev_check_param_block
char JDAQStateMachine::ev_check_param_block[sizeof(ev_check_event::param_block)] |
|
inherited |
◆ ev_input_transitions
const int JDAQStateMachine::ev_input_transitions |
|
staticprivateinherited |
◆ ev_input
◆ ev_input_param_block
char JDAQStateMachine::ev_input_param_block[sizeof(ev_input_event::param_block)] |
|
inherited |
◆ ev_recover_transitions
const int JDAQStateMachine::ev_recover_transitions |
|
staticprivateinherited |
◆ ev_recover
◆ ev_recover_param_block
char JDAQStateMachine::ev_recover_param_block[sizeof(ev_recover_event::param_block)] |
|
inherited |
◆ ev_error_transitions
const int JDAQStateMachine::ev_error_transitions |
|
staticprivateinherited |
◆ ev_error
◆ ev_error_param_block
char JDAQStateMachine::ev_error_param_block[sizeof(ev_error_event::param_block)] |
|
inherited |
◆ state_
CHSM_ns_alias::state* JDAQStateMachine::state_[11] |
|
privateinherited |
◆ transition_
const CHSM_ns_alias::transition JDAQStateMachine::transition_ |
|
staticprivateinherited |
◆ taken_
const CHSM_ns_alias::event* JDAQStateMachine::taken_[14] |
|
privateinherited |
◆ target_
CHSM_ns_alias::state* JDAQStateMachine::target_[14] |
|
privateinherited |
◆ name
std::string JDAQCHSM::name |
|
protectedinherited |
◆ detector_id
int JDAQCHSM::detector_id |
|
protectedinherited |
◆ run_number
◆ TIMEOUT_S
const int KM3NETDAQ::JDAQClient_t::TIMEOUT_S = 1 |
|
staticinherited |
◆ eventTable
◆ hostname
std::string KM3NETDAQ::JDAQClient_t::hostname |
|
protectedinherited |
◆ fullname
std::string KM3NETDAQ::JDAQClient_t::fullname |
|
protectedinherited |
◆ unique_tag
JTag KM3NETDAQ::JDAQClient_t::unique_tag |
|
protectedinherited |
◆ clock
◆ event_number
int KM3NETDAQ::JDAQClient_t::event_number |
|
protectedinherited |
The documentation for this class was generated from the following file:
virtual void actionStart(int, const char *)
Interface for logging messages.
static const std::string TOKEN_DELIMETER
void setSelect()
Set the file descriptor mask for the select call.
virtual void actionEnter()
Interface methods for actions corresponding to state transitions.
virtual void actionContinue(int, const char *)
Data structure to store command line arguments.
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void A5(CHSM_ns_alias::event const &)
virtual void enterState(const CHSM::state &state, const CHSM::event &event)
Action when entering state.
virtual void actionRecover(int, const char *)
virtual void actionReset(int, const char *)
JParser parser
parser method enter()
Exception for ControlHost.
void A3(CHSM_ns_alias::event const &)
JDAQStateMachine::ev_daq_event JDAQEvent_t
Type definition of a DAQ event.
JDAQStateMachine::ev_check_event ev_check
virtual bool enter()
Enter the state machine.
JFileDescriptorMask & getReaderMask()
Get reader mask.
JDAQEvent_t * findEvent(const JTag &tag, const std::string &event_name)
Find event in event table.
JTag getUniqueTag(const std::string &hostname, const std::string &name)
Get unique tag of run control client.
void run()
Run as run control client following command messages via JNET::JControlHost.
static const JNET::JTag RC_REPLY
void run()
Run driver with user input.
Structure to store the ToT mean and standard deviation of the hits produced by a nanobeacon in a sour...
const std::string & getName() const
Get name of state machine.
ControlHost client manager.
JLevel_t getLevel()
Get debug level.
void A6(CHSM_ns_alias::event const &)
JEventTable eventTable
event table
JSharedPointer< JControlHost > server
message server
Interprocess communication.
const_iterator find(const JTag &tag, const std::string &event_name) const
Find entry.
void setLevel(const int __level)
Set debug level.
JSelectReader select
select call
void reset(const long long int t0)
Reset time.
Auxiliary class to specify white space character(s) in currect locale.
static const std::string RUN_CONTROL_CLIENT
static int WhereIs(const std::string &host_name, const std::string &nick_name, std::string &answer)
Locate ControlHost client(s).
void A8(CHSM_ns_alias::event const &)
JDAQStateMachine::ev_start_event ev_start
virtual void actionPause(int, const char *)
static const std::string FILENAME_POSTFIX
void A2(CHSM_ns_alias::event const &)
void synchronise()
Synchronise clients.
Message logging based on std::ostream.
virtual bool exit()
Exit the state machine.
void A12(CHSM_ns_alias::event const &)
void setInterval(const long long int interval_us)
Set interval time.
virtual bool enter()
Enter the state machine.
JSubscriptionList & add(const JSubscription &subscription)
Add subscription.
virtual void actionConfigure(int, const char *)
static const JTag DISPTAG_Died("Died")
bool is_valid() const
Check validity of logger object.
virtual void actionQuit(int, const char *)
void A14(CHSM_ns_alias::event const &)
Message logging based on ControlHost.
void replace(const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event)
Replace entry in table.
void reset(JLogger *__logger=NULL)
Reset logger.
JDAQStateMachine::state_Main::state_RunControl RunControl
void A4(CHSM_ns_alias::event const &)
JDAQStateMachine::ev_error_event ev_error
JSubscriptionList subscription
custom subscription
JMessageLogger logger
message logger
static void copy(std::istream &in, std::ostream &out, const char eol='\n')
Copy data from input to output stream.
JDAQStateMachine::state_Main::state_RunControl::state_Operational Operational
Simple data structure to support I/O of equations (see class JLANG::JEquation).
virtual void actionCheck(int, const char *)
static const JNET::JTag RC_LOG
void A1(CHSM_ns_alias::event const &)
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
long long int getInterval() const
Get interval time.
const std::string & getFullName() const
Get full name of this run control client.
virtual void actionError()
void setReaderMask(const JAbstractFile &file)
Set reader mask.
Utility class to parse parameter values.
std::string getStateName(const std::string &name)
Get name of state.
void filter(const std::string &target="")
Filter client list by putting failing clients to sleep.
void A13(CHSM_ns_alias::event const &)
void A7(CHSM_ns_alias::event const &)
static const JNET::JTag RC_CMD
static const std::string FILENAME_PREFIX
virtual void actionStop(int, const char *)
virtual void actionExit()
void update()
Update client list with incoming ControlHost messages until the client list is synchronised with the ...
int event_number
number of last event
JDAQStateMachine::state_Main Main
static const JTag DISPTAG_Born("Born")
char getTokenDelimeter()
Get the token delimeter for command messages.
std::string toString() const
Convert tag to string.
JDAQClient(const std::string &name, const std::string &server, JLogger *logger, const int level)
Constructor.
Auxiliary classes and methods for language specific functionality.
virtual void actionInit(int, const char *)
int getSize() const
Get size.
virtual void actionInput(int, const char *)
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
void A11(CHSM_ns_alias::event const &)
long long int getDelay() const
Get total delay time.
void A10(CHSM_ns_alias::event const &)
JTimekeeper clock
central clock
int timeout_s
timeout of state transitions [s]
Auxiliary class for all subscription.
int read(const int argc, const char *const argv[])
Parse the program's command line options.
void A9(CHSM_ns_alias::event const &)