Merge branch 'patches/geiger/u2_rx_stream_at' of git@gnuradio.org:jcorgan
authorJohnathan Corgan <jcorgan@corganenterprises.com>
Tue, 8 Dec 2009 03:45:56 +0000 (22:45 -0500)
committerJohnathan Corgan <jcorgan@corganenterprises.com>
Tue, 8 Dec 2009 03:45:56 +0000 (22:45 -0500)
43 files changed:
gnuradio-core/src/lib/general/gr_head.cc
gnuradio-core/src/lib/general/gr_head.h
gnuradio-core/src/lib/general/gr_head.i
gnuradio-core/src/python/gnuradio/blks2impl/dbpsk2.py
gnuradio-core/src/python/gnuradio/blks2impl/dqpsk2.py
gnuradio-examples/grc/Makefile.am
gnuradio-examples/grc/usrp/usrp_rx_dpsk.grc [new file with mode: 0644]
gnuradio-examples/grc/usrp/usrp_tx_dpsk.grc [new file with mode: 0644]
gr-msdd6000/src/.gitignore
gr-msdd6000/src/Makefile.am
gr-msdd6000/src/Makefile.swig.gen
gr-msdd6000/src/msdd6000_rs.cc [new file with mode: 0644]
gr-msdd6000/src/msdd6000_rs.h [new file with mode: 0644]
gr-msdd6000/src/msdd_rs.i [new file with mode: 0644]
gr-msdd6000/src/msdd_rs_source_simple.cc [new file with mode: 0644]
gr-msdd6000/src/msdd_rs_source_simple.h [new file with mode: 0644]
gr-msdd6000/src/python-examples/msdd_rs_spec_an.py [new file with mode: 0755]
grc/base/Block.py
grc/base/FlowGraph.py
grc/blocks/Makefile.am
grc/blocks/blks2_dxpsk2_demod.xml [new file with mode: 0644]
grc/blocks/blks2_dxpsk2_mod.xml [new file with mode: 0644]
grc/blocks/blks2_dxpsk_demod.xml
grc/blocks/blks2_dxpsk_mod.xml
grc/blocks/block_tree.xml
grc/blocks/pad_sink.xml
grc/blocks/pad_source.xml
grc/grc_gnuradio/usrp/dual_usrp.py
grc/grc_gnuradio/usrp/simple_usrp.py
grc/grc_gnuradio/wxgui/top_block_gui.py
grc/gui/ActionHandler.py
grc/gui/Block.py
grc/gui/Dialogs.py
grc/gui/Element.py
grc/gui/FlowGraph.py
grc/gui/Param.py
grc/gui/Port.py
grc/gui/Utils.py
grc/python/Constants.py
grc/python/FlowGraph.py
grc/python/Param.py
grc/python/convert_hier.py
grc/python/flow_graph.tmpl

index 01035ffcdac02ad0ef15641921b2f7850d564221..b52735c06eb39705ea08e78a68e6005474a5f035 100644 (file)
@@ -27,7 +27,7 @@
 #include <gr_io_signature.h>
 #include <string.h>
 
-gr_head::gr_head (size_t sizeof_stream_item, int nitems)
+gr_head::gr_head (size_t sizeof_stream_item, unsigned long long nitems)
   : gr_sync_block ("head",
                   gr_make_io_signature (1, 1, sizeof_stream_item),
                   gr_make_io_signature (1, 1, sizeof_stream_item)),
@@ -36,7 +36,7 @@ gr_head::gr_head (size_t sizeof_stream_item, int nitems)
 }
 
 gr_head_sptr
-gr_make_head (size_t sizeof_stream_item, int nitems)
+gr_make_head (size_t sizeof_stream_item, unsigned long long nitems)
 {
   return gnuradio::get_initial_sptr(new gr_head (sizeof_stream_item, nitems));
 }
@@ -49,7 +49,7 @@ gr_head::work (int noutput_items,
   if (d_ncopied_items >= d_nitems)
     return -1;                         // Done!
 
-  unsigned n = std::min (d_nitems - d_ncopied_items, noutput_items);
+  unsigned n = std::min (d_nitems - d_ncopied_items, (unsigned long long) noutput_items);
   
   if (n == 0)
     return 0;
index 430d5f8b9644df8ff7b5d06d98bdc3f88a15994c..f7eee10648e3f354455844272f8785ae9af6e571 100644 (file)
@@ -38,11 +38,11 @@ typedef boost::shared_ptr<gr_head> gr_head_sptr;
 
 class gr_head : public gr_sync_block
 {
-  friend gr_head_sptr gr_make_head (size_t sizeof_stream_item, int nitems);
-  gr_head (size_t sizeof_stream_item, int nitems);
+  friend gr_head_sptr gr_make_head (size_t sizeof_stream_item, unsigned long long nitems);
+  gr_head (size_t sizeof_stream_item, unsigned long long nitems);
 
-  int  d_nitems;
-  int  d_ncopied_items;
+  unsigned long long   d_nitems;
+  unsigned long long   d_ncopied_items;
 
  public:
   int work (int noutput_items,
@@ -53,7 +53,7 @@ class gr_head : public gr_sync_block
 };
 
 gr_head_sptr
-gr_make_head (size_t sizeof_stream_item, int nitems);
+gr_make_head (size_t sizeof_stream_item, unsigned long long nitems);
 
 
 #endif /* INCLUDED_GR_HEAD_H */
index 2a88b885f010dd041b69d48f58daf5a7e6bfcd0e..3aece9601c16a039a8cee0acba922550ad350279 100644 (file)
@@ -22,7 +22,7 @@
 
 GR_SWIG_BLOCK_MAGIC(gr,head);
 
-gr_head_sptr gr_make_head(size_t sizeof_stream_item, int nitems);
+gr_head_sptr gr_make_head(size_t sizeof_stream_item, unsigned long long nitems);
 
 class gr_head : public gr_block {
   gr_head();
index 4541b453b38d6f46efbe229d5152973ac3e44259..cd9a207c876cd51d1caa01b1d54d42247cccd6c0 100644 (file)
@@ -187,7 +187,8 @@ class dbpsk2_demod(gr.hier_block2):
                  timing_max_dev=_def_timing_max_dev,
                  gray_code=_def_gray_code,
                  verbose=_def_verbose,
-                 log=_def_log):
+                 log=_def_log,
+                 sync_out=False):
         """
        Hierarchical block for RRC-filtered differential BPSK demodulation
 
@@ -208,14 +209,18 @@ class dbpsk2_demod(gr.hier_block2):
         @type gray_code: bool
         @param verbose: Print information about modulator?
         @type verbose: bool
-        @param debug: Print modualtion data to files?
-        @type debug: bool
+        @param log: Print modualtion data to files?
+        @type log: bool
+        @param sync_out: Output a sync signal on :1?
+        @type sync_out: bool
        """
-        
-       gr.hier_block2.__init__(self, "dbpsk2_demod",
-                               gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
-                               gr.io_signature(1, 1, gr.sizeof_char))       # Output signature
-                               
+       if sync_out: io_sig_out = gr.io_signaturev(2, 2, (gr.sizeof_char, gr.sizeof_gr_complex))
+       else: io_sig_out = gr.io_signature(1, 1, gr.sizeof_char)
+
+       gr.hier_block2.__init__(self, "dqpsk2_demod",
+                               gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
+                               io_sig_out)       # Output signature
+
         self._samples_per_symbol = samples_per_symbol
         self._excess_bw = excess_bw
         self._costas_alpha = costas_alpha
@@ -278,6 +283,7 @@ class dbpsk2_demod(gr.hier_block2):
                      self.clock_recov,
                      self.time_recov,
                      self.diffdec, self.slicer, self.symbol_mapper, self.unpack, self)
+        if sync_out: self.connect(self.time_recov, (self, 1))
 
     def samples_per_symbol(self):
         return self._samples_per_symbol
index 9704ac98c5776ea250294b38596be293d164a898..fd1e9f0efcfb38aab9529513403cd3e55118c4c7 100644 (file)
@@ -187,7 +187,8 @@ class dqpsk2_demod(gr.hier_block2):
                  timing_max_dev=_def_timing_max_dev,
                  gray_code=_def_gray_code,
                  verbose=_def_verbose,
-                 log=_def_log):
+                 log=_def_log,
+                 sync_out=False):
         """
        Hierarchical block for RRC-filtered DQPSK demodulation
 
@@ -208,13 +209,17 @@ class dqpsk2_demod(gr.hier_block2):
         @type gray_code: bool
         @param verbose: Print information about modulator?
         @type verbose: bool
-        @param debug: Print modualtion data to files?
-        @type debug: bool
+        @param log: Print modualtion data to files?
+        @type log: bool
+        @param sync_out: Output a sync signal on :1?
+        @type sync_out: bool
        """
+       if sync_out: io_sig_out = gr.io_signaturev(2, 2, (gr.sizeof_char, gr.sizeof_gr_complex))
+       else: io_sig_out = gr.io_signature(1, 1, gr.sizeof_char)
 
        gr.hier_block2.__init__(self, "dqpsk2_demod",
                                gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
-                               gr.io_signature(1, 1, gr.sizeof_char))       # Output signature
+                               io_sig_out)       # Output signature
 
         self._samples_per_symbol = samples_per_symbol
         self._excess_bw = excess_bw
@@ -278,6 +283,7 @@ class dqpsk2_demod(gr.hier_block2):
                      self.clock_recov,
                      self.time_recov,
                      self.diffdec, self.slicer, self.symbol_mapper, self.unpack, self)
+        if sync_out: self.connect(self.time_recov, (self, 1))
 
     def samples_per_symbol(self):
         return self._samples_per_symbol
index 97417c5a22597697e6c09abe298074afd9f4b648..f8a26bacea60519eb4dc9372b09595f5e45f2882 100644 (file)
@@ -49,6 +49,8 @@ usrpdatadir = $(grc_examples_prefix)/usrp
 dist_usrpdata_DATA = \
        usrp/usrp2_const_wave.grc \
        usrp/usrp2_dpsk_mod.grc \
+       usrp/usrp_rx_dpsk.grc \
+       usrp/usrp_tx_dpsk.grc \
        usrp/usrp2_fft.grc \
        usrp/usrp_two_tone_loopback.grc \
        usrp/usrp_wbfm_receive.grc
