From c0331afbefe92a6f5121482c2b6cbf1e1a3f0ca8 Mon Sep 17 00:00:00 2001 From: mer0m Date: Fri, 21 Apr 2017 15:01:58 +0200 Subject: [PATCH] add double pid app --- redpitaya/client/dds_gnuradio.grc | 2 +- redpitaya/client/dds_gnuradio.py | 4 +- redpitaya/client/double_pid_vco.grc | 2846 +++++++++++++++++++++++++++++++++++ redpitaya/client/double_pid_vco.py | 623 ++++++++ redpitaya/client/iq_demod_only.py | 2 +- redpitaya/client/pid_vco.py | 2 +- 6 files changed, 3474 insertions(+), 5 deletions(-) create mode 100644 redpitaya/client/double_pid_vco.grc create mode 100755 redpitaya/client/double_pid_vco.py diff --git a/redpitaya/client/dds_gnuradio.grc b/redpitaya/client/dds_gnuradio.grc index f5b2899..44ecb46 100644 --- a/redpitaya/client/dds_gnuradio.grc +++ b/redpitaya/client/dds_gnuradio.grc @@ -168,7 +168,7 @@ value - "192.168.0.201" + "192.168.0.203" diff --git a/redpitaya/client/dds_gnuradio.py b/redpitaya/client/dds_gnuradio.py index bf562ca..744ce4b 100755 --- a/redpitaya/client/dds_gnuradio.py +++ b/redpitaya/client/dds_gnuradio.py @@ -3,7 +3,7 @@ ################################################## # GNU Radio Python Flow Graph # Title: Dds Gnuradio -# Generated: Thu Apr 20 11:13:10 2017 +# Generated: Fri Apr 21 12:30:52 2017 ################################################## if __name__ == '__main__': @@ -58,7 +58,7 @@ class dds_gnuradio(gr.top_block, Qt.QWidget): self.port = port = 1001 self.offset_out1 = offset_out1 = 0 self.f_dds = f_dds = 0 - self.addr = addr = "192.168.0.201" + self.addr = addr = "192.168.0.203" self.a_dds = a_dds = 0 ################################################## diff --git a/redpitaya/client/double_pid_vco.grc b/redpitaya/client/double_pid_vco.grc new file mode 100644 index 0000000..3813253 --- /dev/null +++ b/redpitaya/client/double_pid_vco.grc @@ -0,0 +1,2846 @@ + + + + Thu Feb 2 22:54:58 2017 + + options + + author + + + + window_size + 1000, 3500 + + + category + [GRC Hier Blocks] + + + comment + + + + description + + + + _enabled + True + + + _coordinate + (8, 24) + + + _rotation + 0 + + + generate_options + qt_gui + + + hier_block_src_path + .: + + + id + double_pid_vco + + + max_nouts + 0 + + + qt_qss_theme + + + + realtime_scheduling + + + + run_command + {python} -u {filename} + + + run_options + prompt + + + run + True + + + thread_safe_setters + + + + title + + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (280, 1068) + + + gui_hint + 5,0 + + + _rotation + 0 + + + id + adc1_offset + + + label + adc1_offset + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + -2**13 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (624, 1068) + + + gui_hint + 5,1 + + + _rotation + 0 + + + id + adc2_offset + + + label + adc2_offset + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + -2**13 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (8, 104) + + + _rotation + 0 + + + id + addr + + + value + "192.168.0.203" + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (280, 588) + + + gui_hint + 3,0 + + + _rotation + 0 + + + id + dds1_ampl + + + label + dds1_ampl + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_range + + comment + + + + value + 39500000 + + + _enabled + True + + + _coordinate + (280, 2708) + + + gui_hint + 12,0 + + + _rotation + 0 + + + id + dds1_f0 + + + label + dds1_f0 + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 1 + + + stop + 60000000 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_range + + comment + + + + value + 39500000 + + + _enabled + True + + + _coordinate + (280, 28) + + + gui_hint + 0,0 + + + _rotation + 0 + + + id + dds1_nco + + + label + dds1_nco + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 1 + + + stop + 60000000 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (280, 828) + + + gui_hint + 4,0 + + + _rotation + 0 + + + id + dds1_offset + + + label + dds1_offset + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + -2**13 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_check_box + + comment + + + + value + 1 + + + _enabled + True + + + false + 0 + + + _coordinate + (280, 164) + + + gui_hint + 1,0 + + + _rotation + 0 + + + id + dds1_pinc_sw + + + label + dds1_pinc_sw + + + true + 1 + + + type + int + + + + variable_qtgui_check_box + + comment + + + + value + 1 + + + _enabled + True + + + false + 0 + + + _coordinate + (280, 284) + + + gui_hint + 2, 0 + + + _rotation + 0 + + + id + dds1_poff_sw + + + label + dds1_poff_sw + + + true + 1 + + + type + int + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (280, 2948) + + + gui_hint + 13,0 + + + _rotation + 0 + + + id + dds1_range + + + label + dds1_range + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + -2**13 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (624, 588) + + + gui_hint + 3,1 + + + _rotation + 0 + + + id + dds2_ampl + + + label + dds2_ampl + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_range + + comment + + + + value + 40750000 + + + _enabled + True + + + _coordinate + (624, 2708) + + + gui_hint + 12,1 + + + _rotation + 0 + + + id + dds2_f0 + + + label + dds2_f0 + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 1 + + + stop + 60000000 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_range + + comment + + + + value + 40750000 + + + _enabled + True + + + _coordinate + (624, 28) + + + gui_hint + 0,1 + + + _rotation + 0 + + + id + dds2_nco + + + label + dds2_nco + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 1 + + + stop + 60000000 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (624, 828) + + + gui_hint + 4,1 + + + _rotation + 0 + + + id + dds2_offset + + + label + dds2_offset + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + -2**13 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_check_box + + comment + + + + value + 1 + + + _enabled + True + + + false + 0 + + + _coordinate + (624, 164) + + + gui_hint + 1,1 + + + _rotation + 0 + + + id + dds2_pinc_sw + + + label + dds2_pinc_sw + + + true + 1 + + + type + int + + + + variable_qtgui_check_box + + comment + + + + value + 1 + + + _enabled + True + + + false + 0 + + + _coordinate + (624, 284) + + + gui_hint + 2, 1 + + + _rotation + 0 + + + id + dds2_poff_sw + + + label + dds2_poff_sw + + + true + 1 + + + type + int + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (624, 2948) + + + gui_hint + 13,1 + + + _rotation + 0 + + + id + dds2_range + + + label + dds2_range + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + -2**13 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (280, 1780) + + + gui_hint + 8,0 + + + _rotation + 0 + + + id + pid1_kd + + + label + pid1_kd + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (280, 1540) + + + gui_hint + 7,0 + + + _rotation + 0 + + + id + pid1_ki + + + label + pid1_ki + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (280, 1308) + + + gui_hint + 6,0 + + + _rotation + 0 + + + id + pid1_kp + + + label + pid1_kp + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_push_button + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (280, 2484) + + + gui_hint + 11,0 + + + _rotation + 0 + + + id + pid1_rst_int + + + label + pid1_rst_int + + + pressed + 1 + + + released + 0 + + + type + int + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (280, 2020) + + + gui_hint + 9,0 + + + _rotation + 0 + + + id + pid1_setpoint + + + label + pid1_setpoint + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + -2**13 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_check_box + + comment + + + + value + 0 + + + _enabled + True + + + false + 0 + + + _coordinate + (280, 2260) + + + gui_hint + 10,0 + + + _rotation + 0 + + + id + pid1_sign + + + label + pid1_sign + + + true + 1 + + + type + int + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (624, 1780) + + + gui_hint + 8,1 + + + _rotation + 0 + + + id + pid2_kd + + + label + pid2_kd + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (624, 1540) + + + gui_hint + 7,1 + + + _rotation + 0 + + + id + pid2_ki + + + label + pid2_ki + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (624, 1308) + + + gui_hint + 6,1 + + + _rotation + 0 + + + id + pid2_kp + + + label + pid2_kp + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_push_button + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (624, 2484) + + + gui_hint + 11,1 + + + _rotation + 0 + + + id + pid2_rst_int + + + label + pid2_rst_int + + + pressed + 1 + + + released + 0 + + + type + int + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (624, 2020) + + + gui_hint + 9,1 + + + _rotation + 0 + + + id + pid2_setpoint + + + label + pid2_setpoint + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + -2**13 + + + step + 1 + + + stop + 2**13-1 + + + rangeType + int + + + widget + counter_slider + + + + variable_qtgui_check_box + + comment + + + + value + 0 + + + _enabled + True + + + false + 0 + + + _coordinate + (624, 2260) + + + gui_hint + 10,1 + + + _rotation + 0 + + + id + pid2_sign + + + label + pid2_sign + + + true + 1 + + + type + int + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (8, 176) + + + _rotation + 0 + + + id + port + + + value + 1001 + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + adc1_offset + + + device + /dev/adc1_offset + + + _enabled + True + + + _coordinate + (280, 1204) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + adc2_offset + + + device + /dev/adc2_offset + + + _enabled + True + + + _coordinate + (624, 1204) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_0 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + dds1_ampl + + + device + /dev/dds1_ampl + + + _enabled + True + + + _coordinate + (280, 724) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_0_0 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + dds2_ampl + + + device + /dev/dds2_ampl + + + _enabled + True + + + _coordinate + (624, 724) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_0_0_0 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + dds1_offset + + + device + /dev/dds1_offset + + + _enabled + True + + + _coordinate + (280, 964) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_0_1 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + int(dds1_f0/(125e6/2**32)) + + + device + /dev/dds1_f0 + + + _enabled + True + + + _coordinate + (280, 2844) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_0_1_0 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + dds1_range + + + device + /dev/dds1_range + + + _enabled + True + + + _coordinate + (280, 3084) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_0_1_0_0 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + dds2_range + + + device + /dev/dds2_range + + + _enabled + True + + + _coordinate + (624, 3084) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_0_1_0_0_0 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + int(dds2_f0/(125e6/2**32)) + + + device + /dev/dds2_f0 + + + _enabled + True + + + _coordinate + (624, 2844) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_0_1_0_1 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + dds2_offset + + + device + /dev/dds2_offset + + + _enabled + True + + + _coordinate + (624, 964) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_0_1_1 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + pid1_setpoint + + + device + /dev/pid1_setpoint + + + _enabled + True + + + _coordinate + (280, 2156) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_1 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + pid1_kp + + + device + /dev/pid1_kp + + + _enabled + True + + + _coordinate + (280, 1444) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_1_0 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + pid1_ki + + + device + /dev/pid1_ki + + + _enabled + True + + + _coordinate + (280, 1676) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_1_0_0 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + pid1_kd + + + device + /dev/pid1_kd + + + _enabled + True + + + _coordinate + (280, 1916) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_1_0_0_0 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + pid1_sign + + + device + /dev/pid1_sign + + + _enabled + True + + + _coordinate + (280, 2380) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_1_0_0_0_0 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + pid1_rst_int + + + device + /dev/pid1_rst_int + + + _enabled + True + + + _coordinate + (280, 2604) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_1_0_0_0_0_0 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + pid2_rst_int + + + device + /dev/pid2_rst_int + + + _enabled + True + + + _coordinate + (624, 2604) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_1_0_0_0_0_0_0 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + pid2_sign + + + device + /dev/pid2_sign + + + _enabled + True + + + _coordinate + (624, 2380) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_1_0_0_0_0_1 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + pid2_kd + + + device + /dev/pid2_kd + + + _enabled + True + + + _coordinate + (624, 1916) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_1_0_0_0_1 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + pid2_ki + + + device + /dev/pid2_ki + + + _enabled + True + + + _coordinate + (624, 1676) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_1_0_0_1 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + pid2_kp + + + device + /dev/pid2_kp + + + _enabled + True + + + _coordinate + (624, 1444) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_1_0_1 + + + port + port + + + + add_const_set_offset + + addr + addr + + + alias + + + + comment + + + + const + pid2_setpoint + + + device + /dev/pid2_setpoint + + + _enabled + True + + + _coordinate + (624, 2156) + + + _rotation + 0 + + + id + add_const_set_offset_0_0_0_1_1 + + + port + port + + + + nco_counter_send_conf + + acc_size + 32 + + + addr + addr + + + alias + + + + comment + + + + device + /dev/dds1_nco + + + _enabled + True + + + freq_dds + dds1_nco + + + freq_ref + 125000000 + + + _coordinate + (280, 400) + + + _rotation + 0 + + + id + nco_counter_send_conf_0 + + + offset + 0 + + + pinc_sw + dds1_pinc_sw + + + poff_sw + dds1_poff_sw + + + port + port + + + + nco_counter_send_conf + + acc_size + 32 + + + addr + addr + + + alias + + + + comment + + + + device + /dev/dds2_nco + + + _enabled + True + + + freq_dds + dds2_nco + + + freq_ref + 125000000 + + + _coordinate + (624, 400) + + + _rotation + 0 + + + id + nco_counter_send_conf_0_0 + + + offset + 0 + + + pinc_sw + dds2_pinc_sw + + + poff_sw + dds2_poff_sw + + + port + port + + + diff --git a/redpitaya/client/double_pid_vco.py b/redpitaya/client/double_pid_vco.py new file mode 100755 index 0000000..dee0b21 --- /dev/null +++ b/redpitaya/client/double_pid_vco.py @@ -0,0 +1,623 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- +################################################## +# GNU Radio Python Flow Graph +# Title: Double Pid Vco +# Generated: Fri Apr 21 14:54:08 2017 +################################################## + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print "Warning: failed to XInitThreads()" + +from PyQt4 import Qt +from gnuradio import eng_notation +from gnuradio import gr +from gnuradio.eng_option import eng_option +from gnuradio.filter import firdes +from gnuradio.qtgui import Range, RangeWidget +from optparse import OptionParser +import redpitaya_gnuradio +import sys + + +class double_pid_vco(gr.top_block, Qt.QWidget): + + def __init__(self): + gr.top_block.__init__(self, "Double Pid Vco") + Qt.QWidget.__init__(self) + self.setWindowTitle("Double Pid Vco") + 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", "double_pid_vco") + self.restoreGeometry(self.settings.value("geometry").toByteArray()) + + ################################################## + # Variables + ################################################## + self.port = port = 1001 + self.pid2_sign = pid2_sign = 0 + self.pid2_setpoint = pid2_setpoint = 0 + self.pid2_rst_int = pid2_rst_int = 0 + self.pid2_kp = pid2_kp = 0 + self.pid2_ki = pid2_ki = 0 + self.pid2_kd = pid2_kd = 0 + self.pid1_sign = pid1_sign = 0 + self.pid1_setpoint = pid1_setpoint = 0 + self.pid1_rst_int = pid1_rst_int = 0 + self.pid1_kp = pid1_kp = 0 + self.pid1_ki = pid1_ki = 0 + self.pid1_kd = pid1_kd = 0 + self.dds2_range = dds2_range = 0 + self.dds2_poff_sw = dds2_poff_sw = 1 + self.dds2_pinc_sw = dds2_pinc_sw = 1 + self.dds2_offset = dds2_offset = 0 + self.dds2_nco = dds2_nco = 40750000 + self.dds2_f0 = dds2_f0 = 40750000 + self.dds2_ampl = dds2_ampl = 0 + self.dds1_range = dds1_range = 0 + self.dds1_poff_sw = dds1_poff_sw = 1 + self.dds1_pinc_sw = dds1_pinc_sw = 1 + self.dds1_offset = dds1_offset = 0 + self.dds1_nco = dds1_nco = 39500000 + self.dds1_f0 = dds1_f0 = 39500000 + self.dds1_ampl = dds1_ampl = 0 + self.addr = addr = "192.168.0.203" + self.adc2_offset = adc2_offset = 0 + self.adc1_offset = adc1_offset = 0 + + ################################################## + # Blocks + ################################################## + _pid2_sign_check_box = Qt.QCheckBox('pid2_sign') + self._pid2_sign_choices = {True: 1, False: 0} + self._pid2_sign_choices_inv = dict((v,k) for k,v in self._pid2_sign_choices.iteritems()) + self._pid2_sign_callback = lambda i: Qt.QMetaObject.invokeMethod(_pid2_sign_check_box, "setChecked", Qt.Q_ARG("bool", self._pid2_sign_choices_inv[i])) + self._pid2_sign_callback(self.pid2_sign) + _pid2_sign_check_box.stateChanged.connect(lambda i: self.set_pid2_sign(self._pid2_sign_choices[bool(i)])) + self.top_grid_layout.addWidget(_pid2_sign_check_box, 10,1) + self._pid2_setpoint_range = Range(-2**13, 2**13-1, 1, 0, 200) + self._pid2_setpoint_win = RangeWidget(self._pid2_setpoint_range, self.set_pid2_setpoint, 'pid2_setpoint', "counter_slider", int) + self.top_grid_layout.addWidget(self._pid2_setpoint_win, 9,1) + _pid2_rst_int_push_button = Qt.QPushButton('pid2_rst_int') + self._pid2_rst_int_choices = {'Pressed': 1, 'Released': 0} + _pid2_rst_int_push_button.pressed.connect(lambda: self.set_pid2_rst_int(self._pid2_rst_int_choices['Pressed'])) + _pid2_rst_int_push_button.released.connect(lambda: self.set_pid2_rst_int(self._pid2_rst_int_choices['Released'])) + self.top_grid_layout.addWidget(_pid2_rst_int_push_button, 11,1) + self._pid2_kp_range = Range(0, 2**13-1, 1, 0, 200) + self._pid2_kp_win = RangeWidget(self._pid2_kp_range, self.set_pid2_kp, 'pid2_kp', "counter_slider", int) + self.top_grid_layout.addWidget(self._pid2_kp_win, 6,1) + self._pid2_ki_range = Range(0, 2**13-1, 1, 0, 200) + self._pid2_ki_win = RangeWidget(self._pid2_ki_range, self.set_pid2_ki, 'pid2_ki', "counter_slider", int) + self.top_grid_layout.addWidget(self._pid2_ki_win, 7,1) + self._pid2_kd_range = Range(0, 2**13-1, 1, 0, 200) + self._pid2_kd_win = RangeWidget(self._pid2_kd_range, self.set_pid2_kd, 'pid2_kd', "counter_slider", int) + self.top_grid_layout.addWidget(self._pid2_kd_win, 8,1) + _pid1_sign_check_box = Qt.QCheckBox('pid1_sign') + self._pid1_sign_choices = {True: 1, False: 0} + self._pid1_sign_choices_inv = dict((v,k) for k,v in self._pid1_sign_choices.iteritems()) + self._pid1_sign_callback = lambda i: Qt.QMetaObject.invokeMethod(_pid1_sign_check_box, "setChecked", Qt.Q_ARG("bool", self._pid1_sign_choices_inv[i])) + self._pid1_sign_callback(self.pid1_sign) + _pid1_sign_check_box.stateChanged.connect(lambda i: self.set_pid1_sign(self._pid1_sign_choices[bool(i)])) + self.top_grid_layout.addWidget(_pid1_sign_check_box, 10,0) + self._pid1_setpoint_range = Range(-2**13, 2**13-1, 1, 0, 200) + self._pid1_setpoint_win = RangeWidget(self._pid1_setpoint_range, self.set_pid1_setpoint, 'pid1_setpoint', "counter_slider", int) + self.top_grid_layout.addWidget(self._pid1_setpoint_win, 9,0) + _pid1_rst_int_push_button = Qt.QPushButton('pid1_rst_int') + self._pid1_rst_int_choices = {'Pressed': 1, 'Released': 0} + _pid1_rst_int_push_button.pressed.connect(lambda: self.set_pid1_rst_int(self._pid1_rst_int_choices['Pressed'])) + _pid1_rst_int_push_button.released.connect(lambda: self.set_pid1_rst_int(self._pid1_rst_int_choices['Released'])) + self.top_grid_layout.addWidget(_pid1_rst_int_push_button, 11,0) + self._pid1_kp_range = Range(0, 2**13-1, 1, 0, 200) + self._pid1_kp_win = RangeWidget(self._pid1_kp_range, self.set_pid1_kp, 'pid1_kp', "counter_slider", int) + self.top_grid_layout.addWidget(self._pid1_kp_win, 6,0) + self._pid1_ki_range = Range(0, 2**13-1, 1, 0, 200) + self._pid1_ki_win = RangeWidget(self._pid1_ki_range, self.set_pid1_ki, 'pid1_ki', "counter_slider", int) + self.top_grid_layout.addWidget(self._pid1_ki_win, 7,0) + self._pid1_kd_range = Range(0, 2**13-1, 1, 0, 200) + self._pid1_kd_win = RangeWidget(self._pid1_kd_range, self.set_pid1_kd, 'pid1_kd', "counter_slider", int) + self.top_grid_layout.addWidget(self._pid1_kd_win, 8,0) + self._dds2_range_range = Range(-2**13, 2**13-1, 1, 0, 200) + self._dds2_range_win = RangeWidget(self._dds2_range_range, self.set_dds2_range, 'dds2_range', "counter_slider", int) + self.top_grid_layout.addWidget(self._dds2_range_win, 13,1) + _dds2_poff_sw_check_box = Qt.QCheckBox('dds2_poff_sw') + self._dds2_poff_sw_choices = {True: 1, False: 0} + self._dds2_poff_sw_choices_inv = dict((v,k) for k,v in self._dds2_poff_sw_choices.iteritems()) + self._dds2_poff_sw_callback = lambda i: Qt.QMetaObject.invokeMethod(_dds2_poff_sw_check_box, "setChecked", Qt.Q_ARG("bool", self._dds2_poff_sw_choices_inv[i])) + self._dds2_poff_sw_callback(self.dds2_poff_sw) + _dds2_poff_sw_check_box.stateChanged.connect(lambda i: self.set_dds2_poff_sw(self._dds2_poff_sw_choices[bool(i)])) + self.top_grid_layout.addWidget(_dds2_poff_sw_check_box, 2, 1) + _dds2_pinc_sw_check_box = Qt.QCheckBox('dds2_pinc_sw') + self._dds2_pinc_sw_choices = {True: 1, False: 0} + self._dds2_pinc_sw_choices_inv = dict((v,k) for k,v in self._dds2_pinc_sw_choices.iteritems()) + self._dds2_pinc_sw_callback = lambda i: Qt.QMetaObject.invokeMethod(_dds2_pinc_sw_check_box, "setChecked", Qt.Q_ARG("bool", self._dds2_pinc_sw_choices_inv[i])) + self._dds2_pinc_sw_callback(self.dds2_pinc_sw) + _dds2_pinc_sw_check_box.stateChanged.connect(lambda i: self.set_dds2_pinc_sw(self._dds2_pinc_sw_choices[bool(i)])) + self.top_grid_layout.addWidget(_dds2_pinc_sw_check_box, 1,1) + self._dds2_offset_range = Range(-2**13, 2**13-1, 1, 0, 200) + self._dds2_offset_win = RangeWidget(self._dds2_offset_range, self.set_dds2_offset, 'dds2_offset', "counter_slider", int) + self.top_grid_layout.addWidget(self._dds2_offset_win, 4,1) + self._dds2_nco_range = Range(0, 60000000, 1, 40750000, 200) + self._dds2_nco_win = RangeWidget(self._dds2_nco_range, self.set_dds2_nco, 'dds2_nco', "counter_slider", int) + self.top_grid_layout.addWidget(self._dds2_nco_win, 0,1) + self._dds2_f0_range = Range(0, 60000000, 1, 40750000, 200) + self._dds2_f0_win = RangeWidget(self._dds2_f0_range, self.set_dds2_f0, 'dds2_f0', "counter_slider", int) + self.top_grid_layout.addWidget(self._dds2_f0_win, 12,1) + self._dds2_ampl_range = Range(0, 2**13-1, 1, 0, 200) + self._dds2_ampl_win = RangeWidget(self._dds2_ampl_range, self.set_dds2_ampl, 'dds2_ampl', "counter_slider", int) + self.top_grid_layout.addWidget(self._dds2_ampl_win, 3,1) + self._dds1_range_range = Range(-2**13, 2**13-1, 1, 0, 200) + self._dds1_range_win = RangeWidget(self._dds1_range_range, self.set_dds1_range, 'dds1_range', "counter_slider", int) + self.top_grid_layout.addWidget(self._dds1_range_win, 13,0) + _dds1_poff_sw_check_box = Qt.QCheckBox('dds1_poff_sw') + self._dds1_poff_sw_choices = {True: 1, False: 0} + self._dds1_poff_sw_choices_inv = dict((v,k) for k,v in self._dds1_poff_sw_choices.iteritems()) + self._dds1_poff_sw_callback = lambda i: Qt.QMetaObject.invokeMethod(_dds1_poff_sw_check_box, "setChecked", Qt.Q_ARG("bool", self._dds1_poff_sw_choices_inv[i])) + self._dds1_poff_sw_callback(self.dds1_poff_sw) + _dds1_poff_sw_check_box.stateChanged.connect(lambda i: self.set_dds1_poff_sw(self._dds1_poff_sw_choices[bool(i)])) + self.top_grid_layout.addWidget(_dds1_poff_sw_check_box, 2, 0) + _dds1_pinc_sw_check_box = Qt.QCheckBox('dds1_pinc_sw') + self._dds1_pinc_sw_choices = {True: 1, False: 0} + self._dds1_pinc_sw_choices_inv = dict((v,k) for k,v in self._dds1_pinc_sw_choices.iteritems()) + self._dds1_pinc_sw_callback = lambda i: Qt.QMetaObject.invokeMethod(_dds1_pinc_sw_check_box, "setChecked", Qt.Q_ARG("bool", self._dds1_pinc_sw_choices_inv[i])) + self._dds1_pinc_sw_callback(self.dds1_pinc_sw) + _dds1_pinc_sw_check_box.stateChanged.connect(lambda i: self.set_dds1_pinc_sw(self._dds1_pinc_sw_choices[bool(i)])) + self.top_grid_layout.addWidget(_dds1_pinc_sw_check_box, 1,0) + self._dds1_offset_range = Range(-2**13, 2**13-1, 1, 0, 200) + self._dds1_offset_win = RangeWidget(self._dds1_offset_range, self.set_dds1_offset, 'dds1_offset', "counter_slider", int) + self.top_grid_layout.addWidget(self._dds1_offset_win, 4,0) + self._dds1_nco_range = Range(0, 60000000, 1, 39500000, 200) + self._dds1_nco_win = RangeWidget(self._dds1_nco_range, self.set_dds1_nco, 'dds1_nco', "counter_slider", int) + self.top_grid_layout.addWidget(self._dds1_nco_win, 0,0) + self._dds1_f0_range = Range(0, 60000000, 1, 39500000, 200) + self._dds1_f0_win = RangeWidget(self._dds1_f0_range, self.set_dds1_f0, 'dds1_f0', "counter_slider", int) + self.top_grid_layout.addWidget(self._dds1_f0_win, 12,0) + self._dds1_ampl_range = Range(0, 2**13-1, 1, 0, 200) + self._dds1_ampl_win = RangeWidget(self._dds1_ampl_range, self.set_dds1_ampl, 'dds1_ampl', "counter_slider", int) + self.top_grid_layout.addWidget(self._dds1_ampl_win, 3,0) + self._adc2_offset_range = Range(-2**13, 2**13-1, 1, 0, 200) + self._adc2_offset_win = RangeWidget(self._adc2_offset_range, self.set_adc2_offset, 'adc2_offset', "counter_slider", int) + self.top_grid_layout.addWidget(self._adc2_offset_win, 5,1) + self._adc1_offset_range = Range(-2**13, 2**13-1, 1, 0, 200) + self._adc1_offset_win = RangeWidget(self._adc1_offset_range, self.set_adc1_offset, 'adc1_offset', "counter_slider", int) + self.top_grid_layout.addWidget(self._adc1_offset_win, 5,0) + self.nco_counter_send_conf_0_0 = redpitaya_gnuradio.nco_counter_send_conf( + addr=addr, + port=port, + device='/dev/dds2_nco', + freq_ref=125000000, + freq_dds=dds2_nco, + acc_size=32, + offset=0, + pinc_sw=dds2_pinc_sw, + poff_sw=dds2_poff_sw, + ) + + self.nco_counter_send_conf_0 = redpitaya_gnuradio.nco_counter_send_conf( + addr=addr, + port=port, + device='/dev/dds1_nco', + freq_ref=125000000, + freq_dds=dds1_nco, + acc_size=32, + offset=0, + pinc_sw=dds1_pinc_sw, + poff_sw=dds1_poff_sw, + ) + + self.add_const_set_offset_0_0_0_1_1 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/pid2_setpoint', + const=pid2_setpoint, + ) + + self.add_const_set_offset_0_0_0_1_0_1 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/pid2_kp', + const=pid2_kp, + ) + + self.add_const_set_offset_0_0_0_1_0_0_1 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/pid2_ki', + const=pid2_ki, + ) + + self.add_const_set_offset_0_0_0_1_0_0_0_1 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/pid2_kd', + const=pid2_kd, + ) + + self.add_const_set_offset_0_0_0_1_0_0_0_0_1 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/pid2_sign', + const=pid2_sign, + ) + + self.add_const_set_offset_0_0_0_1_0_0_0_0_0_0 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/pid2_rst_int', + const=pid2_rst_int, + ) + + 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/pid1_rst_int', + const=pid1_rst_int, + ) + + self.add_const_set_offset_0_0_0_1_0_0_0_0 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/pid1_sign', + const=pid1_sign, + ) + + self.add_const_set_offset_0_0_0_1_0_0_0 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/pid1_kd', + const=pid1_kd, + ) + + self.add_const_set_offset_0_0_0_1_0_0 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/pid1_ki', + const=pid1_ki, + ) + + self.add_const_set_offset_0_0_0_1_0 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/pid1_kp', + const=pid1_kp, + ) + + self.add_const_set_offset_0_0_0_1 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/pid1_setpoint', + const=pid1_setpoint, + ) + + self.add_const_set_offset_0_0_0_0_1_1 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/dds2_offset', + const=dds2_offset, + ) + + self.add_const_set_offset_0_0_0_0_1_0_1 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/dds2_f0', + const=int(dds2_f0/(125e6/2**32)), + ) + + self.add_const_set_offset_0_0_0_0_1_0_0_0 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/dds2_range', + const=dds2_range, + ) + + self.add_const_set_offset_0_0_0_0_1_0_0 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/dds1_range', + const=dds1_range, + ) + + self.add_const_set_offset_0_0_0_0_1_0 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/dds1_f0', + const=int(dds1_f0/(125e6/2**32)), + ) + + self.add_const_set_offset_0_0_0_0_1 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/dds1_offset', + const=dds1_offset, + ) + + self.add_const_set_offset_0_0_0_0_0_0 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/dds2_ampl', + const=dds2_ampl, + ) + + self.add_const_set_offset_0_0_0_0_0 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/dds1_ampl', + const=dds1_ampl, + ) + + self.add_const_set_offset_0_0_0_0 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/adc2_offset', + const=adc2_offset, + ) + + self.add_const_set_offset_0_0_0 = redpitaya_gnuradio.add_const_set_offset( + addr=addr, + port=port, + device='/dev/adc1_offset', + const=adc1_offset, + ) + + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "double_pid_vco") + self.settings.setValue("geometry", self.saveGeometry()) + event.accept() + + def get_port(self): + return self.port + + def set_port(self, port): + self.port = port + + def get_pid2_sign(self): + return self.pid2_sign + + def set_pid2_sign(self, pid2_sign): + self.pid2_sign = pid2_sign + self._pid2_sign_callback(self.pid2_sign) + self.add_const_set_offset_0_0_0_1_0_0_0_0_1.set_const(device='/dev/pid2_sign', const=self.pid2_sign) + + def get_pid2_setpoint(self): + return self.pid2_setpoint + + def set_pid2_setpoint(self, pid2_setpoint): + self.pid2_setpoint = pid2_setpoint + self.add_const_set_offset_0_0_0_1_1.set_const(device='/dev/pid2_setpoint', const=self.pid2_setpoint) + + def get_pid2_rst_int(self): + return self.pid2_rst_int + + def set_pid2_rst_int(self, pid2_rst_int): + self.pid2_rst_int = pid2_rst_int + self.add_const_set_offset_0_0_0_1_0_0_0_0_0_0.set_const(device='/dev/pid2_rst_int', const=self.pid2_rst_int) + + def get_pid2_kp(self): + return self.pid2_kp + + def set_pid2_kp(self, pid2_kp): + self.pid2_kp = pid2_kp + self.add_const_set_offset_0_0_0_1_0_1.set_const(device='/dev/pid2_kp', const=self.pid2_kp) + + def get_pid2_ki(self): + return self.pid2_ki + + def set_pid2_ki(self, pid2_ki): + self.pid2_ki = pid2_ki + self.add_const_set_offset_0_0_0_1_0_0_1.set_const(device='/dev/pid2_ki', const=self.pid2_ki) + + def get_pid2_kd(self): + return self.pid2_kd + + def set_pid2_kd(self, pid2_kd): + self.pid2_kd = pid2_kd + self.add_const_set_offset_0_0_0_1_0_0_0_1.set_const(device='/dev/pid2_kd', const=self.pid2_kd) + + def get_pid1_sign(self): + return self.pid1_sign + + def set_pid1_sign(self, pid1_sign): + self.pid1_sign = pid1_sign + self._pid1_sign_callback(self.pid1_sign) + self.add_const_set_offset_0_0_0_1_0_0_0_0.set_const(device='/dev/pid1_sign', const=self.pid1_sign) + + def get_pid1_setpoint(self): + return self.pid1_setpoint + + def set_pid1_setpoint(self, pid1_setpoint): + self.pid1_setpoint = pid1_setpoint + self.add_const_set_offset_0_0_0_1.set_const(device='/dev/pid1_setpoint', const=self.pid1_setpoint) + + def get_pid1_rst_int(self): + return self.pid1_rst_int + + def set_pid1_rst_int(self, pid1_rst_int): + self.pid1_rst_int = pid1_rst_int + self.add_const_set_offset_0_0_0_1_0_0_0_0_0.set_const(device='/dev/pid1_rst_int', const=self.pid1_rst_int) + + def get_pid1_kp(self): + return self.pid1_kp + + def set_pid1_kp(self, pid1_kp): + self.pid1_kp = pid1_kp + self.add_const_set_offset_0_0_0_1_0.set_const(device='/dev/pid1_kp', const=self.pid1_kp) + + def get_pid1_ki(self): + return self.pid1_ki + + def set_pid1_ki(self, pid1_ki): + self.pid1_ki = pid1_ki + self.add_const_set_offset_0_0_0_1_0_0.set_const(device='/dev/pid1_ki', const=self.pid1_ki) + + def get_pid1_kd(self): + return self.pid1_kd + + def set_pid1_kd(self, pid1_kd): + self.pid1_kd = pid1_kd + self.add_const_set_offset_0_0_0_1_0_0_0.set_const(device='/dev/pid1_kd', const=self.pid1_kd) + + def get_dds2_range(self): + return self.dds2_range + + def set_dds2_range(self, dds2_range): + self.dds2_range = dds2_range + self.add_const_set_offset_0_0_0_0_1_0_0_0.set_const(device='/dev/dds2_range', const=self.dds2_range) + + def get_dds2_poff_sw(self): + return self.dds2_poff_sw + + def set_dds2_poff_sw(self, dds2_poff_sw): + self.dds2_poff_sw = dds2_poff_sw + self._dds2_poff_sw_callback(self.dds2_poff_sw) + self.nco_counter_send_conf_0_0.set_nco(device='/dev/dds2_nco', freq_ref=125000000, freq_dds=self.dds2_nco, acc_size=32, offset=0, pinc_sw=self.dds2_pinc_sw, poff_sw=self.dds2_poff_sw) + + def get_dds2_pinc_sw(self): + return self.dds2_pinc_sw + + def set_dds2_pinc_sw(self, dds2_pinc_sw): + self.dds2_pinc_sw = dds2_pinc_sw + self._dds2_pinc_sw_callback(self.dds2_pinc_sw) + self.nco_counter_send_conf_0_0.set_nco(device='/dev/dds2_nco', freq_ref=125000000, freq_dds=self.dds2_nco, acc_size=32, offset=0, pinc_sw=self.dds2_pinc_sw, poff_sw=self.dds2_poff_sw) + + def get_dds2_offset(self): + return self.dds2_offset + + def set_dds2_offset(self, dds2_offset): + self.dds2_offset = dds2_offset + self.add_const_set_offset_0_0_0_0_1_1.set_const(device='/dev/dds2_offset', const=self.dds2_offset) + + def get_dds2_nco(self): + return self.dds2_nco + + def set_dds2_nco(self, dds2_nco): + self.dds2_nco = dds2_nco + self.nco_counter_send_conf_0_0.set_nco(device='/dev/dds2_nco', freq_ref=125000000, freq_dds=self.dds2_nco, acc_size=32, offset=0, pinc_sw=self.dds2_pinc_sw, poff_sw=self.dds2_poff_sw) + + def get_dds2_f0(self): + return self.dds2_f0 + + def set_dds2_f0(self, dds2_f0): + self.dds2_f0 = dds2_f0 + self.add_const_set_offset_0_0_0_0_1_0_1.set_const(device='/dev/dds2_f0', const=int(self.dds2_f0/(125e6/2**32))) + + def get_dds2_ampl(self): + return self.dds2_ampl + + def set_dds2_ampl(self, dds2_ampl): + self.dds2_ampl = dds2_ampl + self.add_const_set_offset_0_0_0_0_0_0.set_const(device='/dev/dds2_ampl', const=self.dds2_ampl) + + def get_dds1_range(self): + return self.dds1_range + + def set_dds1_range(self, dds1_range): + self.dds1_range = dds1_range + self.add_const_set_offset_0_0_0_0_1_0_0.set_const(device='/dev/dds1_range', const=self.dds1_range) + + def get_dds1_poff_sw(self): + return self.dds1_poff_sw + + def set_dds1_poff_sw(self, dds1_poff_sw): + self.dds1_poff_sw = dds1_poff_sw + self._dds1_poff_sw_callback(self.dds1_poff_sw) + self.nco_counter_send_conf_0.set_nco(device='/dev/dds1_nco', freq_ref=125000000, freq_dds=self.dds1_nco, acc_size=32, offset=0, pinc_sw=self.dds1_pinc_sw, poff_sw=self.dds1_poff_sw) + + def get_dds1_pinc_sw(self): + return self.dds1_pinc_sw + + def set_dds1_pinc_sw(self, dds1_pinc_sw): + self.dds1_pinc_sw = dds1_pinc_sw + self._dds1_pinc_sw_callback(self.dds1_pinc_sw) + self.nco_counter_send_conf_0.set_nco(device='/dev/dds1_nco', freq_ref=125000000, freq_dds=self.dds1_nco, acc_size=32, offset=0, pinc_sw=self.dds1_pinc_sw, poff_sw=self.dds1_poff_sw) + + def get_dds1_offset(self): + return self.dds1_offset + + def set_dds1_offset(self, dds1_offset): + self.dds1_offset = dds1_offset + self.add_const_set_offset_0_0_0_0_1.set_const(device='/dev/dds1_offset', const=self.dds1_offset) + + def get_dds1_nco(self): + return self.dds1_nco + + def set_dds1_nco(self, dds1_nco): + self.dds1_nco = dds1_nco + self.nco_counter_send_conf_0.set_nco(device='/dev/dds1_nco', freq_ref=125000000, freq_dds=self.dds1_nco, acc_size=32, offset=0, pinc_sw=self.dds1_pinc_sw, poff_sw=self.dds1_poff_sw) + + def get_dds1_f0(self): + return self.dds1_f0 + + def set_dds1_f0(self, dds1_f0): + self.dds1_f0 = dds1_f0 + self.add_const_set_offset_0_0_0_0_1_0.set_const(device='/dev/dds1_f0', const=int(self.dds1_f0/(125e6/2**32))) + + def get_dds1_ampl(self): + return self.dds1_ampl + + def set_dds1_ampl(self, dds1_ampl): + self.dds1_ampl = dds1_ampl + self.add_const_set_offset_0_0_0_0_0.set_const(device='/dev/dds1_ampl', const=self.dds1_ampl) + + def get_addr(self): + return self.addr + + def set_addr(self, addr): + self.addr = addr + + def get_adc2_offset(self): + return self.adc2_offset + + def set_adc2_offset(self, adc2_offset): + self.adc2_offset = adc2_offset + self.add_const_set_offset_0_0_0_0.set_const(device='/dev/adc2_offset', const=self.adc2_offset) + + def get_adc1_offset(self): + return self.adc1_offset + + def set_adc1_offset(self, adc1_offset): + self.adc1_offset = adc1_offset + self.add_const_set_offset_0_0_0.set_const(device='/dev/adc1_offset', const=self.adc1_offset) + + +def main(top_block_cls=double_pid_vco, options=None): + + from distutils.version import StrictVersion + if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"): + style = gr.prefs().get_string('qtgui', 'style', 'raster') + Qt.QApplication.setGraphicsSystem(style) + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls() + tb.start() + tb.show() + + def quitting(): + tb.stop() + tb.wait() + qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting) + qapp.exec_() + + +if __name__ == '__main__': + main() diff --git a/redpitaya/client/iq_demod_only.py b/redpitaya/client/iq_demod_only.py index 28296e8..62391b6 100755 --- a/redpitaya/client/iq_demod_only.py +++ b/redpitaya/client/iq_demod_only.py @@ -3,7 +3,7 @@ ################################################## # GNU Radio Python Flow Graph # Title: Iq Demod Only -# Generated: Thu Apr 20 16:31:50 2017 +# Generated: Fri Apr 21 11:41:10 2017 ################################################## if __name__ == '__main__': diff --git a/redpitaya/client/pid_vco.py b/redpitaya/client/pid_vco.py index 4f2ae82..2edd88b 100755 --- a/redpitaya/client/pid_vco.py +++ b/redpitaya/client/pid_vco.py @@ -3,7 +3,7 @@ ################################################## # GNU Radio Python Flow Graph # Title: Pid Vco -# Generated: Tue Apr 11 15:32:11 2017 +# Generated: Fri Apr 21 12:38:53 2017 ################################################## if __name__ == '__main__': -- 2.16.4