Editing FAQ

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 231: Line 231:
 
from gnuradio import gr
 
from gnuradio import gr
 
from gnuradio import blocks
 
from gnuradio import blocks
 
  
 
def main():
 
def main():
 
     tb = gr.top_block()
 
     tb = gr.top_block()
     src1 = blocks.vector_source_f(list(range(16)), repeat=True)
+
     src1 = blocks.vector_source_f(range(16), repeat=True)
 
     throttle = blocks.throttle(gr.sizeof_float, 1e6)
 
     throttle = blocks.throttle(gr.sizeof_float, 1e6)
 
     sink = blocks.file_sink(gr.sizeof_float, 'out.dat')
 
     sink = blocks.file_sink(gr.sizeof_float, 'out.dat')
Line 241: Line 240:
 
     tb.start()
 
     tb.start()
 
     time.sleep(1)
 
     time.sleep(1)
     print("Locking flowgraph...")
+
     print "Locking flowgraph..."
 
     tb.lock()
 
     tb.lock()
 
     tb.disconnect(src1)
 
     tb.disconnect(src1)
 
     src2 = blocks.null_source(gr.sizeof_float)
 
     src2 = blocks.null_source(gr.sizeof_float)
 
     tb.connect(src2, throttle)
 
     tb.connect(src2, throttle)
     print("Unlocking flowgraph...")
+
     print "Unlocking flowgraph..."
 
     tb.unlock()
 
     tb.unlock()
 
     time.sleep(2)
 
     time.sleep(2)
 
     tb.stop()
 
     tb.stop()
 
     tb.wait()
 
     tb.wait()
 
  
 
if __name__ == "__main__":
 
if __name__ == "__main__":
Line 266: Line 264:
 
from gnuradio import gr
 
from gnuradio import gr
 
from gnuradio import blocks
 
from gnuradio import blocks
import my_awesome_oot_module as myoot # This is your custom module
+
import my_awesome_oot_module as myoot # This is your custom module
 
 
  
 
def main():
 
def main():
 
     tb = gr.top_block()
 
     tb = gr.top_block()
     src1 = blocks.vector_source_f(list(range(16)), repeat=True)
+
     src1 = blocks.vector_source_f(range(16), repeat=True)
 
     src2 = blocks.null_source(gr.sizeof_float)
 
     src2 = blocks.null_source(gr.sizeof_float)
     switch = myoot.switch() # This is your custom block
+
     switch = myoot.switch() # This is your custom block
 
     throttle = blocks.throttle(gr.sizeof_float, 1e6)
 
     throttle = blocks.throttle(gr.sizeof_float, 1e6)
 
     sink = blocks.file_sink(gr.sizeof_float, 'out.dat')
 
     sink = blocks.file_sink(gr.sizeof_float, 'out.dat')
Line 282: Line 279:
 
     tb.stop()
 
     tb.stop()
 
     tb.wait()
 
     tb.wait()
 
  
 
if __name__ == "__main__":
 
if __name__ == "__main__":
Line 289: Line 285:
  
 
<!-- Marker section 6 -->
 
<!-- Marker section 6 -->
 
 
== Signal Processing ==
 
== Signal Processing ==
  

Please note that all contributions to GNU Radio are considered to be released under the Creative Commons Attribution-ShareAlike (see GNU Radio:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)