diff --git a/gnuradio-examples/grc/usrp/usrp_rx_dpsk.grc b/gnuradio-examples/grc/usrp/usrp_rx_dpsk.grc
new file mode 100644 (file)
index 0000000..9843ee6
--- /dev/null
@@ -0,0 +1,727 @@
+<?xml version='1.0' encoding='ASCII'?>
+<flow_graph>
+  <timestamp>Wed Dec  2 11:03:20 2009</timestamp>
+  <block>
+    <key>options</key>
+    <param>
+      <key>id</key>
+      <value>usrp_rx_dpsk</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>title</key>
+      <value>USRP RX DPSK</value>
+    </param>
+    <param>
+      <key>author</key>
+      <value></value>
+    </param>
+    <param>
+      <key>description</key>
+      <value></value>
+    </param>
+    <param>
+      <key>window_size</key>
+      <value>1280, 1024</value>
+    </param>
+    <param>
+      <key>generate_options</key>
+      <value>wx_gui</value>
+    </param>
+    <param>
+      <key>category</key>
+      <value>Custom</value>
+    </param>
+    <param>
+      <key>run_options</key>
+      <value>prompt</value>
+    </param>
+    <param>
+      <key>run</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>realtime_scheduling</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(12, 9)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>samps_per_sym</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>4</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(14, 79)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>bb_freq</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>2.45e9</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(18, 151)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>p2p</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>2.0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(13, 314)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable_slider</key>
+    <param>
+      <key>id</key>
+      <value>timing_alpha</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>label</key>
+      <value>Timing Alpha</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>.1</value>
+    </param>
+    <param>
+      <key>min</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>max</key>
+      <value>.5</value>
+    </param>
+    <param>
+      <key>num_steps</key>
+      <value>100</value>
+    </param>
+    <param>
+      <key>style</key>
+      <value>wx.SL_HORIZONTAL</value>
+    </param>
+    <param>
+      <key>converver</key>
+      <value>float_converter</value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value></value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(759, 365)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>gr_null_sink</key>
+    <param>
+      <key>id</key>
+      <value>gr_null_sink_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>byte</value>
+    </param>
+    <param>
+      <key>vlen</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(815, 80)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable_slider</key>
+    <param>
+      <key>id</key>
+      <value>costas_alpha</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>label</key>
+      <value>Costas Alpha</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>0.175</value>
+    </param>
+    <param>
+      <key>min</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>max</key>
+      <value>.5</value>
+    </param>
+    <param>
+      <key>num_steps</key>
+      <value>100</value>
+    </param>
+    <param>
+      <key>style</key>
+      <value>wx.SL_HORIZONTAL</value>
+    </param>
+    <param>
+      <key>converver</key>
+      <value>float_converter</value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value></value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(598, 367)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>wxgui_fftsink2</key>
+    <param>
+      <key>id</key>
+      <value>wxgui_fftsink2_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>complex</value>
+    </param>
+    <param>
+      <key>title</key>
+      <value>Receive Spectrum</value>
+    </param>
+    <param>
+      <key>samp_rate</key>
+      <value>samp_rate</value>
+    </param>
+    <param>
+      <key>baseband_freq</key>
+      <value>bb_freq</value>
+    </param>
+    <param>
+      <key>y_per_div</key>
+      <value>10</value>
+    </param>
+    <param>
+      <key>y_divs</key>
+      <value>10</value>
+    </param>
+    <param>
+      <key>ref_level</key>
+      <value>-40</value>
+    </param>
+    <param>
+      <key>ref_scale</key>
+      <value>p2p</value>
+    </param>
+    <param>
+      <key>fft_size</key>
+      <value>1024</value>
+    </param>
+    <param>
+      <key>fft_rate</key>
+      <value>15</value>
+    </param>
+    <param>
+      <key>peak_hold</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>average</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>avg_alpha</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>win</key>
+      <value>None</value>
+    </param>
+    <param>
+      <key>win_size</key>
+      <value></value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value></value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(383, 321)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>samp_rate</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>1e6/4</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(20, 234)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable_slider</key>
+    <param>
+      <key>id</key>
+      <value>gain</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>label</key>
+      <value>Gain</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>20</value>
+    </param>
+    <param>
+      <key>min</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>max</key>
+      <value>70</value>
+    </param>
+    <param>
+      <key>num_steps</key>
+      <value>100</value>
+    </param>
+    <param>
+      <key>style</key>
+      <value>wx.SL_HORIZONTAL</value>
+    </param>
+    <param>
+      <key>converver</key>
+      <value>float_converter</value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value></value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(152, 378)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>usrp2_source_xxxx</key>
+    <param>
+      <key>id</key>
+      <value>usrp2_source_xxxx_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>complex</value>
+    </param>
+    <param>
+      <key>interface</key>
+      <value></value>
+    </param>
+    <param>
+      <key>mac_addr</key>
+      <value></value>
+    </param>
+    <param>
+      <key>decimation</key>
+      <value>int(100e6/samp_rate)</value>
+    </param>
+    <param>
+      <key>frequency</key>
+      <value>bb_freq</value>
+    </param>
+    <param>
+      <key>lo_offset</key>
+      <value>float('inf')</value>
+    </param>
+    <param>
+      <key>gain</key>
+      <value>gain</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(158, 51)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>usrp_simple_source_x</key>
+    <param>
+      <key>id</key>
+      <value>usrp_simple_source_x_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>complex</value>
+    </param>
+    <param>
+      <key>format</key>
+      <value></value>
+    </param>
+    <param>
+      <key>which</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>decimation</key>
+      <value>int(64e6/samp_rate)</value>
+    </param>
+    <param>
+      <key>frequency</key>
+      <value>bb_freq</value>
+    </param>
+    <param>
+      <key>lo_offset</key>
+      <value>float('inf')</value>
+    </param>
+    <param>
+      <key>gain</key>
+      <value>gain</value>
+    </param>
+    <param>
+      <key>side</key>
+      <value>B</value>
+    </param>
+    <param>
+      <key>rx_ant</key>
+      <value>TX/RX</value>
+    </param>
+    <param>
+      <key>hb_filters</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(154, 218)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>blks2_dxpsk2_demod</key>
+    <param>
+      <key>id</key>
+      <value>blks2_dxpsk2_demod_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>dqpsk</value>
+    </param>
+    <param>
+      <key>samples_per_symbol</key>
+      <value>samps_per_sym</value>
+    </param>
+    <param>
+      <key>excess_bw</key>
+      <value>0.35</value>
+    </param>
+    <param>
+      <key>costas_alpha</key>
+      <value>costas_alpha</value>
+    </param>
+    <param>
+      <key>timing_alpha</key>
+      <value>timing_alpha</value>
+    </param>
+    <param>
+      <key>timing_max_dev</key>
+      <value>1.5</value>
+    </param>
+    <param>
+      <key>omega_relative_limit</key>
+      <value>0.005</value>
+    </param>
+    <param>
+      <key>gray_code</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>verbose</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>log</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>sync_out</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(487, 64)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>wxgui_scopesink2</key>
+    <param>
+      <key>id</key>
+      <value>wxgui_scopesink2_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>complex</value>
+    </param>
+    <param>
+      <key>title</key>
+      <value>Recovered DQPSK Constellation</value>
+    </param>
+    <param>
+      <key>samp_rate</key>
+      <value>samp_rate/4/20</value>
+    </param>
+    <param>
+      <key>v_scale</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>v_offset</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>t_scale</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>ac_couple</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>xy_mode</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>num_inputs</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>win_size</key>
+      <value></value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value></value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(760, 239)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>180</value>
+    </param>
+  </block>
+  <block>
+    <key>gr_keep_one_in_n</key>
+    <param>
+      <key>id</key>
+      <value>gr_keep_one_in_n_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>complex</value>
+    </param>
+    <param>
+      <key>n</key>
+      <value>20</value>
+    </param>
+    <param>
+      <key>vlen</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(873, 151)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <connection>
+    <source_block_id>usrp2_source_xxxx_0</source_block_id>
+    <sink_block_id>wxgui_fftsink2_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>usrp2_source_xxxx_0</source_block_id>
+    <sink_block_id>blks2_dxpsk2_demod_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>blks2_dxpsk2_demod_0</source_block_id>
+    <sink_block_id>gr_null_sink_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>blks2_dxpsk2_demod_0</source_block_id>
+    <sink_block_id>gr_keep_one_in_n_0</sink_block_id>
+    <source_key>1</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>gr_keep_one_in_n_0</source_block_id>
+    <sink_block_id>wxgui_scopesink2_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+</flow_graph>
diff --git a/gnuradio-examples/grc/usrp/usrp_tx_dpsk.grc b/gnuradio-examples/grc/usrp/usrp_tx_dpsk.grc
new file mode 100644 (file)
index 0000000..90ec5e9
--- /dev/null
@@ -0,0 +1,583 @@
+<?xml version='1.0' encoding='ASCII'?>
+<flow_graph>
+  <timestamp>Thu Dec  3 11:42:41 2009</timestamp>
+  <block>
+    <key>options</key>
+    <param>
+      <key>id</key>
+      <value>usrp_tx_dpsk</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>title</key>
+      <value>USRP TX DPSK</value>
+    </param>
+    <param>
+      <key>author</key>
+      <value></value>
+    </param>
+    <param>
+      <key>description</key>
+      <value></value>
+    </param>
+    <param>
+      <key>window_size</key>
+      <value>1280, 1024</value>
+    </param>
+    <param>
+      <key>generate_options</key>
+      <value>wx_gui</value>
+    </param>
+    <param>
+      <key>category</key>
+      <value>Custom</value>
+    </param>
+    <param>
+      <key>run_options</key>
+      <value>prompt</value>
+    </param>
+    <param>
+      <key>run</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>realtime_scheduling</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(10, 10)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>samps_per_sym</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>4</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(15, 76)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>random_source_x</key>
+    <param>
+      <key>id</key>
+      <value>random_source_x_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>byte</value>
+    </param>
+    <param>
+      <key>min</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>max</key>
+      <value>2**8</value>
+    </param>
+    <param>
+      <key>num_samps</key>
+      <value>1000</value>
+    </param>
+    <param>
+      <key>repeat</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(23, 319)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>blks2_dxpsk2_mod</key>
+    <param>
+      <key>id</key>
+      <value>blks2_dxpsk2_mod_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>dqpsk</value>
+    </param>
+    <param>
+      <key>samples_per_symbol</key>
+      <value>samps_per_sym</value>
+    </param>
+    <param>
+      <key>excess_bw</key>
+      <value>0.35</value>
+    </param>
+    <param>
+      <key>gray_code</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>verbose</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>log</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(234, 151)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>usrp_simple_sink_x</key>
+    <param>
+      <key>id</key>
+      <value>usrp_simple_sink_x_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>complex</value>
+    </param>
+    <param>
+      <key>which</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>interpolation</key>
+      <value>int(128e6/samp_rate)</value>
+    </param>
+    <param>
+      <key>frequency</key>
+      <value>bb_freq</value>
+    </param>
+    <param>
+      <key>lo_offset</key>
+      <value>float('inf')</value>
+    </param>
+    <param>
+      <key>gain</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>side</key>
+      <value>A</value>
+    </param>
+    <param>
+      <key>transmit</key>
+      <value>auto_tr</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(516, 203)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>usrp2_sink_xxxx</key>
+    <param>
+      <key>id</key>
+      <value>usrp2_sink_xxxx_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>complex</value>
+    </param>
+    <param>
+      <key>interface</key>
+      <value></value>
+    </param>
+    <param>
+      <key>mac_addr</key>
+      <value></value>
+    </param>
+    <param>
+      <key>interpolation</key>
+      <value>int(100e6/samp_rate)</value>
+    </param>
+    <param>
+      <key>frequency</key>
+      <value>bb_freq</value>
+    </param>
+    <param>
+      <key>lo_offset</key>
+      <value>float('inf')</value>
+    </param>
+    <param>
+      <key>gain</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(498, 51)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable_slider</key>
+    <param>
+      <key>id</key>
+      <value>tx_ampl</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>label</key>
+      <value>TX Amplitude</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>.2</value>
+    </param>
+    <param>
+      <key>min</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>max</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>num_steps</key>
+      <value>100</value>
+    </param>
+    <param>
+      <key>style</key>
+      <value>wx.SL_HORIZONTAL</value>
+    </param>
+    <param>
+      <key>converver</key>
+      <value>float_converter</value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value></value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(277, 491)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>bb_freq</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>2.45e9+freq_off</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(14, 141)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable_slider</key>
+    <param>
+      <key>id</key>
+      <value>freq_off</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>label</key>
+      <value>Frequency Offset</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>min</key>
+      <value>-samp_rate/2</value>
+    </param>
+    <param>
+      <key>max</key>
+      <value>samp_rate/2</value>
+    </param>
+    <param>
+      <key>num_steps</key>
+      <value>100</value>
+    </param>
+    <param>
+      <key>style</key>
+      <value>wx.SL_HORIZONTAL</value>
+    </param>
+    <param>
+      <key>converver</key>
+      <value>float_converter</value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value></value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(63, 483)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>p2p</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>2**15</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(179, 37)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>gr_multiply_const_vxx</key>
+    <param>
+      <key>id</key>
+      <value>gr_multiply_const_vxx_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>complex</value>
+    </param>
+    <param>
+      <key>const</key>
+      <value>tx_ampl*p2p/2.</value>
+    </param>
+    <param>
+      <key>vlen</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(306, 355)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>wxgui_fftsink2</key>
+    <param>
+      <key>id</key>
+      <value>wxgui_fftsink2_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>complex</value>
+    </param>
+    <param>
+      <key>title</key>
+      <value>Transmit Spectrum</value>
+    </param>
+    <param>
+      <key>samp_rate</key>
+      <value>samp_rate</value>
+    </param>
+    <param>
+      <key>baseband_freq</key>
+      <value>bb_freq</value>
+    </param>
+    <param>
+      <key>y_per_div</key>
+      <value>10</value>
+    </param>
+    <param>
+      <key>y_divs</key>
+      <value>10</value>
+    </param>
+    <param>
+      <key>ref_level</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>ref_scale</key>
+      <value>p2p</value>
+    </param>
+    <param>
+      <key>fft_size</key>
+      <value>1024</value>
+    </param>
+    <param>
+      <key>fft_rate</key>
+      <value>20</value>
+    </param>
+    <param>
+      <key>peak_hold</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>average</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>avg_alpha</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>win</key>
+      <value>None</value>
+    </param>
+    <param>
+      <key>win_size</key>
+      <value></value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value></value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(576, 410)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>samp_rate</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>1e6/4</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(12, 207)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <connection>
+    <source_block_id>random_source_x_0</source_block_id>
+    <sink_block_id>blks2_dxpsk2_mod_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>blks2_dxpsk2_mod_0</source_block_id>
+    <sink_block_id>gr_multiply_const_vxx_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>gr_multiply_const_vxx_0</source_block_id>
+    <sink_block_id>usrp_simple_sink_x_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>gr_multiply_const_vxx_0</source_block_id>
+    <sink_block_id>wxgui_fftsink2_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+</flow_graph>
index 33061d3ab41ce59cf706e6bacf419b7692b3e686..ca4a54fb08f6e050cbd20e1c0f5180c65056dbdb 100644 (file)
@@ -4,3 +4,5 @@
 /.deps
 /msdd.cc
 /msdd.py
