#include #include #include #include #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" #include "JLogger/JStreamLogger.hh" #include "JLogger/JControlHostLogger.hh" #include "JRuncontrol/JDAQClient.hh" #include "JRuncontrol/JDAQDriver.hh" /** * \file * Run control driver program. * \author mdejong */ int main(int argc, char* argv[]) { using namespace std; string file_name; string server; string logger; bool use_cout; int timeout_s; int debug; try { JParser<> zap("Run control driver program."); zap['f'] = make_field(file_name); zap['H'] = make_field(server) = "localhost"; zap['M'] = make_field(logger) = "localhost"; zap['c'] = make_field(use_cout); zap['t'] = make_field(timeout_s) = 10; // [s] zap['d'] = make_field(debug) = 0; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } using namespace KM3NETDAQ; if (server == "localhost") server = JSYSTEM::getHostname(); if (logger == "localhost") logger = JSYSTEM::getHostname(); JClient::SERVER = server; JClient::LOGGER = logger; JLogger* out = NULL; if (use_cout) out = new JStreamLogger(cout); else out = new JControlHostLogger(logger); JDAQDriver driver(argv[0], server, out, debug, timeout_s); ifstream in(file_name.c_str()); driver.run(in); in.close(); }