12 #include <boost/asio.hpp>
13 #include <boost/scoped_ptr.hpp>
14 #include <boost/program_options.hpp>
19 namespace po = boost::program_options;
20 #include "configure.hpp"
27 boost::scoped_ptr<JControlHost>
m_ch;
29 mutable boost::asio::ip::udp::socket
m_input;
57 virtual void actionInit(
int length,
const char* buffer) {}
66 m_input.open(boost::asio::ip::udp::v4());
69 boost::asio::ip::udp::endpoint(
70 boost::asio::ip::udp::v4()
78 , conf.get<
unsigned>(
"out_server_port")
123 static size_t const max_size = 10000;
124 static char buffer[max_size];
126 std::size_t
const size =
m_input.receive(
127 boost::asio::buffer(buffer, max_size)
140 int main(
int argc,
char* argv[])
148 po::options_description desc(
"Options");
150 (
"help,h",
"Print this help and exit.")
151 (
"version,v",
"Print the version and exit.")
154 , po::value<std::string>(&server)->default_value(server)
155 ,
"Set the address of the SM server."
159 , po::value<std::string>(&logger)->default_value(logger)
160 ,
"Set the address of the logger server."
164 , po::value<std::string>(&client_name)->default_value(client_name)
165 ,
"Set the address of the client name."
169 , po::value<int>(&port)->required()
170 ,
"Set the UDP port to read data from"
174 , po::value<int>(&debug)->default_value(debug)
175 ,
"Set the debug level."
179 po::variables_map vm;
181 po::command_line_parser(argc, argv).
options(desc).run(),
185 if (vm.count(
"help")) {
186 std::cout << desc << std::endl;
190 if (vm.count(
"version")) {
196 }
catch (
const po::error& e) {
197 std::cerr <<
"MonRouter: Error: " << e.what() <<
'\n'
198 << desc << std::endl;
200 }
catch (
const std::runtime_error& e) {
201 std::cerr <<
"MonRouter: Error: " << e.what() <<
'\n'
202 << desc << std::endl;
int main(int argc, char *argv[])
JDAQStateMachine::ev_configure_event ev_configure
virtual void actionPause(int length, const char *buffer)
virtual void actionStart(int length, const char *buffer)
bool has(const int file_descriptor) const
Has file descriptor.
void set(const int file_descriptor)
Set file descriptor.
MonitorRouter(std::string const &name, std::string const &server, JLogger *logger, const int level, int port)
Interface for logging messages.
Message logging based on ControlHost.
virtual void actionReset(int length, const char *buffer)
virtual void actionRunning()
This method is repeatedly called when this client machine is in state Running and the clock interval ...
void replaceEvent(const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event)
Replace tag of given event in event table.
JSharedPointer< JControlHost > server
message server
virtual void actionQuit(int length, const char *buffer)
void run()
Run as run control client following command messages via JNET::JControlHost.
virtual void actionEnter()
Interface methods for actions corresponding to state transitions.
boost::asio::io_service m_service
boost::property_tree::ptree parse(std::string str)
virtual void actionSelect(const JFileDescriptorMask &mask)
Action method following last select call.
then usage $script[port]< option > nPossible options
boost::asio::ip::udp::socket m_input
Auxiliary class for method select.
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
static const JNET::JTag RC_MONITORING_ROUTER
boost::scoped_ptr< JControlHost > m_ch
virtual void actionStop(int length, const char *buffer)
General purpose message reporting.
int getRunNumber() const
Get run number.
virtual void actionExit()
Control unit client base class.
virtual bool enter(const JArgs &args)
Enter the state machine.
JMessageLogger logger
message logger
static const JNET::JTag RC_CMD
virtual void setSelect(JFileDescriptorMask &mask) const
Set the file descriptor mask for the select call.
static const JNET::JTag IO_MONITORING_DATA
then cat $TRIPOD_INITIAL<< EOF1 256877.5 4743716.7-2438.42 256815.5 4743395.0-2435.53 257096.2 4743636.0-2439.5EOFfiif[[!-f $DETECTOR]];then JEditDetector-a $DETECTOR_INITIAL-s"-1 addz -6.9"-o $DETECTOR--!eval`JPrintDetector-a $DETECTOR-O SUMMARY`for STRING in ${STRINGS[*]};do set_variable MODULE`getModule-a $DETECTOR-L"$STRING 0"`JEditDetector-a $DETECTOR-M"$MODULE setz -2.9"-o $DETECTOR--!donefiif[[!-f $TRIPOD]];then cp-p $TRIPOD_INITIAL $TRIPODfiJAcoustics.sh $DETECTOR_IDcat > acoustics_trigger_parameters txt<< EOFQ=0.0;TMax_s=0.020;numberOfHits=90;EOFJAcousticsEventBuilder.sh $DETECTOR $RUNS[*]INPUT_FILES=(`ls KM3NeT_ ${(l:8::0::0:) DETECTOR_ID}_0 *${^RUNS}_event.root`) cd $WORKDIRif[!$HOMEDIR-ef $WORKDIR];then cp-p $HOMEDIR/$DETECTOR $WORKDIR cp-p $HOMEDIR/${^ACOUSTICS_KEYS}.txt $WORKDIR cp-p $HOMEDIR/${^INPUT_FILES}$WORKDIRfisource $JPP_DIR/examples/JAcoustics/acoustics-fit-toolkit.shtimer_startinitialise stage_b 1 0 100.0e-6 10.0 0.002 0.1 0 > &stage log
virtual void actionInit(int length, const char *buffer)
virtual void actionConfigure(int length, const char *buffer)
virtual void actionContinue(int length, const char *buffer)