implement new buffer input / output api
This commit is contained in:
@ -31,7 +31,7 @@ class SpectrumThread(csdr.output, SdrSourceEventClient):
|
||||
|
||||
self.dsp = dsp = csdr.dsp(self)
|
||||
dsp.nc_port = self.sdrSource.getPort()
|
||||
dsp.setSocketClient(self.sdrSource.getSocketClient())
|
||||
dsp.setBuffer(self.sdrSource.getBuffer())
|
||||
dsp.set_demodulator("fft")
|
||||
|
||||
self.subscriptions = [
|
||||
|
@ -11,7 +11,7 @@ from owrx.command import CommandMapper
|
||||
from owrx.socket import getAvailablePort
|
||||
from owrx.property import PropertyStack, PropertyLayer
|
||||
|
||||
from pycsdr import SocketClient
|
||||
from pycsdr import SocketClient, Buffer
|
||||
|
||||
import logging
|
||||
|
||||
@ -51,6 +51,7 @@ class SdrSource(ABC):
|
||||
|
||||
self.commandMapper = None
|
||||
self.socketClient = None
|
||||
self.buffer = None
|
||||
|
||||
self.props = PropertyStack()
|
||||
# layer 0 reserved for profile properties
|
||||
@ -144,12 +145,18 @@ class SdrSource(ABC):
|
||||
def getPort(self):
|
||||
return self.port
|
||||
|
||||
def getSocketClient(self):
|
||||
def _getSocketCLient(self):
|
||||
with self.modificationLock:
|
||||
if self.socketClient is None:
|
||||
self.socketClient = SocketClient(self.port)
|
||||
return self.socketClient
|
||||
|
||||
def getBuffer(self):
|
||||
if self.buffer is None:
|
||||
self.buffer = Buffer()
|
||||
self._getSocketCLient().setOutput(self.buffer)
|
||||
return self.buffer
|
||||
|
||||
def getCommandValues(self):
|
||||
dict = self.sdrProps.__dict__()
|
||||
if "lfo_offset" in dict and dict["lfo_offset"] is not None:
|
||||
|
Reference in New Issue
Block a user