1 #include "artdaq/Application/TaskType.hh"
2 #include "artdaq/Application/BoardReaderApp.hh"
3 #include "artdaq/ExternalComms/MakeCommanderPlugin.hh"
4 #include "artdaq/Application/LoadParameterSet.hh"
5 #include "artdaq/BuildInfo/GetPackageBuildInfo.hh"
6 #include "artdaq/DAQdata/Globals.hh"
7 #include "cetlib_except/exception.h"
9 #include <boost/program_options.hpp>
10 #include <boost/lexical_cast.hpp>
15 int main(
int argc,
char* argv[])
17 artdaq::configureMessageFacility(
"boardreader");
19 fhicl::ParameterSet config = LoadParameterSet(argc, argv);
21 std::string name = config.get<std::string>(
"application_name",
"BoardReader");
22 auto rank = config.get<
int>(
"rank", 0);
23 TLOG_DEBUG(name +
"Main") <<
"Setting application name to " << name << TLOG_ENDL;
25 TLOG_DEBUG(name +
"Main") <<
"artdaq version " <<
30 artdaq::setMsgFacAppName(name, config.get<
int>(
"id"));
36 auto auto_run = config.get<
bool>(
"auto_run",
false);
38 int run = config.get<
int>(
"run_number", 101);
39 uint64_t timeout = config.get<uint64_t>(
"transition_timeout", 30);
40 uint64_t timestamp = 0;
42 br_app.do_initialize(config, timeout, timestamp);
43 br_app.do_start(art::RunID(run), timeout, timestamp);
45 TLOG_INFO(name) <<
"Running XMLRPC Commander. To stop, either Control-C or " << std::endl
46 <<
"xmlrpc http://`hostname`:" << config.get<
int>(
"id") <<
"/RPC2 daq.stop" << std::endl
47 <<
"xmlrpc http://`hostname`:" << config.get<
int>(
"id") <<
"/RPC2 daq.shutdown" << TLOG_ENDL;
51 commander->run_server();
BoardReaderApp is an artdaq::Commandable derived class which controls the BoardReaderCore state machi...
static artdaq::PackageBuildInfo getPackageBuildInfo()
Gets the version number and build timestmap for artdaq.
std::unique_ptr< artdaq::CommanderInterface > MakeCommanderPlugin(const fhicl::ParameterSet &commander_pset, artdaq::Commandable &commandable)
Load a CommanderInterface plugin.