Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
KM3NeT_Audio_Channel.h
Go to the documentation of this file.
1#ifndef KM3NET_AUDIO_CHANNEL_H_
2#define KM3NET_AUDIO_CHANNEL_H_
3/**
4 * \author fsimeone
5 */
6
7
8#include <cstdio>
9#include <cstdlib>
10#include <ctime>
11#include <map>
12
13#include <boost/asio.hpp>
14#include <boost/bind.hpp>
15#include <boost/function.hpp>
16
17#include "KM3NeT_Audio_Data.h"
18#include "toalib/km3_toa_lib.hpp"
19
20
22typedef boost::shared_ptr<KM3::TOALIB::CTOAFinder::probeSignalT> pProbe;
23typedef boost::function<void(ToA_Packet packet)> callback_send_toa;
24
25//#define DEBUG_KM3NET_AUDIO_CHANNEL
26#define MAX_DUMP_SIZE 4194304
27
29{
30public:
31 static const int DEBUG_LEVEL=2;
32
33 KM3NeT_Audio_Channel( boost::asio::io_service& io_service,\
34 callback_send_toa callback,\
35 uint32_t id,\
36 std::string& debug_path,\
37 uint32_t window=STD_WINDOW,\
38 uint32_t overlap=STD_OVERLAP);
39 virtual ~KM3NeT_Audio_Channel();
40
41 void Add_probe(pProbe probe, std::size_t id, std::size_t threshold);
42 void Append(real_type sample);
43 void Check_time(Audio_Header header){data_.Check_time(header);};
44 void Set_test(uint32_t id){test_=id;};
45
46private:
47 void Analysis(ToA_Packet packet,real_type* buffer,uint32_t length);
48 boost::asio::io_service::strand strand_;
51
53
54 uint32_t id_;
55
56 KM3::TOALIB::CTOAFinder finder_;
58
59 std::string debug_files_path_;
60 void Open_test_file(uint32_t id, uint8_t ch);
61 uint32_t test_;
62 uint32_t overlap_;
63 std::FILE* test_file_;
64};
65
66#endif
boost::shared_ptr< KM3::TOALIB::CTOAFinder::probeSignalT > pProbe
boost::function< void(ToA_Packet packet)> callback_send_toa
std::pair< std::size_t, std::size_t > threshold_entry
#define STD_WINDOW
#define STD_OVERLAP
void Add_probe(pProbe probe, std::size_t id, std::size_t threshold)
callback_send_toa send_toa_
static const int DEBUG_LEVEL
void Append(real_type sample)
void Analysis(ToA_Packet packet, real_type *buffer, uint32_t length)
boost::asio::io_service::strand strand_
void Open_test_file(uint32_t id, uint8_t ch)
std::map< std::size_t, std::size_t > thresholds_
std::vector< std::size_t > probes_id_
void Set_test(uint32_t id)
void Check_time(Audio_Header header)
KM3::TOALIB::CTOAFinder finder_
KM3NeT_Audio_Channel(boost::asio::io_service &io_service, callback_send_toa callback, uint32_t id, std::string &debug_path, uint32_t window=STD_WINDOW, uint32_t overlap=STD_OVERLAP)
void Check_time(Audio_Header header)