本文整理汇总了Python中shinysdr.top.Top.start方法的典型用法代码示例。如果您正苦于以下问题:Python Top.start方法的具体用法?Python Top.start怎么用?Python Top.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shinysdr.top.Top
的用法示例。
在下文中一共展示了Top.start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DemodulatorTester
# 需要导入模块: from shinysdr.top import Top [as 别名]
# 或者: from shinysdr.top.Top import start [as 别名]
class DemodulatorTester(object):
'''
Set up an environment for testing a demodulator and do some fundamental tests.
'''
def __init__(self, mode, state=None):
# TODO: Refactor things so that we can take the demod ctor rather than a mode string
if state is None:
state = {}
mode_def = lookup_mode(mode)
if mode_def is None:
raise Exception('No such mode is registered: ' + repr(mode))
# TODO: Tell the simulated device to have no modulators, or have a simpler dummy source for testing, so we don't waste time on setup
self.__top = Top(devices={'s1': SimulatedDevice()})
(_, receiver) = self.__top.add_receiver(mode, key='a', state=state)
self.__demodulator = receiver.get_demodulator()
if not isinstance(self.__demodulator, mode_def.demod_class):
raise Exception('Demodulator not of expected class: ' + repr(self.__demodulator))
self.__top.start() # TODO overriding internals
def close(self):
if self.__top is not None:
self.__top.stop()
self.__top = None
def __enter__(self):
state_smoke_test(self.__demodulator)
def __exit__(self, exc_type, exc_value, traceback):
self.close()
示例2: DemodulatorTester
# 需要导入模块: from shinysdr.top import Top [as 别名]
# 或者: from shinysdr.top.Top import start [as 别名]
class DemodulatorTester(object):
'''
Set up an environment for testing a demodulator.
'''
def __init__(self, mode):
# TODO: Refactor things so that we can take the demod ctor rather than a mode string
# TODO: Tell the simulated device to have no modulators, or have a simpler dummy source for testing, so we don't waste time on setup
self.__top = Top(devices={'s1': SimulatedDevice()})
self.__top.add_receiver(mode, key='a')
self.__top.start() # TODO overriding internals
def close(self):
if self.__top is not None:
self.__top.stop()
self.__top = None
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
self.close()
示例3: DemodulatorTester
# 需要导入模块: from shinysdr.top import Top [as 别名]
# 或者: from shinysdr.top.Top import start [as 别名]
class DemodulatorTester(object):
'''
Set up an environment for testing a demodulator and do some fundamental tests.
'''
def __init__(self, mode, state=None):
# TODO: Refactor things so that we can take the demod ctor rather than a mode string
# TODO: Tell the simulated device to have no modulators, or have a simpler dummy source for testing, so we don't waste time on setup
if state is None:
state = {}
self.__top = Top(devices={'s1': SimulatedDevice()})
(_, receiver) = self.__top.add_receiver(mode, key='a', state=state)
self.__demodulator = receiver.get_demodulator()
self.__top.start() # TODO overriding internals
def close(self):
if self.__top is not None:
self.__top.stop()
self.__top = None
def __enter__(self):
state_smoke_test(self.__demodulator)
def __exit__(self, exc_type, exc_value, traceback):
self.close()