Example #1
0
    _Row('SB', s_boolean,
         label='Sub RX/Dual Watch'),  # TODO: Use transceiver-specific name
    _UnusedCommand('SD'),  # not yet used
    _UnusedCommand('SM'),  # not yet used
    _Row('SQ', IntSyntax(3, 0, 29), s=True, label='Squelch'),
    _UnusedCommand('SW'),  # not yet used
    _UnusedCommand('TB'),  # not yet used
    _UnusedCommand('TQ'),  # not yet used
    _UnusedCommand('TX'),  # not yet used
    _UnusedCommand('UP'),  # not used
    _Row('VX',
         EnumSyntax({
             '0': 'On',
             '1': 'Off'
         }),
         get_only=True,
         s=True,
         label='VOX'),  # note is per-mode
    _Row('XF', IntSyntax(1), get_only=True, s=True, label='XFIL'),
    _Row('XT', s_boolean, label='XIT On'),

    # Non-command state
    _NonCommandRow('scan', bool, False),
    _NonCommandRow('split', bool, False),
])

_plugin_client = ClientResourceDef(key=__name__,
                                   resource=static.File(
                                       sibpath(__file__, 'client')),
                                   load_js_path='elecraft.js')
Example #2
0
    def get_angle(self):
        return self.__angle

    @setter
    def set_angle(self, value):
        value = float(value)
        compensation = math.pi / 180 * -6.5  # empirical, calibrated against VOR receiver (and therefore probably wrong)
        value = value + compensation
        value = value % (2 * math.pi)
        phase_shift = int(self.__rf_rate / self.__vor_sig_freq *
                          (value / (2 * math.pi)))
        self.__delay.set_dly(phase_shift)
        self.__angle = value

    def get_input_type(self):
        return SignalType(kind='MONO', sample_rate=self.__audio_rate)

    def get_output_type(self):
        return SignalType(kind='IQ', sample_rate=self.__rf_rate)


# Twisted plugin exports
pluginMode = ModeDef(mode='VOR',
                     info='VOR',
                     demod_class=VOR,
                     mod_class=VORModulator)
pluginClient = ClientResourceDef(
    key=__name__,
    resource=static.File(os.path.join(os.path.split(__file__)[0], 'client')),
    load_js_path='vor.js')
Example #3
0
    return value


def _parse_telemetry_value(facts, errors, value_str, channel):
    try:
        value = float(value_str)
    except ValueError:
        errors.append('Telemetry channel %i did not parse: %r' %
                      (channel, value_str))
        return
    facts.append(Telemetry(channel=channel, value=value))


_plugin_resource = static.File(
    os.path.join(os.path.split(__file__)[0], 'client'))
_plugin_resource.putChild(
    'symbols',
    static.File(
        os.path.join(
            os.path.split(shinysdr.__file__)[0], 'deps/aprs-symbols/png')))
_plugin_resource.putChild(
    'symbol-index',
    static.File(
        os.path.join(
            os.path.split(shinysdr.__file__)[0],
            'deps/aprs-symbol-index/generated/symbols.dense.json')))

plugin_client_js = ClientResourceDef(key=__name__,
                                     resource=_plugin_resource,
                                     load_js_path='aprs.js')