+/msdd_rs.cc
+/msdd_rs.py
index 0865d40de7c96d5f51cc87b3331463e862bb9ddd..9ae4efb0a6672bce6589f4f7326e58f77dc68a58 100644 (file)
@@ -28,26 +28,40 @@ AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
 grinclude_HEADERS =                    \
        msdd_source_simple.h            \
        msdd_buffer_copy_behaviors.h    \
-       msdd6000.h
+       msdd6000.h                      \
+       msdd_rs_source_simple.h         \
+       msdd6000_rs.h
 
-lib_LTLIBRARIES = libgnuradio-msdd6000.la
+lib_LTLIBRARIES = libgnuradio-msdd6000.la \
+       libgnuradio-msdd6000_rs.la
 
 libgnuradio_msdd6000_la_SOURCES =      \
        msdd_source_simple.cc           \
        msdd6000.cc
 
+
+libgnuradio_msdd6000_rs_la_SOURCES =   \
+       msdd_rs_source_simple.cc                \
+       msdd6000_rs.cc
+
 libgnuradio_msdd6000_la_LIBADD =       \
        $(GNURADIO_CORE_LA)
 
 libgnuradio_msdd6000_la_LDFLAGS =      \
        $(NO_UNDEFINED)
 
+libgnuradio_msdd6000_rs_la_LIBADD =    \
+       $(GNURADIO_CORE_LA)
+
+libgnuradio_msdd6000_rs_la_LDFLAGS =   \
+       $(NO_UNDEFINED)
+
 if PYTHON
 #################################
 # SWIG interface and library
 
 TOP_SWIG_IFILES =                      \
-       msdd.i
+       msdd.i msdd_rs.i
 
 # Install so that they end up available as:
 #   import gnuradio.msdd
@@ -56,10 +70,16 @@ TOP_SWIG_IFILES =                   \
 msdd_pythondir_category =              \
        gnuradio
 
+msdd_rs_pythondir_category =   \ 
+       gnuradio
+
 # additional libraries for linking with the SWIG-generated library
 msdd_la_swig_libadd =                  \
        libgnuradio-msdd6000.la
 
+msdd_rs_la_swig_libadd =                       \
+       libgnuradio-msdd6000_rs.la
+
 include $(top_srcdir)/Makefile.swig
 
 # add some of the variables generated inside the Makefile.swig.gen
index 5c2920230f6f9ec2c22447d0c247f183eac160e0..ced3979f7fcb68f12f032478d015873b66adb91a 100644 (file)
 ## this has to be done in the including Makefile.am -before-
 ## Makefile.swig is included.
 
+
 msdd_pythondir_category ?= gnuradio/msdd
 msdd_pylibdir_category ?= $(msdd_pythondir_category)
 msdd_pythondir = $(pythondir)/$(msdd_pythondir_category)
 msdd_pylibdir = $(pyexecdir)/$(msdd_pylibdir_category)
 
+msdd_rs_pythondir_category ?= gnuradio/msdd_rs
+msdd_rs_pylibdir_category ?= $(msdd_rs_pythondir_category)
+msdd_rs_pythondir = $(pythondir)/$(msdd_rs_pythondir_category)
+msdd_rs_pylibdir = $(pyexecdir)/$(msdd_rs_pylibdir_category)
+
 ## SWIG headers are always installed into the same directory.
 
 msdd_swigincludedir = $(swigincludedir)
+msdd_rs_swigincludedir = $(swigincludedir)
 
 ## This is a template file for a "generated" Makefile addition (in
 ## this case, "Makefile.swig.gen").  By including the top-level
@@ -63,6 +70,7 @@ msdd_swigincludedir = $(swigincludedir)
 ## the SWIG-generated files will be removed from the distribution.
 
 STAMPS += $(DEPDIR)/msdd-generate-*
+STAMPS += $(DEPDIR)/msdd_rs-generate-*
 
 ## Other cleaned files: dependency files generated by SWIG or this Makefile
 
@@ -72,27 +80,40 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S*
 ## .h file is sometimes built, but not always ... so that one has to
 ## be added manually by the including Makefile.am .
 
-swig_built_sources += msdd.py msdd.cc
+swig_built_sources += msdd.py msdd_rs.py msdd.cc msdd_rs.cc
 
 ## Various SWIG variables.  These can be overloaded in the including
 ## Makefile.am by setting the variable value there, then including
 ## Makefile.swig .
 
 msdd_swiginclude_HEADERS =             \
-       msdd.i                  \
+       msdd.i                          \
+       msdd_rs.i                       \
        $(msdd_swiginclude_headers)
 
 msdd_pylib_LTLIBRARIES =               \
        _msdd.la
 
+msdd_rs_pylib_LTLIBRARIES =            \
+        _msdd_rs.la
+
 _msdd_la_SOURCES =                     \
-       msdd.cc                 \
+       msdd.cc                         \
        $(msdd_la_swig_sources)
 
+_msdd_rs_la_SOURCES =                          \
+    msdd_rs.cc                                 \
+    $(msdd_la_swig_sources)
+
+
 _msdd_la_LIBADD =                      \
        $(STD_SWIG_LA_LIB_ADD)          \
        $(msdd_la_swig_libadd)
 
+_msdd_rs_la_LIBADD =                           \
+    $(STD_SWIG_LA_LIB_ADD)             \
+    $(msdd_rs_la_swig_libadd)
+
 _msdd_la_LDFLAGS =                     \
        $(STD_SWIG_LA_LD_FLAGS)         \
        $(msdd_la_swig_ldflags)
@@ -101,10 +122,22 @@ _msdd_la_CXXFLAGS =                       \
        $(STD_SWIG_CXX_FLAGS)           \
        $(msdd_la_swig_cxxflags)
 
+_msdd_rs_la_LDFLAGS =                          \
+    $(STD_SWIG_LA_LD_FLAGS)            \
+    $(msdd_rs_la_swig_ldflags)
+
+_msdd_rs_la_CXXFLAGS =                         \
+    $(STD_SWIG_CXX_FLAGS)              \
+    $(msdd_rs_la_swig_cxxflags)
+
 msdd_python_PYTHON =                   \
-       msdd.py                 \
+       msdd.py                         \
        $(msdd_python)
 
+msdd_rs_python_PYTHON =                        \
+    msdd_rs.py                                 \
+    $(msdd_rs_python)
+
 ## Entry rule for running SWIG
 
 msdd.h msdd.py msdd.cc: msdd.i
@@ -251,9 +284,161 @@ $(DEPDIR)/msdd-generate-stamp:
 ##
        touch $(DEPDIR)/msdd-generate-stamp
 
+
+
+
+
+
+msdd_rs.h msdd_rs.py msdd_rs.cc: msdd_rs.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/msdd-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/msdd_rs-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/msdd_rs-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/msdd_rs-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/msdd_rs-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/msdd_rs-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/msdd_rs-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/msdd_rs-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/msdd_rs-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(msdd_rs_swig_args) \
+               -MD -MF $(DEPDIR)/msdd_rs.Std \
+               -module msdd_rs -o msdd_rs.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/msdd_rs.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/msdd_rs.Std \
+                       > $(DEPDIR)/msdd_rs.Sd; \
+               $(RM) $(DEPDIR)/msdd_rs.Std; \
+               $(MV) $(DEPDIR)/msdd_rs.Sd $(DEPDIR)/msdd_rs.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/msdd_rs.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/msdd_rs.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/msdd_rs.Std $(DEPDIR)/msdd_rs.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/msdd_rs.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/msdd_rs.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/msdd_rs.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/msdd_rs.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/msdd_rs-generate-stamp
+
 # KLUDGE: Force runtime include of a SWIG dependency file.  This is
 # not guaranteed to be portable, but will probably work.  If it works,
 # we have accurate dependencies for our swig stuff, which is good.
 
+
 @am__include@ @am__quote@./$(DEPDIR)/msdd.d@am__quote@
+@am__include@ @am__quote@./$(DEPDIR)/msdd_rs.d@am__quote@
+
 
