Hello Everyone,
I am trying to build a controller which will allow to control output power of a signal according to some received variables.
I have build everything according to the tutorial:
The python code of my block is as follows:
#The "Init" part is as follows:
class fuzzy_mod_adap_ff_ff(gr.sync_block):
"""
docstring for block fuzzy_mod_adap_ff_ff
"""
def __init__(self,):
gr.sync_block.__init__(self,
name="fuzzy_mod_adap_ff_ff",
in_sig=[np.float32, np.float32],
out_sig=[np.float32, np.float32])
.
.
.
.
#The part of the work function of the code is as follows:
def work(self, input_items, output_items):
in0 = input_items[0]
in1 = input_items[1]
out0 = output_items[0]
out1 = output_items[1]
for i in range(0, len(in0)):
X1= in0[i]
Act_Mod= in1[i]
self.Normaliza(X1,Act_Mod)
out1[i], out0[i] = self.Fuzzy()
return len(output_items[0])
After this I ran the QA Test and the results are:
address@hiddendn:~/Fuzzy_GNU_Blocks/gr-FuzzySyst/python$ python qa_fuzzy_mod_adap_ff_ff.py
(38.653770446777344, 61.346229553222656, 38.653770446777344, 61.346229553222656)
(61.346229553222656, 38.653770446777344, 61.346229553222656, 38.653770446777344)
(38.653770446777344, 61.346229553222656, 38.653770446777344, 61.346229553222656)
(61.346229553222656, 38.653770446777344, 61.346229553222656, 38.653770446777344)
.
----------------------------------------------------------------------
Ran 1 test in 0.021s
OK
The QA Python file is attached, just in case.
Nevertheless, when i try to run the block in the following flowgraph:
The result when i run the Flowgraph is:
The New Mod and Power Out values shows first "0" and after 1 minute or more, change to the value in the previous image.
Nevertheless when i change the variables in the QT Gui, the outputs (New Mod and Poer Out") the don´t change, and if they do they do it after 3 minutes or more.
I dont know what could be the problem because the QA test runs perfect but in the flowgraph it does not.
Just for the record i put a "throttle block" and nothing changed.
I would appreciate all the help you can give me regarding this.
Kind regards.