GNU Radio 3.7.1 C++ API
oscope_sink_x.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2003,2004,2013 Free Software Foundation, Inc.
00004  *
00005  * This file is part of GNU Radio
00006  *
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  *
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 
00023 #ifndef INCLUDED_GR_OSCOPE_SINK_X_H
00024 #define INCLUDED_GR_OSCOPE_SINK_X_H
00025 
00026 #include <gnuradio/wxgui/api.h>
00027 #include <gnuradio/wxgui/trigger_mode.h>
00028 #include <gnuradio/wxgui/oscope_guts.h>
00029 #include <gnuradio/sync_block.h>
00030 
00031 namespace gr {
00032   namespace wxgui {
00033 
00034     /*!
00035      * \brief Abstract class for python oscilloscope module.
00036      * \ingroup sink_blk
00037      *
00038      * Don't instantiate this. Use gr::blocks::oscope_sink_f instead.
00039      */
00040     class WXGUI_API oscope_sink_x : public sync_block
00041     {
00042     protected:
00043       double d_sampling_rate;
00044       oscope_guts *d_guts;
00045 
00046       oscope_sink_x() {};
00047       oscope_sink_x(const std::string name,
00048                     gr::io_signature::sptr input_sig,
00049                     double sampling_rate);
00050     public:
00051       virtual ~oscope_sink_x();
00052 
00053       //// gr::blocks::oscope_sink_x::sptr
00054       //typedef boost::shared_ptr<oscope_sink_x> sptr;
00055       //
00056       //static sptr make(const std::string name,
00057       //                 gnuradio/io_signature.h_sptr input_sig,
00058       //                 double sampling_rate);
00059 
00060       bool set_update_rate(double update_rate);
00061       bool set_decimation_count(int decimation_count);
00062       bool set_trigger_channel(int channel);
00063       bool set_trigger_mode(trigger_mode mode);
00064       bool set_trigger_slope(trigger_slope slope);
00065       bool set_trigger_level(double trigger_level);
00066       bool set_trigger_level_auto();
00067       bool set_sample_rate(double sample_rate);
00068       bool set_num_channels(int nchannels);
00069 
00070       // ACCESSORS
00071       int num_channels() const;
00072       double sample_rate() const;
00073       double update_rate() const;
00074       int get_decimation_count() const;
00075       int get_trigger_channel() const;
00076       trigger_mode get_trigger_mode() const;
00077       trigger_slope get_trigger_slope() const;
00078       double get_trigger_level() const;
00079 
00080       // # of samples written to each output record.
00081       int get_samples_per_output_record() const;
00082 
00083       virtual int work(int noutput_items,
00084                        gr_vector_const_void_star &input_items,
00085                        gr_vector_void_star &output_items) = 0;
00086     };
00087 
00088   } /* namespace wxgui */
00089 } /* namespace gr */
00090 
00091 #endif /* INCLUDED_GR_OSCOPE_SINK_X_H */