diff --git a/gr-msdd6000/src/msdd6000_rs.cc b/gr-msdd6000/src/msdd6000_rs.cc
new file mode 100644 (file)
index 0000000..d78f2b4
--- /dev/null
@@ -0,0 +1,286 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <msdd6000_rs.h>
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#define DEBUG(A)       printf("=debug=> %s\n", A)
+
+static void 
+optimize_socket(int socket);
+
+/*
+ * Holds types that need autoconf help.  They're here and not in the .h file because
+ * here we've got access to config.h
+ */
+class MSDD6000_RS::detail {
+public:
+  struct sockaddr_in d_sockaddr;
+};
+
+
+MSDD6000_RS::MSDD6000_RS(char* addr)
+  : d_detail(new MSDD6000_RS::detail())
+{
+       d_sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
+       
+       optimize_socket(d_sock);
+       
+       
+       // set up remote sockaddr
+//     int s = inet_aton(addr, &d_adx); 
+       d_detail->d_sockaddr.sin_family = AF_INET;
+       d_detail->d_sockaddr.sin_port = htons(10000);
+       int s = inet_aton(addr, &d_detail->d_sockaddr.sin_addr);
+       
+       // set up local sockaddr
+       struct in_addr d_myadx;
+       struct sockaddr_in d_mysockaddr;
+       short int port = 10010;
+       d_myadx.s_addr = INADDR_ANY;
+       d_mysockaddr.sin_family = AF_INET;
+       d_mysockaddr.sin_port = htons(port);
+       memcpy(&d_mysockaddr.sin_addr.s_addr, &d_myadx.s_addr, sizeof(in_addr));
+       //d_sockaddr.sin_addr = INADDR_ANY;
+       s = bind(d_sock, (const sockaddr*) &d_mysockaddr, sizeof(d_mysockaddr));
+       
+       // set default values
+       //d_decim = 2;
+       d_ddc_gain      = 2;
+       d_rf_attn       = 0;
+       d_fc_mhz        = 3500;
+       d_offset_hz = 0;
+        d_ddc_gain  = 0;
+        d_ddc_sample_rate_khz = 25600;
+        d_ddc_bw_khz          = 25600;
+        d_start               = 0;
+       d_state = STATE_STOPPED;
+}
+
+MSDD6000_RS::~MSDD6000_RS()
+{
+       //printf("MSDD6000_RS::Destructing\n");
+       close(d_sock);
+}
+
+
+static void
+optimize_socket(int socket){
+#define BANDWIDTH      1000000000/8
+#define DELAY          0.5
+       int ret;
+
+       int sock_buf_size = static_cast<int>(2*BANDWIDTH*DELAY);
+       char textbuf[512];
+       snprintf(textbuf, sizeof(textbuf), "%d", sock_buf_size);
+       printf("sock_buf_size = %d\n", sock_buf_size);
+       
+       ret = setsockopt(socket, SOL_SOCKET, SO_SNDBUF,
+                        &sock_buf_size, sizeof(sock_buf_size));
+
+       ret = setsockopt(socket, SOL_SOCKET, SO_RCVBUF,
+                        &sock_buf_size, sizeof(sock_buf_size));
+       
+       int uid = getuid();
+       if(uid!=0){
+               printf(" ****** COULD NOT OPTIMIZE SYSTEM NETWORK PARAMETERS BECAUSE YOU ARE NOT RUNNING AS ROOT *******\n ****** YOUR MSDD6000_RS RECIEVER PERFORMANCE IS GOING TO BE TERRIBLE *******\n");
+               return;
+       }
+
+
+       // SET UP SOME SYSTEM WIDE TCP SOCKET PARAMETERS
+       // FIXME seems like kind of a big hammer.  Are you sure you need this?
+       FILE* fd = fopen("/proc/sys/net/core/netdev_max_backlog", "w");
+       if (fd){
+         fwrite("10000", 1, strlen("10000"), fd);
+         fclose(fd);
+       }
+
+       fd = fopen("/proc/sys/net/core/rmem_max", "w");
+       if (fd){
+         fwrite(textbuf, 1, strlen(textbuf), fd);
+         fclose(fd);
+       }
+
+       fd = fopen("/proc/sys/net/core/wmem_max", "w");
+       if (fd){
+         fwrite(textbuf, 1, strlen(textbuf), fd);
+         fclose(fd);
+       }
+
+       // just incase these were rejected before because of max sizes...
+
+       ret = setsockopt( socket, SOL_SOCKET, SO_SNDBUF,
+                   (char *)&sock_buf_size, sizeof(sock_buf_size) );
+
+       ret = setsockopt( socket, SOL_SOCKET, SO_RCVBUF,
+                   (char *)&sock_buf_size, sizeof(sock_buf_size) );
+       
+}
+
+
+//void MSDD6000_RS::set_decim(int decim_pow2){
+//     DEBUG("SETTING NEW DECIM");
+//     d_decim = decim_pow2;
+//
+//     if(d_state==STATE_STARTED)
+//             send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_decim, d_offset_hz);
+//}
+
+void MSDD6000_RS::set_rf_attn(int attn){
+       DEBUG("SETTING NEW RF ATTN");
+       d_rf_attn = attn;
+       if(d_state==STATE_STARTED)
+               send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);
+}
+
+void MSDD6000_RS::set_ddc_gain(int gain){
+       DEBUG("SETTING NEW DDC GAIN");
+       d_ddc_gain = gain;
+       if(d_state==STATE_STARTED)
+               send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);
+}
+
+void MSDD6000_RS::set_fc(int center_mhz, int offset_hz){
+       DEBUG("SETTING NEW FC");
+       d_fc_mhz = center_mhz;
+       d_offset_hz = offset_hz;
+       
+       send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);
+//     if(d_state==STATE_STARTED)
+//             send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_decim, d_offset_hz);
+//             send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);
+//             
+}
+
+void MSDD6000_RS::set_ddc_samp_rate(float sample_rate_khz){
+       DEBUG("SETTING NEW SAMPLE RATE");
+       d_ddc_sample_rate_khz = sample_rate_khz;
+       send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);               
+}
+
+void MSDD6000_RS::set_ddc_bw(float bw_khz){
+       DEBUG("SETTING NEW DDC BW");
+       d_ddc_bw_khz = bw_khz;
+       send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);               
+}
+
+void MSDD6000_RS::start(){
+    send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);       
+    return;
+}
+
+void MSDD6000_RS::stop(){
+       // new request with 0 decim tells it to halt
+       stop_data();
+}
+
+
+int MSDD6000_RS::start_data(){
+       d_start = 1;
+       send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);       
+       d_state = STATE_STARTED;
+    return 0;
+       }
+
+
+int MSDD6000_RS::stop_data(){
+       // new request with 0 decim tells it to halt
+       d_start = 0;
+       send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);       
+       d_state = STATE_STOPPED;
+    return 0;
+       }
+       
+/* Query functions */
+float MSDD6000_RS::pull_ddc_samp_rate(){
+  return d_ddc_sample_rate_khz;
+}
+float MSDD6000_RS::pull_ddc_bw(){
+       return d_ddc_bw_khz;
+}
+
+float MSDD6000_RS::pull_rx_freq(){
+       return d_fc_mhz;
+}
+int   MSDD6000_RS::pull_ddc_gain(){
+       return d_ddc_gain;
+}
+
+int   MSDD6000_RS::pull_rf_atten(){
+       return d_rf_attn;
+}
+
+
+void MSDD6000_RS::send_request(float freq_mhz, float rf_attn, float ddc_gain, float ddc_offset_hz, float ddc_samp_rate_khz, float ddc_input_bw_khz, float ddc_start){
+       static char buff[512];
+       // Send MSDD6000_RS control frame.
+       sprintf(buff, "%f %f %f %f %f %f %f\n",freq_mhz, rf_attn, ddc_gain, ddc_offset_hz, ddc_samp_rate_khz, ddc_input_bw_khz, ddc_start); //ddc_dec, ddc_offset_hz);
+       printf("sending: %s\n", buff);
+        int flags = 0;
+       sendto( d_sock, buff, strlen(buff)+1, flags,
+               (const sockaddr*)&(d_detail->d_sockaddr), sizeof(d_detail->d_sockaddr));
+       }
+
+
+int  MSDD6000_RS::read(char* buf, int size){
+       int flags = 0;
+       return recv(d_sock, buf, size, flags);
+       }
+       
+int MSDD6000_RS::parse_control(char* buf, int size){
+    //packet_len = sprintf(&txbuff[6], "%f %f %f %f %f %f %f",downsamp,ddc_dec_rate,ddc_step_int,ddc_step_frac,ddc_samp_rate_khz,ddc_input_bw_khz,ddc_start);    
+
+    float downsamp;
+    float ddc_dec_rate;
+    float ddc_step_int;
+    float ddc_step_frac;
+    float ddc_samp_rate_khz;
+    float ddc_input_bw_khz;
+    float ddc_start;
+
+    sscanf(&buf[6],"%f %f %f %f %f %f %f",&downsamp,&ddc_dec_rate,&ddc_step_int,&ddc_step_frac,&ddc_samp_rate_khz,&ddc_input_bw_khz,&ddc_start);
+  
+    // pull off sample rate  
+    d_ddc_sample_rate_khz = ddc_samp_rate_khz;
+    printf("Sample Rate %f\n",d_ddc_sample_rate_khz);
+    // pull off bw
+    d_ddc_bw_khz  =  ddc_input_bw_khz;
+    printf("BW %f\n", d_ddc_bw_khz);
+    return 0;
+}
+
+
diff --git a/gr-msdd6000/src/msdd6000_rs.h b/gr-msdd6000/src/msdd6000_rs.h
new file mode 100644 (file)
index 0000000..4be4624
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef MSDD_RS__RS_6000_H
+#define MSDD_RS__RS_6000_H
+
+#include <boost/scoped_ptr.hpp>
+
+class MSDD6000_RS {
+  class detail;
+
+  //! holds objects with system dependent types
+  boost::scoped_ptr<detail>    d_detail;  
+
+public:
+
+  enum state {
+    STATE_STOPPED, STATE_STARTED
+  };
+
+  MSDD6000_RS(char* ip_addr);
+  ~MSDD6000_RS();
+
+  /* set functions -- sets digitizer parameters */
+ // void set_output(int mode, void* arg);
+
+  void set_rf_attn(int attn);
+  void set_ddc_gain(int gain);
+  void set_fc(int center_mhz, int offset_hz);
+  void set_ddc_samp_rate(float sample_rate_khz);
+  void set_ddc_bw(float bw_khz);
+
+  void start();
+  void stop();
+
+  /* function starts the flow of data from the digitizer */
+  int start_data();
+  /* function stops the flow of data from the digitizer */
+  int stop_data();
+  
+  /* query functions -- queries digitizer 'actual' parameters */
+  float pull_ddc_samp_rate();
+  float pull_ddc_bw();
+  float pull_rx_freq();
+  int   pull_ddc_gain();
+  int   pull_rf_atten();
+       
+  void send_request(float,float,float,float,float,float,float);        
+  int read(char*, int);
+
+  int parse_control(char*, int);
+
+private:
+  // parameters for a receiver object.
+  int   d_fc_mhz;
+  int   d_offset_hz;
+  int   d_rf_attn;
+  int   d_ddc_gain;
+  float d_ddc_sample_rate_khz;
+  float d_ddc_bw_khz;
+  int   d_start;
+  int   d_sock;
+  state d_state;
+
+};
+
+
+#endif
diff --git a/gr-msdd6000/src/msdd_rs.i b/gr-msdd6000/src/msdd_rs.i
new file mode 100644 (file)
index 0000000..16a1bec
--- /dev/null
@@ -0,0 +1,93 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004,2009 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%include "gnuradio.i"  // the common stuff
+
+%{
+#include "msdd_rs_source_simple.h"
+%}
+
+
+GR_SWIG_BLOCK_MAGIC(msdd_rs,source_simple)
+
+msdd_rs_source_simple_sptr
+msdd_rs_make_source_simple (
+       const char *src,
+       unsigned short port_src
+       );
+
+class msdd_rs_source_simple : public gr_sync_block {
+  protected:
+    msdd_rs_source_simple(
+       const char *src,
+       unsigned short port_src
+       );
+  public:
+    ~msdd_rs_source_c(); 
+  int work (int noutput_items,
+      gr_vector_const_void_star &input_items,
+      gr_vector_void_star &output_items);
+
+  bool start();
+  bool stop();
+
+  /* function starts the flow of data */
+  int start_data();
+
+  /* function stops the flow of data */
+  int stop_data();
+
+  long pull_adc_freq();
+  /* Request the current ddc sample rate */
+  float pull_ddc_samp_rate();
+  /* Request the current ddc bandwidth */
+  float pull_ddc_bw();
+  /* Request the current rx freq */
+  float pull_rx_freq();
+  /* Request current ddc gain */
+  int pull_ddc_gain();
+  /* Request current RF attenuation */
+  int pull_rf_atten();
+
+
+  /*  int decim_rate(); */
+  gr_vector_int gain_range();
+  gr_vector_float freq_range();
+
+  /* Set Functions */
+  /*  bool set_decim_rate(unsigned int); */
+  bool set_rx_freq(double); /* set_rx_freq(int,double); */
+  /*  bool set_pga(int,double); */
+
+  bool set_ddc_gain(double);
+  /* Set desired sample rate of MSDD6000 -- Note bounds checking is 
+  done by the module and it will return the value actually used in the hardware. */
+  bool set_ddc_samp_rate(double);
+  /* Set desired input BW of MSDD6000 -- Note bounds checking is 
+  // done by the module and it will return the value actually used in the hardware. */
+  bool set_ddc_bw(double);
+
+  bool set_rf_atten(double);
+
+
+  };
diff --git a/gr-msdd6000/src/msdd_rs_source_simple.cc b/gr-msdd6000/src/msdd_rs_source_simple.cc
new file mode 100644 (file)
index 0000000..36bed31
--- /dev/null
@@ -0,0 +1,236 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <msdd_rs_source_simple.h>
+#include <gr_io_signature.h>
+#include <string.h>
+
+
+msdd_rs_source_simple_sptr
+msdd_rs_make_source_simple ( const char *src, unsigned short port_src) 
+{
+  return msdd_rs_source_simple_sptr (new msdd_rs_source_simple ( src, port_src)); 
+}
+
+
+msdd_rs_source_simple::msdd_rs_source_simple (
+                   const char *src, 
+                   unsigned short port_src) 
+               : gr_sync_block("MSDD_RS_SOURCE_SIMPLE",
+                               gr_make_io_signature (0,0,0),
+                               gr_make_io_signature (1, 1, sizeof (short))),
+                  rcv(new MSDD6000_RS((char*) src)), d_lastseq(0)
+{
+}
+
+msdd_rs_source_simple::~msdd_rs_source_simple ()
+{
+}
+
+
+int
+msdd_rs_source_simple::work (int noutput_items,
+                         gr_vector_const_void_star &input_items,
+                         gr_vector_void_star &output_items)
+{
+       
+#define BUF_LEN        (366*sizeof(short)*2 + 6)
+
+       float* out1 =(float*) output_items[0];
+
+       char buffer[BUF_LEN];
+       /* Read a buffer out -- looking at UDP payload at this point.*/
+       rcv->read( &buffer[0], BUF_LEN );
+       
+       int seq = *((int*) &buffer[2]);
+       char type = buffer[0];
+       //printf("Sequence %d\n",seq);
+       
+       // FIXME get rid of these magic 366's!
+       if(d_lastseq == -366)
+       {
+        if (type != 0){
+            /* Received control packet -- parse and update locally stored parameters */
+            printf("Parsing control Packet\n");
+            rcv->parse_control(&buffer[0], seq);       
+        }
+        else{   
+            // not started case
+            if(seq == 0){
+                d_lastseq = 0;
+            } 
+            else 
+            {
+                // THROW AWAY SAMPLES WE ARE NOT STARTED YET!
+                return 0;
+            }
+        }
+       } 
+       // Started case
+       else 
+       {
+        if (type != 0){
+                        /* Received control packet -- parse and update locally stored parameters */
+            printf("Parsing control Packet\n");
+            rcv->parse_control(&buffer[0], seq);       
+        }
+            
+        else {
+            int samples_missed = seq - d_lastseq - 366;
+            if(samples_missed > 0)
+            {
+                printf("dropped %d samples.\n", samples_missed);
+            }
+            d_lastseq = seq;
+        }
+       }
+       
+       if(noutput_items< 366*2){
+               printf("NOT ENOUGH SPACE IN OUTPUT BUFFER!!! >:-(\n");
+               }
+       
+       memcpy(&out1[0], &buffer[6], BUF_LEN - 6);
+       
+//     for(int i = 0; i < 366*2; i++){
+//             out1[i] = (float)  (*((short*) &buffer[6+2*i]) );
+//     }
+       
+       return 366*2;
+}
+
+//bool msdd_rs_source_simple::set_decim_rate(unsigned int rate)
+//{
+//     // FIXME seems buggy.  How about a floor or ceil?
+//        rcv->set_decim((int) log2(rate));
+//     return true;
+//}
+
+bool msdd_rs_source_simple::set_rx_freq(double freq)
+{
+       long new_fc = (long)freq;
+       rcv->set_fc( new_fc/1000000, new_fc%1000000);
+       return true;
+}
+
+
+bool msdd_rs_source_simple::set_ddc_gain(double gain)
+{
+       if(gain < 0 || gain > 7){ // only 3 bits available.
+               printf("GAIN IS OUTSIDE ACCEPTABLE RANGE!\n");
+               return false;
+       }
+       //decimation gain
+       rcv->set_ddc_gain((int)gain);
+       return true;
+}
+
+// Set desired sample rate of MSDD6000 -- Note bounds checking is 
+// done by the module and it will return the value actually used in the hardware.
+bool msdd_rs_source_simple::set_ddc_samp_rate(double rate)
+{
+       rcv->set_ddc_samp_rate((float) rate);
+       return true;            
+}
+
+// Set desired input BW of MSDD6000 -- Note bounds checking is 
+// done by the module and it will return the value actually used in the hardware.
+bool msdd_rs_source_simple::set_ddc_bw(double bw)
+{
+       rcv->set_ddc_bw((float) bw);
+       return true;            
+}
+
+bool msdd_rs_source_simple::set_rf_atten(double rf_atten)
+{
+        rcv->set_rf_attn((int) rf_atten);
+        return true;
+}
+
+bool msdd_rs_source_simple::start()
+{
+       rcv->start();
+    rcv->stop_data();
+       return true;
+}
+
+bool msdd_rs_source_simple::stop()
+{
+       rcv->stop();
+       return true;
+}
+
+int msdd_rs_source_simple::start_data()
+{
+       return rcv->start_data();
+}
+
+int msdd_rs_source_simple::stop_data()
+{
+       return rcv->stop_data();
+}
+
+/* Query functions */
+long msdd_rs_source_simple::pull_adc_freq(){
+       return 102400000;
+}
+
+/* Request the current ddc sample rate */
+float msdd_rs_source_simple::pull_ddc_samp_rate(){
+       return(rcv->pull_ddc_samp_rate());
+}
+
+/* Request the current ddc bandwidth */
+float msdd_rs_source_simple::pull_ddc_bw(){
+       return(rcv->pull_ddc_bw());
+       
+}
+
+/* Request the current rx freq */
+float msdd_rs_source_simple::pull_rx_freq(){
+       return(rcv->pull_rx_freq());
+}
+
+/* Request current ddc gain */
+int msdd_rs_source_simple::pull_ddc_gain(){
+       return(rcv->pull_ddc_gain());
+}
+
+/* Request current RF attenuation */
+int msdd_rs_source_simple::pull_rf_atten(){
+       return(rcv->pull_rf_atten());
+}
+
+std::vector<int> msdd_rs_source_simple::gain_range(){
+       static std::vector<int> r;
+       r.push_back(0);
+       r.push_back(12);
+       return r;
+}
+
+std::vector<float> msdd_rs_source_simple::freq_range(){
+       std::vector<float> r;
+       r.push_back(30.0*1000*1000);
+       r.push_back(6.0*1000*1000*1000);
+       return r;
+}
diff --git a/gr-msdd6000/src/msdd_rs_source_simple.h b/gr-msdd6000/src/msdd_rs_source_simple.h
new file mode 100644 (file)
index 0000000..f320cbb
--- /dev/null
@@ -0,0 +1,87 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_MSDD_RS_SOURCE_SIMPLE_H
+#define INCLUDED_MSDD_RS_SOURCE_SIMPLE_H
+
+#include <gr_sync_block.h>
+#include <msdd6000_rs.h>
+#include <boost/scoped_ptr.hpp>
+
+class msdd_rs_source_simple;
+typedef boost::shared_ptr<msdd_rs_source_simple> msdd_rs_source_simple_sptr;
+
+
+// public shared_ptr constructor
+
+msdd_rs_source_simple_sptr msdd_rs_make_source_simple ( const char *src, unsigned short port_src);
+
+
+class msdd_rs_source_simple : public gr_sync_block {
+ private:
+  friend msdd_rs_source_simple_sptr
+  msdd_rs_make_source_simple ( const char *src, unsigned short port_src);
+
+  boost::scoped_ptr<MSDD6000_RS> rcv;
+  int d_lastseq;
+
+ protected:
+  msdd_rs_source_simple (const char *src, unsigned short port_src);
+
+ public:
+  ~msdd_rs_source_simple ();
+  bool stop();
+  bool start();
+
+  /* function starts the flow of data from the digitizer */
+  int start_data();
+  /* function stops the flow of data from the digitizer */
+  int stop_data();
+
+  // Do not need this //
+//  bool set_decim_rate(unsigned int);
+  /* Adding functions for setting the sample rate and
+  * receiver bandwidth
+  */
+  
+  /* hardware commands -- change current state of digitizer */
+  bool set_ddc_samp_rate(double);
+  bool set_ddc_bw(double);
+  
+  bool set_rx_freq(double);
+  bool set_ddc_gain(double);
+  bool set_rf_atten(double);
+
+  int work(int, gr_vector_const_void_star&, gr_vector_void_star&);
+  
+  /* Query methods -- query current state of digitizer */
+  long  pull_adc_freq();
+  float pull_ddc_samp_rate();
+  float pull_ddc_bw();
+  float pull_rx_freq();
+  int   pull_ddc_gain();
+  int   pull_rf_atten();
+  
+  /* Pulling back gain and frequency ranges */
+  std::vector<int> gain_range();
+  std::vector<float> freq_range();
+};
+
+#endif /* INCLUDED_MSDD_RS__RS__SOURCE_C_H */
diff --git a/gr-msdd6000/src/python-examples/msdd_rs_spec_an.py b/gr-msdd6000/src/python-examples/msdd_rs_spec_an.py
new file mode 100755 (executable)
index 0000000..4855375
--- /dev/null
@@ -0,0 +1,350 @@
+#!/usr/bin/env python
+#
+# Copyright 2009 Free Software Foundation, Inc.
+# 
+# This file is part of GNU Radio
+# 
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+# 
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+# 
+
+from gnuradio import gr
+from gnuradio import msdd_rs
+from gnuradio import eng_notation
+from gnuradio.eng_option import eng_option
+from gnuradio.qtgui import qtgui
+from optparse import OptionParser
+import sys,time
+
+try:
+    from gnuradio.qtgui import qtgui
+    from PyQt4 import QtGui, QtCore
+    import sip
+except ImportError:
+    print "Please install gr-qtgui."
+    sys.exit(1)
+
+try:
+    from msdd_display_qtgui import Ui_MainWindow
+except ImportError:
+    print "Error: could not find msdd_display_qtgui.py:"
+    print "\t\"pyuic4 msdd_display_qtgui.ui -o msdd_display_qtgui.py\""
+    sys.exit(1)
+
+
+# ////////////////////////////////////////////////////////////////////
+#        Define the QT Interface and Control Dialog
+# ////////////////////////////////////////////////////////////////////
+
+
+class main_window(QtGui.QMainWindow):
+    def __init__(self, snk, fg, parent=None):
+
+        QtGui.QWidget.__init__(self, parent)
+        self.gui = Ui_MainWindow()
+        self.gui.setupUi(self)
+
+        self.fg = fg
+
+        # Add the qtsnk widgets to the layout box
+        self.gui.sinkLayout.addWidget(snk)
+
+        self.gui.dcGainEdit.setText(QtCore.QString("%1").arg(0.001))
+
+        # Connect up some signals
+        self.connect(self.gui.pauseButton, QtCore.SIGNAL("clicked()"),
+                     self.pauseFg)
+        self.connect(self.gui.frequencyEdit, QtCore.SIGNAL("editingFinished()"),
+                     self.frequencyEditText)
+        self.connect(self.gui.gainEdit, QtCore.SIGNAL("editingFinished()"),
+                     self.gainEditText)
+        self.connect(self.gui.bandwidthEdit, QtCore.SIGNAL("editingFinished()"),
+                     self.bandwidthEditText)
+        self.connect(self.gui.amplifierEdit, QtCore.SIGNAL("editingFinished()"),
+                     self.amplifierEditText)
+
+        self.connect(self.gui.actionSaveData, QtCore.SIGNAL("activated()"),
+                     self.saveData)
+        self.gui.actionSaveData.setShortcut(QtGui.QKeySequence.Save)
+
+        self.connect(self.gui.dcGainEdit, QtCore.SIGNAL("editingFinished()"),
+                     self.dcGainEditText)
+        self.connect(self.gui.dcCancelCheckBox, QtCore.SIGNAL("clicked(bool)"),
+                     self.dcCancelClicked)
+
+    def pauseFg(self):
+        if(self.gui.pauseButton.text() == "Pause"):
+            self.fg.stop()
+            self.fg.wait()
+            self.fg.stop_data()
+            self.gui.pauseButton.setText("Unpause")
+        else:
+            self.fg.start()
+            self.fg.start_data()
+            self.gui.pauseButton.setText("Pause")
+      
+
+    # Functions to set the values in the GUI
+    def set_frequency(self, freq):
+        self.freq = freq
+        sfreq = eng_notation.num_to_str(self.freq)
+        self.gui.frequencyEdit.setText(QtCore.QString("%1").arg(sfreq))
+        
+    def set_gain(self, gain):
+        self.gain = gain
+        self.gui.gainEdit.setText(QtCore.QString("%1").arg(self.gain))
+
+    def set_bandwidth(self, bw):
+        self.bw = bw
+        sbw = eng_notation.num_to_str(self.bw)
+        self.gui.bandwidthEdit.setText(QtCore.QString("%1").arg(sbw))
+
+    def set_amplifier(self, amp):
+        self.amp = amp
+        self.gui.amplifierEdit.setText(QtCore.QString("%1").arg(self.amp))
+
+
+    # Functions called when signals are triggered in the GUI
+    def frequencyEditText(self):
+        try:
+            freq = eng_notation.str_to_num(self.gui.frequencyEdit.text().toAscii()) 
+            self.fg.set_frequency(freq)
+            self.freq = freq
+        except RuntimeError:
+            pass
+
+    def gainEditText(self):
+        try:
+            gain = float(self.gui.gainEdit.text())
+            self.fg.set_gain(gain)
+            self.gain = gain
+        except ValueError:
+            pass
+                
+    def bandwidthEditText(self):
+        try:
+            bw = eng_notation.str_to_num(self.gui.bandwidthEdit.text().toAscii())
+            self.fg.set_bandwidth(bw)
+            self.bw = bw
+        except ValueError:
+            pass
+        
+    def amplifierEditText(self):
+        try:
+            amp = float(self.gui.amplifierEdit.text())
+            self.fg.set_amplifier_gain(amp)
+            self.amp = amp
+        except ValueError:
+            pass
+
+    def saveData(self):
+        fileName = QtGui.QFileDialog.getSaveFileName(self, "Save data to file", ".");
+        if(len(fileName)):
+            self.fg.save_to_file(str(fileName))
+
+    def dcGainEditText(self):
+        gain = float(self.gui.dcGainEdit.text())
+        self.fg.set_dc_gain(gain)
+        
+    def dcCancelClicked(self, state):
+        self.dcGainEditText()
+        self.fg.cancel_dc(state)
+        
+
+        
+class my_top_block(gr.top_block):
+    def __init__(self):
+        gr.top_block.__init__(self)
+
+        parser = OptionParser(option_class=eng_option)
+        parser.add_option("-e", "--interface", type="string", default="eth0",
+                          help="select Ethernet interface, default is eth0")
+        parser.add_option("-m", "--mac-addr", type="string", default="",
+                          help="select USRP by MAC address, default is auto-select")
+        parser.add_option("-W", "--bw", type="float", default=1e6,
+                          help="set bandwidth of receiver [default=%default]")
+        parser.add_option("-f", "--freq", type="eng_float", default="2.4G",
+                          help="set frequency to FREQ", metavar="FREQ")
+        parser.add_option("-g", "--gain", type="eng_float", default=None,
+                          help="set gain in dB (default is midpoint)")
+        parser.add_option("--fft-size", type="int", default=2048,
+                          help="Set number of FFT bins [default=%default]")
+        (options, args) = parser.parse_args()
+
+        if len(args) != 0:
+            parser.print_help()
+            sys.exit(1)
+       self.options = options
+        self.show_debug_info = True
+        
+        self.qapp = QtGui.QApplication(sys.argv)
+
+#        self.u = usrp2.source_32fc(options.interface, options.mac_addr)
+       self.u = msdd_rs.source_simple("192.168.1.20", 10000);
+       self.conv = gr.interleaved_short_to_complex();
+        self._adc_rate = self.u.pull_adc_freq()
+        self.set_bandwidth(options.bw)
+
+        if options.gain is None:
+            # if no gain was specified, use the mid-point in dB
+#            g = self.u.gain_range()   
+           g = [0, 10]
+            #options.gain = float(g[0]+g[1])/2
+            options.gain = float(0)
+        self.set_gain(options.gain)
+
+        if options.freq is None:
+               options.freq = 2.4e9;
+#            # if no frequency was specified, use the mid-point of the subdev
+#            f = self.u.freq_range()
+#            options.freq = float(f[0]+f[1])/2
+
+       self.set_frequency(options.freq)
+
+        self._fftsize = options.fft_size
+
+
+       self._freq = options.freq;
+       self._bandwidth = 400;
+        
+       self.set_bandwidth(self._bandwidth);
+
+        self.snk = qtgui.sink_c(options.fft_size, gr.firdes.WIN_BLACKMAN_hARRIS,
+                                self._freq, self._bandwidth,
+                                "USRP2 Display",
+                                True, True, False, True, False)
+
+        # Set up internal amplifier
+        self.amp = gr.multiply_const_cc(0.0)
+        self.set_amplifier_gain(0.01)
+
+        # Create a single-pole IIR filter to remove DC
+        #   but don't connect it yet
+        self.dc_gain = 0.001
+        self.dc = gr.single_pole_iir_filter_cc(self.dc_gain)
+        self.dc_sub = gr.sub_cc()
+
+       self.agc = gr.agc2_cc(1e-3, 1e-5, 0.01, 0.01, 10);
+
+        self.connect(self.u, self.conv, self.snk)
+        #self.connect(self.u, self.conv, self.amp, self.snk)
+
+        if self.show_debug_info:
+            print "Decimation rate: ", self._decim
+            print "Bandwidth: ", self._bandwidth
+#            print "D'board: ", self.u.daughterboard_id()
+
+        # Get the reference pointer to the SpectrumDisplayForm QWidget
+        # Wrap the pointer as a PyQt SIP object
+        #     This can now be manipulated as a PyQt4.QtGui.QWidget
+        self.pysink = sip.wrapinstance(self.snk.pyqwidget(), QtGui.QWidget)
+
+        self.main_win = main_window(self.pysink, self)
+
+        self.main_win.set_frequency(self._freq)
+        self.main_win.set_gain(self._gain)
+        self.main_win.set_bandwidth(self._bandwidth)
+        self.main_win.set_amplifier(self._amp_value)
+
+        self.main_win.show()
+
+
+    def save_to_file(self, name):
+        self.lock()
+
+        # Add file sink to save data
+        self.file_sink = gr.file_sink(gr.sizeof_gr_complex, name)
+        self.connect(self.conv, self.file_sink)
+
+        self.unlock()
+
+    def set_gain(self, gain):
+        self._gain = gain
+        self.u.set_ddc_gain(self._gain)
+
+    def set_frequency(self, freq):
+        self._freq = freq
+        r = self.u.set_rx_freq(freq)
+
+        try:
+            self.snk.set_frequency_range(self._freq, self._bandwidth)
+        except:
+            pass
+
+    def set_bandwidth(self, bw):
+        self._bandwidth = bw
+        self._decim = int(self._adc_rate / self._bandwidth)
+#        self.u.set_decim_rate(self._decim)
+       r1 = self.u.set_ddc_samp_rate( bw );
+       r2 = self.u.set_ddc_bw( bw );
+       self.u.start_data();
+
+       print r1
+       print r2;
+       
+       time.sleep(0.05);
+       bw = self.u.pull_ddc_bw();
+       sr = self.u.pull_ddc_samp_rate();
+       fc = self.u.pull_rx_freq();
+       
+       #self.snk.d_bandwidth = sr;
+
+       print bw;
+       print sr;
+       print fc;
+
+#      sys.exit(-1);
+
+        try:
+            self.snk.set_frequency_range(self._freq, self._bandwidth)
+        except:
+            pass
+
+    def set_amplifier_gain(self, amp):
+        self._amp_value = amp
+        self.amp.set_k(self._amp_value)
+
+    def set_dc_gain(self, gain):
+        self.dc.set_taps(gain)
+        
+    def cancel_dc(self, state):
+        self.lock()
+
+        if(state):
+            self.disconnect(self.u, self.amp)
+            self.connect(self.u, (self.dc_sub,0))
+            self.connect(self.u, self.dc, (self.dc_sub,1))
+            self.connect(self.dc_sub, self.amp)
+        else:
+            self.disconnect(self.dc_sub, self.amp)
+            self.disconnect(self.dc, (self.dc_sub,1))
+            self.disconnect(self.u, self.dc)
+            self.disconnect(self.u, (self.dc_sub,0))
+            self.connect(self.u, self.amp)
+
+        self.unlock()
+
+def main ():
+    tb = my_top_block()
+    tb.start()
+    tb.u.start_data();
+    tb.snk.exec_();
+
+if __name__ == '__main__':
+    try:
+        main ()
+    except KeyboardInterrupt:
+        pass
+    
index b2015cc403ec4f5cffab3284e82311f8e350fb74..42eb6b3fbcfb23368bbf9417977eda07df2667f0 100644 (file)
@@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 
 from . import odict
 from Element import Element
