16 using namespace KM3NETDAQ;
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 if (
getName() ==
"JDAQDemoClient/-") {
107 istringstream
is(
string(buffer,length));
109 int us1 = 0, us2 = 0;
111 if (is >> us1 >> us2 && us1 > 0 && us2 > 0) {
115 JErrorStream(logger) <<
"Time to sleep/kill " << us1 <<
"/" << us2 <<
" us";
119 shell <<
"(usleep " << us2 <<
"; kill -9 " << getpid() <<
") &" << endl;
128 JDebugStream(logger) <<
"actionStart(" << std::string(buffer,length) <<
")";
133 JDebugStream(logger) <<
"actionPause(" << std::string(buffer,length) <<
")";
138 JDebugStream(logger) <<
"actionContinue(" << std::string(buffer,length) <<
")";
143 JDebugStream(logger) <<
"actionStop(" << std::string(buffer,length) <<
")";
148 JDebugStream(logger) <<
"actionReset(" << std::string(buffer,length) <<
")";
153 JDebugStream(logger) <<
"actionQuit(" << std::string(buffer,length) <<
")";
161 int main(
int argc,
char* argv[])
165 using namespace KM3NETDAQ;
178 JParser<> zap(
"Application for writing real-time data to disk.");
191 catch(
const exception &error) {
192 FATAL(error.what() << endl);
204 if (file_name ==
"") {
216 demo.debug(CHSM::machine::D_all);
218 demo.CHSM::machine::enter();
220 ifstream
in(file_name.c_str());
The JShell clas can be used to interact with the shell via I/O streams.
JDAQDemoClient(const std::string &name)
Constructor.
Utility class to parse command line options.
int main(int argc, char *argv[])
virtual void actionEnter()
Interface methods for actions corresponding to state transitions.
std::string getProcessName(const std::string &name, const std::string &process)
Get process name of run control client.
Message logging based on std::ostream.
Interface for logging messages.
Message logging based on ControlHost.
virtual void actionExit()
void run()
Run as run control client following command messages via JNET::JControlHost.
virtual void actionQuit(int length, const char *buffer)
virtual void actionConfigure(int length, const char *buffer)
virtual void actionInit(int length, const char *buffer)
virtual void actionPause(int length, const char *buffer)
JDAQDemoClient(const std::string &name, const std::string &server, JLogger *logger, const int level)
Constructor.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Level specific message streamers.
General purpose messaging.
virtual void actionStart(int length, const char *buffer)
then fatal The output file must have the wildcard in the name
virtual void actionContinue(int length, const char *buffer)
JDAQDemoClient(const std::string &name, JLogger *logger, const int level)
Constructor.
Control unit client base class.
then fatal The output file must have the wildcard in the e g root fi 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
Utility class to parse command line options.
static JShell & getInstance()
Get reference to unique instance of this class object.
Shell interaction via I/O streams.
virtual void actionReset(int length, const char *buffer)
virtual bool enter(const JArgs &args)
Enter the state machine.
const char * getName()
Get ROOT name of given data type.
virtual void actionStop(int length, const char *buffer)