[Top][All Lists]

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

[Discuss-gnuradio] Problem using Parser

From: Ahmet Hasim Gokceoglu
Subject: [Discuss-gnuradio] Problem using Parser
Date: Mon, 21 Apr 2008 21:30:16 +0300


I am trying to write a code for qpsk receiver and want to get some
parameters from the user by using parser. However I get some error
when I execute the code

#!/usr/bin/env python

from gnuradio import gr, gru, eng_notation, optfir, modulation_utils
from gnuradio import usrp
from gnuradio import blks2
from gnuradio.eng_option import eng_option
from optparse import OptionParser
from usrpm import usrp_dbid
import math
import sys
import wx

#import psk
import cmath
from pprint import pprint

class qpsk_rx_block(gr.hier_block2):

        def __init__(self,argv):

                gr.hier_block2.__init__(self, "qpsk_rx_block",
gr.io_signature(1, 1, gr.sizeof_char),       # Input signature
gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature

                parser.add_option("-R", "--rx-subdev-spec",
type="subdev", default=None,
                          help="select USRP Rx side A or B (default=A)")
                parser.add_option("-f", "--freq", type="eng_float",
                          help="set frequency to FREQ", metavar="FREQ")

                (options, args) = parser.parse_args()

I get the error

Traceback (most recent call last):
  File "./QPSK_receiver.py", line 39, in <module>
    class qpsk_rx_block(gr.hier_block2):
  File "./QPSK_receiver.py", line 48, in qpsk_rx_block
    parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
NameError: name 'parser' is not defined

Does anybody have any idea?

reply via email to

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