-from Param import Param
-from Port import Port
 
 from Cheetah.Template import Template
 from UserDict import UserDict
index 7c51ef42a475a7fb0ba6fceff4465c2131c079a3..b4ac8fc3a2bf6a489d027cd07d77c8dae7b48eec 100644 (file)
@@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 
 from . import odict
 from Element import Element
-from Block import Block
-from Connection import Connection
 from .. gui import Messages
 
 class FlowGraph(Element):
index e436cc7645e970708505ba4c8d8db2173a2f4580..9c91af54376c9ce6f85ba343682a089a4316178a 100644 (file)
@@ -34,6 +34,8 @@ dist_ourdata_DATA = \
        blks2_cvsd_decode.xml \
        blks2_dxpsk_demod.xml \
        blks2_dxpsk_mod.xml \
+       blks2_dxpsk2_demod.xml \
+       blks2_dxpsk2_mod.xml \
        blks2_error_rate.xml \
        blks2_fm_deemph.xml \
        blks2_fm_demod_cf.xml \
diff --git a/grc/blocks/blks2_dxpsk2_demod.xml b/grc/blocks/blks2_dxpsk2_demod.xml
new file mode 100644 (file)
index 0000000..ce8305c
--- /dev/null
@@ -0,0 +1,145 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##DPSK2 Demod - 2, 4
+###################################################
+ -->
+<block>
+       <name>DPSK2 Demod</name>
+       <key>blks2_dxpsk2_demod</key>
+       <import>from gnuradio import blks2</import>
+       <make>blks2.$(type)2_demod(
+       samples_per_symbol=$samples_per_symbol,
+       excess_bw=$excess_bw,
+       costas_alpha=$costas_alpha,
+       timing_alpha=$timing_alpha,
+       timing_max_dev=$timing_max_dev,
+       gray_code=$gray_code,
+       verbose=$verbose,
+       log=$log,
+       sync_out=$sync_out,
+)</make>
+       <callback>clock_recov.set_alpha($costas_alpha)</callback>
+       <callback>clock_recov.set_beta(0.25*$costas_alpha**2)</callback>
+       <callback>time_recov.set_alpha($timing_alpha)</callback>
+       <param>
+               <name>Type</name>
+               <key>type</key>
+               <type>enum</type>
+               <option>
+                       <name>DBPSK</name>
+                       <key>dbpsk</key>
+               </option>
+               <option>
+                       <name>DQPSK</name>
+                       <key>dqpsk</key>
+               </option>
+       </param>
+       <param>
+               <name>Samples/Symbol</name>
+               <key>samples_per_symbol</key>
+               <value>2</value>
+               <type>int</type>
+       </param>
+       <param>
+               <name>Excess BW</name>
+               <key>excess_bw</key>
+               <value>0.35</value>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Costas Alpha</name>
+               <key>costas_alpha</key>
+               <value>0.175</value>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Timing Alpha</name>
+               <key>timing_alpha</key>
+               <value>0.100</value>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Timing Max Dev</name>
+               <key>timing_max_dev</key>
+               <value>1.5</value>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Omega Relative Limit</name>
+               <key>omega_relative_limit</key>
+               <value>0.005</value>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Gray Code</name>
+               <key>gray_code</key>
+               <value>True</value>
+               <type>bool</type>
+               <option>
+                       <name>Yes</name>
+                       <key>True</key>
+               </option>
+               <option>
+                       <name>No</name>
+                       <key>False</key>
+               </option>
+       </param>
+       <param>
+               <name>Verbose</name>
+               <key>verbose</key>
+               <value>False</value>
+               <type>bool</type>
+               <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
+               <option>
+                       <name>On</name>
+                       <key>True</key>
+               </option>
+               <option>
+                       <name>Off</name>
+                       <key>False</key>
+               </option>
+       </param>
+       <param>
+               <name>Logging</name>
+               <key>log</key>
+               <value>False</value>
+               <type>bool</type>
+               <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
+               <option>
+                       <name>On</name>
+                       <key>True</key>
+               </option>
+               <option>
+                       <name>Off</name>
+                       <key>False</key>
+               </option>
+       </param>
+       <param>
+               <name>Sync Out</name>
+               <key>sync_out</key>
+               <value>False</value>
+               <type>bool</type>
+               <option>
+                       <name>On</name>
+                       <key>True</key>
+               </option>
+               <option>
+                       <name>Off</name>
+                       <key>False</key>
+               </option>
+       </param>
+       <sink>
+               <name>in</name>
+               <type>complex</type>
+       </sink>
+       <source>
+               <name>out</name>
+               <type>byte</type>
+       </source>
+       <source>
+               <name>sync</name>
+               <type>complex</type>
+               <optional>1</optional>
+       </source>
+</block>
diff --git a/grc/blocks/blks2_dxpsk2_mod.xml b/grc/blocks/blks2_dxpsk2_mod.xml
new file mode 100644 (file)
index 0000000..bf292be
--- /dev/null
@@ -0,0 +1,95 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##DPSK2 Mod - 2, 4
+###################################################
+ -->
+<block>
+       <name>DPSK2 Mod</name>
+       <key>blks2_dxpsk2_mod</key>
+       <import>from gnuradio import blks2</import>
+       <make>blks2.$(type)2_mod(
+       samples_per_symbol=$samples_per_symbol,
+       excess_bw=$excess_bw,
+       gray_code=$gray_code,
+       verbose=$verbose,
+       log=$log,
+)</make>
+       <param>
+               <name>Type</name>
+               <key>type</key>
+               <type>enum</type>
+               <option>
+                       <name>DBPSK</name>
+                       <key>dbpsk</key>
+               </option>
+               <option>
+                       <name>DQPSK</name>
+                       <key>dqpsk</key>
+               </option>
+       </param>
+       <param>
+               <name>Samples/Symbol</name>
+               <key>samples_per_symbol</key>
+               <value>2</value>
+               <type>int</type>
+       </param>
+       <param>
+               <name>Excess BW</name>
+               <key>excess_bw</key>
+               <value>0.35</value>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Gray Code</name>
+               <key>gray_code</key>
+               <value>True</value>
+               <type>bool</type>
+               <option>
+                       <name>Yes</name>
+                       <key>True</key>
+               </option>
+               <option>
+                       <name>No</name>
+                       <key>False</key>
+               </option>
+       </param>
+       <param>
+               <name>Verbose</name>
+               <key>verbose</key>
+               <value>False</value>
+               <type>bool</type>
+               <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
+               <option>
+                       <name>On</name>
+                       <key>True</key>
+               </option>
+               <option>
+                       <name>Off</name>
+                       <key>False</key>
+               </option>
+       </param>
+       <param>
+               <name>Logging</name>
+               <key>log</key>
+               <value>False</value>
+               <type>bool</type>
+               <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
+               <option>
+                       <name>On</name>
+                       <key>True</key>
+               </option>
+               <option>
+                       <name>Off</name>
+                       <key>False</key>
+               </option>
+       </param>
+       <sink>
+               <name>in</name>
+               <type>byte</type>
+       </sink>
+       <source>
+               <name>out</name>
+               <type>complex</type>
+       </source>
+</block>
index 4c13b3415e73ec5f2beeb82bc3c7c7f3229c1dd6..1c96b6cec62ab7d0e554ff90b3ce9857ea395e5c 100644 (file)
@@ -76,7 +76,7 @@
                <name>Gray Code</name>
                <key>gray_code</key>
                <value>True</value>
