Beispiel #1
0
    def __init__(self,
                 signal_type=None,
                 enable_scope=False,
                 freq_resolution=4096,
                 time_length=2048,
                 window_type=windows.WIN_BLACKMAN_HARRIS,
                 frame_rate=30.0,
                 input_center_freq=0.0,
                 paused=False,
                 context=None):
        assert isinstance(signal_type, SignalType)
        assert context is not None

        itemsize = signal_type.get_itemsize()
        gr.hier_block2.__init__(
            self,
            type(self).__name__,
            gr.io_signature(1, 1, itemsize),
            gr.io_signature(0, 0, 0),
        )

        # constant parameters
        self.__power_offset = 40  # TODO autoset or controllable
        self.__itemsize = itemsize
        self.__context = context
        self.__enable_scope = enable_scope

        # settable parameters
        self.__signal_type = signal_type
        self.__freq_resolution = int(freq_resolution)
        self.__time_length = int(time_length)
        self.__window_type = _window_type_enum(window_type)
        self.__frame_rate = float(frame_rate)
        self.__input_center_freq = float(input_center_freq)
        self.__paused = bool(paused)

        # interest tracking
        # this is indirect because we ignore interest when paused
        self.__interested_cell = LooseCell(type=bool,
                                           value=False,
                                           writable=False,
                                           persists=False)
        self.__has_subscriptions = False
        self.__interest = InterestTracker(self.__cell_interest_callback)

        self.__fft_queue = gr.msg_queue()
        self.__scope_queue = gr.msg_queue()

        # stuff created by __do_connect
        self.__gate = None
        self.__fft_sink = None
        self.__scope_sink = None
        self.__frame_dec = None
        self.__frame_rate_to_decimation_conversion = 0.0

        self.__do_connect()
Beispiel #2
0
 def __init__(self):
     InterestTracker.__init__(self, self.__set)
Beispiel #3
0
 def __init__(self):
     InterestTracker.__init__(self, self.__set)