diff --git a/redpitaya/client/gr_rp_blocks/gr_add_const_set_offset.xml b/redpitaya/client/gr_add_const_set_offset.xml similarity index 100% rename from redpitaya/client/gr_rp_blocks/gr_add_const_set_offset.xml rename to redpitaya/client/gr_add_const_set_offset.xml diff --git a/redpitaya/client/gr_rp_blocks/gr_nco_counter_send_conf.xml b/redpitaya/client/gr_nco_counter_send_conf.xml similarity index 100% rename from redpitaya/client/gr_rp_blocks/gr_nco_counter_send_conf.xml rename to redpitaya/client/gr_nco_counter_send_conf.xml diff --git a/redpitaya/client/gr_rp_blocks/gr_source_test.xml b/redpitaya/client/gr_source_test.xml similarity index 100% rename from redpitaya/client/gr_rp_blocks/gr_source_test.xml rename to redpitaya/client/gr_source_test.xml diff --git a/redpitaya/client/gr_rp_blocks/gr_source_test.xml.old b/redpitaya/client/gr_source_test.xml.old similarity index 100% rename from redpitaya/client/gr_rp_blocks/gr_source_test.xml.old rename to redpitaya/client/gr_source_test.xml.old diff --git a/redpitaya/client/pid_dds.grc b/redpitaya/client/pid_vco.grc similarity index 83% rename from redpitaya/client/pid_dds.grc rename to redpitaya/client/pid_vco.grc index e6fee53..560392d 100644 --- a/redpitaya/client/pid_dds.grc +++ b/redpitaya/client/pid_vco.grc @@ -46,7 +46,7 @@ </param> <param> <key>id</key> - <value>pid_dds</value> + <value>pid_vco</value> </param> <param> <key>max_nouts</key> @@ -168,7 +168,7 @@ </param> <param> <key>value</key> - <value>"192.168.0.202"</value> + <value>"192.168.0.203"</value> </param> </block> <block> @@ -286,7 +286,7 @@ </param> <param> <key>stop</key> - <value>2**14-1</value> + <value>2**13-1</value> </param> <param> <key>rangeType</key> @@ -313,7 +313,7 @@ </param> <param> <key>_coordinate</key> - <value>(696, 784)</value> + <value>(696, 668)</value> </param> <param> <key>gui_hint</key> @@ -349,7 +349,7 @@ </param> <param> <key>stop</key> - <value>2**14-1</value> + <value>60000000</value> </param> <param> <key>rangeType</key> @@ -376,7 +376,7 @@ </param> <param> <key>_coordinate</key> - <value>(696, 272)</value> + <value>(696, 236)</value> </param> <param> <key>gui_hint</key> @@ -439,7 +439,7 @@ </param> <param> <key>_coordinate</key> - <value>(704, 536)</value> + <value>(704, 460)</value> </param> <param> <key>gui_hint</key> @@ -487,7 +487,7 @@ </param> </block> <block> - <key>variable_qtgui_push_button</key> + <key>variable_qtgui_range</key> <param> <key>comment</key> <value></value> @@ -502,11 +502,11 @@ </param> <param> <key>_coordinate</key> - <value>(392, 800)</value> + <value>(672, 868)</value> </param> <param> <key>gui_hint</key> - <value>4, 2</value> + <value>5, 3</value> </param> <param> <key>_rotation</key> @@ -514,24 +514,40 @@ </param> <param> <key>id</key> - <value>pid_int_rst</value> + <value>dds_range</value> </param> <param> <key>label</key> - <value>pid_int_rst</value> + <value>dds_range</value> </param> <param> - <key>pressed</key> + <key>min_len</key> + <value>200</value> + </param> + <param> + <key>orient</key> + <value>Qt.Horizontal</value> + </param> + <param> + <key>start</key> + <value>-2**13</value> + </param> + <param> + <key>step</key> <value>1</value> </param> <param> - <key>released</key> - <value>0</value> + <key>stop</key> + <value>2**13-1</value> </param> <param> - <key>type</key> + <key>rangeType</key> <value>int</value> </param> + <param> + <key>widget</key> + <value>counter_slider</value> + </param> </block> <block> <key>variable_qtgui_range</key> @@ -549,7 +565,7 @@ </param> <param> <key>_coordinate</key> - <value>(192, 784)</value> + <value>(192, 668)</value> </param> <param> <key>gui_hint</key> @@ -612,7 +628,7 @@ </param> <param> <key>_coordinate</key> - <value>(192, 536)</value> + <value>(192, 460)</value> </param> <param> <key>gui_hint</key> @@ -675,7 +691,7 @@ </param> <param> <key>_coordinate</key> - <value>(200, 272)</value> + <value>(200, 236)</value> </param> <param> <key>gui_hint</key> @@ -723,7 +739,7 @@ </param> </block> <block> - <key>variable_qtgui_check_box</key> + <key>variable_qtgui_push_button</key> <param> <key>comment</key> <value></value> @@ -736,17 +752,13 @@ <key>_enabled</key> <value>True</value> </param> - <param> - <key>false</key> - <value>0</value> - </param> <param> <key>_coordinate</key> - <value>(400, 544)</value> + <value>(392, 684)</value> </param> <param> <key>gui_hint</key> - <value>3, 2</value> + <value>4, 2</value> </param> <param> <key>_rotation</key> @@ -754,16 +766,20 @@ </param> <param> <key>id</key> - <value>pid_sign</value> + <value>pid_rst_int</value> </param> <param> <key>label</key> - <value>pid_sign</value> + <value>pid_rst_int</value> </param> <param> - <key>true</key> + <key>pressed</key> <value>1</value> </param> + <param> + <key>released</key> + <value>0</value> + </param> <param> <key>type</key> <value>int</value> @@ -785,7 +801,7 @@ </param> <param> <key>_coordinate</key> - <value>(400, 272)</value> + <value>(400, 236)</value> </param> <param> <key>gui_hint</key> @@ -797,11 +813,11 @@ </param> <param> <key>id</key> - <value>pid_sp</value> + <value>pid_setpoint</value> </param> <param> <key>label</key> - <value>pid_sp</value> + <value>pid_setpoint</value> </param> <param> <key>min_len</key> @@ -832,6 +848,147 @@ <value>counter_slider</value> </param> </block> + <block> + <key>variable_qtgui_check_box</key> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>value</key> + <value>0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>false</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(400, 468)</value> + </param> + <param> + <key>gui_hint</key> + <value>3, 2</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>pid_sign</value> + </param> + <param> + <key>label</key> + <value>pid_sign</value> + </param> + <param> + <key>true</key> + <value>1</value> + </param> + <param> + <key>type</key> + <value>int</value> + </param> + </block> + <block> + <key>variable_qtgui_check_box</key> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>value</key> + <value>0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>false</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(960, 12)</value> + </param> + <param> + <key>gui_hint</key> + <value>1, 4</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>pinc</value> + </param> + <param> + <key>label</key> + <value>pinc</value> + </param> + <param> + <key>true</key> + <value>1</value> + </param> + <param> + <key>type</key> + <value>int</value> + </param> + </block> + <block> + <key>variable_qtgui_check_box</key> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>value</key> + <value>0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>false</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(952, 164)</value> + </param> + <param> + <key>gui_hint</key> + <value>2, 4</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>poff</value> + </param> + <param> + <key>label</key> + <value>poff</value> + </param> + <param> + <key>true</key> + <value>1</value> + </param> + <param> + <key>type</key> + <value>int</value> + </param> + </block> <block> <key>variable</key> <param> @@ -1016,7 +1173,7 @@ </param> <param> <key>_coordinate</key> - <value>(688, 672)</value> + <value>(688, 596)</value> </param> <param> <key>_rotation</key> @@ -1047,7 +1204,7 @@ </param> <param> <key>const</key> - <value>dds_f0</value> + <value>int(dds_f0/(125e6/2**32))</value> </param> <param> <key>device</key> @@ -1059,7 +1216,7 @@ </param> <param> <key>_coordinate</key> - <value>(680, 920)</value> + <value>(680, 804)</value> </param> <param> <key>_rotation</key> @@ -1090,11 +1247,11 @@ </param> <param> <key>const</key> - <value>pid_sp</value> + <value>dds_range</value> </param> <param> <key>device</key> - <value>/dev/pid_sp</value> + <value>/dev/dds_range</value> </param> <param> <key>_enabled</key> @@ -1102,7 +1259,50 @@ </param> <param> <key>_coordinate</key> - <value>(384, 408)</value> + <value>(712, 924)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>add_const_set_offset_0_0_0_0_1_0_0</value> + </param> + <param> + <key>port</key> + <value>port</value> + </param> + </block> + <block> + <key>add_const_set_offset</key> + <param> + <key>addr</key> + <value>addr</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>const</key> + <value>pid_setpoint</value> + </param> + <param> + <key>device</key> + <value>/dev/pid_setpoint</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(384, 372)</value> </param> <param> <key>_rotation</key> @@ -1145,7 +1345,7 @@ </param> <param> <key>_coordinate</key> - <value>(184, 408)</value> + <value>(184, 372)</value> </param> <param> <key>_rotation</key> @@ -1188,7 +1388,7 @@ </param> <param> <key>_coordinate</key> - <value>(176, 672)</value> + <value>(176, 596)</value> </param> <param> <key>_rotation</key> @@ -1231,7 +1431,7 @@ </param> <param> <key>_coordinate</key> - <value>(176, 920)</value> + <value>(176, 804)</value> </param> <param> <key>_rotation</key> @@ -1274,7 +1474,7 @@ </param> <param> <key>_coordinate</key> - <value>(392, 672)</value> + <value>(392, 596)</value> </param> <param> <key>_rotation</key> @@ -1305,11 +1505,11 @@ </param> <param> <key>const</key> - <value>pid_int_rst</value> + <value>pid_rst_int</value> </param> <param> <key>device</key> - <value>/dev/pid_int_rst</value> + <value>/dev/pid_rst_int</value> </param> <param> <key>_enabled</key> @@ -1317,7 +1517,7 @@ </param> <param> <key>_coordinate</key> - <value>(392, 920)</value> + <value>(392, 804)</value> </param> <param> <key>_rotation</key> @@ -1336,7 +1536,7 @@ <key>nco_counter_send_conf</key> <param> <key>acc_size</key> - <value>28</value> + <value>32</value> </param> <param> <key>addr</key> @@ -1368,7 +1568,7 @@ </param> <param> <key>_coordinate</key> - <value>(672, 384)</value> + <value>(672, 344)</value> </param> <param> <key>_rotation</key> @@ -1382,6 +1582,14 @@ <key>offset</key> <value>0</value> </param> + <param> + <key>pinc_sw</key> + <value>pinc</value> + </param> + <param> + <key>poff_sw</key> + <value>poff</value> + </param> <param> <key>port</key> <value>port</value> diff --git a/redpitaya/client/pid_dds.py b/redpitaya/client/pid_vco.py similarity index 69% rename from redpitaya/client/pid_dds.py rename to redpitaya/client/pid_vco.py index 8b5cf1f..4f2ae82 100755 --- a/redpitaya/client/pid_dds.py +++ b/redpitaya/client/pid_vco.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- ################################################## # GNU Radio Python Flow Graph -# Title: Pid Dds -# Generated: Fri Mar 31 15:49:11 2017 +# Title: Pid Vco +# Generated: Tue Apr 11 15:32:11 2017 ################################################## if __name__ == '__main__': @@ -27,12 +27,12 @@ import redpitaya_gnuradio import sys -class pid_dds(gr.top_block, Qt.QWidget): +class pid_vco(gr.top_block, Qt.QWidget): def __init__(self): - gr.top_block.__init__(self, "Pid Dds") + gr.top_block.__init__(self, "Pid Vco") Qt.QWidget.__init__(self) - self.setWindowTitle("Pid Dds") + self.setWindowTitle("Pid Vco") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: @@ -49,33 +49,47 @@ class pid_dds(gr.top_block, Qt.QWidget): self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) - self.settings = Qt.QSettings("GNU Radio", "pid_dds") + self.settings = Qt.QSettings("GNU Radio", "pid_vco") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.port = port = 1001 - self.pid_sp = pid_sp = 0 + self.poff = poff = 0 + self.pinc = pinc = 0 self.pid_sign = pid_sign = 0 + self.pid_setpoint = pid_setpoint = 0 + self.pid_rst_int = pid_rst_int = 0 self.pid_kp = pid_kp = 0 self.pid_ki = pid_ki = 0 self.pid_kd = pid_kd = 0 - self.pid_int_rst = pid_int_rst = 0 + self.dds_range = dds_range = 0 self.dds_offset = dds_offset = 0 self.dds_nco = dds_nco = 0 self.dds_f0 = dds_f0 = 0 self.dds_ampl = dds_ampl = 0 self.dac1_offset = dac1_offset = 0 - self.addr = addr = "192.168.0.202" + self.addr = addr = "192.168.0.203" self.adc1_offset = adc1_offset = 0 ################################################## # Blocks ################################################## - self._pid_sp_range = Range(-2**13, 2**13-1, 1, 0, 200) - self._pid_sp_win = RangeWidget(self._pid_sp_range, self.set_pid_sp, 'pid_sp', "counter_slider", int) - self.top_grid_layout.addWidget(self._pid_sp_win, 2, 2) + _poff_check_box = Qt.QCheckBox('poff') + self._poff_choices = {True: 1, False: 0} + self._poff_choices_inv = dict((v,k) for k,v in self._poff_choices.iteritems()) + self._poff_callback = lambda i: Qt.QMetaObject.invokeMethod(_poff_check_box, "setChecked", Qt.Q_ARG("bool", self._poff_choices_inv[i])) + self._poff_callback(self.poff) + _poff_check_box.stateChanged.connect(lambda i: self.set_poff(self._poff_choices[bool(i)])) + self.top_grid_layout.addWidget(_poff_check_box, 2, 4) + _pinc_check_box = Qt.QCheckBox('pinc') + self._pinc_choices = {True: 1, False: 0} + self._pinc_choices_inv = dict((v,k) for k,v in self._pinc_choices.iteritems()) + self._pinc_callback = lambda i: Qt.QMetaObject.invokeMethod(_pinc_check_box, "setChecked", Qt.Q_ARG("bool", self._pinc_choices_inv[i])) + self._pinc_callback(self.pinc) + _pinc_check_box.stateChanged.connect(lambda i: self.set_pinc(self._pinc_choices[bool(i)])) + self.top_grid_layout.addWidget(_pinc_check_box, 1, 4) _pid_sign_check_box = Qt.QCheckBox('pid_sign') self._pid_sign_choices = {True: 1, False: 0} self._pid_sign_choices_inv = dict((v,k) for k,v in self._pid_sign_choices.iteritems()) @@ -83,6 +97,14 @@ class pid_dds(gr.top_block, Qt.QWidget): self._pid_sign_callback(self.pid_sign) _pid_sign_check_box.stateChanged.connect(lambda i: self.set_pid_sign(self._pid_sign_choices[bool(i)])) self.top_grid_layout.addWidget(_pid_sign_check_box, 3, 2) + self._pid_setpoint_range = Range(-2**13, 2**13-1, 1, 0, 200) + self._pid_setpoint_win = RangeWidget(self._pid_setpoint_range, self.set_pid_setpoint, 'pid_setpoint', "counter_slider", int) + self.top_grid_layout.addWidget(self._pid_setpoint_win, 2, 2) + _pid_rst_int_push_button = Qt.QPushButton('pid_rst_int') + self._pid_rst_int_choices = {'Pressed': 1, 'Released': 0} + _pid_rst_int_push_button.pressed.connect(lambda: self.set_pid_rst_int(self._pid_rst_int_choices['Pressed'])) + _pid_rst_int_push_button.released.connect(lambda: self.set_pid_rst_int(self._pid_rst_int_choices['Released'])) + self.top_grid_layout.addWidget(_pid_rst_int_push_button, 4, 2) self._pid_kp_range = Range(0, 2**14-1, 1, 0, 200) self._pid_kp_win = RangeWidget(self._pid_kp_range, self.set_pid_kp, 'pid_kp', "counter_slider", int) self.top_grid_layout.addWidget(self._pid_kp_win, 2, 1) @@ -92,21 +114,19 @@ class pid_dds(gr.top_block, Qt.QWidget): self._pid_kd_range = Range(0, 2**14-1, 1, 0, 200) self._pid_kd_win = RangeWidget(self._pid_kd_range, self.set_pid_kd, 'pid_kd', "counter_slider", int) self.top_grid_layout.addWidget(self._pid_kd_win, 4, 1) - _pid_int_rst_push_button = Qt.QPushButton('pid_int_rst') - self._pid_int_rst_choices = {'Pressed': 1, 'Released': 0} - _pid_int_rst_push_button.pressed.connect(lambda: self.set_pid_int_rst(self._pid_int_rst_choices['Pressed'])) - _pid_int_rst_push_button.released.connect(lambda: self.set_pid_int_rst(self._pid_int_rst_choices['Released'])) - self.top_grid_layout.addWidget(_pid_int_rst_push_button, 4, 2) + self._dds_range_range = Range(-2**13, 2**13-1, 1, 0, 200) + self._dds_range_win = RangeWidget(self._dds_range_range, self.set_dds_range, 'dds_range', "counter_slider", int) + self.top_grid_layout.addWidget(self._dds_range_win, 5, 3) self._dds_offset_range = Range(-2**13, 2**13-1, 1, 0, 200) self._dds_offset_win = RangeWidget(self._dds_offset_range, self.set_dds_offset, 'dds_offset', "counter_slider", int) self.top_grid_layout.addWidget(self._dds_offset_win, 3, 3) self._dds_nco_range = Range(0, 60000000, 1, 0, 200) self._dds_nco_win = RangeWidget(self._dds_nco_range, self.set_dds_nco, 'dds_nco', "counter_slider", int) self.top_grid_layout.addWidget(self._dds_nco_win, 2, 3) - self._dds_f0_range = Range(0, 2**14-1, 1, 0, 200) + self._dds_f0_range = Range(0, 60000000, 1, 0, 200) self._dds_f0_win = RangeWidget(self._dds_f0_range, self.set_dds_f0, 'dds_f0', "counter_slider", int) self.top_grid_layout.addWidget(self._dds_f0_win, 4, 3) - self._dds_ampl_range = Range(0, 2**14-1, 1, 0, 200) + self._dds_ampl_range = Range(0, 2**13-1, 1, 0, 200) self._dds_ampl_win = RangeWidget(self._dds_ampl_range, self.set_dds_ampl, 'dds_ampl', "counter_slider", int) self.top_grid_layout.addWidget(self._dds_ampl_win, 1, 3) self._dac1_offset_range = Range(-2**13, 2**13-1, 1, 0, 200) @@ -121,15 +141,17 @@ class pid_dds(gr.top_block, Qt.QWidget): device='/dev/dds_nco', freq_ref=125000000, freq_dds=dds_nco, - acc_size=28, + acc_size=32, offset=0, + pinc_sw=pinc, + poff_sw=poff, ) self.add_const_set_offset_0_0_0_1_0_0_0_0_0 = redpitaya_gnuradio.add_const_set_offset( addr=addr, port=port, - device='/dev/pid_int_rst', - const=pid_int_rst, + device='/dev/pid_rst_int', + const=pid_rst_int, ) self.add_const_set_offset_0_0_0_1_0_0_0_0 = redpitaya_gnuradio.add_const_set_offset( @@ -163,15 +185,22 @@ class pid_dds(gr.top_block, Qt.QWidget): self.add_const_set_offset_0_0_0_1 = redpitaya_gnuradio.add_const_set_offset( addr=addr, port=port, - device='/dev/pid_sp', - const=pid_sp, + device='/dev/pid_setpoint', + const=pid_setpoint, + ) + + self.add_const_set_offset_0_0_0_0_1_0_0 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/dds_range', + const=dds_range, ) self.add_const_set_offset_0_0_0_0_1_0 = redpitaya_gnuradio.add_const_set_offset( addr=addr, port=port, device='/dev/dds_f0', - const=dds_f0, + const=int(dds_f0/(125e6/2**32)), ) self.add_const_set_offset_0_0_0_0_1 = redpitaya_gnuradio.add_const_set_offset( @@ -204,7 +233,7 @@ class pid_dds(gr.top_block, Qt.QWidget): def closeEvent(self, event): - self.settings = Qt.QSettings("GNU Radio", "pid_dds") + self.settings = Qt.QSettings("GNU Radio", "pid_vco") self.settings.setValue("geometry", self.saveGeometry()) event.accept() @@ -214,12 +243,21 @@ class pid_dds(gr.top_block, Qt.QWidget): def set_port(self, port): self.port = port - def get_pid_sp(self): - return self.pid_sp + def get_poff(self): + return self.poff + + def set_poff(self, poff): + self.poff = poff + self._poff_callback(self.poff) + self.nco_counter_send_conf_0.set_nco(device='/dev/dds_nco', freq_ref=125000000, freq_dds=self.dds_nco, acc_size=32, offset=0, pinc_sw=self.pinc, poff_sw=self.poff) - def set_pid_sp(self, pid_sp): - self.pid_sp = pid_sp - self.add_const_set_offset_0_0_0_1.set_const(device='/dev/pid_sp', const=self.pid_sp) + def get_pinc(self): + return self.pinc + + def set_pinc(self, pinc): + self.pinc = pinc + self._pinc_callback(self.pinc) + self.nco_counter_send_conf_0.set_nco(device='/dev/dds_nco', freq_ref=125000000, freq_dds=self.dds_nco, acc_size=32, offset=0, pinc_sw=self.pinc, poff_sw=self.poff) def get_pid_sign(self): return self.pid_sign @@ -229,6 +267,20 @@ class pid_dds(gr.top_block, Qt.QWidget): self._pid_sign_callback(self.pid_sign) self.add_const_set_offset_0_0_0_1_0_0_0_0.set_const(device='/dev/pid_sign', const=self.pid_sign) + def get_pid_setpoint(self): + return self.pid_setpoint + + def set_pid_setpoint(self, pid_setpoint): + self.pid_setpoint = pid_setpoint + self.add_const_set_offset_0_0_0_1.set_const(device='/dev/pid_setpoint', const=self.pid_setpoint) + + def get_pid_rst_int(self): + return self.pid_rst_int + + def set_pid_rst_int(self, pid_rst_int): + self.pid_rst_int = pid_rst_int + self.add_const_set_offset_0_0_0_1_0_0_0_0_0.set_const(device='/dev/pid_rst_int', const=self.pid_rst_int) + def get_pid_kp(self): return self.pid_kp @@ -250,12 +302,12 @@ class pid_dds(gr.top_block, Qt.QWidget): self.pid_kd = pid_kd self.add_const_set_offset_0_0_0_1_0_0_0.set_const(device='/dev/pid_kd', const=self.pid_kd) - def get_pid_int_rst(self): - return self.pid_int_rst + def get_dds_range(self): + return self.dds_range - def set_pid_int_rst(self, pid_int_rst): - self.pid_int_rst = pid_int_rst - self.add_const_set_offset_0_0_0_1_0_0_0_0_0.set_const(device='/dev/pid_int_rst', const=self.pid_int_rst) + def set_dds_range(self, dds_range): + self.dds_range = dds_range + self.add_const_set_offset_0_0_0_0_1_0_0.set_const(device='/dev/dds_range', const=self.dds_range) def get_dds_offset(self): return self.dds_offset @@ -269,14 +321,14 @@ class pid_dds(gr.top_block, Qt.QWidget): def set_dds_nco(self, dds_nco): self.dds_nco = dds_nco - self.nco_counter_send_conf_0.set_nco(device='/dev/dds_nco', freq_ref=125000000, freq_dds=self.dds_nco, acc_size=28, offset=0) + self.nco_counter_send_conf_0.set_nco(device='/dev/dds_nco', freq_ref=125000000, freq_dds=self.dds_nco, acc_size=32, offset=0, pinc_sw=self.pinc, poff_sw=self.poff) def get_dds_f0(self): return self.dds_f0 def set_dds_f0(self, dds_f0): self.dds_f0 = dds_f0 - self.add_const_set_offset_0_0_0_0_1_0.set_const(device='/dev/dds_f0', const=self.dds_f0) + self.add_const_set_offset_0_0_0_0_1_0.set_const(device='/dev/dds_f0', const=int(self.dds_f0/(125e6/2**32))) def get_dds_ampl(self): return self.dds_ampl @@ -306,7 +358,7 @@ class pid_dds(gr.top_block, Qt.QWidget): self.add_const_set_offset_0_0_0.set_const(device='/dev/adc1_offset', const=self.adc1_offset) -def main(top_block_cls=pid_dds, options=None): +def main(top_block_cls=pid_vco, options=None): from distutils.version import StrictVersion if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"): diff --git a/redpitaya/client/gr_rp_blocks/redpitaya_gnuradio.py b/redpitaya/client/redpitaya_gnuradio.py similarity index 100% rename from redpitaya/client/gr_rp_blocks/redpitaya_gnuradio.py rename to redpitaya/client/redpitaya_gnuradio.py diff --git a/redpitaya/client/gr_rp_blocks/redpitaya_gnuradio.pyc b/redpitaya/client/redpitaya_gnuradio.pyc similarity index 100% rename from redpitaya/client/gr_rp_blocks/redpitaya_gnuradio.pyc rename to redpitaya/client/redpitaya_gnuradio.pyc diff --git a/redpitaya/client/sourceme.bma b/redpitaya/client/sourceme.bma new file mode 100644 index 0000000..23cd7f3 --- /dev/null +++ b/redpitaya/client/sourceme.bma @@ -0,0 +1 @@ +export GRC_BLOCKS_PATH=. diff --git a/sdr/fm_radio/fm_radio.py b/sdr/fm_radio/fm_radio.py index 2898f32..7b21c77 100755 --- a/sdr/fm_radio/fm_radio.py +++ b/sdr/fm_radio/fm_radio.py @@ -3,7 +3,7 @@ ################################################## # GNU Radio Python Flow Graph # Title: Fm Radio -# Generated: Sat Apr 8 11:09:28 2017 +# Generated: Tue Apr 11 17:29:18 2017 ################################################## if __name__ == '__main__':