-               <type>enum</type>
+               <type>bool</type>
                <option>
                        <name>Yes</name>
                        <key>True</key>
index 28fd742fa6b9400c238b5d1b58f99b24bce2de27..77505d8ad588f54b3e7def2f00dd43de9f3ae233 100644 (file)
@@ -48,7 +48,7 @@
                <name>Gray Code</name>
                <key>gray_code</key>
                <value>True</value>
-               <type>enum</type>
+               <type>bool</type>
                <option>
                        <name>Yes</name>
                        <key>True</key>
index fc074cb69101e0577bf4e84b060a2ef008baf7dc..57703f6d69f4f01e78aa18f6d0169d885ea3863d 100644 (file)
                <block>blks2_dxpsk_mod</block>
                <block>blks2_dxpsk_demod</block>
 
+               <block>blks2_dxpsk2_mod</block>
+               <block>blks2_dxpsk2_demod</block>
+
                <block>blks2_gmsk_mod</block>
                <block>blks2_gmsk_demod</block>
 
index 734526793fae96b1c1ef890faf61feeab0c3167b..2e949526039150e0e166c9deb1bcfc415815bfcc 100644 (file)
@@ -9,10 +9,10 @@
        <key>pad_sink</key>
        <make></make>
        <param>
-               <name>Num Inputs</name>
-               <key>nports</key>
-               <value>1</value>
-               <type>int</type>
+               <name>Label</name>
+               <key>label</key>
+               <value>out</value>
+               <type>string</type>
        </param>
        <param>
                <name>Input Type</name>
                <type>int</type>
        </param>
        <check>$vlen &gt; 0</check>
