Hi Tim,
Thanks for the offer to help! I appreciate it very much.
Here is the rest of yml file. I also have some further questions:
1. In the gr-modtool design, I picked the "general" block, is this correct?
2. The current model has 3 streaming inputs. Each output sample computation
takes one sample from each input. So I leave the forecast() method as the
default which is:
    ninput_items_required[i] = noutput_items, is this correct?
     And, in the general_work() method, I also leave the default:
    return len(output_items[0]), is this correct?
3. The final model will have the same 3 input streams, but each computation
will produce a stream of 8 output samples. So, do I now change the
forecast() method to:
    ninput_items_required[i] = noutput_items - 7
    Then, in the general_work() method do:
     return len(8*input_items[0])
     Then, for the yml file set, vlen = 8              "The setting of
these parameters in Item 3 are all confusing to me"

parameters:

- id: scale

  label: Scale_Value

  dtype: bool

  default: True



#  Make one 'inputs' list entry per input and one 'outputs' list entry per
output.

#  Keys include:

#      * label (an identifier for the GUI)

#      * domain (optional - stream or message. Default is stream)

#      * dtype (e.g. int, float, complex, byte, short, xxx_vector, ...)

#      * vlen (optional - data stream vector length. Default is 1)

#      * optional (optional - set to 1 for optional inputs. Default is 0)

inputs:

- domain: stream

  dtype: complex

  multiplicity: '3'



# - label: in0

#   dtype: complex

# - label: in1

#   dtype: complex

# - label: in2

#   dtype: complex



outputs:

- label: out

  dtype: complex



#  'file_format' specifies the version of the GRC yml format used in the
file

#  and should usually not be changed.

file_format: 1




On Mon, Jan 18, 2021 at 7:50 AM Tim Huggins <[email protected]>
wrote:

> George,
>
> I have made several OOT Python blocks with variable numbers of inputs and
> outputs and while I could very easily be overlooking something the error
> does not, at first glance, appear to be in the code that you have sent out.
> Can you send the rest of your yml file (and potentially the rest of the
> python)? I am curious if there is something missing in either the templates
> or parameters sections of your yml file.
>
> Tim
>
> On Friday, January 15, 2021, 2:56:48 PM EST, George Edwards <
> [email protected]> wrote:
>
>
> Hello,
>
> I am trying to make a Python OOT block which accepts a stream of 3 inputs
> complex valued data and for each single input sample (one on each input
> line) the block will output 8 complex samples. For my first cut, I am
> simply trying to get the module to work outputting one complex sample
> (rather than 8). Below are the essential parts of my program.
>
> 1. In the def __init__ (self.), I set the inner method
> gr.basic_block.__init__(self,
>        name="my_block_name_py_cc",
>        in_sig = [numpy.complex64, numpy.complex64,  numpy.complex64  ],
>        out_sig = [ numpy.complex64 ])       # with 3 inputs and one output
>
> 2. In the general_work() method for now I set the output to a
> constant complex value as follows
>       out_items[0][:] = 1.0+1.0*1j
>
> 3. In the *.yml file, the input is set as:
>         inputs:
>         - domain: stream
>            dtype: complex
>            multiplicity: '3'
>
> The module compiles. However, when I run the QA file, it gives an error
> stating something is wrong in File "..........blocks_swig1.py at line 8354.
> TypeError: in method 'vector_source_c_make', argument 2 of type 'bool'
>
> I went to the file and the line stated, but I have not seen anything to
> help me make corrections. As far as a TypeError of 'bool', I do not see
> where I would have made such an error. I have an input parameter in the def
> __init__(self, start = True) method, 'start', which comes in as bool, but
> that is the only bool variable I am using. The documentation I read for the
> method states "This block produces a stream of samples based on an input
> vector" (which is my goal if I can get it to work).
>
> I will appreciate any help to get me on the right track.
>
> Regards,
> George
>
>

Reply via email to