summaryrefslogtreecommitdiff
path: root/gr-input/python/Calculator.py
diff options
context:
space:
mode:
authorAmbikeshwar Srivastava2015-02-24 12:50:41 +0530
committerAmbikeshwar Srivastava2015-02-24 12:50:41 +0530
commit7469534c14f56a440aa854ad3bb89ab6c4bec38c (patch)
treeaeabdf846ece9bef354203244e606910dcc246a7 /gr-input/python/Calculator.py
parenta46dd99f5c2f08b1b9c49c725dfcefbc1e635b45 (diff)
parentcaa828af6ff39194078080d88792677ba1a0d834 (diff)
downloadgnuradio-7469534c14f56a440aa854ad3bb89ab6c4bec38c.tar.gz
gnuradio-7469534c14f56a440aa854ad3bb89ab6c4bec38c.tar.bz2
gnuradio-7469534c14f56a440aa854ad3bb89ab6c4bec38c.zip
Merge pull request #3 from ashwini-patil/master
Python files Added
Diffstat (limited to 'gr-input/python/Calculator.py')
-rw-r--r--gr-input/python/Calculator.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/gr-input/python/Calculator.py b/gr-input/python/Calculator.py
index 7180bba53..f2eaf0481 100644
--- a/gr-input/python/Calculator.py
+++ b/gr-input/python/Calculator.py
@@ -18,9 +18,12 @@
# Boston, MA 02110-1301, USA.
#
-import time
import numpy
+from numpy import log
+from numpy import exp
+from numpy import sqrt
from gnuradio import gr
+import time
class Calculator(gr.sync_block):
"""
@@ -31,18 +34,19 @@ class Calculator(gr.sync_block):
a = []
for i in range(0,number):
a.append(numpy.float32)
- print "value of a",a
+# print "value of a",a
gr.sync_block.__init__(self,
- name="add_python",
+ name="Calculator",
in_sig=a,
out_sig=[numpy.float32])
+
+ #print "I am over slept"
+ #print len(self.ret_array)
def set_parameters(self,Exp,num_inputs):
self.Exp = Exp
+ #print "This is EXP", Exp
self.num_inputs = num_inputs
- #print "I am over slept"
- #print len(self.ret_array)
-
def work(self, input_items, output_items):
try:
@@ -85,8 +89,11 @@ class Calculator(gr.sync_block):
a9 = input_items[9]
except IndexError:
pass
- out = output_items[0]
- out[:] = eval(self.Exp)
-# print "i am length",len(output_items[0][:5])
-# print "value of out",out
+ #out = output_items[0][0]
+ print "This is self.Exp\n",self.Exp
+
+ output_items[0][:] = eval(self.Exp)
+ #print "This is the output value\n", output_items[0][0]
+ #print "I am the oputput add python\n", eval(self.Exp)
return len(output_items[0])
+