def __init__(self, dps=500, l1=10.0, l2=15.0, ld=4.0, nthreads=8): gr.top_block.__init__(self, "Test Sim") ################################################## # Parameters ################################################## self.dps = dps self.l1 = l1 self.l2 = l2 self.ld = ld self.nthreads = nthreads ################################################## # Variables ################################################## self.samp_rate = samp_rate = 25e6 self.dbps = dbps = 100 ################################################## # Blocks ################################################## self.eventsim_operation2_0 = eventsim.operation2(samp_rate, 0, l2) self.eventsim_operation1_0 = eventsim.operation1(samp_rate, 0, l1) self.eventsim_detector_0 = eventsim.detector(samp_rate, dps, ld) self.es_trigger_sample_timer_0 = es.trigger_sample_timer( gr.sizeof_gr_complex, int(samp_rate / dbps), 10000, int(samp_rate), int(samp_rate / dbps)) (self.es_trigger_sample_timer_0).set_min_output_buffer(2000000) self.es_sink_0 = es.sink(1 * [gr.sizeof_gr_complex], nthreads, 256, 0, 2, "") self.blocks_file_source_0 = blocks.file_source( gr.sizeof_gr_complex * 1, "test.dat", True) ################################################## # Connections ################################################## self.msg_connect((self.es_trigger_sample_timer_0, 'which_stream'), (self.es_sink_0, 'schedule_event')) self.msg_connect( (self.es_trigger_sample_timer_0, 'sample_timer_event'), (self.eventsim_detector_0, 'handle_event')) self.msg_connect((self.eventsim_detector_0, 'which_stream'), (self.es_sink_0, 'schedule_event')) self.msg_connect((self.eventsim_detector_0, 'detect_type1_event'), (self.eventsim_operation1_0, 'handle_event')) self.msg_connect((self.eventsim_detector_0, 'detect_type2_event'), (self.eventsim_operation2_0, 'handle_event')) self.msg_connect((self.eventsim_operation1_0, 'which_stream'), (self.es_sink_0, 'schedule_event')) self.msg_connect((self.eventsim_operation1_0, 'type1_event'), (self.eventsim_operation2_0, 'handle_event')) self.msg_connect((self.eventsim_operation2_0, 'which_stream'), (self.es_sink_0, 'schedule_event')) self.connect((self.blocks_file_source_0, 0), (self.es_trigger_sample_timer_0, 0)) self.connect((self.es_trigger_sample_timer_0, 0), (self.es_sink_0, 0))
def __init__(self, l1=10.0, l2=15.0, ld=4.0, nthreads=1, dps=500, nsinks=4): gr.top_block.__init__(self, "Test Sim Multi") ################################################## # Parameters ################################################## self.l1 = l1 self.l2 = l2 self.ld = ld self.nthreads = nthreads self.dps = dps self.nsinks = nsinks ################################################## # Variables ################################################## self.samp_rate = samp_rate = 25e6 self.dbps = dbps = 10 ################################################## # Blocks ################################################## self.eventsim_operation2_0 = eventsim.operation2(samp_rate, 0, l2) self.eventsim_operation1_0 = eventsim.operation1(samp_rate, 0, l1) self.eventsim_detector_0 = eventsim.detector(samp_rate, dps, ld, 20) self.es_trigger_sample_timer_0 = es.trigger_sample_timer(gr.sizeof_gr_complex, int(samp_rate/dbps), 0, 4*int(samp_rate), int(samp_rate/dbps) ) (self.es_trigger_sample_timer_0).set_min_output_buffer(8000000) self.es_mulisink_0 = es.multisink(1*[gr.sizeof_gr_complex],nthreads,128,1,2,"grp", nsinks) self.blocks_null_source_0 = blocks.null_source(gr.sizeof_gr_complex*1) ################################################## # Connections ################################################## self.msg_connect((self.es_trigger_sample_timer_0, 'which_stream'), (self.es_mulisink_0, 'schedule_event')) self.msg_connect((self.es_trigger_sample_timer_0, 'sample_timer_event'), (self.eventsim_detector_0, 'handle_event')) self.msg_connect((self.eventsim_detector_0, 'which_stream'), (self.es_mulisink_0, 'schedule_event')) self.msg_connect((self.eventsim_detector_0, 'detect_type1_event'), (self.eventsim_operation1_0, 'handle_event')) self.msg_connect((self.eventsim_detector_0, 'detect_type2_event'), (self.eventsim_operation2_0, 'handle_event')) self.msg_connect((self.eventsim_operation1_0, 'which_stream'), (self.es_mulisink_0, 'schedule_event')) self.msg_connect((self.eventsim_operation1_0, 'type1_event'), (self.eventsim_operation2_0, 'handle_event')) self.msg_connect((self.eventsim_operation2_0, 'which_stream'), (self.es_mulisink_0, 'schedule_event')) self.connect((self.blocks_null_source_0, 0), (self.es_trigger_sample_timer_0, 0)) self.connect((self.es_trigger_sample_timer_0, 0), (self.es_mulisink_0, 0))
def __init__(self, dps=500, l1=10.0, l2=15.0, ld=4.0, nthreads=8): gr.top_block.__init__(self, "Test Sim") ################################################## # Parameters ################################################## self.dps = dps self.l1 = l1 self.l2 = l2 self.ld = ld self.nthreads = nthreads ################################################## # Variables ################################################## self.samp_rate = samp_rate = 25e6 self.dbps = dbps = 100 ################################################## # Blocks ################################################## self.eventsim_operation2_0 = eventsim.operation2(samp_rate, 0, l2) self.eventsim_operation1_0 = eventsim.operation1(samp_rate, 0, l1) self.eventsim_detector_0 = eventsim.detector(samp_rate, dps, ld) self.es_trigger_sample_timer_0 = es.trigger_sample_timer(gr.sizeof_gr_complex, int(samp_rate/dbps), 10000, int(samp_rate), int(samp_rate/dbps) ) (self.es_trigger_sample_timer_0).set_min_output_buffer(2000000) self.es_sink_0 = es.sink(1*[gr.sizeof_gr_complex],nthreads,256,0,2,"") self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, "test.dat", True) ################################################## # Connections ################################################## self.msg_connect((self.es_trigger_sample_timer_0, 'which_stream'), (self.es_sink_0, 'schedule_event')) self.msg_connect((self.es_trigger_sample_timer_0, 'sample_timer_event'), (self.eventsim_detector_0, 'handle_event')) self.msg_connect((self.eventsim_detector_0, 'which_stream'), (self.es_sink_0, 'schedule_event')) self.msg_connect((self.eventsim_detector_0, 'detect_type1_event'), (self.eventsim_operation1_0, 'handle_event')) self.msg_connect((self.eventsim_detector_0, 'detect_type2_event'), (self.eventsim_operation2_0, 'handle_event')) self.msg_connect((self.eventsim_operation1_0, 'which_stream'), (self.es_sink_0, 'schedule_event')) self.msg_connect((self.eventsim_operation1_0, 'type1_event'), (self.eventsim_operation2_0, 'handle_event')) self.msg_connect((self.eventsim_operation2_0, 'which_stream'), (self.es_sink_0, 'schedule_event')) self.connect((self.blocks_file_source_0, 0), (self.es_trigger_sample_timer_0, 0)) self.connect((self.es_trigger_sample_timer_0, 0), (self.es_sink_0, 0))