|
From: | Tim Huggins |
Subject: | Re: Problem with Python OOT |
Date: | Tue, 19 Jan 2021 20:05:02 +0000 (UTC) |
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
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.TimOn Friday, January 15, 2021, 2:56:48 PM EST, George Edwards <gedwards.eng@gmail.com> 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 output2. In the general_work() method for now I set the output to a constant complex value as followsout_items[0][:] = 1.0+1.0*1j3. In the *.yml file, the input is set as:inputs:- domain: streamdtype: complexmultiplicity: '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
[Prev in Thread] | Current Thread | [Next in Thread] |