def __init__(self): gr.top_block.__init__(self, "Calibration Example") Qt.QWidget.__init__(self) self.setWindowTitle("Calibration Example") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "calibration_example") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 1024000*2 self.gain_rx = gain_rx = 0 self.center_freq = center_freq = 2.4e9 self.cal_freq = cal_freq = 1000 ################################################## # Blocks ################################################## self.tab = Qt.QTabWidget() self.tab_widget_0 = Qt.QWidget() self.tab_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.tab_widget_0) self.tab_grid_layout_0 = Qt.QGridLayout() self.tab_layout_0.addLayout(self.tab_grid_layout_0) self.tab.addTab(self.tab_widget_0, "Input") self.tab_widget_1 = Qt.QWidget() self.tab_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.tab_widget_1) self.tab_grid_layout_1 = Qt.QGridLayout() self.tab_layout_1.addLayout(self.tab_grid_layout_1) self.tab.addTab(self.tab_widget_1, "Post Gain Correct") self.tab_widget_2 = Qt.QWidget() self.tab_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.tab_widget_2) self.tab_grid_layout_2 = Qt.QGridLayout() self.tab_layout_2.addLayout(self.tab_grid_layout_2) self.tab.addTab(self.tab_widget_2, "Post Phase Correct") self.top_layout.addWidget(self.tab) self.uhd_usrp_source_0_0 = uhd.usrp_source( ",".join(("addr0=192.168.30.2,addr1=192.168.70.2,addr2=192.168.20.2", "")), uhd.stream_args( cpu_format="fc32", channels=range(3), ), ) self.uhd_usrp_source_0_0.set_clock_source("external", 0) self.uhd_usrp_source_0_0.set_time_source("external", 0) self.uhd_usrp_source_0_0.set_clock_source("external", 1) self.uhd_usrp_source_0_0.set_time_source("external", 1) self.uhd_usrp_source_0_0.set_clock_source("external", 2) self.uhd_usrp_source_0_0.set_time_source("external", 2) self.uhd_usrp_source_0_0.set_time_now(uhd.time_spec(time.time()), uhd.ALL_MBOARDS) self.uhd_usrp_source_0_0.set_samp_rate(samp_rate) self.uhd_usrp_source_0_0.set_center_freq(center_freq, 0) self.uhd_usrp_source_0_0.set_gain(gain_rx, 0) self.uhd_usrp_source_0_0.set_center_freq(center_freq, 1) self.uhd_usrp_source_0_0.set_gain(gain_rx, 1) self.uhd_usrp_source_0_0.set_center_freq(center_freq, 2) self.uhd_usrp_source_0_0.set_gain(gain_rx, 2) self.uhd_usrp_sink_0_0 = uhd.usrp_sink( ",".join(("addr=192.168.10.2", "")), uhd.stream_args( cpu_format="fc32", channels=range(1), ), ) self.uhd_usrp_sink_0_0.set_time_now(uhd.time_spec(time.time()), uhd.ALL_MBOARDS) self.uhd_usrp_sink_0_0.set_samp_rate(samp_rate) self.uhd_usrp_sink_0_0.set_center_freq(center_freq, 0) self.uhd_usrp_sink_0_0.set_gain(10, 0) self.qtgui_time_sink_x_0_1 = qtgui.time_sink_f( 100, #size samp_rate, #samp_rate "Input", #name 3 #number of inputs ) self.qtgui_time_sink_x_0_1.set_update_time(0.10) self.qtgui_time_sink_x_0_1.set_y_axis(-1, 1) self.qtgui_time_sink_x_0_1.set_y_label("Amplitude", "") self.qtgui_time_sink_x_0_1.enable_tags(-1, True) self.qtgui_time_sink_x_0_1.set_trigger_mode(qtgui.TRIG_MODE_AUTO, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_1.enable_autoscale(True) self.qtgui_time_sink_x_0_1.enable_grid(False) self.qtgui_time_sink_x_0_1.enable_control_panel(True) if not True: self.qtgui_time_sink_x_0_1.disable_legend() labels = ["", "", "", "", "", "", "", "", "", ""] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue"] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(3): if len(labels[i]) == 0: self.qtgui_time_sink_x_0_1.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0_1.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_1.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_1.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_1.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_1.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_1.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_1_win = sip.wrapinstance(self.qtgui_time_sink_x_0_1.pyqwidget(), Qt.QWidget) self.tab_layout_0.addWidget(self._qtgui_time_sink_x_0_1_win) self.qtgui_time_sink_x_0_0 = qtgui.time_sink_f( 100, #size samp_rate, #samp_rate "Output Synced", #name 3 #number of inputs ) self.qtgui_time_sink_x_0_0.set_update_time(0.10) self.qtgui_time_sink_x_0_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0_0.set_y_label("Amplitude", "") self.qtgui_time_sink_x_0_0.enable_tags(-1, True) self.qtgui_time_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_AUTO, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_0.enable_autoscale(True) self.qtgui_time_sink_x_0_0.enable_grid(False) self.qtgui_time_sink_x_0_0.enable_control_panel(True) if not True: self.qtgui_time_sink_x_0_0.disable_legend() labels = ["", "", "", "", "", "", "", "", "", ""] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue"] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(3): if len(labels[i]) == 0: self.qtgui_time_sink_x_0_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0_0.pyqwidget(), Qt.QWidget) self.tab_layout_2.addWidget(self._qtgui_time_sink_x_0_0_win) self.qtgui_time_sink_x_0 = qtgui.time_sink_f( 100, #size samp_rate, #samp_rate "Post Gain Correct", #name 3 #number of inputs ) self.qtgui_time_sink_x_0.set_update_time(0.10) self.qtgui_time_sink_x_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0.set_y_label("Amplitude", "") self.qtgui_time_sink_x_0.enable_tags(-1, True) self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_AUTO, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0.enable_autoscale(True) self.qtgui_time_sink_x_0.enable_grid(False) self.qtgui_time_sink_x_0.enable_control_panel(True) if not True: self.qtgui_time_sink_x_0.disable_legend() labels = ["", "", "", "", "", "", "", "", "", ""] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue"] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(3): if len(labels[i]) == 0: self.qtgui_time_sink_x_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget) self.tab_layout_1.addWidget(self._qtgui_time_sink_x_0_win) self.measure_phases_0 = measure_phases( cal_tone_freq=cal_freq, memSize=1024, samp_rate=samp_rate, skip=1024000*10, updatePeriod=1000, ) self.correct_gains_hier_0 = correct_gains_hier( cal_tone_freq=cal_freq, samp_rate=samp_rate, ) self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_int*1) self.blocks_complex_to_real_0_2 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_1 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_0_2 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_0_1 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_0_0_1 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_0_0_0 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_0_0 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_0 = blocks.complex_to_real(1) self.blocks_complex_to_real_0 = blocks.complex_to_real(1) self.analog_sig_source_x_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, cal_freq, 1, 0) ################################################## # Connections ################################################## self.connect((self.analog_sig_source_x_0, 0), (self.uhd_usrp_sink_0_0, 0)) self.connect((self.blocks_complex_to_real_0, 0), (self.qtgui_time_sink_x_0, 0)) self.connect((self.blocks_complex_to_real_0_0, 0), (self.qtgui_time_sink_x_0, 1)) self.connect((self.blocks_complex_to_real_0_0_0, 0), (self.qtgui_time_sink_x_0, 2)) self.connect((self.blocks_complex_to_real_0_0_0_0, 0), (self.qtgui_time_sink_x_0_0, 2)) self.connect((self.blocks_complex_to_real_0_0_0_1, 0), (self.qtgui_time_sink_x_0_1, 2)) self.connect((self.blocks_complex_to_real_0_0_1, 0), (self.qtgui_time_sink_x_0_0, 1)) self.connect((self.blocks_complex_to_real_0_0_2, 0), (self.qtgui_time_sink_x_0_1, 1)) self.connect((self.blocks_complex_to_real_0_1, 0), (self.qtgui_time_sink_x_0_0, 0)) self.connect((self.blocks_complex_to_real_0_2, 0), (self.qtgui_time_sink_x_0_1, 0)) self.connect((self.correct_gains_hier_0, 0), (self.blocks_complex_to_real_0, 0)) self.connect((self.correct_gains_hier_0, 1), (self.blocks_complex_to_real_0_0, 0)) self.connect((self.correct_gains_hier_0, 2), (self.blocks_complex_to_real_0_0_0, 0)) self.connect((self.correct_gains_hier_0, 0), (self.measure_phases_0, 0)) self.connect((self.correct_gains_hier_0, 1), (self.measure_phases_0, 1)) self.connect((self.correct_gains_hier_0, 2), (self.measure_phases_0, 2)) self.connect((self.measure_phases_0, 2), (self.blocks_complex_to_real_0_0_0_0, 0)) self.connect((self.measure_phases_0, 1), (self.blocks_complex_to_real_0_0_1, 0)) self.connect((self.measure_phases_0, 0), (self.blocks_complex_to_real_0_1, 0)) self.connect((self.measure_phases_0, 3), (self.blocks_null_sink_0, 0)) self.connect((self.measure_phases_0, 4), (self.blocks_null_sink_0, 1)) self.connect((self.measure_phases_0, 5), (self.blocks_null_sink_0, 2)) self.connect((self.uhd_usrp_source_0_0, 2), (self.blocks_complex_to_real_0_0_0_1, 0)) self.connect((self.uhd_usrp_source_0_0, 1), (self.blocks_complex_to_real_0_0_2, 0)) self.connect((self.uhd_usrp_source_0_0, 0), (self.blocks_complex_to_real_0_2, 0)) self.connect((self.uhd_usrp_source_0_0, 0), (self.correct_gains_hier_0, 0)) self.connect((self.uhd_usrp_source_0_0, 1), (self.correct_gains_hier_0, 1)) self.connect((self.uhd_usrp_source_0_0, 2), (self.correct_gains_hier_0, 2))
def __init__(self): gr.top_block.__init__(self, "Calibration Example") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 1024000*2 self.gain_rx = gain_rx = 0 self.center_freq = center_freq = 2.4e9 self.cal_freq = cal_freq = 1000 ################################################## # Blocks ################################################## self.uhd_usrp_source_0_0 = uhd.usrp_source( ",".join(("addr0=192.168.30.2,addr1=192.168.70.2,addr2=192.168.20.2", "")), uhd.stream_args( cpu_format="fc32", channels=range(3), ), ) self.uhd_usrp_source_0_0.set_clock_source("external", 0) self.uhd_usrp_source_0_0.set_time_source("external", 0) self.uhd_usrp_source_0_0.set_clock_source("external", 1) self.uhd_usrp_source_0_0.set_time_source("external", 1) self.uhd_usrp_source_0_0.set_clock_source("external", 2) self.uhd_usrp_source_0_0.set_time_source("external", 2) self.uhd_usrp_source_0_0.set_time_now(uhd.time_spec(time.time()), uhd.ALL_MBOARDS) self.uhd_usrp_source_0_0.set_samp_rate(samp_rate) self.uhd_usrp_source_0_0.set_center_freq(center_freq, 0) self.uhd_usrp_source_0_0.set_gain(gain_rx, 0) self.uhd_usrp_source_0_0.set_center_freq(center_freq, 1) self.uhd_usrp_source_0_0.set_gain(gain_rx, 1) self.uhd_usrp_source_0_0.set_center_freq(center_freq, 2) self.uhd_usrp_source_0_0.set_gain(gain_rx, 2) self.uhd_usrp_sink_0_0 = uhd.usrp_sink( ",".join(("addr=192.168.10.2", "")), uhd.stream_args( cpu_format="fc32", channels=range(1), ), ) self.uhd_usrp_sink_0_0.set_time_now(uhd.time_spec(time.time()), uhd.ALL_MBOARDS) self.uhd_usrp_sink_0_0.set_samp_rate(samp_rate) self.uhd_usrp_sink_0_0.set_center_freq(center_freq, 0) self.uhd_usrp_sink_0_0.set_gain(10, 0) self.measure_phases_0 = measure_phases( cal_tone_freq=cal_freq, memSize=1024, samp_rate=samp_rate, skip=1024000*10, updatePeriod=1000, ) self.correct_gains_hier_0 = correct_gains_hier( cal_tone_freq=cal_freq, samp_rate=samp_rate, ) self.blocks_head_0_1 = blocks.head(gr.sizeof_gr_complex*1, 10000000) self.blocks_head_0_0 = blocks.head(gr.sizeof_gr_complex*1, 10000000) self.blocks_head_0 = blocks.head(gr.sizeof_gr_complex*1, 10000000) self.blocks_file_sink_0_1 = blocks.file_sink(gr.sizeof_gr_complex*1, "/home/travis/Dropbox/PHD/WiFiUS/doa/gnuradio/gr-wifius/data/channel2_complex.bin", False) self.blocks_file_sink_0_1.set_unbuffered(False) self.blocks_file_sink_0_0 = blocks.file_sink(gr.sizeof_gr_complex*1, "/home/travis/Dropbox/PHD/WiFiUS/doa/gnuradio/gr-wifius/data/channel1_complex.bin", False) self.blocks_file_sink_0_0.set_unbuffered(False) self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_gr_complex*1, "/home/travis/Dropbox/PHD/WiFiUS/doa/gnuradio/gr-wifius/data/channel0_complex.bin", False) self.blocks_file_sink_0.set_unbuffered(False) self.analog_sig_source_x_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, cal_freq, 1, 0) ################################################## # Connections ################################################## self.connect((self.analog_sig_source_x_0, 0), (self.uhd_usrp_sink_0_0, 0)) self.connect((self.blocks_head_0, 0), (self.blocks_file_sink_0, 0)) self.connect((self.blocks_head_0_0, 0), (self.blocks_file_sink_0_0, 0)) self.connect((self.blocks_head_0_1, 0), (self.blocks_file_sink_0_1, 0)) self.connect((self.correct_gains_hier_0, 0), (self.measure_phases_0, 0)) self.connect((self.correct_gains_hier_0, 1), (self.measure_phases_0, 1)) self.connect((self.correct_gains_hier_0, 2), (self.measure_phases_0, 2)) self.connect((self.measure_phases_0, 0), (self.blocks_head_0, 0)) self.connect((self.measure_phases_0, 1), (self.blocks_head_0_0, 0)) self.connect((self.measure_phases_0, 2), (self.blocks_head_0_1, 0)) self.connect((self.uhd_usrp_source_0_0, 0), (self.correct_gains_hier_0, 0)) self.connect((self.uhd_usrp_source_0_0, 1), (self.correct_gains_hier_0, 1)) self.connect((self.uhd_usrp_source_0_0, 2), (self.correct_gains_hier_0, 2))
def __init__(self): gr.top_block.__init__(self, "Top Block") Qt.QWidget.__init__(self) self.setWindowTitle("Top Block") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "top_block") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.variable_qtgui_range_0_0 = variable_qtgui_range_0_0 = 50 self.variable_qtgui_range_0 = variable_qtgui_range_0 = 50 self.variable_qtgui_chooser_0_1 = variable_qtgui_chooser_0_1 = False self.samp_rate = samp_rate = 1024000*2 self.gain_rx = gain_rx = 0 self.center_freq = center_freq = 2.4e9 self.cal_freq = cal_freq = 1000 ################################################## # Blocks ################################################## self._variable_qtgui_range_0_0_range = Range(0, 100, 1, 50, 200) self._variable_qtgui_range_0_0_win = RangeWidget(self._variable_qtgui_range_0_0_range, self.set_variable_qtgui_range_0_0, "Gain", "counter_slider", float) self.top_layout.addWidget(self._variable_qtgui_range_0_0_win) self._variable_qtgui_range_0_range = Range(0, 100, 1, 50, 200) self._variable_qtgui_range_0_win = RangeWidget(self._variable_qtgui_range_0_range, self.set_variable_qtgui_range_0, "Delay", "counter_slider", int) self.top_layout.addWidget(self._variable_qtgui_range_0_win) self._variable_qtgui_chooser_0_1_options = (1, 0, ) self._variable_qtgui_chooser_0_1_labels = ("True", "False", ) self._variable_qtgui_chooser_0_1_tool_bar = Qt.QToolBar(self) self._variable_qtgui_chooser_0_1_tool_bar.addWidget(Qt.QLabel("Trigger"+": ")) self._variable_qtgui_chooser_0_1_combo_box = Qt.QComboBox() self._variable_qtgui_chooser_0_1_tool_bar.addWidget(self._variable_qtgui_chooser_0_1_combo_box) for label in self._variable_qtgui_chooser_0_1_labels: self._variable_qtgui_chooser_0_1_combo_box.addItem(label) self._variable_qtgui_chooser_0_1_callback = lambda i: Qt.QMetaObject.invokeMethod(self._variable_qtgui_chooser_0_1_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._variable_qtgui_chooser_0_1_options.index(i))) self._variable_qtgui_chooser_0_1_callback(self.variable_qtgui_chooser_0_1) self._variable_qtgui_chooser_0_1_combo_box.currentIndexChanged.connect( lambda i: self.set_variable_qtgui_chooser_0_1(self._variable_qtgui_chooser_0_1_options[i])) self.top_layout.addWidget(self._variable_qtgui_chooser_0_1_tool_bar) self.tab = Qt.QTabWidget() self.tab_widget_0 = Qt.QWidget() self.tab_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.tab_widget_0) self.tab_grid_layout_0 = Qt.QGridLayout() self.tab_layout_0.addLayout(self.tab_grid_layout_0) self.tab.addTab(self.tab_widget_0, "Input") self.tab_widget_1 = Qt.QWidget() self.tab_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.tab_widget_1) self.tab_grid_layout_1 = Qt.QGridLayout() self.tab_layout_1.addLayout(self.tab_grid_layout_1) self.tab.addTab(self.tab_widget_1, "Post Gain Correct") self.tab_widget_2 = Qt.QWidget() self.tab_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.tab_widget_2) self.tab_grid_layout_2 = Qt.QGridLayout() self.tab_layout_2.addLayout(self.tab_grid_layout_2) self.tab.addTab(self.tab_widget_2, "Post Phase Correct") self.top_layout.addWidget(self.tab) self.qtgui_time_sink_x_0_1_0 = qtgui.time_sink_f( 10240, #size samp_rate, #samp_rate "Post (Gains)", #name 3 #number of inputs ) self.qtgui_time_sink_x_0_1_0.set_update_time(0.10) self.qtgui_time_sink_x_0_1_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0_1_0.set_y_label("Amplitude", "") self.qtgui_time_sink_x_0_1_0.enable_tags(-1, True) self.qtgui_time_sink_x_0_1_0.set_trigger_mode(qtgui.TRIG_MODE_AUTO, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_1_0.enable_autoscale(True) self.qtgui_time_sink_x_0_1_0.enable_grid(False) self.qtgui_time_sink_x_0_1_0.enable_control_panel(True) if not True: self.qtgui_time_sink_x_0_1_0.disable_legend() labels = ["", "", "", "", "", "", "", "", "", ""] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue"] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(3): if len(labels[i]) == 0: self.qtgui_time_sink_x_0_1_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0_1_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_1_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_1_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_1_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_1_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_1_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_1_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0_1_0.pyqwidget(), Qt.QWidget) self.tab_layout_1.addWidget(self._qtgui_time_sink_x_0_1_0_win) self.qtgui_time_sink_x_0_1 = qtgui.time_sink_f( 10240, #size samp_rate, #samp_rate "Input", #name 3 #number of inputs ) self.qtgui_time_sink_x_0_1.set_update_time(0.10) self.qtgui_time_sink_x_0_1.set_y_axis(-1, 1) self.qtgui_time_sink_x_0_1.set_y_label("Amplitude", "") self.qtgui_time_sink_x_0_1.enable_tags(-1, True) self.qtgui_time_sink_x_0_1.set_trigger_mode(qtgui.TRIG_MODE_AUTO, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_1.enable_autoscale(True) self.qtgui_time_sink_x_0_1.enable_grid(False) self.qtgui_time_sink_x_0_1.enable_control_panel(True) if not True: self.qtgui_time_sink_x_0_1.disable_legend() labels = ["", "", "", "", "", "", "", "", "", ""] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue"] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(3): if len(labels[i]) == 0: self.qtgui_time_sink_x_0_1.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0_1.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_1.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_1.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_1.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_1.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_1.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_1_win = sip.wrapinstance(self.qtgui_time_sink_x_0_1.pyqwidget(), Qt.QWidget) self.tab_layout_0.addWidget(self._qtgui_time_sink_x_0_1_win) self.qtgui_time_sink_x_0_0 = qtgui.time_sink_f( 10240, #size samp_rate, #samp_rate "Output Synced", #name 3 #number of inputs ) self.qtgui_time_sink_x_0_0.set_update_time(0.10) self.qtgui_time_sink_x_0_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0_0.set_y_label("Amplitude", "") self.qtgui_time_sink_x_0_0.enable_tags(-1, True) self.qtgui_time_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_AUTO, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_0.enable_autoscale(True) self.qtgui_time_sink_x_0_0.enable_grid(False) self.qtgui_time_sink_x_0_0.enable_control_panel(True) if not True: self.qtgui_time_sink_x_0_0.disable_legend() labels = ["", "", "", "", "", "", "", "", "", ""] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue"] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(3): if len(labels[i]) == 0: self.qtgui_time_sink_x_0_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0_0.pyqwidget(), Qt.QWidget) self.tab_layout_2.addWidget(self._qtgui_time_sink_x_0_0_win) self.measure_phases_0 = measure_phases( cal_tone_freq=cal_freq, mUpdatePeriod=1000, memSize=1024, samp_rate=samp_rate, skip=1024000*10, updatePeriod=1, ) self.correct_gains_hier_0 = correct_gains_hier( cal_tone_freq=cal_freq, samp_rate_0=samp_rate, ) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) self.blocks_multiply_const_vxx_0_0 = blocks.multiply_const_vcc((variable_qtgui_range_0_0*0.01, )) self.blocks_message_strobe_0 = blocks.message_strobe(pmt.from_double(variable_qtgui_chooser_0_1), 1000) self.blocks_delay_0_1 = blocks.delay(gr.sizeof_gr_complex*1, 10) self.blocks_delay_0_0 = blocks.delay(gr.sizeof_gr_complex*1, variable_qtgui_range_0) self.blocks_delay_0 = blocks.delay(gr.sizeof_gr_complex*1, 0) self.blocks_complex_to_real_0_2_0 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_2 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_1 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_0_2_0 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_0_2 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_0_1 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_0_0_1_0 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_0_0_1 = blocks.complex_to_real(1) self.blocks_complex_to_real_0_0_0_0 = blocks.complex_to_real(1) self.analog_sig_source_x_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, cal_freq, 1, 0) ################################################## # Connections ################################################## self.msg_connect((self.blocks_message_strobe_0, 'strobe'), (self.correct_gains_hier_0, 'Trigger')) self.msg_connect((self.blocks_message_strobe_0, 'strobe'), (self.measure_phases_0, 'Trigger')) self.connect((self.analog_sig_source_x_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_complex_to_real_0_0_0_0, 0), (self.qtgui_time_sink_x_0_0, 2)) self.connect((self.blocks_complex_to_real_0_0_0_1, 0), (self.qtgui_time_sink_x_0_1, 2)) self.connect((self.blocks_complex_to_real_0_0_0_1_0, 0), (self.qtgui_time_sink_x_0_1_0, 2)) self.connect((self.blocks_complex_to_real_0_0_1, 0), (self.qtgui_time_sink_x_0_0, 1)) self.connect((self.blocks_complex_to_real_0_0_2, 0), (self.qtgui_time_sink_x_0_1, 1)) self.connect((self.blocks_complex_to_real_0_0_2_0, 0), (self.qtgui_time_sink_x_0_1_0, 1)) self.connect((self.blocks_complex_to_real_0_1, 0), (self.qtgui_time_sink_x_0_0, 0)) self.connect((self.blocks_complex_to_real_0_2, 0), (self.qtgui_time_sink_x_0_1, 0)) self.connect((self.blocks_complex_to_real_0_2_0, 0), (self.qtgui_time_sink_x_0_1_0, 0)) self.connect((self.blocks_delay_0, 0), (self.blocks_multiply_const_vxx_0_0, 0)) self.connect((self.blocks_delay_0_0, 0), (self.blocks_complex_to_real_0_0_0_1, 0)) self.connect((self.blocks_delay_0_0, 0), (self.correct_gains_hier_0, 2)) self.connect((self.blocks_delay_0_1, 0), (self.blocks_complex_to_real_0_0_2, 0)) self.connect((self.blocks_delay_0_1, 0), (self.correct_gains_hier_0, 1)) self.connect((self.blocks_multiply_const_vxx_0_0, 0), (self.blocks_complex_to_real_0_2, 0)) self.connect((self.blocks_multiply_const_vxx_0_0, 0), (self.correct_gains_hier_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.blocks_delay_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.blocks_delay_0_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.blocks_delay_0_1, 0)) self.connect((self.correct_gains_hier_0, 2), (self.blocks_complex_to_real_0_0_0_1_0, 0)) self.connect((self.correct_gains_hier_0, 1), (self.blocks_complex_to_real_0_0_2_0, 0)) self.connect((self.correct_gains_hier_0, 0), (self.blocks_complex_to_real_0_2_0, 0)) self.connect((self.correct_gains_hier_0, 0), (self.measure_phases_0, 0)) self.connect((self.correct_gains_hier_0, 1), (self.measure_phases_0, 1)) self.connect((self.correct_gains_hier_0, 2), (self.measure_phases_0, 2)) self.connect((self.measure_phases_0, 2), (self.blocks_complex_to_real_0_0_0_0, 0)) self.connect((self.measure_phases_0, 1), (self.blocks_complex_to_real_0_0_1, 0)) self.connect((self.measure_phases_0, 0), (self.blocks_complex_to_real_0_1, 0))