32 #include "application.hh" 36 #include "dripline_constants.hh" 48 LINFO(
plog,
"Attempting to cancel" );
53 int main(
int argc,
char** argv )
58 scarab::main_app the_main;
61 scarab::param_node t_default_config;
62 t_default_config.add(
"ip", scarab::param_value(
"127.0.0.1" ) );
63 t_default_config.add(
"port", scarab::param_value( 23530 ) );
64 t_default_config.add(
"interface", scarab::param_value(
"eth1" ) );
65 the_main.default_config() = t_default_config;
68 the_main.add_config_option< std::string >(
"--ip",
"ip",
"IP address from which to receive packets" );
69 the_main.add_config_option<
unsigned >(
"-p,--port",
"port",
"Port on which to receive packets" );
70 the_main.add_config_option< std::string >(
"-i,--interface",
"interface",
"Ethernet interface to grab packets off of" );
71 the_main.add_config_flag<
bool >(
"-f,--fpa",
"fpa",
"Enable use of the FPA" );
77 the_main.callback( [&]() {
78 std::string t_ip( the_main.master_config()[
"ip"]().as_string() );
79 unsigned t_port = the_main.master_config()[
"port"]().as_uint();
80 std::string t_interface( the_main.master_config()[
"interface"]().as_string() );
81 bool t_use_fpa( the_main.master_config().has(
"fpa" ) );
83 LINFO(
plog,
"Creating and configuring nodes" );
85 midge::diptera* t_root =
new midge::diptera();
91 t_pck_rec->set_name(
"pck_rec" );
92 t_pck_rec->set_length( 10 );
93 t_pck_rec->set_port( t_port );
94 t_pck_rec->interface() = t_interface;
95 t_root->add( t_pck_rec );
98 throw error() <<
"FPA was requested, but is only available on a Linux machine";
104 t_pck_rec->set_name(
"pck_rec" );
105 t_pck_rec->set_length( 10 );
106 t_pck_rec->set_port( t_port );
107 t_pck_rec->ip() = t_ip;
108 t_root->add( t_pck_rec );
113 t_tfr_rec->set_name(
"tfr_rec" );
114 t_tfr_rec->set_time_length( 10 );
115 t_tfr_rec->set_start_paused(
false );
116 t_root->add( t_tfr_rec );
119 t_str_wrt->set_name(
"strw" );
120 t_root->add( t_str_wrt );
123 t_term_f->set_name(
"term_f" );
124 t_root->add( t_term_f );
126 LINFO(
plog,
"Connecting nodes" );
128 t_root->join(
"pck_rec.out_0:tfr_rec.in_0" );
129 t_root->join(
"tfr_rec.out_0:strw.in_0" );
130 t_root->join(
"tfr_rec.out_1:term_f.in_0" );
132 LINFO(
plog,
"Exit with ctrl-c" );
137 LINFO(
plog,
"Executing" );
139 std::exception_ptr t_e_ptr = t_root->run(
"pck_rec:tfr_rec:strw:term_f" );
141 if( t_e_ptr ) std::rethrow_exception( t_e_ptr );
143 LINFO(
plog,
"Execution complete" );
152 CLI11_PARSE( the_main, argc, argv );
154 return RETURN_SUCCESS;
156 catch( std::exception& e )
158 LERROR(
plog,
"Exception caught: " << e.what() );
static scarab::logger plog("batch_executor")
A producer to receive UDP packets via the standard socket interface and write them as raw blocks of m...
A consumer to that writes all time ROACH packets to an egg file.
A producer to receive UDP packets via the fast-packet-acquisition interface and write them as raw blo...
A transformer to receive raw blocks of memory, parse them, and distribute them as time and frequency ...
LOGGER(plog, "egg_writer")
int main(int argc, char **argv)
scarab::cancelable * f_cancelable