Go to the documentation of this file.
41 const std::string& server,
71 logger.debug(
"actionEnter()");
76 logger.debug(
"actionExit()");
78 if (
getName() ==
"JDAQDemoClient/+") {
82 sleep(std::numeric_limits<unsigned int>::max());
91 JDebugStream(logger) <<
"actionInit(" << std::string(buffer,length) <<
")";
93 if (
string(buffer,length) == ev_error.name()) {
103 JDebugStream(logger) <<
"actionConfigure(" << std::string(buffer,length) <<
")";
105 istringstream is(
string(buffer,length));
107 int us1 = 0, us2 = 0;
109 if (is >> us1 >> us2) {
113 JErrorStream(logger) <<
"Time to sleep/kill " << us1 <<
"/" << us2 <<
" us";
117 shell <<
"(usleep " << us2 <<
"; kill -9 " << getpid() <<
") &" << endl;
125 JDebugStream(logger) <<
"actionStart(" << std::string(buffer,length) <<
")";
130 JDebugStream(logger) <<
"actionPause(" << std::string(buffer,length) <<
")";
135 JDebugStream(logger) <<
"actionContinue(" << std::string(buffer,length) <<
")";
140 JDebugStream(logger) <<
"actionStop(" << std::string(buffer,length) <<
")";
145 JDebugStream(logger) <<
"actionReset(" << std::string(buffer,length) <<
")";
150 JDebugStream(logger) <<
"actionQuit(" << std::string(buffer,length) <<
")";
158 int main(
int argc,
char* argv[])
175 JParser<> zap(
"Application for writing real-time data to disk.");
188 catch(
const exception &error) {
189 FATAL(error.what() << endl);
201 if (file_name ==
"") {
213 demo.debug(CHSM::machine::D_all);
215 demo.CHSM::machine::enter();
217 ifstream in(file_name.c_str());
Level specific message streamers.
Interface for logging messages.
virtual void actionStart(int length, const char *buffer)
virtual void actionContinue(int length, const char *buffer)
virtual void actionReset(int length, const char *buffer)
JDAQDemoClient(const std::string &name)
Constructor.
The JShell clas can be used to interact with the shell via I/O streams.
virtual void actionInit(int length, const char *buffer)
JDAQDemoClient(const std::string &name, const std::string &server, JLogger *logger, const int level)
Constructor.
virtual void actionStop(int length, const char *buffer)
void run()
Run as run control client following command messages via JNET::JControlHost.
virtual void actionConfigure(int length, const char *buffer)
Utility class to parse command line options.
int main(int argc, char *argv[])
Run control demo client.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
virtual void actionQuit(int length, const char *buffer)
Message logging based on std::ostream.
virtual void actionExit()
virtual void actionPause(int length, const char *buffer)
Control unit client base class.
Message logging based on ControlHost.
JDAQDemoClient(const std::string &name, JLogger *logger, const int level)
Constructor.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
const char * getName()
Get ROOT name of given data type.
virtual void actionEnter()
Interface methods for actions corresponding to state transitions.
KM3NeT DAQ data structures and auxiliaries.
static JShell & getInstance()
Get reference to unique instance of this class object.
std::string getProcessName(const std::string &name, const std::string &process)
Get process name of run control client.
virtual bool enter(const JArgs &args)
Enter the state machine.