-       <check>0 &lt; $nports</check>
        <sink>
                <name>in</name>
                <type>$type</type>
                <vlen>$vlen</vlen>
-               <nports>$nports</nports>
        </sink>
        <doc>
-The inputs of this block will become the outputs to this flow graph when it is instantiated as a hierarchical block. \
-Limit one sink pad block per flow graph.
+The inputs of this block will become the outputs to this flow graph when it is instantiated as a hierarchical block.
+
+Pad sink will be ordered alphabetically by their ids. The first pad sink will have an index of 0.
        </doc>
 </block>
index f44d9623879d77b1c35026b82eeddf745bdc3b3c..7b2210cbbc75f74df47c526f7d4040ab414edb19 100644 (file)
@@ -9,10 +9,10 @@
        <key>pad_source</key>
        <make></make>
        <param>
-               <name>Num Outputs</name>
-               <key>nports</key>
-               <value>1</value>
-               <type>int</type>
+               <name>Label</name>
+               <key>label</key>
+               <value>in</value>
+               <type>string</type>
        </param>
        <param>
                <name>Output Type</name>
                <type>int</type>
        </param>
        <check>$vlen &gt; 0</check>
-       <check>0 &lt; $nports</check>
        <source>
                <name>out</name>
                <type>$type</type>
                <vlen>$vlen</vlen>
-               <nports>$nports</nports>
        </source>
        <doc>
-The outputs of this block will become the inputs to this flow graph when it is instantiated as a hierarchical block. \
-Limit one source pad block per flow graph. \
-The "pad sink id" will be ignored in this mode.
+The outputs of this block will become the inputs to this flow graph when it is instantiated as a hierarchical block.
+
+Pad sources will be ordered alphabetically by their ids. The first pad source will have an index of 0.
        </doc>
 </block>
index 3692e17602148c9d674e648eb7a1a157f86e93a2..b26dbddd41f899c7be1fcc678755bcf3642a6aa2 100644 (file)
@@ -19,7 +19,7 @@
 #
 
 import common
-from gnuradio import gr, usrp
+from gnuradio import gr
 
 ####################################################################
 # Dual USRP Source
index fc4c75bf0618598dab80b60fc0df990a7e623c92..fb7a39570f0dead666abe6a4290e688f2580117b 100644 (file)
@@ -19,7 +19,7 @@
 #
 
 import common
-from gnuradio import gr, usrp
+from gnuradio import gr
 
 ####################################################################
 # Simple USRP Source
index 998575897399c6d7db643dfb0a37d735c1644b45..333ccf1c1203a2caca749a324efc677188917f8b 100644 (file)
@@ -19,7 +19,6 @@
 #
 
 import wx
-import sys, os
 from gnuradio import gr
 import panel
 
index ee3e19a6c6628db3d4e79ab1a4facd3e85bc8a8d..108e23a2355da942434e81f6a5d856401f830728 100644 (file)
@@ -29,7 +29,6 @@ import Preferences
 from threading import Thread
 import Messages
 from .. base import ParseXML
-import random
 from MainWindow import MainWindow
 from PropsDialog import PropsDialog
 import Dialogs
index 8c65bf06f104a2dd347856460d347775c813ff9f..27143e070420ccdd6cec709f0b2d098e509a5e30 100644 (file)
@@ -29,6 +29,7 @@ from Constants import \
 import pygtk
 pygtk.require('2.0')
 import gtk
+import pango
 
 BLOCK_MARKUP_TMPL="""\
 #set $foreground = $block.is_valid() and 'black' or 'red'
@@ -130,8 +131,11 @@ class Block(Element):
                layout.set_markup(Utils.parse_template(BLOCK_MARKUP_TMPL, block=self))
                self.label_width, self.label_height = layout.get_pixel_size()
                #display the params
-               for param in filter(lambda p: p.get_hide() not in ('all', 'part'), self.get_params()):
-                       layout = param.get_layout()
+               markups = [param.get_markup() for param in self.get_params() if param.get_hide() not in ('all', 'part')]
+               if markups:
+                       layout = gtk.DrawingArea().create_pango_layout('')
+                       layout.set_spacing(LABEL_SEPARATION*pango.SCALE)
+                       layout.set_markup('\n'.join(markups))
                        layouts.append(layout)
                        w,h = layout.get_pixel_size()
                        self.label_width = max(w, self.label_width)
@@ -151,12 +155,11 @@ class Block(Element):
                        else: w_off = 0
                        pixmap.draw_layout(gc, w_off, h_off, layout)
                        h_off = h + h_off + LABEL_SEPARATION
-               #create vertical and horizontal images
-               self.horizontal_label = image = pixmap.get_image(0, 0, width, height)
+               #create vertical and horizontal pixmaps
+               self.horizontal_label = pixmap
                if self.is_vertical():
-                       self.vertical_label = vimage = gtk.gdk.Image(gtk.gdk.IMAGE_NORMAL, pixmap.get_visual(), height, width)
-                       for i in range(width):
-                               for j in range(height): vimage.put_pixel(j, width-i-1, image.get_pixel(i, j))
+                       self.vertical_label = self.get_parent().new_pixmap(height, width)
+                       Utils.rotate_pixmap(gc, self.horizontal_label, self.vertical_label)
                #calculate width and height needed
                self.W = self.label_width + 2*BLOCK_LABEL_PADDING
                self.H = max(*(
@@ -179,9 +182,9 @@ class Block(Element):
                )
                #draw label image
                if self.is_horizontal():
-                       window.draw_image(gc, self.horizontal_label, 0, 0, x+BLOCK_LABEL_PADDING, y+(self.H-self.label_height)/2, -1, -1)
+                       window.draw_drawable(gc, self.horizontal_label, 0, 0, x+BLOCK_LABEL_PADDING, y+(self.H-self.label_height)/2, -1, -1)
                elif self.is_vertical():
-                       window.draw_image(gc, self.vertical_label, 0, 0, x+(self.H-self.label_height)/2, y+BLOCK_LABEL_PADDING, -1, -1)
+                       window.draw_drawable(gc, self.vertical_label, 0, 0, x+(self.H-self.label_height)/2, y+BLOCK_LABEL_PADDING, -1, -1)
                #draw ports
                for port in self.get_ports(): port.draw(gc, window)
 
index af40f47c088a38d57baebc2dc20477a25fcb9b35..473c796aff23bf6efe931612cc859f52f30f891d 100644 (file)
@@ -20,7 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 import pygtk
 pygtk.require('2.0')
 import gtk
-import Preferences
 import Utils
 
 class TextDisplay(gtk.TextView):
index f0518ee12ba56883debd666ede1a8e31c12bc8fe..e020c5caa9ba5854bf91f2dc0b8ff0deb00acfa6 100644 (file)
@@ -17,9 +17,6 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
 
-import pygtk
-pygtk.require('2.0')
-import gtk
 from Constants import LINE_SELECT_SENSITIVITY
 from Constants import POSSIBLE_ROTATIONS
 
index 8feb171f1fd15e1a25c1f24013f56d8a6dd1f768..5adecccc13a063e756825b37ed24e5652da318f0 100644 (file)
@@ -22,7 +22,6 @@ import Actions
 import Colors
 import Utils
 from Element import Element
-from .. base import FlowGraph as _FlowGraph
 import pygtk
 pygtk.require('2.0')
 import gtk
index cb8bfdc5291accc624977e4bbbaf27d8768bdfa3..b3018dab216a59b43b8539b72abb1a35172585bf 100644 (file)
@@ -165,11 +165,9 @@ class Param(Element):
                if self.get_options(): return EnumEntryParam(self, *args, **kwargs)
                return EntryParam(self, *args, **kwargs)
 
-       def get_layout(self):
+       def get_markup(self):
                """
