Psyllid  v1.12.4
Project 8 Data Acquisisition Software
streaming_writer.hh
Go to the documentation of this file.
1 /*
2  * streaming_writer.hh
3  *
4  * Created on: May 31, 2016
5  * Author: nsoblath
6  */
7 
8 #ifndef PSYLLID_STREAMING_WRITER_HH_
9 #define PSYLLID_STREAMING_WRITER_HH_
10 
11 #include "egg_writer.hh"
12 #include "node_builder.hh"
13 #include "time_data.hh"
14 
15 #include "consumer.hh"
16 
17 namespace psyllid
18 {
19 
53  public midge::_consumer< midge::type_list< time_data > >,
54  public egg_writer
55  {
56  public:
58  virtual ~streaming_writer();
59 
60  public:
61  mv_accessible( unsigned, file_num );
62 
63  mv_accessible( unsigned, bit_depth ); // # of bits
64  mv_accessible( unsigned, data_type_size ); // # of bytes
65  mv_accessible( unsigned, sample_size ); // # of components
66  mv_accessible( unsigned, record_size ); // # of samples
67  mv_accessible( unsigned, acq_rate ); // MHz
68  mv_accessible( double, v_offset ); // V
69  mv_accessible( double, v_range ); // V
70  mv_accessible( double, center_freq ); // Hz
71  mv_accessible( double, freq_range ); // Hz
72 
73  public:
74  virtual void prepare_to_write( monarch_wrap_ptr a_mw_ptr, header_wrap_ptr a_hw_ptr );
75 
76  virtual void initialize();
77  virtual void execute( midge::diptera* a_midge = nullptr );
78  virtual void finalize();
79 
80  private:
82 
84  unsigned f_stream_no;
85 
86  };
87 
88 
89  class streaming_writer_binding : public _node_binding< streaming_writer, streaming_writer_binding >
90  {
91  public:
93  virtual ~streaming_writer_binding();
94 
95  private:
96  virtual void do_apply_config( streaming_writer* a_node, const scarab::param_node& a_config ) const;
97  virtual void do_dump_config( const streaming_writer* a_node, scarab::param_node& a_config ) const;
98  };
99 
100 } /* namespace psyllid */
101 
102 #endif /* PSYLLID_STREAMING_WRITER_HH_ */
std::shared_ptr< header_wrapper > header_wrap_ptr
Base class for all writers.
Definition: egg_writer.hh:24
virtual void execute(midge::diptera *a_midge=nullptr)
std::shared_ptr< monarch_wrapper > monarch_wrap_ptr
A consumer to that writes all time ROACH packets to an egg file.
mv_accessible(unsigned, file_num)
monarch_wrap_ptr f_monarch_ptr
virtual void prepare_to_write(monarch_wrap_ptr a_mw_ptr, header_wrap_ptr a_hw_ptr)