encapsulate fft chain in its own class

This commit is contained in:
Jakob Ketterl
2020-12-16 18:52:00 +01:00
parent 4b61192b36
commit 1bd6aa73f3
3 changed files with 43 additions and 13 deletions

16
csdr/chain/__init__.py Normal file
View File

@@ -0,0 +1,16 @@
class Chain(object):
def __init__(self, *workers):
self.workers = workers
stage = None
for w in self.workers:
if stage is not None:
w.setInput(stage.getBuffer())
stage = w
self.buffer = stage.getBuffer()
def stop(self):
for w in self.workers:
w.stop()
def getBuffer(self):
return self.buffer