Imported Upstream version 3.0.4
[debian/gnuradio] / gnuradio-core / src / lib / io / gr_oscope_sink.i
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004 Free Software Foundation, Inc.
4  * 
5  * This file is part of GNU Radio
6  * 
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  * 
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING.  If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22
23 enum gr_trigger_mode {
24   gr_TRIG_AUTO,                 // auto trigger (on anything)
25   gr_TRIG_POS_SLOPE,            // trigger on positive slope across trigger level
26   gr_TRIG_NEG_SLOPE             // trigger on negative slope across trigger level
27 };
28
29 // GR_SWIG_BLOCK_MAGIC(gr,oscope_sink_x)
30
31 %ignore gr_oscope_sink_x;
32 class gr_oscope_sink_x : public gr_sync_block
33 {
34  protected:
35   gr_oscope_sink_x (const std::string name,
36                     gr_io_signature_sptr input_sig,
37                     double sample_rate);
38
39  public:
40   ~gr_oscope_sink_x ();
41
42   bool set_update_rate (double update_rate);
43   bool set_decimation_count (int decimation_count);
44   bool set_trigger_channel (int channel);
45   bool set_trigger_mode (gr_trigger_mode mode);
46   bool set_trigger_level (double trigger_level);
47   bool set_trigger_level_auto ();                               // set to 50% level
48   bool set_sample_rate(double sample_rate);
49
50   // ACCESSORS
51   int num_channels () const;
52   double sample_rate () const;
53   double update_rate () const;
54   int get_decimation_count () const;
55   int get_trigger_channel () const;
56   gr_trigger_mode get_trigger_mode () const;
57   double get_trigger_level () const;
58
59   // # of samples written to each output record.
60   int get_samples_per_output_record () const;
61 };
62
63 // ----------------------------------------------------------------
64
65 GR_SWIG_BLOCK_MAGIC(gr,oscope_sink_f)
66
67 gr_oscope_sink_f_sptr
68 gr_make_oscope_sink_f (double sample_rate, gr_msg_queue_sptr msgq);
69
70 class gr_oscope_sink_f : public gr_oscope_sink_x
71 {
72 private:
73   gr_oscope_sink_f (double sample_rate, gr_msg_queue_sptr msgq);
74
75 public:
76   ~gr_oscope_sink_f ();
77 };
78
79 // ----------------------------------------------------------------