if k not in self.__cells: self.__cells[k] = LooseCell(key=k, value=None, type=object, writable=False, persists=False) self.__cells[k].set_internal(v) def is_interesting(self): """Implements ITelemetryObject.""" return True def get_object_expiry(self): """implement ITelemetryObject""" return self.__last_heard_time + drop_unheard_timeout_seconds @exported_value(type=Timestamp()) def get_last_heard_time(self): return self.__last_heard_time # TODO: Arrange for a way for the user to see why it is unavailable. _rtl_433_available = test_subprocess(['rtl_433', '-r', '/dev/null'], 'Reading samples from file', shell=False) plugin_mode = ModeDef(mode='433', label='rtl_433', demod_class=RTL433Demodulator, available=_rtl_433_available)
def __lineReceived(self, line): if line == '': # observed glitch in output pass elif line.startswith('Enabled demodulators:'): pass elif line.startswith( '$ULTW' ) and self.__last_line is not None: # observed glitch in output; need to glue to previous line, I think? ll = self.__last_line self.__last_line = None self.__target(ll + line) elif line.startswith('APRS: '): line = line[len('APRS: '):] self.__last_line = line self.__target(line) else: # TODO: Log these properly print 'Not APRS line: %r' % line # TODO: Arrange for a way for the user to see why it is unavailable. _multimon_available = test_subprocess('multimon-ng -h; exit 0', 'available demodulators:', shell=True) pluginDef_APRS = ModeDef( mode='APRS', # TODO: Rename mode to be more accurate label='APRS', demod_class=FMAPRSDemodulator, available=_multimon_available)
raise Exception('shouldn\'t happen') def __lineReceived(self, line): if line == '': # observed glitch in output pass elif line.startswith('Enabled demodulators:'): pass elif line.startswith('$ULTW') and self.__last_line is not None: # observed glitch in output; need to glue to previous line, I think? ll = self.__last_line self.__last_line = None self.__target(ll + line) elif line.startswith('APRS: '): line = line[len('APRS: '):] self.__last_line = line self.__target(line) else: # TODO: Log these properly print 'Not APRS line: %r' % line # TODO: Arrange for a way for the user to see why it is unavailable. _multimon_available = test_subprocess('multimon-ng -h; exit 0', 'available demodulators:', shell=True) pluginDef_APRS = ModeDef( mode='APRS', # TODO: Rename mode to be more accurate label='APRS', demod_class=FMAPRSDemodulator, shared_objects={'aprs_information': APRSInformation}, available=_multimon_available)
type=object, writable=False, persists=False) self.__cells[k].set_internal(v) def is_interesting(self): """Implements ITelemetryObject.""" return True def get_object_expiry(self): """implement ITelemetryObject""" return self.__last_heard_time + drop_unheard_timeout_seconds @exported_value(type=Timestamp()) def get_last_heard_time(self): return self.__last_heard_time # TODO: Arrange for a way for the user to see why it is unavailable. _rtl_433_available = test_subprocess( ['rtl_433', '-r', '/dev/null'], 'Reading samples from file', shell=False) plugin_mode = ModeDef( mode='433', label='rtl_433', demod_class=RTL433Demodulator, available=_rtl_433_available)
# Output converter = blocks.float_to_short(vlen=1, scale=int_scale) self.connect(self, self.fm_demod, converter, self.process) # Dummy sink for useless stereo output of demod self.connect((self.fm_demod, 1), blocks.null_sink(gr.sizeof_float)) # Audio copy output resampler = make_resampler(pipe_rate, audio_rate) self.connect(converter, blocks.short_to_float(vlen=1, scale=int_scale), resampler) # self.connect(self.fm_demod, resampler) self.connect(resampler, (self, 0)) self.connect(resampler, (self, 1)) def can_set_mode(self, mode): return False def get_half_bandwidth(self): return self.fm_demod.get_half_bandwidth() @exported_value() def get_band_filter_shape(self): return self.fm_demod.get_band_filter_shape() # TODO: Arrange for a way for the user to see why it is unavailable. pluginDef_APRS = ModeDef( "APRS", label="APRS", demodClass=MultimonNGDemodulator, available=test_subprocess("multimon-ng -h; exit 0", "available demodulators:", shell=True), )
filter, blocks.complex_to_imag(1), blocks.multiply_const_ff(255.0/2), blocks.add_const_ff(255.0/2), blocks.float_to_uchar(), (interleaver, 1)) # Dummy audio zero = analog.sig_source_f(0, analog.GR_CONST_WAVE, 0, 0, 0) self.throttle = blocks.throttle(gr.sizeof_float, audio_rate) self.connect(zero, self.throttle) self.connect(self.throttle, (self, 0)) self.connect(self.throttle, (self, 1)) def can_set_mode(self, mode): return False def get_half_bandwidth(self): return pipe_rate / 2 @exported_value() def get_band_filter_shape(self): return { 'low': -pipe_rate/2, 'high': pipe_rate/2, 'width': transition_width } # TODO: Arrange for a way for the user to see why it is unavailable. pluginDef = ModeDef('MODE-S', label='Mode S', demodClass=ModeSDemodulator, available=test_subprocess(['dump1090', '--help'], '--enable-agc'))
blocks.multiply_const_ff(255.0 / 2), blocks.add_const_ff(255.0 / 2), blocks.float_to_uchar(), (interleaver, 1), ) # Dummy audio zero = analog.sig_source_f(0, analog.GR_CONST_WAVE, 0, 0, 0) self.throttle = blocks.throttle(gr.sizeof_float, audio_rate) self.connect(zero, self.throttle) self.connect(self.throttle, (self, 0)) self.connect(self.throttle, (self, 1)) def can_set_mode(self, mode): return False def get_half_bandwidth(self): return pipe_rate / 2 @exported_value() def get_band_filter_shape(self): return {"low": -pipe_rate / 2, "high": pipe_rate / 2, "width": transition_width} # TODO: Arrange for a way for the user to see why it is unavailable. pluginDef = ModeDef( "MODE-S", label="Mode S", demodClass=ModeSDemodulator, available=test_subprocess(["dump1090", "--help"], "--enable-agc"), )