示例#1
0
 def __init__(self, ws_url="ws://localhost:8502/api/ws", buckets=360):
     gr.sync_block.__init__(self,
                            name="pos_max_hold_fvf",
                            in_sig=[np.float32],
                            out_sig=[(np.float32, buckets)])
     self._client = client.Client(ws_url)
     self._buckets = buckets
     self._alpha = 0.9
     self._max_hold = np.zeros(buckets, np.float64)
     self._max_hold -= 140
示例#2
0
 def __init__(self, tb, signal):
     self.tb = tb
     self.signal = signal
     SocketServer.TCPServer.__init__(self, ("localhost", 4532),
                                     RigctlHandler)
     client_name = None
     try:
         client_name = open("client_name.txt", "r").read().strip()
     except IOError:
         pass
     self.rci = client.Client(client_name=client_name)
示例#3
0
 def __init__(self):
     super(top_block, self).__init__()
     self._client = client.Client()
示例#4
0
    url = '%s/deviceset/%d/device/settings' % (base_uri, dev)
    if channel is not None:
        url = '%s/deviceset/%d/channel/%d/settings' % (base_uri, dev, channel)
    r = requests.get(url)
    r.raise_for_status()
    return r.json()


def patch_settings(dev, settings, channel=None):
    url = '%s/deviceset/%d/device/settings' % (base_uri, dev)
    if channel is not None:
        url = '%s/deviceset/%d/channel/%d/settings' % (base_uri, dev, channel)
    requests.patch(url, json=settings).raise_for_status()


rci = client.Client('ws://localhost:8502/api/ws')
if tx:
    # Copy frequency to TX
    settings = get_settings(txdev)
    rxsettings = get_settings(rxdev)
    freq = rxsettings['limeSdrInputSettings']['centerFrequency']
    rxchannelsettings = get_settings(rxdev, 0)
    for v in rxchannelsettings.itervalues():
        if isinstance(v, dict) and 'inputFrequencyOffset' in v:
            freq += v['inputFrequencyOffset']
    settings['hackRFOutputSettings']['centerFrequency'] = freq
    patch_settings(txdev, settings)
    # Set input gain to 0
    settings = get_settings(rxdev)
    settings['limeSdrInputSettings']['gain'] = 0
    patch_settings(rxdev, settings)