discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] OOT sourcec block in python error


From: Ayaz Mahmud
Subject: [Discuss-gnuradio] OOT sourcec block in python error
Date: Mon, 30 Jul 2018 17:22:35 +0000

Hi,

 

I am trying to build a source block in python. Below is my code. After using the block I am getting a syntax error: self.Span_SourceBlock_0 = Template error: Span.SourceBlock($input)

 

My block should take input from user(int/float), and output the same. Though these are available blocks in GnuRadio but I am trying to learn on building it. Can you please check if my way of writing the code is correct?

 

import numpy

from gnuradio import gr

 

class SourceBlock(gr.sync_block):

    """

    docstring for block SourceBlock

    """

    def __init__(self, input):

        self.input = input

        gr.sync_block.__init__(self,

            name="SourceBlock",

            in_sig=None,

            out_sig=[numpy.float32])

 

 

    def work(self, input_items, output_items):

        out = output_items[0]

        out[0][:] = self.input

        return len(output_items[0])

 

Thanks,

Ayaz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]