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 setUp(self): self.top = Top(devices={'s1': SimulatedDevice()}) (_key, self.receiver) = self.top.add_receiver('AM', key='a')
def setUp(self): super(TestSimulatedDevice, self).setUpFor(device=SimulatedDevice())
def setUp(self): self.session = Session( receive_flowgraph=Top(devices={'s1': SimulatedDevice()}), read_only_dbs={}, writable_db=DatabaseModel(the_reactor, {}, writable=True), features={})
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
#d = shinysdr.plugins.hamlib.connect_to_rotctld(config.reactor, host='w1xm-radar-1.mit.edu', port=4533) #d.addCallback(lambda rotator: config.devices.add(u'dish', sdr, PositionedDevice(42.360326, -71.089324), rotator)) #config.wait_for(d) config.devices.add(u'dish', sdr, PositionedDevice(42.360326, -71.089324)) from shinysdr.plugins.flightradar24 import Flightradar24 config.devices.add(u'flightradar24', Flightradar24(config.reactor, bounds=(47, 37, -76, -66))) ## For hardware which uses a sound-card as its ADC or appears as an ## audio device. #config.devices.add(u'audio', AudioDevice(rx_device='')) #config.set_server_audio_allowed(True, 'pulse_shinyout', 48000) # Locally generated RF signals for test purposes. if sim: config.devices.add(u'sim', SimulatedDevice()) # Databases config.databases.add_directory('/config/databases') from uuid import getnode as get_mac config.serve_web( # These are in Twisted endpoint description syntax: # <http://twistedmatrix.com/documents/current/api/twisted.internet.endpoints.html#serverFromString> # Note: ws_endpoint must currently be 1 greater than http_endpoint; if one # is SSL then both must be. These restrictions will be relaxed later. http_endpoint='tcp:8100', ws_endpoint='tcp:8101', # A secret placed in the URL as simple access control. Does not
def test_state_smoke(self): state_smoke_test( Session(receive_flowgraph=Top(devices={'s1': SimulatedDevice()}), features={}))