Psyllid  v1.12.4
Project 8 Data Acquisisition Software
test_fast_packet_acq.cc
Go to the documentation of this file.
1 /*
2  * test_fast_packet_acq.cc
3  *
4  * Created on: Dec 28, 2015
5  * Author: nsoblath
6  *
7  * Suggested UDP client: roach_simulator.go
8  *
9  * Usage: > test_fast_packet_acq [options]
10  *
11  * Options:
12  * - interface -- (string) network interface to listen on; defaults to "eth1"
13  */
14 
15 
16 #include "tf_roach_receiver.hh"
17 #include "fpa_factory.hh"
18 #include "psyllid_error.hh"
19 #include "midge_error.hh"
20 
21 #include "configurator.hh"
22 #include "logger.hh"
23 #include "param.hh"
24 
25 
26 using namespace psyllid;
27 
28 LOGGER( plog, "test_fast_packet_acq" );
29 
30 int main( int argc, char** argv )
31 {
32  try
33  {
34  scarab::param_node t_default_config;
35  t_default_config.add( "interface", scarab::param_value( "eth1" ) );
36 
37  scarab::configurator t_configurator( argc, argv, &t_default_config );
38 
39  std::string t_interface( t_configurator.get< std::string >( "interface" ) );
40 
41  // setup the server config
42  scarab::param_node t_server_config = scarab::param_node();
43  t_server_config.add( "type", scarab::param_value( "fpa" ) );
44  t_server_config.add( "interface", scarab::param_value( t_interface ) );
45 
46  LINFO( plog, "Creating and configuring receiver" );
47 
48  tf_roach_receiver t_receiver;
49  t_receiver.set_name( "rec" );
50  //t_receiver.node_ptr( &t_fpa, t_interface );
51  t_receiver.set_server_config( t_server_config );
52 
53  LINFO( plog, "Initializing receiver & FPA" );
54 
55  t_receiver.initialize();
56 
57  LINFO( plog, "Running receiver" );
58 
59  t_receiver.execute();
60 
61  LINFO( plog, "Finalizing receiver and FPA" );
62 
63  t_receiver.finalize();
64 
65  return 0;
66  }
67  catch( psyllid::error& e )
68  {
69  LERROR( plog, "Psyllid exception caught: " << e.what() );
70  return -1;
71  }
72  catch( midge::error& e )
73  {
74  LERROR( plog, "Midge exception caught: " << e.what() );
75  return -1;
76  }
77 
78 }
const char * what() const
static scarab::logger plog("batch_executor")
int main(int argc, char **argv)
A transformer to receive raw blocks of memory, parse them, and distribute them as time and frequency ...
LOGGER(plog, "egg_writer")
virtual void execute(midge::diptera *a_midge=nullptr)