-               Create a layout based on the current markup.
-               @return the pango layout
+               Get the markup for this param.
+               @return a pango markup string
                """
-               layout = gtk.DrawingArea().create_pango_layout('')
-               layout.set_markup(Utils.parse_template(PARAM_MARKUP_TMPL, param=self))
-               return layout
+               return Utils.parse_template(PARAM_MARKUP_TMPL, param=self)
index 6763f6cbd553f61ab7673095f247687000e06dc4..2896d04c18e0efae889198a503ed1bf99aaeaf52 100644 (file)
@@ -97,12 +97,11 @@ class Port(Element):
                gc.set_foreground(self._bg_color)
                pixmap.draw_rectangle(gc, True, 0, 0, self.w, self.h)
                pixmap.draw_layout(gc, 0, 0, layout)
-               #create the images
-               self.horizontal_label = image = pixmap.get_image(0, 0, self.w, self.h)
+               #create vertical and horizontal pixmaps
+               self.horizontal_label = pixmap
                if self.is_vertical():
-                       self.vertical_label = vimage = gtk.gdk.Image(gtk.gdk.IMAGE_NORMAL, pixmap.get_visual(), self.h, self.w)
-                       for i in range(self.w):
-                               for j in range(self.h): vimage.put_pixel(j, self.w-i-1, image.get_pixel(i, j))
+                       self.vertical_label = self.get_parent().get_parent().new_pixmap(self.h, self.w)
+                       Utils.rotate_pixmap(gc, self.horizontal_label, self.vertical_label)
 
        def draw(self, gc, window):
                """
@@ -117,9 +116,9 @@ class Port(Element):
                X,Y = self.get_coordinate()
                (x,y),(w,h) = self._areas_list[0] #use the first area's sizes to place the labels
                if self.is_horizontal():
-                       window.draw_image(gc, self.horizontal_label, 0, 0, x+X+(self.W-self.w)/2, y+Y+(self.H-self.h)/2, -1, -1)
+                       window.draw_drawable(gc, self.horizontal_label, 0, 0, x+X+(self.W-self.w)/2, y+Y+(self.H-self.h)/2, -1, -1)
                elif self.is_vertical():
-                       window.draw_image(gc, self.vertical_label, 0, 0, x+X+(self.H-self.h)/2, y+Y+(self.W-self.w)/2, -1, -1)
+                       window.draw_drawable(gc, self.vertical_label, 0, 0, x+X+(self.H-self.h)/2, y+Y+(self.W-self.w)/2, -1, -1)
 
        def get_connector_coordinate(self):
                """
index 83036a4b858c0c4eb5460738be7eb2f3e4002e6d..b5489d56e7ac5cc2c866ee385f9625605a40e750 100644 (file)
@@ -19,8 +19,31 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 
 from Constants import POSSIBLE_ROTATIONS
 from Cheetah.Template import Template
+import pygtk
+pygtk.require('2.0')
+import gtk
 import gobject
 
+def rotate_pixmap(gc, src_pixmap, dst_pixmap, angle=gtk.gdk.PIXBUF_ROTATE_COUNTERCLOCKWISE):
+       """
+       Load the destination pixmap with a rotated version of the source pixmap.
+       The source pixmap will be loaded into a pixbuf, rotated, and drawn to the destination pixmap.
+       The pixbuf is a client-side drawable, where a pixmap is a server-side drawable.
+       @param gc the graphics context
+       @param src_pixmap the source pixmap
+       @param dst_pixmap the destination pixmap
+       @param angle the angle to rotate by
+       """
+       width, height = src_pixmap.get_size()
+       pixbuf = gtk.gdk.Pixbuf(
+               colorspace=gtk.gdk.COLORSPACE_RGB,
+               has_alpha=False, bits_per_sample=8,
+               width=width, height=height,
+       )
+       pixbuf.get_from_drawable(src_pixmap, src_pixmap.get_colormap(), 0, 0, 0, 0, -1, -1)
+       pixbuf = pixbuf.rotate_simple(angle)
+       dst_pixmap.draw_pixbuf(gc, pixbuf, 0, 0, 0, 0)
+
 def get_rotated_coordinate(coor, rotation):
        """
        Rotate the coordinate by the given rotation.
index 439a524209da7277526f81b1b0f6f92194345c0c..e661c392782a2501fe740a2485278041c41aa77c 100644 (file)
@@ -18,7 +18,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
 
 import os
-import sys
 import stat
 from gnuradio import gr
 
index 4dd18a81f4cd230dbec042dfb77a2068129ed859..b2d406bbd65514ffdc155e58fb799cd74a3292fa 100644 (file)
@@ -20,8 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 import expr_utils
 from .. base.FlowGraph import FlowGraph as _FlowGraph
 from .. gui.FlowGraph import FlowGraph as _GUIFlowGraph
-from Block import Block
-from Connection import Connection
 import re
 
 _variable_matcher = re.compile('^(variable\w*)$')
@@ -50,44 +48,36 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
                #return from cache
                return self._eval_cache[my_hash]
 
-       def _get_io_signature(self, pad_key):
+       def _get_io_signaturev(self, pad_key):
                """
-               Get an io signature for this flow graph.
+               Get a list of io signatures for this flow graph.
                The pad key determines the directionality of the io signature.
                @param pad_key a string of pad_source or pad_sink
-               @return a dict with: type, nports, vlen, size
+               @return a list of dicts with: type, label, vlen, size
                """
                pads = filter(lambda b: b.get_key() == pad_key, self.get_enabled_blocks())
-               if not pads: return {
-                       'nports': '0',
-                       'type': '',
-                       'vlen': '0',
-                       'size': '0',
-               }
-               pad = pads[0] #take only the first, user should not have more than 1
+               sorted_pads = sorted(pads, lambda x, y: cmp(x.get_id(), y.get_id()))
                #load io signature
-               return {
-                       'nports': str(pad.get_param('nports').get_evaluated()),
+               return [{
+                       'label': str(pad.get_param('label').get_evaluated()),
                        'type': str(pad.get_param('type').get_evaluated()),
                        'vlen': str(pad.get_param('vlen').get_evaluated()),
                        'size': pad.get_param('type').get_opt('size'),
-               }
+               } for pad in sorted_pads]
 
-       def get_input_signature(self):
+       def get_input_signaturev(self):
                """
                Get the io signature for the input side of this flow graph.
-               The io signature with be "0", "0" if no pad source is present.
-               @return a string tuple of type, num_ports, port_size
+               @return a list of io signature structures
                """
-               return self._get_io_signature('pad_source')
+               return self._get_io_signaturev('pad_source')
 
-       def get_output_signature(self):
+       def get_output_signaturev(self):
                """
                Get the io signature for the output side of this flow graph.
-               The io signature with be "0", "0" if no pad sink is present.
-               @return a string tuple of type, num_ports, port_size
+               @return a list of io signature structures
                """
-               return self._get_io_signature('pad_sink')
+               return self._get_io_signaturev('pad_sink')
 
        def get_imports(self):
                """
index 81fb6ba7acb7b48407fc2197099223a7a6780fe5..febb112ad3a1f4404b71574c1b1e5394e440240f 100644 (file)
@@ -17,7 +17,6 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
 
-import expr_utils
 from .. base.Param import Param as _Param
 from .. gui.Param import Param as _GUIParam
 from .. gui.Param import EntryParam
index bdafbcbc13dde8d9dc2fa7c028996f9cc7426c7b..befddccea0ce2e947befdf59c200cae18c603e7f 100644 (file)
@@ -23,8 +23,8 @@ from .. base import odict
 
 def convert_hier(flow_graph, python_file):
        #extract info from the flow graph
-       input_sig = flow_graph.get_input_signature()
-       output_sig = flow_graph.get_output_signature()
+       input_sigs = flow_graph.get_input_signaturev()
+       output_sigs = flow_graph.get_output_signaturev()
        parameters = flow_graph.get_parameters()
        block_key = flow_graph.get_option('id')
        block_name = flow_graph.get_option('title')
@@ -56,20 +56,18 @@ def convert_hier(flow_graph, python_file):
                params_n.append(param_n)
        block_n['param'] = params_n
        #sink data
-       if int(input_sig['nports']):
+       for input_sig in input_sigs:
                sink_n = odict()
-               sink_n['name'] = 'in'
+               sink_n['name'] = input_sig['label']
                sink_n['type'] = input_sig['type']
                sink_n['vlen'] = input_sig['vlen']
-               sink_n['nports'] = input_sig['nports']
                block_n['sink'] = sink_n
        #source data
-       if int(output_sig['nports']):
+       for output_sig in output_sigs:
                source_n = odict()
-               source_n['name'] = 'out'
+               source_n['name'] = output_sig['label']
                source_n['type'] = output_sig['type']
                source_n['vlen'] = output_sig['vlen']
-               source_n['nports'] = output_sig['nports']
                block_n['source'] = source_n
        #doc data
        block_n['doc'] = "%s\n%s\n%s"%(block_author, block_desc, python_file)
index ab764006c06e304f9a663a655b7a2edd66ed75bb..a1a9308aa30335fb2228a252536c2215421dd83c 100644 (file)
@@ -65,15 +65,25 @@ class $(class_name)(gr.top_block):
        def __init__($param_str):
                gr.top_block.__init__(self, "$title")
 #elif $generate_options == 'hb'
-       #set $in_sig = $flow_graph.get_input_signature()
-       #set $out_sig = $flow_graph.get_output_signature()
+       #set $in_sigs = $flow_graph.get_input_signaturev()
+       #set $out_sigs = $flow_graph.get_output_signaturev()
 class $(class_name)(gr.hier_block2):
+#def make_io_sig($io_sigs)
+       #set $size_strs = ['%s*%s'%(io_sig['size'], io_sig['vlen']) for io_sig in $io_sigs]
+       #if len($io_sigs) == 0
+gr.io_signature(0, 0, 0)#slurp
+       #elif len($io_sigs) == 1
+gr.io_signature(1, 1, $size_strs[0])#slurp
+       #else
+gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))])#slurp
+       #end if
+#end def
 
        def __init__($param_str):
                gr.hier_block2.__init__(
                        self, "$title",
-                       gr.io_signature($in_sig.nports, $in_sig.nports, $in_sig.size*$in_sig.vlen),
-                       gr.io_signature($out_sig.nports, $out_sig.nports, $out_sig.size*$out_sig.vlen),
+                       $make_io_sig($in_sigs),
+                       $make_io_sig($out_sigs),
                )
 #end if
 ########################################################