From 80025b8c2cb398a0ccd467b36e5e0b0c43bab7d8 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut <tnt@246tNt.com> Date: Mon, 11 Sep 2017 17:04:25 -0700 Subject: grc: Make sure to install the yml files Signed-off-by: Sylvain Munaut <tnt@246tNt.com> --- grc/blocks/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'grc/blocks/CMakeLists.txt') diff --git a/grc/blocks/CMakeLists.txt b/grc/blocks/CMakeLists.txt index d46b1febbe..2dbc7c6d0d 100644 --- a/grc/blocks/CMakeLists.txt +++ b/grc/blocks/CMakeLists.txt @@ -20,6 +20,7 @@ ######################################################################## include(GrPython) +file(GLOB yml_files "*.yml") file(GLOB xml_files "*.xml") macro(REPLACE_IN_FILE _xml_block match replace) @@ -54,6 +55,6 @@ endif() add_custom_target(grc_generated_xml ALL DEPENDS ${generated_xml_files}) install( - FILES ${xml_files} ${generated_xml_files} + FILES ${yml_files} ${xml_files} ${generated_xml_files} DESTINATION ${GRC_BLOCKS_DIR} ) -- cgit v1.2.3 From 4804d1fdb6950d2b2ec5707cd8a362f01ed2cf90 Mon Sep 17 00:00:00 2001 From: Håkon Vågsether <haakonsv@gmail.com> Date: Thu, 5 Oct 2017 11:57:24 +0200 Subject: Added YAML blocks that needed manual editing --- gr-qtgui/grc/CMakeLists.txt | 26 +- gr-qtgui/grc/qtgui.tree.yml | 23 + gr-qtgui/grc/qtgui_ber_sink_b.block.yml | 366 ++++++++++ gr-qtgui/grc/qtgui_ber_sink_b.xml | 684 ------------------ gr-qtgui/grc/qtgui_block_tree.xml | 61 -- gr-qtgui/grc/qtgui_check_box.block.yml | 66 ++ gr-qtgui/grc/qtgui_check_box.xml | 82 --- gr-qtgui/grc/qtgui_chooser.block.yml | 191 +++++ gr-qtgui/grc/qtgui_chooser.xml | 257 ------- gr-qtgui/grc/qtgui_const_sink_x.block.yml | 457 ++++++++++++ gr-qtgui/grc/qtgui_const_sink_x.xml | 859 ----------------------- gr-qtgui/grc/qtgui_edit_box_msg.block.yml | 69 ++ gr-qtgui/grc/qtgui_edit_box_msg.xml | 152 ---- gr-qtgui/grc/qtgui_entry.block.yml | 57 ++ gr-qtgui/grc/qtgui_entry.xml | 67 -- gr-qtgui/grc/qtgui_freq_sink_x.block.yml | 447 ++++++++++++ gr-qtgui/grc/qtgui_freq_sink_x.xml | 791 --------------------- gr-qtgui/grc/qtgui_histogram_sink_x.block.yml | 419 +++++++++++ gr-qtgui/grc/qtgui_histogram_sink_x.xml | 794 --------------------- gr-qtgui/grc/qtgui_label.block.yml | 66 ++ gr-qtgui/grc/qtgui_label.xml | 87 --- gr-qtgui/grc/qtgui_number_sink.block.yml | 283 ++++++++ gr-qtgui/grc/qtgui_number_sink.xml | 496 ------------- gr-qtgui/grc/qtgui_push_button.block.yml | 60 ++ gr-qtgui/grc/qtgui_push_button.xml | 79 --- gr-qtgui/grc/qtgui_range.block.yml | 86 +++ gr-qtgui/grc/qtgui_range.xml | 131 ---- gr-qtgui/grc/qtgui_sink_x.block.yml | 148 ++++ gr-qtgui/grc/qtgui_sink_x.xml | 232 ------ gr-qtgui/grc/qtgui_tab_widget.block.yml | 141 ++++ gr-qtgui/grc/qtgui_tab_widget.xml | 206 ------ gr-qtgui/grc/qtgui_time_raster_x.block.yml | 266 +++++++ gr-qtgui/grc/qtgui_time_raster_x.xml | 466 ------------- gr-qtgui/grc/qtgui_time_sink_x.block.yml | 559 +++++++++++++++ gr-qtgui/grc/qtgui_time_sink_x.xml | 948 ------------------------- gr-qtgui/grc/qtgui_vector_sink_f.block.yml | 352 ++++++++++ gr-qtgui/grc/qtgui_vector_sink_f.xml | 603 ---------------- gr-qtgui/grc/qtgui_waterfall_sink_x.block.yml | 303 ++++++++ gr-qtgui/grc/qtgui_waterfall_sink_x.xml | 557 --------------- gr-uhd/grc/CMakeLists.txt | 26 +- gr-uhd/grc/gen_uhd_usrp_blocks.py | 968 +++++++++----------------- gr-uhd/grc/uhd.tree.yml | 5 + gr-uhd/grc/uhd_amsg_source.block.yml | 18 + gr-uhd/grc/uhd_amsg_source.xml | 24 - gr-uhd/grc/uhd_block_tree.xml | 15 - grc/blocks/CMakeLists.txt | 35 +- grc/blocks/block_tree.xml | 24 - grc/blocks/grc.tree.yml | 15 + grc/blocks/import.block.yml | 20 + grc/blocks/import.xml | 26 - grc/blocks/note.block.yml | 9 + grc/blocks/note.xml | 17 - grc/blocks/options.block.yml | 146 ++++ grc/blocks/options.xml | 250 ------- grc/blocks/pad_sink.block.yml | 51 ++ grc/blocks/pad_sink.xml | 103 --- grc/blocks/pad_source.block.yml | 51 ++ grc/blocks/pad_source.xml | 104 --- grc/blocks/parameter.block.yml | 55 ++ grc/blocks/parameter.xml | 118 ---- grc/blocks/variable.block.yml | 19 + grc/blocks/variable.xml | 23 - grc/blocks/variable_config.block.yml | 58 ++ grc/blocks/variable_config.xml | 88 --- grc/blocks/variable_function_probe.block.yml | 54 ++ grc/blocks/variable_function_probe.xml | 78 --- grc/blocks/variable_struct.block.yml.py | 105 +++ grc/blocks/variable_struct.xml.py | 97 --- grc/blocks/virtual_sink.block.yml | 13 + grc/blocks/virtual_sink.xml | 21 - grc/blocks/virtual_source.block.yml | 13 + grc/blocks/virtual_source.xml | 21 - grc/tests/resources/file1.block.yml | 38 + grc/tests/resources/file1.xml | 58 -- grc/tests/resources/file2.block.yml | 31 + grc/tests/resources/file2.xml | 80 --- grc/tests/resources/file3.block.yml | 66 ++ grc/tests/resources/file3.xml | 100 --- 78 files changed, 5491 insertions(+), 9489 deletions(-) create mode 100644 gr-qtgui/grc/qtgui.tree.yml create mode 100644 gr-qtgui/grc/qtgui_ber_sink_b.block.yml delete mode 100644 gr-qtgui/grc/qtgui_ber_sink_b.xml delete mode 100644 gr-qtgui/grc/qtgui_block_tree.xml create mode 100644 gr-qtgui/grc/qtgui_check_box.block.yml delete mode 100644 gr-qtgui/grc/qtgui_check_box.xml create mode 100644 gr-qtgui/grc/qtgui_chooser.block.yml delete mode 100644 gr-qtgui/grc/qtgui_chooser.xml create mode 100644 gr-qtgui/grc/qtgui_const_sink_x.block.yml delete mode 100644 gr-qtgui/grc/qtgui_const_sink_x.xml create mode 100644 gr-qtgui/grc/qtgui_edit_box_msg.block.yml delete mode 100644 gr-qtgui/grc/qtgui_edit_box_msg.xml create mode 100644 gr-qtgui/grc/qtgui_entry.block.yml delete mode 100644 gr-qtgui/grc/qtgui_entry.xml create mode 100644 gr-qtgui/grc/qtgui_freq_sink_x.block.yml delete mode 100644 gr-qtgui/grc/qtgui_freq_sink_x.xml create mode 100644 gr-qtgui/grc/qtgui_histogram_sink_x.block.yml delete mode 100644 gr-qtgui/grc/qtgui_histogram_sink_x.xml create mode 100644 gr-qtgui/grc/qtgui_label.block.yml delete mode 100644 gr-qtgui/grc/qtgui_label.xml create mode 100644 gr-qtgui/grc/qtgui_number_sink.block.yml delete mode 100644 gr-qtgui/grc/qtgui_number_sink.xml create mode 100644 gr-qtgui/grc/qtgui_push_button.block.yml delete mode 100644 gr-qtgui/grc/qtgui_push_button.xml create mode 100644 gr-qtgui/grc/qtgui_range.block.yml delete mode 100644 gr-qtgui/grc/qtgui_range.xml create mode 100644 gr-qtgui/grc/qtgui_sink_x.block.yml delete mode 100644 gr-qtgui/grc/qtgui_sink_x.xml create mode 100644 gr-qtgui/grc/qtgui_tab_widget.block.yml delete mode 100644 gr-qtgui/grc/qtgui_tab_widget.xml create mode 100644 gr-qtgui/grc/qtgui_time_raster_x.block.yml delete mode 100644 gr-qtgui/grc/qtgui_time_raster_x.xml create mode 100644 gr-qtgui/grc/qtgui_time_sink_x.block.yml delete mode 100644 gr-qtgui/grc/qtgui_time_sink_x.xml create mode 100644 gr-qtgui/grc/qtgui_vector_sink_f.block.yml delete mode 100644 gr-qtgui/grc/qtgui_vector_sink_f.xml create mode 100644 gr-qtgui/grc/qtgui_waterfall_sink_x.block.yml delete mode 100644 gr-qtgui/grc/qtgui_waterfall_sink_x.xml create mode 100644 gr-uhd/grc/uhd.tree.yml create mode 100644 gr-uhd/grc/uhd_amsg_source.block.yml delete mode 100644 gr-uhd/grc/uhd_amsg_source.xml delete mode 100644 gr-uhd/grc/uhd_block_tree.xml delete mode 100644 grc/blocks/block_tree.xml create mode 100644 grc/blocks/grc.tree.yml create mode 100644 grc/blocks/import.block.yml delete mode 100644 grc/blocks/import.xml create mode 100644 grc/blocks/note.block.yml delete mode 100644 grc/blocks/note.xml create mode 100644 grc/blocks/options.block.yml delete mode 100644 grc/blocks/options.xml create mode 100644 grc/blocks/pad_sink.block.yml delete mode 100644 grc/blocks/pad_sink.xml create mode 100644 grc/blocks/pad_source.block.yml delete mode 100644 grc/blocks/pad_source.xml create mode 100644 grc/blocks/parameter.block.yml delete mode 100644 grc/blocks/parameter.xml create mode 100644 grc/blocks/variable.block.yml delete mode 100644 grc/blocks/variable.xml create mode 100644 grc/blocks/variable_config.block.yml delete mode 100644 grc/blocks/variable_config.xml create mode 100644 grc/blocks/variable_function_probe.block.yml delete mode 100644 grc/blocks/variable_function_probe.xml create mode 100644 grc/blocks/variable_struct.block.yml.py delete mode 100644 grc/blocks/variable_struct.xml.py create mode 100644 grc/blocks/virtual_sink.block.yml delete mode 100644 grc/blocks/virtual_sink.xml create mode 100644 grc/blocks/virtual_source.block.yml delete mode 100644 grc/blocks/virtual_source.xml create mode 100644 grc/tests/resources/file1.block.yml delete mode 100644 grc/tests/resources/file1.xml create mode 100644 grc/tests/resources/file2.block.yml delete mode 100644 grc/tests/resources/file2.xml create mode 100644 grc/tests/resources/file3.block.yml delete mode 100644 grc/tests/resources/file3.xml (limited to 'grc/blocks/CMakeLists.txt') diff --git a/gr-qtgui/grc/CMakeLists.txt b/gr-qtgui/grc/CMakeLists.txt index 74e6958639..f9ccf116cb 100644 --- a/gr-qtgui/grc/CMakeLists.txt +++ b/gr-qtgui/grc/CMakeLists.txt @@ -18,30 +18,30 @@ # Boston, MA 02110-1301, USA. ######################################################################## -file(GLOB xml_files "*.xml") +file(GLOB yml_files "*.yml") -macro(REPLACE_IN_FILE _xml_block match replace) - set(xml_block_src "${CMAKE_CURRENT_SOURCE_DIR}/${_xml_block}") - set(xml_block "${CMAKE_CURRENT_BINARY_DIR}/${_xml_block}") +macro(REPLACE_IN_FILE _yml_block match replace) + set(yml_block_src "${CMAKE_CURRENT_SOURCE_DIR}/${_yml_block}") + set(yml_block "${CMAKE_CURRENT_BINARY_DIR}/${_yml_block}") - list(REMOVE_ITEM xml_files "${xml_block_src}") - file(READ "${xml_block_src}" xml_block_src_text) + list(REMOVE_ITEM yml_files "${yml_block_src}") + file(READ "${yml_block_src}" yml_block_src_text) string(REPLACE "${match}" "${replace}" - xml_block_text "${xml_block_src_text}") - file(WRITE "${xml_block}" "${xml_block_text}") + yml_block_text "${yml_block_src_text}") + file(WRITE "${yml_block}" "${yml_block_text}") - list(APPEND generated_xml_files "${xml_block}") + list(APPEND generated_yml_files "${yml_block}") endmacro() if(DESIRED_QT_VERSION EQUAL 4) - foreach(xml_block_src ${xml_files}) - get_filename_component(xml_block "${xml_block_src}" NAME) - REPLACE_IN_FILE("${xml_block}" "PyQt5" "PyQt4") + foreach(yml_block_src ${yml_files}) + get_filename_component(yml_block "${yml_block_src}" NAME) + REPLACE_IN_FILE("${yml_block}" "PyQt5" "PyQt4") endforeach() endif() install( - FILES ${xml_files} ${generated_xml_files} + FILES ${yml_files} ${generated_yml_files} DESTINATION "${GRC_BLOCKS_DIR}" ) diff --git a/gr-qtgui/grc/qtgui.tree.yml b/gr-qtgui/grc/qtgui.tree.yml new file mode 100644 index 0000000000..e479adf6af --- /dev/null +++ b/gr-qtgui/grc/qtgui.tree.yml @@ -0,0 +1,23 @@ +'[Core]': +- Instrumentation: + - QT: + - qtgui_freq_sink_x + - qtgui_time_sink_x + - qtgui_const_sink_x + - qtgui_waterfall_sink_x + - qtgui_time_raster_sink_x + - qtgui_bercurve_sink + - qtgui_histogram_sink_x + - qtgui_number_sink + - qtgui_vector_sink_f + - qtgui_sink_x +- GUI Widgets: + - QT: + - qtgui_tab_widget + - variable_qtgui_range + - variable_qtgui_chooser + - variable_qtgui_check_box + - variable_qtgui_push_button + - variable_qtgui_entry + - variable_qtgui_label + - qtgui_edit_box_msg diff --git a/gr-qtgui/grc/qtgui_ber_sink_b.block.yml b/gr-qtgui/grc/qtgui_ber_sink_b.block.yml new file mode 100644 index 0000000000..3060862299 --- /dev/null +++ b/gr-qtgui/grc/qtgui_ber_sink_b.block.yml @@ -0,0 +1,366 @@ +id: qtgui_bercurve_sink +label: QT GUI Bercurve Sink + +parameters: +- id: esno + label: esno + dtype: raw + default: numpy.arange(0.0, 4.0, .5) + hide: part +- id: berminerrors + label: Min. BER Errs. + dtype: int + default: '100' +- id: berlimit + label: BER Limit + dtype: real + default: '-7.0' +- id: num_curves + label: Num Curves + dtype: int + default: '1' + hide: part +- id: curvenames + label: Curve Names + dtype: raw + default: '[]' + hide: part +- id: ymin + label: Y min + dtype: real + default: '-10' + hide: part +- id: ymax + label: Y max + dtype: real + default: '0' + hide: part +- id: update_time + label: Update Period + dtype: real + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(num_curves) >= 1 else 'all') } +- id: width1 + label: Line 1 Width + category: Config + dtype: int + default: '1' + hide: ${ ('part' if int(num_curves) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['"blue"', '"red"', '"green"', '"black"', '"cyan"', '"magenta"', '"yellow"', + '"dark red"', '"dark green"', '"Dark Blue"'] + option_labels: [Blue, Red, Green, Black, Cyan, Magenta, Yellow, Dark Red, Dark + Green, Dark Blue] + hide: ${ ('part' if int(num_curves) >= 1 else 'all') } +- id: style1 + label: Line 1 Style + category: Config + dtype: enum + options: ['1', '2', '3', '4', '5', '0'] + option_labels: [Solid, Dash, Dots, Dash-Dot, Dash-Dot-Dot, None] + hide: ${ ('part' if int(num_curves) >= 1 else 'all') } +- id: marker1 + label: Line 1 Marker + category: Config + dtype: enum + options: ['0', '1', '2', '3', '4', '6', '7', '8', '9', '-1'] + option_labels: [Circle, Rectangle, Diamond, Triangle, Down Triangle, Left Triangle, + Right Triangle, Cross, X-Cross, None] + hide: ${ ('part' if int(num_curves) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(num_curves) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 2 else 'all') } +- id: width2 + label: Line 2 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(num_curves) >= 2 else 'all') } +- id: style2 + label: Line 2 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 2 else 'all') } +- id: marker2 + label: Line 2 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 2 else 'all') } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 3 else 'all') } +- id: width3 + label: Line 3 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + default: '"green"' + hide: ${ ('part' if int(num_curves) >= 3 else 'all') } +- id: style3 + label: Line 3 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 3 else 'all') } +- id: marker3 + label: Line 3 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 3 else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 4 else 'all') } +- id: width4 + label: Line 4 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + default: '"black"' + hide: ${ ('part' if int(num_curves) >= 4 else 'all') } +- id: style4 + label: Line 4 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 4 else 'all') } +- id: marker4 + label: Line 4 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 4 else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 5 else 'all') } +- id: width5 + label: Line 5 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + default: '"cyan"' + hide: ${ ('part' if int(num_curves) >= 5 else 'all') } +- id: style5 + label: Line 5 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 5 else 'all') } +- id: marker5 + label: Line 5 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 5 else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 6 else 'all') } +- id: width6 + label: Line 6 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + default: '"magenta"' + hide: ${ ('part' if int(num_curves) >= 6 else 'all') } +- id: style6 + label: Line 6 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 6 else 'all') } +- id: marker6 + label: Line 6 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 6 else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 7 else 'all') } +- id: width7 + label: Line 7 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + default: '"yellow"' + hide: ${ ('part' if int(num_curves) >= 7 else 'all') } +- id: style7 + label: Line 7 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 7 else 'all') } +- id: marker7 + label: Line 7 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 7 else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 8 else 'all') } +- id: width8 + label: Line 8 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + default: '"dark red"' + hide: ${ ('part' if int(num_curves) >= 8 else 'all') } +- id: style8 + label: Line 8 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 8 else 'all') } +- id: marker8 + label: Line 8 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 8 else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 9 else 'all') } +- id: width9 + label: Line 9 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + default: '"dark green"' + hide: ${ ('part' if int(num_curves) >= 9 else 'all') } +- id: style9 + label: Line 9 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 9 else 'all') } +- id: marker9 + label: Line 9 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 9 else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 10 else 'all') } +- id: width10 + label: Line 10 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + default: '"dark blue"' + hide: ${ ('part' if int(num_curves) >= 10 else 'all') } +- id: style10 + label: Line 10 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 10 else 'all') } +- id: marker10 + label: Line 10 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 10 else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: byte + multiplicity: ${ len(esno)*2*num_curves } + +templates: + imports: |- + from PyQt5import Qt + from gnuradio import qtgui + import sip + import numpy + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.ber_sink_b( + ${esno}, #range of esnos + ${num_curves}, #number of curves + ${berminerrors}, #ensure at least + ${berlimit}, #cutoff + ${curvenames} #indiv. curve names + ) + self.${id}.set_update_time(${update_time}) + self.${id}.set_y_axis(${ymin}, ${ymax}) + self.${id}.set_x_axis(${esno}[0], ${esno}[-1]) + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + widths = [${width1}, ${width2}, ${width3}, ${width4}, ${width5}, + ${width6}, ${width7}, ${width8}, ${width9}, ${width10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + + for i in range(${num_curves}): + if len(labels[i]) == 0: + self.${id}.set_line_label(i, "Data {0}".format(i)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id}.set_line_width(i, widths[i]) + self.${id}.set_line_color(i, colors[i]) + self.${id}.set_line_style(i, styles[i]) + self.${id}.set_line_marker(i, markers[i]) + self.${id}.set_line_alpha(i, alphas[i]) + + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint()(win)} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_ber_sink_b.xml b/gr-qtgui/grc/qtgui_ber_sink_b.xml deleted file mode 100644 index 05a36dfbc0..0000000000 --- a/gr-qtgui/grc/qtgui_ber_sink_b.xml +++ /dev/null @@ -1,684 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Bercurve Sink</name> - <key>qtgui_bercurve_sink</key> - <import>from PyQt5import Qt</import> - <import>from gnuradio import qtgui</import> - <import>import sip</import> - <import>import numpy</import> - <make>#set $win = 'self._%s_win'%$id - qtgui.ber_sink_b( - $esno, \#range of esnos - $num_curves, \#number of curves - $berminerrors, \#ensure at least - $berlimit, \#cutoff - $curvenames, \#indiv. curve names - ) -self.$(id).set_update_time($update_time) -self.$(id).set_y_axis($ymin, $ymax) -self.$(id).set_x_axis($(esno)[0], $(esno)[-1]) - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -widths = [$width1, $width2, $width3, $width4, $width5, - $width6, $width7, $width8, $width9, $width10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -styles = [$style1, $style2, $style3, $style4, $style5, - $style6, $style7, $style8, $style9, $style10] -markers = [$marker1, $marker2, $marker3, $marker4, $marker5, - $marker6, $marker7, $marker8, $marker9, $marker10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] -for i in xrange($num_curves): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_line_width(i, widths[i]) - self.$(id).set_line_color(i, colors[i]) - self.$(id).set_line_style(i, styles[i]) - self.$(id).set_line_marker(i, markers[i]) - self.$(id).set_line_alpha(i, alphas[i]) - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - - <param> - <name>esno</name> - <key>esno</key> - <value>numpy.arange(0.0, 4.0, .5)</value> - <type>raw</type> - </param> - - <param> - <name>Min. BER Errs.</name> - <key>berminerrors</key> - <value>100</value> - <type>int</type> - </param> - - <param> - <name>BER Limit</name> - <key>berlimit</key> - <value>-7.0</value> - <type>real</type> - </param> - - <param> - <name>Num Curves</name> - <key>num_curves</key> - <value>1</value> - <type>int</type> - </param> - - <param> - <name>Curve Names</name> - <key>curvenames</key> - <value>[]</value> - <type>raw</type> - <hide>part</hide> - </param> - - <param> - <name>Y min</name> - <key>ymin</key> - <value>-10</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Y max</name> - <key>ymax</key> - <value>0</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Width</name> - <key>width1</key> - <value>1</value> - <type>int</type> - <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Blue</name> - <key>"blue"</key> - </option> - <option> - <name>Red</name> - <key>"red"</key> - </option> - <option> - <name>Green</name> - <key>"green"</key> - </option> - <option> - <name>Black</name> - <key>"black"</key> - </option> - <option> - <name>Cyan</name> - <key>"cyan"</key> - </option> - <option> - <name>Magenta</name> - <key>"magenta"</key> - </option> - <option> - <name>Yellow</name> - <key>"yellow"</key> - </option> - <option> - <name>Dark Red</name> - <key>"dark red"</key> - </option> - <option> - <name>Dark Green</name> - <key>"dark green"</key> - </option> - <option> - <name>Dark Blue</name> - <key>"Dark Blue"</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Style</name> - <key>style1</key> - <type>enum</type> - <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Solid</name> - <key>1</key> - </option> - <option> - <name>Dash</name> - <key>2</key> - </option> - <option> - <name>Dots</name> - <key>3</key> - </option> - <option> - <name>Dash-Dot</name> - <key>4</key> - </option> - <option> - <name>Dash-Dot-Dot</name> - <key>5</key> - </option> - <option> - <name>None</name> - <key>0</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Marker</name> - <key>marker1</key> - <type>enum</type> - <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Circle</name> - <key>0</key> - </option> - <option> - <name>Rectangle</name> - <key>1</key> - </option> - <option> - <name>Diamond</name> - <key>2</key> - </option> - <option> - <name>Triangle</name> - <key>3</key> - </option> - <option> - <name>Down Triangle</name> - <key>4</key> - </option> - <option> - <name>Left Triangle</name> - <key>6</key> - </option> - <option> - <name>Right Triangle</name> - <key>7</key> - </option> - <option> - <name>Cross</name> - <key>8</key> - </option> - <option> - <name>X-Cross</name> - <key>9</key> - </option> - <option> - <name>None</name> - <key>-1</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 2 Width</name> - <key>width2</key> - <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <value>"red"</value> - <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 2 Style</name> - <key>style2</key> - <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 2 Marker</name> - <key>marker2</key> - <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 3 Width</name> - <key>width3</key> - <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <value>"green"</value> - <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 3 Style</name> - <key>style3</key> - <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 3 Marker</name> - <key>marker3</key> - <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 4 Width</name> - <key>width4</key> - <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <value>"black"</value> - <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 4 Style</name> - <key>style4</key> - <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 4 Marker</name> - <key>marker4</key> - <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 5 Width</name> - <key>width5</key> - <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <value>"cyan"</value> - <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 5 Style</name> - <key>style5</key> - <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 5 Marker</name> - <key>marker5</key> - <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 6 Width</name> - <key>width6</key> - <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <value>"magenta"</value> - <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 6 Style</name> - <key>style6</key> - <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 6 Marker</name> - <key>marker6</key> - <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 7 Width</name> - <key>width7</key> - <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <value>"yellow"</value> - <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 7 Style</name> - <key>style7</key> - <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 7 Marker</name> - <key>marker7</key> - <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 8 Width</name> - <key>width8</key> - <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <value>"dark red"</value> - <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 8 Style</name> - <key>style8</key> - <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 8 Marker</name> - <key>marker8</key> - <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 9 Width</name> - <key>width9</key> - <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <value>"dark green"</value> - <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 9 Style</name> - <key>style9</key> - <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 9 Marker</name> - <key>marker9</key> - <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 10 Width</name> - <key>width10</key> - <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <value>"dark blue"</value> - <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 10 Style</name> - <key>style10</key> - <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 10 Marker</name> - <key>marker10</key> - <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> - </param> - - - <sink> - <name>out</name> - <type>byte</type> - <nports>len($esno)*2*$num_curves</nports> - </sink> - - <bus_structure_sink>map(lambda b: map(lambda a: b * len($esno) * 2 + a, range(len($esno)*2)), range($num_curves))</bus_structure_sink> - - <doc> - The GUI hint can be used to position the widget within the application. \ - The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ - Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_block_tree.xml b/gr-qtgui/grc/qtgui_block_tree.xml deleted file mode 100644 index 33fb12a7b5..0000000000 --- a/gr-qtgui/grc/qtgui_block_tree.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0"?> - -<!-- - Copyright 2012-2013 Free Software Foundation, Inc. - - This file is part of GNU Radio - - GNU Radio is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - GNU Radio is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNU Radio; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, - Boston, MA 02110-1301, USA. ---> - -<!-- -################################################### -##Block Tree for GR QTGUI blocks. -################################################### - --> -<cat> - <name>[Core]</name> - <cat> - <name>Instrumentation</name> - <cat> - <name>QT</name> - <block>qtgui_freq_sink_x</block> - <block>qtgui_time_sink_x</block> - <block>qtgui_const_sink_x</block> - <block>qtgui_waterfall_sink_x</block> - <block>qtgui_time_raster_sink_x</block> - <block>qtgui_bercurve_sink</block> - <block>qtgui_histogram_sink_x</block> - <block>qtgui_number_sink</block> - <block>qtgui_vector_sink_f</block> - <block>qtgui_sink_x</block> - </cat> - </cat> - <cat> - <name>GUI Widgets</name> - <cat> - <name>QT</name> - <block>qtgui_tab_widget</block> - <block>variable_qtgui_range</block> - <block>variable_qtgui_chooser</block> - <block>variable_qtgui_check_box</block> - <block>variable_qtgui_push_button</block> - <block>variable_qtgui_entry</block> - <block>variable_qtgui_label</block> - <block>qtgui_edit_box_msg</block> - </cat> - </cat> -</cat> diff --git a/gr-qtgui/grc/qtgui_check_box.block.yml b/gr-qtgui/grc/qtgui_check_box.block.yml new file mode 100644 index 0000000000..3f58b3cc78 --- /dev/null +++ b/gr-qtgui/grc/qtgui_check_box.block.yml @@ -0,0 +1,66 @@ +id: variable_qtgui_check_box +label: QT GUI Check Box + +parameters: +- id: label + label: Label + dtype: string + hide: ${ ('none' if label else 'part') } +- id: type + label: Type + dtype: enum + default: int + options: [real, int, string, bool, raw] + option_labels: [Float, Integer, String, Boolean, Any] + option_attributes: + conv: [float, int, str, bool, eval] + hide: part +- id: value + label: Default Value + dtype: ${ type } + default: 'True' +- id: 'true' + label: 'True' + dtype: ${ type } + default: 'True' +- id: 'false' + label: 'False' + dtype: ${ type } + default: 'False' +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +value: ${ value } + +asserts: +- ${value in (true, false)} + +templates: + imports: from PyQt5 import Qt + var_make: self.${id} = ${id} = ${value} + callbacks: + - self.set_${id}(${value}) + - self._${id}_callback(${id}) + make: |- + <% + win = '_%s_check_box'%id + if not label: + label = id + %> + ${win} = Qt.QCheckBox(${label}) + self._${id}_choices = {True: ${true}, False: ${false}} + self._${id}_choices_inv = dict((v,k) for k,v in self._${id}_choices.iteritems()) + self._${id}_callback = lambda i: Qt.QMetaObject.invokeMethod(${win}, "setChecked", Qt.Q_ARG("bool", self._${id}_choices_inv[i])) + self._${id}_callback(self.${id}) + ${win}.stateChanged.connect(lambda i: self.set_${id}(self._${id}_choices[bool(i)])) + ${gui_hint()(win)} + +documentation: |- + This block creates a variable check box. Leave the label blank to use the variable id as the label. + + A check box selects between two values of similar type. Te values do not necessarily need to be of boolean type. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_check_box.xml b/gr-qtgui/grc/qtgui_check_box.xml deleted file mode 100644 index ccee59dd92..0000000000 --- a/gr-qtgui/grc/qtgui_check_box.xml +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Check Box: -## a gui check box form -################################################### - --> -<block> - <name>QT GUI Check Box</name> - <key>variable_qtgui_check_box</key> - <import>from PyQt5 import Qt</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $win = '_%s_check_box'%$id -#if not $label() - #set $label = '"%s"'%$id -#end if -$win = Qt.QCheckBox($label) -self._$(id)_choices = {True: $true, False: $false} -self._$(id)_choices_inv = dict((v,k) for k,v in self._$(id)_choices.iteritems()) -self._$(id)_callback = lambda i: Qt.QMetaObject.invokeMethod($(win), "setChecked", Qt.Q_ARG("bool", self._$(id)_choices_inv[i])) -self._$(id)_callback(self.$id) -$(win).stateChanged.connect(lambda i: self.set_$(id)(self._$(id)_choices[bool(i)])) -$(gui_hint()($win))</make> - <callback>self.set_$(id)($value)</callback> - <callback>self._$(id)_callback($id)</callback> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Type</name> - <key>type</key> - <value>int</value> - <type>enum</type> - <hide>part</hide> - <option><name>Float</name><key>real</key><opt>conv:float</opt></option> - <option><name>Integer</name><key>int</key><opt>conv:int</opt></option> - <option><name>String</name><key>string</key><opt>conv:str</opt></option> - <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt></option> - <option><name>Any</name><key>raw</key><opt>conv:eval</opt></option> - </param> - <param> - <name>Default Value</name> - <key>value</key> - <value>True</value> - <type>$type</type> - </param> - <param> - <name>True</name> - <key>true</key> - <value>True</value> - <type>$type</type> - </param> - <param> - <name>False</name> - <key>false</key> - <value>False</value> - <type>$type</type> - </param> - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - <check>$value in ($true, $false)</check> - <doc> -This block creates a variable check box. \ -Leave the label blank to use the variable id as the label. - -A check box selects between two values of similar type. \ -Te values do not necessarily need to be of boolean type. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_chooser.block.yml b/gr-qtgui/grc/qtgui_chooser.block.yml new file mode 100644 index 0000000000..12087d8b94 --- /dev/null +++ b/gr-qtgui/grc/qtgui_chooser.block.yml @@ -0,0 +1,191 @@ +id: variable_qtgui_chooser +label: QT GUI Chooser +flags: has_python + +parameters: +- id: label + label: Label + dtype: string + hide: ${ ('none' if label else 'part') } +- id: type + label: Type + dtype: enum + default: int + options: [real, int, string, raw] + option_labels: [Float, Integer, String, Any] + hide: part +- id: num_opts + label: Num Options + dtype: enum + default: '3' + options: ['0', '1', '2', '3', '4', '5'] + option_labels: [List, '1', '2', '3', '4', '5'] +- id: value + label: Default Value + dtype: ${ type } + default: '0' +- id: options + label: Options + dtype: raw + default: '[0, 1, 2]' + hide: ${ ('all' if int(num_opts) else 'none') } +- id: labels + label: Labels + dtype: raw + default: '[]' + hide: ${ ('all' if int(num_opts) else 'none') } +- id: option0 + label: Option 0 + dtype: ${ type } + default: '0' + hide: ${ ('none' if int(num_opts) > 0 else 'all') } +- id: label0 + label: Label 0 + dtype: string + hide: ${ (int(num_opts) > 0) and (label0 and 'none' or 'part') or 'all' } +- id: option1 + label: Option 1 + dtype: ${ type } + default: '1' + hide: ${ ('none' if int(num_opts) > 1 else 'all') } +- id: label1 + label: Label 1 + dtype: string + hide: ${ (int(num_opts) > 1) and (label1 and 'none' or 'part') or 'all' } +- id: option2 + label: Option 2 + dtype: ${ type } + default: '2' + hide: ${ ('none' if int(num_opts) > 2 else 'all') } +- id: label2 + label: Label 2 + dtype: string + hide: ${ (int(num_opts) > 2) and (label2 and 'none' or 'part') or 'all' } +- id: option3 + label: Option 3 + dtype: ${ type } + default: '3' + hide: ${ ('none' if int(num_opts) > 3 else 'all') } +- id: label3 + label: Label 3 + dtype: string + hide: ${ (int(num_opts) > 3) and (label3 and 'none' or 'part') or 'all' } +- id: option4 + label: Option 4 + dtype: ${ type } + default: '4' + hide: ${ ('none' if int(num_opts) > 4 else 'all') } +- id: label4 + label: Label 4 + dtype: string + hide: ${ (int(num_opts) > 4) and (label4 and 'none' or 'part') or 'all' } +- id: widget + label: Widget + dtype: enum + default: combo_box + options: [combo_box, radio_buttons] + option_labels: [Combo Box, Radio Buttons] + hide: part +- id: orient + label: Orientation + dtype: enum + default: Qt.QVBoxLayout + options: [Qt.QHBoxLayout, Qt.QVBoxLayout] + option_labels: [Horizontal, Vertical] + hide: ${ ('part' if widget == 'radio_buttons' else 'all') } +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +value: ${ value } + +templates: + imports: |- + from PyQt5 import Qt + from PyQt5.QtCore import QObject, pyqtSlot + var_make: self.${id} = ${id} = ${value} + callbacks: + - self.set_${id}(${value}) + - self._${id}_callback(${id}) + make: |- + <% + all_options = [ option0, option1, option2, option3, option4 ][:int(num_opts)] + all_labels = [ label0, label1, label2, label3, label4 ][:int(num_opts)] + if not label: + label = id + %>\ + # Create the options list + % if int(num_opts): + self._${id}_options = (\ + % for ch in all_options: + ${ch}, \ + % endfor + ) + % else: + self._${id]_options = ${options} + % endif + # Create the labels list + % if int(num_opts): + self._${id}_labels = (\ + % for i, lbl in all_labels: + % if lbl: + ${lbl}, \ + % else: + str(self._${id}_options[${i}], \ + % endif + % endfor + ) + % elif labels: + self._${id]_labels = ${labels} + % else: + self._${id}_map(str, self._${id}_options) + % endif + # Create the combo box + % if widget == 'combo_box': + <% + win = 'self._%s_tool_bar'%id + %>\ + ${win} = Qt.QToolBar(self) + ${win}.addWidget(Qt.QLabel(${label} + ": ")) + self._${id}_combo_box = Qt.QComboBox() + ${win}.addWidget(self._${id}_combo_box) + for label in self._${id}_labels: self._${id}_combo_box.addItem(label) + self._${id}_callback = lambda i: Qt.QMetaObject.invokeMethod(self._${id}_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._${id}_options.index(i))) + self._${id}_callback(self.${id}) + self._${id}_combo_box.currentIndexChanged.connect( + lambda i: self.set_${id}(self._${id}_options[i])) + % endif + # Create the radio buttons + % if widget == 'radio_buttons': + <% + win = 'self._%s_group_box'%id + %>\ + ${win} = QtQGroupBox(${label}) + self._${id}_box = ${orient}() + class variable_chooser_button_group(Qt.QButtonGroup): + def __init__(self, parent=None): + Qt.QButtonGroup.__init__(self, parent) + @pyqtSlot(int) + def updateButtonChecked(self, button_id): + self.button(button_id).setChecked(True) + self._${id}_button_group = variable_chooser_button_group() + ${win}.setLayout(self._${id}_box) + for i, label in enumerate(self._${id}_labels): + radio_button = Qt.QRadioButton(label) + self._${id}_box.addWidget(radio_button) + self._${id}_button_group.addButton(radio_button, i) + self._${id}_callback = lambda i: Qt.QMetaObject.invokeMethod(self._${id}_button_group, "updateButtonChecked", Qt.Q_ARG("int", self._${id}_options.index(i))) + self._${id}_callback(self.${id}) + self._${id}_button_group.buttonClicked[int].connect( + lambda i: self.set_${id}(self._${id}_options[i])) + % endif + ${gui_hint()(win)} + +documentation: |- + This block creates a variable with enumerated options. The gui widget is implemented as a combo box or radio button group. Leave the label blank to use the variable id as the label. + + Choose the number of options available to your chooser. When the label is left blank, the option will be used as the label. Set the number of options to "list" to enter a single list of options and labels. When the labels is an empty list, the options will be used as the label. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_chooser.xml b/gr-qtgui/grc/qtgui_chooser.xml deleted file mode 100644 index f79bb8ccb3..0000000000 --- a/gr-qtgui/grc/qtgui_chooser.xml +++ /dev/null @@ -1,257 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Chooser: -## A chooser, radio buttons -################################################### - --> -<block> - <name>QT GUI Chooser</name> - <key>variable_qtgui_chooser</key> - <import>from PyQt5 import Qt</import> - <import>from PyQt5.QtCore import QObject, pyqtSlot</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#slurp -#set $all_options = [$option0, $option1, $option2, $option3, $option4][:int($num_opts())] -#set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_opts())] -#if not $label() - #set $label = '"%s"'%$id -#end if -######################################################################## -## Create the options list -######################################################################## -#if int($num_opts()) -self._$(id)_options = (#slurp - #for $ch in $all_options -$ch, #slurp - #end for -) -#else -self._$(id)_options = $options -#end if -######################################################################## -## Create the labels list -######################################################################## -#if int($num_opts()) -self._$(id)_labels = (#slurp - #for i, $lbl in enumerate($all_labels) - #if $lbl() -$lbl, #slurp - #else -str(self._$(id)_options[$i]), #slurp - #end if - #end for -) -#elif $labels() -self._$(id)_labels = $labels -#else -self._$(id)_labels = map(str, self._$(id)_options) -#end if -######################################################################## -## Create the combo box -######################################################################## -#if $widget() == 'combo_box' -#set $win = 'self._%s_tool_bar'%$id -$win = Qt.QToolBar(self) -$(win).addWidget(Qt.QLabel($label+": ")) -self._$(id)_combo_box = Qt.QComboBox() -$(win).addWidget(self._$(id)_combo_box) -for label in self._$(id)_labels: self._$(id)_combo_box.addItem(label) -self._$(id)_callback = lambda i: Qt.QMetaObject.invokeMethod(self._$(id)_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._$(id)_options.index(i))) -self._$(id)_callback(self.$id) -self._$(id)_combo_box.currentIndexChanged.connect( - lambda i: self.set_$(id)(self._$(id)_options[i])) -#end if -######################################################################## -## Create the radio buttons -######################################################################## -#if $widget() == 'radio_buttons' -#set $win = 'self._%s_group_box'%$id -$win = Qt.QGroupBox($label) -self._$(id)_box = $(orient)() -class variable_chooser_button_group(Qt.QButtonGroup): - def __init__(self, parent=None): - Qt.QButtonGroup.__init__(self, parent) - @pyqtSlot(int) - def updateButtonChecked(self, button_id): - self.button(button_id).setChecked(True) -self._$(id)_button_group = variable_chooser_button_group() -$(win).setLayout(self._$(id)_box) -for i, label in enumerate(self._$(id)_labels): - radio_button = Qt.QRadioButton(label) - self._$(id)_box.addWidget(radio_button) - self._$(id)_button_group.addButton(radio_button, i) -self._$(id)_callback = lambda i: Qt.QMetaObject.invokeMethod(self._$(id)_button_group, "updateButtonChecked", Qt.Q_ARG("int", self._$(id)_options.index(i))) -self._$(id)_callback(self.$id) -self._$(id)_button_group.buttonClicked[int].connect( - lambda i: self.set_$(id)(self._$(id)_options[i])) -#end if -$(gui_hint()($win))</make> - <callback>self.set_$(id)($value)</callback> - <callback>self._$(id)_callback($id)</callback> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Type</name> - <key>type</key> - <value>int</value> - <type>enum</type> - <hide>part</hide> - <option><name>Float</name><key>real</key></option> - <option><name>Integer</name><key>int</key></option> - <option><name>String</name><key>string</key></option> - <option><name>Any</name><key>raw</key></option> - </param> - <param> - <name>Num Options</name> - <key>num_opts</key> - <value>3</value> - <type>enum</type> - <option><name>List</name><key>0</key></option> - <option><name>1</name><key>1</key></option> - <option><name>2</name><key>2</key></option> - <option><name>3</name><key>3</key></option> - <option><name>4</name><key>4</key></option> - <option><name>5</name><key>5</key></option> - </param> - <param> - <name>Default Value</name> - <key>value</key> - <value>0</value> - <type>$type</type> - </param> - <param> - <name>Options</name> - <key>options</key> - <value>[0, 1, 2]</value> - <type>raw</type> - <hide>#if int($num_opts()) then 'all' else 'none'#</hide> - </param> - <param> - <name>Labels</name> - <key>labels</key> - <value>[]</value> - <type>raw</type> - <hide>#if int($num_opts()) then 'all' else 'none'#</hide> - </param> - <param> - <name>Option 0</name> - <key>option0</key> - <value>0</value> - <type>$type</type> - <hide>#if int($num_opts()) > 0 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 0</name> - <key>label0</key> - <value></value> - <type>string</type> - <hide>$((int($num_opts()) > 0) and ($label0() and 'none' or 'part') or 'all')</hide> - </param> - <param> - <name>Option 1</name> - <key>option1</key> - <value>1</value> - <type>$type</type> - <hide>#if int($num_opts()) > 1 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 1</name> - <key>label1</key> - <value></value> - <type>string</type> - <hide>$((int($num_opts()) > 1) and ($label1() and 'none' or 'part') or 'all')</hide> - </param> - <param> - <name>Option 2</name> - <key>option2</key> - <value>2</value> - <type>$type</type> - <hide>#if int($num_opts()) > 2 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 2</name> - <key>label2</key> - <value></value> - <type>string</type> - <hide>$((int($num_opts()) > 2) and ($label2() and 'none' or 'part') or 'all')</hide> - </param> - <param> - <name>Option 3</name> - <key>option3</key> - <value>3</value> - <type>$type</type> - <hide>#if int($num_opts()) > 3 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 3</name> - <key>label3</key> - <value></value> - <type>string</type> - <hide>$((int($num_opts()) > 3) and ($label3() and 'none' or 'part') or 'all')</hide> - </param> - <param> - <name>Option 4</name> - <key>option4</key> - <value>4</value> - <type>$type</type> - <hide>#if int($num_opts()) > 4 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 4</name> - <key>label4</key> - <value></value> - <type>string</type> - <hide>$((int($num_opts()) > 4) and ($label4() and 'none' or 'part') or 'all')</hide> - </param> - <param> - <name>Widget</name> - <key>widget</key> - <value>combo_box</value> - <type>enum</type> - <hide>part</hide> - <option><name>Combo Box</name><key>combo_box</key></option> - <option><name>Radio Buttons</name><key>radio_buttons</key></option> - </param> - <param> - <name>Orientation</name> - <key>orient</key> - <value>Qt.QVBoxLayout</value> - <type>enum</type> - <hide>#if $widget() == 'radio_buttons' then 'part' else 'all'#</hide> - <option> - <name>Horizontal</name> - <key>Qt.QHBoxLayout</key> - </option> - <option> - <name>Vertical</name> - <key>Qt.QVBoxLayout</key> - </option> - </param> - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - <doc> -This block creates a variable with enumerated options. \ -The gui widget is implemented as a combo box or radio button group. \ -Leave the label blank to use the variable id as the label. - -Choose the number of options available to your chooser. \ -When the label is left blank, the option will be used as the label. \ -Set the number of options to "list" to enter a single list of options and labels. \ -When the labels is an empty list, the options will be used as the label. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_const_sink_x.block.yml b/gr-qtgui/grc/qtgui_const_sink_x.block.yml new file mode 100644 index 0000000000..af6b166df1 --- /dev/null +++ b/gr-qtgui/grc/qtgui_const_sink_x.block.yml @@ -0,0 +1,457 @@ +id: qtgui_const_sink_x +label: QT GUI Constellation Sink + +parameters: +- id: type + label: Type + dtype: enum + default: complex + options: [complex, msg_complex] + option_labels: [Complex, Complex Message] + option_attributes: + fcn: [const_sink_c, const_sink_c] + t: [complex, message] + hide: part +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: size + label: Number of Points + dtype: int + default: '1024' + hide: ${ ('all' if type.startswith('msg') else 'none') } +- id: grid + label: Grid + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: autoscale + label: Autoscale + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] +- id: ymin + label: Y min + dtype: real + default: '-2' + hide: part +- id: ymax + label: Y max + dtype: real + default: '2' + hide: part +- id: xmin + label: X min + dtype: real + default: '-2' + hide: part +- id: xmax + label: X max + dtype: real + default: '2' + hide: part +- id: nconnections + label: Number of Inputs + dtype: int + default: '1' + hide: ${ ('all' if type.startswith('msg') else 'part') } +- id: update_time + label: Update Period + dtype: real + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: tr_mode + label: Trigger Mode + category: Trigger + dtype: enum + default: qtgui.TRIG_MODE_FREE + options: [qtgui.TRIG_MODE_FREE, qtgui.TRIG_MODE_AUTO, qtgui.TRIG_MODE_NORM, qtgui.TRIG_MODE_TAG] + option_labels: [Free, Auto, Normal, Tag] + hide: part +- id: tr_slope + label: Trigger Slope + category: Trigger + dtype: enum + default: qtgui.TRIG_MODE_POS + options: [qtgui.TRIG_SLOPE_POS, qtgui.TRIG_SLOPE_NEG] + option_labels: [Positive, Negative] + hide: part +- id: tr_level + label: Trigger Level + category: Trigger + dtype: float + default: '0.0' + hide: part +- id: tr_chan + label: Trigger Channel + category: Trigger + dtype: int + default: '0' + hide: part +- id: tr_tag + label: Trigger Tag Key + category: Trigger + dtype: string + default: '""' + hide: part +- id: legend + label: Legend + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: axislabels + label: Axis Labels + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: width1 + label: Line 1 Width + category: Config + dtype: int + default: '1' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['"blue"', '"red"', '"green"', '"black"', '"cyan"', '"magenta"', '"yellow"', + '"dark red"', '"dark green"', '"Dark Blue"'] + option_labels: [Blue, Red, Green, Black, Cyan, Magenta, Yellow, Dark Red, Dark + Green, Dark Blue] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: style1 + label: Line 1 Style + category: Config + dtype: enum + options: ['0', '1', '2', '3', '4', '5'] + option_labels: [None, Solid, Dash, Dots, Dash-Dot, Dash-Dot-Dot] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: marker1 + label: Line 1 Marker + category: Config + dtype: enum + options: ['0', '1', '2', '3', '4', '6', '7', '8', '9', '-1'] + option_labels: [Circle, Rectangle, Diamond, Triangle, Down Triangle, Left Triangle, + Right Triangle, Cross, X-Cross, None] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: width2 + label: Line 2 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: style2 + label: Line 2 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: marker2 + label: Line 2 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: width3 + label: Line 3 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: style3 + label: Line 3 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: marker3 + label: Line 3 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: width4 + label: Line 4 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: style4 + label: Line 4 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: marker4 + label: Line 4 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: width5 + label: Line 5 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: style5 + label: Line 5 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: marker5 + label: Line 5 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: width6 + label: Line 6 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: style6 + label: Line 6 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: marker6 + label: Line 6 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: width7 + label: Line 7 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: style7 + label: Line 7 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: marker7 + label: Line 7 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: width8 + label: Line 8 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: style8 + label: Line 8 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: marker8 + label: Line 8 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: width9 + label: Line 9 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: style9 + label: Line 9 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: marker9 + label: Line 9 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: width10 + label: Line 10 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: style10 + label: Line 10 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: marker10 + label: Line 10 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: ${ type.t } + multiplicity: ${ (0 if type.startswith('msg') else nconnections) } + optional: true + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + import sip + callbacks: + - set_resize(${width}, ${height}) + - set_update_time(${update_time}) + - set_title(${which}, ${title}) + - set_color(${which}, ${color}) + - self.${id}.set_trigger_mode(${tr_mode}, ${tr_slope}, ${tr_level}, ${tr_chan}, + ${tr_tag}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.${type.fcn}( + ${size}, #size + ${name}, #name + ${0 if type.startswith('msg') else nconnections} #number of inputs + ) + self.${id}.set_update_time(${update_time}) + self.${id}.set_y_axis(${ymin}, ${ymax}) + self.${id}.set_x_axis(${xmin}, ${xmax}) + self.${id}.set_trigger_mode(${tr_mode}, ${tr_slope}, ${tr_level}, ${tr_chan}, ${tr_tag}) + self.${id}.enable_autoscale(${autoscale}) + self.${id}.enable_grid(${grid}) + self.${id}.enable_axis_labels(${axislabels}) + + if not ${legend}: + self.${id}.disable_legend() + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + widths = [${width1}, ${width2}, ${width3}, ${width4}, ${width5}, + ${width6}, ${width7}, ${width8}, ${width9}, ${width10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + styles = [${style1}, ${style2}, ${style3}, ${style4}, ${style5}, + ${style6}, ${style7}, ${style8}, ${style9}, ${style10}] + markers = [${marker1}, ${marker2}, ${marker3}, ${marker4}, ${marker5}, + ${marker6}, ${marker7}, ${marker8}, ${marker9}, ${marker10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + + for i in range(${1 if type.startswith('msg') else nconnections}): + if len(labels[i]) == 0: + self.${id}.set_line_label(i, "Data {0}".format(i)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id}.set_line_width(i, widths[i]) + self.${id}.set_line_color(i, colors[i]) + self.${id}.set_line_style(i, styles[i]) + self.${id}.set_line_marker(i, markers[i]) + self.${id}.set_line_alpha(i, alphas[i]) + + self._${id}_win = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint()(win)} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_const_sink_x.xml b/gr-qtgui/grc/qtgui_const_sink_x.xml deleted file mode 100644 index 10f82cce82..0000000000 --- a/gr-qtgui/grc/qtgui_const_sink_x.xml +++ /dev/null @@ -1,859 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Constellation Sink</name> - <key>qtgui_const_sink_x</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.$(type.fcn)( - $size, \#size - $name, \#name - #if $type.t == 'message' then 0 else $nconnections# \#number of inputs -) -self.$(id).set_update_time($update_time) -self.$(id).set_y_axis($ymin, $ymax) -self.$(id).set_x_axis($xmin, $xmax) -self.$(id).set_trigger_mode($tr_mode, $tr_slope, $tr_level, $tr_chan, $tr_tag) -self.$(id).enable_autoscale($autoscale) -self.$(id).enable_grid($grid) -self.$(id).enable_axis_labels($axislabels) - -if not $legend: - self.$(id).disable_legend() - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -widths = [$width1, $width2, $width3, $width4, $width5, - $width6, $width7, $width8, $width9, $width10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -styles = [$style1, $style2, $style3, $style4, $style5, - $style6, $style7, $style8, $style9, $style10] -markers = [$marker1, $marker2, $marker3, $marker4, $marker5, - $marker6, $marker7, $marker8, $marker9, $marker10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] -for i in xrange(#if $type.t == 'message' then 1 else $nconnections#): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_line_width(i, widths[i]) - self.$(id).set_line_color(i, colors[i]) - self.$(id).set_line_style(i, styles[i]) - self.$(id).set_line_marker(i, markers[i]) - self.$(id).set_line_alpha(i, alphas[i]) - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - <callback>set_resize($width, $height)</callback> - <callback>set_update_time($update_time)</callback> - <callback>set_title($which, $title)</callback> - <callback>set_color($which, $color)</callback> - <callback>self.$(id).set_trigger_mode($tr_mode, $tr_slope, $tr_level, $tr_chan, $tr_tag)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Trigger</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:const_sink_c</opt> - <opt>t:complex</opt> - </option> - <option> - <name>Complex Message</name> - <key>msg_complex</key> - <opt>fcn:const_sink_c</opt> - <opt>t:message</opt> - </option> - </param> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>Number of Points</name> - <key>size</key> - <value>1024</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'none'#</hide> - </param> - - <param> - <name>Grid</name> - <key>grid</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Autoscale</name> - <key>autoscale</key> - <value>False</value> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Y min</name> - <key>ymin</key> - <value>-2</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Y max</name> - <key>ymax</key> - <value>2</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>X min</name> - <key>xmin</key> - <value>-2</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>X max</name> - <key>xmax</key> - <value>2</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'part'#</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - - <param> - <name>Trigger Mode</name> - <key>tr_mode</key> - <value>qtgui.TRIG_MODE_FREE</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Free</name> - <key>qtgui.TRIG_MODE_FREE</key> - </option> - <option> - <name>Auto</name> - <key>qtgui.TRIG_MODE_AUTO</key> - </option> - <option> - <name>Normal</name> - <key>qtgui.TRIG_MODE_NORM</key> - </option> - <option> - <name>Tag</name> - <key>qtgui.TRIG_MODE_TAG</key> - </option> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Slope</name> - <key>tr_slope</key> - <value>qtgui.TRIG_MODE_POS</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Positive</name> - <key>qtgui.TRIG_SLOPE_POS</key> - </option> - <option> - <name>Negative</name> - <key>qtgui.TRIG_SLOPE_NEG</key> - </option> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Level</name> - <key>tr_level</key> - <value>0.0</value> - <type>float</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Channel</name> - <key>tr_chan</key> - <value>0</value> - <type>int</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Tag Key</name> - <key>tr_tag</key> - <value>""</value> - <type>string</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - - - <!-- Begin Config Tab items --> - <param> - <name>Legend</name> - <key>legend</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Axis Labels</name> - <key>axislabels</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Width</name> - <key>width1</key> - <value>1</value> - <type>int</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Blue</name> - <key>"blue"</key> - </option> - <option> - <name>Red</name> - <key>"red"</key> - </option> - <option> - <name>Green</name> - <key>"green"</key> - </option> - <option> - <name>Black</name> - <key>"black"</key> - </option> - <option> - <name>Cyan</name> - <key>"cyan"</key> - </option> - <option> - <name>Magenta</name> - <key>"magenta"</key> - </option> - <option> - <name>Yellow</name> - <key>"yellow"</key> - </option> - <option> - <name>Dark Red</name> - <key>"dark red"</key> - </option> - <option> - <name>Dark Green</name> - <key>"dark green"</key> - </option> - <option> - <name>Dark Blue</name> - <key>"Dark Blue"</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Style</name> - <key>style1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>None</name> - <key>0</key> - </option> - <option> - <name>Solid</name> - <key>1</key> - </option> - <option> - <name>Dash</name> - <key>2</key> - </option> - <option> - <name>Dots</name> - <key>3</key> - </option> - <option> - <name>Dash-Dot</name> - <key>4</key> - </option> - <option> - <name>Dash-Dot-Dot</name> - <key>5</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Marker</name> - <key>marker1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Circle</name> - <key>0</key> - </option> - <option> - <name>Rectangle</name> - <key>1</key> - </option> - <option> - <name>Diamond</name> - <key>2</key> - </option> - <option> - <name>Triangle</name> - <key>3</key> - </option> - <option> - <name>Down Triangle</name> - <key>4</key> - </option> - <option> - <name>Left Triangle</name> - <key>6</key> - </option> - <option> - <name>Right Triangle</name> - <key>7</key> - </option> - <option> - <name>Cross</name> - <key>8</key> - </option> - <option> - <name>X-Cross</name> - <key>9</key> - </option> - <option> - <name>None</name> - <key>-1</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 2 Width</name> - <key>width2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 2 Style</name> - <key>style2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 2 Marker</name> - <key>marker2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 3 Width</name> - <key>width3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 3 Style</name> - <key>style3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 3 Marker</name> - <key>marker3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 4 Width</name> - <key>width4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 4 Style</name> - <key>style4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 4 Marker</name> - <key>marker4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 5 Width</name> - <key>width5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 5 Style</name> - <key>style5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 5 Marker</name> - <key>marker5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 6 Width</name> - <key>width6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 6 Style</name> - <key>style6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 6 Marker</name> - <key>marker6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 7 Width</name> - <key>width7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 7 Style</name> - <key>style7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 7 Marker</name> - <key>marker7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 8 Width</name> - <key>width8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 8 Style</name> - <key>style8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 8 Marker</name> - <key>marker8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 9 Width</name> - <key>width9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 9 Style</name> - <key>style9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 9 Marker</name> - <key>marker9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 10 Width</name> - <key>width10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 10 Style</name> - <key>style10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 10 Marker</name> - <key>marker10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - - <sink> - <name>in</name> - <type>$type.t</type> - <nports>#if $type.t == 'message' then 0 else $nconnections#</nports> - <optional>1</optional> - </sink> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_edit_box_msg.block.yml b/gr-qtgui/grc/qtgui_edit_box_msg.block.yml new file mode 100644 index 0000000000..37aa0ce071 --- /dev/null +++ b/gr-qtgui/grc/qtgui_edit_box_msg.block.yml @@ -0,0 +1,69 @@ +id: qtgui_edit_box_msg +label: QT GUI Message Edit Box + +parameters: +- id: type + label: Type + dtype: enum + default: string + options: [string, int, float, double, complex, int_vec, flt_vec, dbl_vec, cpx_vec] + option_labels: [String, Int, Float, Double, Complex, Int (Vec), Float (Vec), Double + (Vec), Complex (Vec)] + option_attributes: + t: [qtgui.STRING, qtgui.INT, qtgui.FLOAT, qtgui.DOUBLE, qtgui.COMPLEX, qtgui.INT_VEC, + qtgui.FLOAT_VEC, qtgui.DOUBLE_VEC, qtgui.COMPLEX_VEC] +- id: value + label: Value + dtype: string +- id: label + label: Label + dtype: string +- id: is_pair + label: Pair Mode + dtype: enum + default: 'True' + options: ['False', 'True'] +- id: is_static + label: Static Mode + dtype: enum + default: 'True' + options: ['False', 'True'] +- id: key + label: Key + dtype: string + hide: ${ ('none' if is_pair == 'True' else 'all') } +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part + +asserts: +- ${(is_pair and is_static and len(key) > 0) or not (is_pair and is_static)} + +inputs: +- domain: message + id: val + optional: true + +outputs: +- domain: message + id: msg + optional: true + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + import sip + make: + <% + win = 'self._%s_win'%id + %>\ + qtgui.edit_box_msg(${type.t)}, ${value}, ${label}, ${is_pair}, ${is_static}, ${key}) + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint()(win)} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_edit_box_msg.xml b/gr-qtgui/grc/qtgui_edit_box_msg.xml deleted file mode 100644 index d77a4b3e1b..0000000000 --- a/gr-qtgui/grc/qtgui_edit_box_msg.xml +++ /dev/null @@ -1,152 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Edit Box that sends messages -################################################### - --> -<block> - <name>QT GUI Message Edit Box</name> - <key>qtgui_edit_box_msg</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.edit_box_msg($(type.t), $value, $label, $is_pair, $is_static, $key) -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - - <param> - <name>Type</name> - <key>type</key> - <value>string</value> - <type>enum</type> - <option> - <name>String</name> - <key>string</key> - <opt>t:qtgui.STRING</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>t:qtgui.INT</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>t:qtgui.FLOAT</opt> - </option> - <option> - <name>Double</name> - <key>double</key> - <opt>t:qtgui.DOUBLE</opt> - </option> - <option> - <name>Complex</name> - <key>complex</key> - <opt>t:qtgui.COMPLEX</opt> - </option> - <option> - <name>Int (Vec)</name> - <key>int_vec</key> - <opt>t:qtgui.INT_VEC</opt> - </option> - <option> - <name>Float (Vec)</name> - <key>flt_vec</key> - <opt>t:qtgui.FLOAT_VEC</opt> - </option> - <option> - <name>Double (Vec)</name> - <key>dbl_vec</key> - <opt>t:qtgui.DOUBLE_VEC</opt> - </option> - <option> - <name>Complex (Vec)</name> - <key>cpx_vec</key> - <opt>t:qtgui.COMPLEX_VEC</opt> - </option> - </param> - - <param> - <name>Value</name> - <key>value</key> - <value></value> - <type>string</type> - </param> - - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - </param> - - <param> - <name>Pair Mode</name> - <key>is_pair</key> - <value>True</value> - <type>enum</type> - <option> - <name>False</name> - <key>False</key> - </option> - <option> - <name>True</name> - <key>True</key> - </option> - </param> - - <param> - <name>Static Mode</name> - <key>is_static</key> - <value>True</value> - <type>enum</type> - <option> - <name>False</name> - <key>False</key> - </option> - <option> - <name>True</name> - <key>True</key> - </option> - </param> - - <param> - <name>Key</name> - <key>key</key> - <value></value> - <type>string</type> - <hide>#if $is_pair() == 'True' then 'none' else 'all'#</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <!-- If both is_pair and is_static are True, we require a default key. - If either or both are false, we don't care about a default key. - --> - <check>($is_pair and $is_static and len($key) > 0) or not ($is_pair and $is_static)</check> - - <sink> - <name>val</name> - <type>message</type> - <optional>1</optional> - </sink> - - <source> - <name>msg</name> - <type>message</type> - <optional>1</optional> - </source> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_entry.block.yml b/gr-qtgui/grc/qtgui_entry.block.yml new file mode 100644 index 0000000000..25b7bcf33f --- /dev/null +++ b/gr-qtgui/grc/qtgui_entry.block.yml @@ -0,0 +1,57 @@ +id: variable_qtgui_entry +label: QT GUI Entry + +parameters: +- id: label + label: Label + dtype: string + hide: ${ ('none' if label else 'part') } +- id: type + label: Type + dtype: enum + default: int + options: [real, int, string, bool, raw] + option_labels: [Float, Integer, String, Boolean, Any] + option_attributes: + conv: [eng_notation.str_to_num, int, str, bool, eval] + str: [eng_notation.num_to_str, str, str, str, repr] + hide: part +- id: value + label: Default Value + dtype: ${ type } + default: '0' +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +value: ${ value } + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import eng_notation + var_make: self.${id} = ${id} = ${value} + callbacks: + - self.set_${id}(${value}) + - Qt.QMetaObject.invokeMethod(self._${id}_line_edit, "setText", Qt.Q_ARG("QString", + ${type.str}(${id}))) + make: |- + <% + win = 'self._%s_tool_bar'%id + if not label: + label = '"%s"'%id + %> + ${win} = Qt.QToolBar(self) + ${win}.addWidget(Qt.QLabel(${label}+": ")) + self._${id}_line_edit = Qt.QLineEdit(str(self.${id})) + self._${id}_tool_bar.addWidget(self._${id}_line_edit) + self._${id}_line_edit.returnPressed.connect( + lambda: self.set_${id}(${type.conv}(str(self._${id}_line_edit.text().toAscii())))) + ${gui_hint()(win)} + +documentation: |- + This block creates a variable with a text entry box. Leave the label blank to use the variable id as the label. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_entry.xml b/gr-qtgui/grc/qtgui_entry.xml deleted file mode 100644 index fc0f4089d1..0000000000 --- a/gr-qtgui/grc/qtgui_entry.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Text Entry: -## a gui text box form -################################################### - --> -<block> - <name>QT GUI Entry</name> - <key>variable_qtgui_entry</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import eng_notation</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $win = 'self._%s_tool_bar'%$id -$win = Qt.QToolBar(self) -#if not $label() - #set $label = '"%s"'%$id -#end if -$(win).addWidget(Qt.QLabel($label+": ")) -self._$(id)_line_edit = Qt.QLineEdit(str(self.$id)) -self._$(id)_tool_bar.addWidget(self._$(id)_line_edit) -self._$(id)_line_edit.returnPressed.connect( - lambda: self.set_$(id)($(type.conv)(str(self._$(id)_line_edit.text().toAscii())))) -$(gui_hint()($win))</make> - <callback>self.set_$(id)($value)</callback> - <callback>Qt.QMetaObject.invokeMethod(self._$(id)_line_edit, "setText", Qt.Q_ARG("QString", $(type.str)($id)))</callback> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Type</name> - <key>type</key> - <value>int</value> - <type>enum</type> - <hide>part</hide> - <option><name>Float</name><key>real</key><opt>conv:eng_notation.str_to_num</opt><opt>str:eng_notation.num_to_str</opt></option> - <option><name>Integer</name><key>int</key><opt>conv:int</opt><opt>str:str</opt></option> - <option><name>String</name><key>string</key><opt>conv:str</opt><opt>str:str</opt></option> - <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt><opt>str:str</opt></option> - <option><name>Any</name><key>raw</key><opt>conv:eval</opt><opt>str:repr</opt></option> - </param> - <param> - <name>Default Value</name> - <key>value</key> - <value>0</value> - <type>$type</type> - </param> - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - <doc> -This block creates a variable with a text entry box. \ -Leave the label blank to use the variable id as the label. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_freq_sink_x.block.yml b/gr-qtgui/grc/qtgui_freq_sink_x.block.yml new file mode 100644 index 0000000000..d935f04c4e --- /dev/null +++ b/gr-qtgui/grc/qtgui_freq_sink_x.block.yml @@ -0,0 +1,447 @@ +id: qtgui_freq_sink_x +label: QT GUI Frequency Sink + +parameters: +- id: type + label: Type + dtype: enum + default: complex + options: [complex, float, msg_complex, msg_float] + option_labels: [Complex, Float, Complex Message, Float Message] + option_attributes: + fcn: [freq_sink_c, freq_sink_f, freq_sink_c, freq_sink_f] + t: [complex, float, message, message] + hide: part +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: fftsize + label: FFT Size + dtype: int + default: '1024' + hide: ${ ('all' if (type == 'msg_complex' or type == 'msg_float') else 'none') } +- id: freqhalf + label: Spectrum Width + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: [Full, Half] + hide: ${ ('part' if type == "float" or type == "msg_float" else 'all') } +- id: wintype + label: Window Type + dtype: enum + default: firdes.WIN_BLACKMAN_hARRIS + options: [firdes.WIN_BLACKMAN_hARRIS, firdes.WIN_HAMMING, firdes.WIN_HANN, firdes.WIN_BLACKMAN, + firdes.WIN_RECTANGULAR, firdes.WIN_KAISER, firdes.WIN_FLATTOP] + option_labels: [Blackman-harris, Hamming, Hann, Blackman, Rectangular, Kaiser, + Flat-top] + hide: part +- id: fc + label: Center Frequency (Hz) + dtype: real + default: '0' +- id: bw + label: Bandwidth (Hz) + dtype: real + default: samp_rate +- id: grid + label: Grid + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: autoscale + label: Autoscale + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: average + label: Average + dtype: enum + default: 'False' + options: ['1.0', '0.2', '0.1', '0.05'] + option_labels: [None, Low, Medium, High] + hide: part +- id: ymin + label: Y min + dtype: real + default: '-140' + hide: part +- id: ymax + label: Y max + dtype: real + default: '10' + hide: part +- id: label + label: Y label + dtype: string + default: Relative Gain + hide: part +- id: units + label: Y units + dtype: string + default: dB + hide: part +- id: nconnections + label: Number of Inputs + dtype: int + default: '1' + hide: ${ ('all' if (type == 'msg_complex' or type == 'msg_float') else 'part') } +- id: update_time + label: Update Period + dtype: real + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: showports + label: Show Msg Ports + dtype: enum + default: 'True' + options: ['False', 'True'] + option_labels: ['Yes', 'No'] + hide: part +- id: tr_mode + label: Trigger Mode + category: Trigger + dtype: enum + default: qtgui.TRIG_MODE_FREE + options: [qtgui.TRIG_MODE_FREE, qtgui.TRIG_MODE_AUTO, qtgui.TRIG_MODE_NORM, qtgui.TRIG_MODE_TAG] + option_labels: [Free, Auto, Normal, Tag] + hide: part +- id: tr_level + label: Trigger Level + category: Trigger + dtype: float + default: '0.0' + hide: part +- id: tr_chan + label: Trigger Channel + category: Trigger + dtype: int + default: '0' + hide: part +- id: tr_tag + label: Trigger Tag Key + category: Trigger + dtype: string + default: '""' + hide: part +- id: ctrlpanel + label: Control Panel + category: Config + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: legend + label: Legend + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: axislabels + label: Axis Labels + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: width1 + label: Line 1 Width + category: Config + dtype: int + default: '1' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['"blue"', '"red"', '"green"', '"black"', '"cyan"', '"magenta"', '"yellow"', + '"dark red"', '"dark green"', '"dark blue"'] + option_labels: [Blue, Red, Green, Black, Cyan, Magenta, Yellow, Dark Red, Dark + Green, Dark Blue] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: width2 + label: Line 2 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: width3 + label: Line 3 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + default: '"green"' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: width4 + label: Line 4 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + default: '"black"' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: width5 + label: Line 5 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + default: '"cyan"' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: width6 + label: Line 6 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + default: '"magenta"' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: width7 + label: Line 7 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + default: '"yellow"' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: width8 + label: Line 8 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + default: '"dark red"' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: width9 + label: Line 9 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + default: '"dark green"' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: width10 + label: Line 10 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + default: '"dark blue"' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: ${ type.t } + multiplicity: ${ (0 if (type == 'msg_complex' or type == 'msg_float') else nconnections) } + optional: true +- domain: message + id: freq + optional: true + hide: ${ showports } + +outputs: +- domain: message + id: freq + optional: true + hide: ${ showports } + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + from gnuradio.filter import firdes + import sip + callbacks: + - set_frequency_range(${fc}, ${bw}) + - set_update_time(${update_time}) + - set_y_axis(${ymin}, ${ymax}) + - self.${id}.set_trigger_mode(${tr_mode}, ${tr_level}, ${tr_chan}, ${tr_tag}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.${type.fcn}( + ${fftsize}, #size + ${wintype}, #wintype + ${fc}, #fc + ${bw}, #bw + ${name}, #name + ${ 0 if (type == 'msg_complex' or type == 'msg_float') else nconnections } + ) + self.${id}.set_update_time(${update_time}) + self.${id}.set_y_axis(${ymin}, ${ymax}) + self.${id}.set_y_label(${label}, ${units}) + self.${id}.set_trigger_mode(${tr_mode}, ${tr_level}, ${tr_chan}, ${tr_tag}) + self.${id}.enable_autoscale(${autoscale}) + self.${id}.enable_grid(${grid}) + self.${id}.set_fft_average(${average}) + self.${id}.enable_axis_labels(${axislabels}) + self.${id}.enable_control_panel(${ctrlpanel}) + + if not ${legend}: + self.${id}.disable_legend() + + if ${type} == "float" or ${type} == "msg_float": + self.${id}.set_plot_pos_half(not ${freqhalf}) + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + widths = [${width1}, ${width2}, ${width3}, ${width4}, ${width5}, + ${width6}, ${width7}, ${width8}, ${width9}, ${width10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + + for i in range(${1 if (type == 'msg_complex' or type == 'msg_float') else nconnections}): + if len(labels[i]) == 0: + self.${id}.set_line_label(i, "Data {0}".format(i)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id}.set_line_width(i, widths[i]) + self.${id}.set_line_color(i, colors[i]) + self.${id}.set_line_alpha(i, alphas[i]) + + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${ gui_hint()(win)} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_freq_sink_x.xml b/gr-qtgui/grc/qtgui_freq_sink_x.xml deleted file mode 100644 index ed39db7781..0000000000 --- a/gr-qtgui/grc/qtgui_freq_sink_x.xml +++ /dev/null @@ -1,791 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Frequency Sink</name> - <key>qtgui_freq_sink_x</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>from gnuradio.filter import firdes</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.$(type.fcn)( - $fftsize, \#size - $wintype, \#wintype - $fc, \#fc - $bw, \#bw - $name, \#name - #if $type.t == 'message' then 0 else $nconnections# \#number of inputs -) -self.$(id).set_update_time($update_time) -self.$(id).set_y_axis($ymin, $ymax) -self.$(id).set_y_label($label, $units) -self.$(id).set_trigger_mode($tr_mode, $tr_level, $tr_chan, $tr_tag) -self.$(id).enable_autoscale($autoscale) -self.$(id).enable_grid($grid) -self.$(id).set_fft_average($average) -self.$(id).enable_axis_labels($axislabels) -self.$(id).enable_control_panel($ctrlpanel) - -if not $legend: - self.$(id).disable_legend() - -if "$type" == "float" or "$type" == "msg_float": - self.$(id).set_plot_pos_half(not $freqhalf) - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -widths = [$width1, $width2, $width3, $width4, $width5, - $width6, $width7, $width8, $width9, $width10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] -for i in xrange(#if $type.t == 'message' then 1 else $nconnections#): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_line_width(i, widths[i]) - self.$(id).set_line_color(i, colors[i]) - self.$(id).set_line_alpha(i, alphas[i]) - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - <callback>set_frequency_range($fc, $bw)</callback> - <callback>set_update_time($update_time)</callback> - <callback>set_title($which, $title)</callback> - <callback>set_color($which, $color)</callback> - <callback>set_y_axis($ymin, $ymax)</callback> - <callback>self.$(id).set_trigger_mode($tr_mode, $tr_level, $tr_chan, $tr_tag)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Trigger</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:freq_sink_c</opt> - <opt>t:complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:freq_sink_f</opt> - <opt>t:float</opt> - </option> - <option> - <name>Complex Message</name> - <key>msg_complex</key> - <opt>fcn:freq_sink_c</opt> - <opt>t:message</opt> - </option> - <option> - <name>Float Message</name> - <key>msg_float</key> - <opt>fcn:freq_sink_f</opt> - <opt>t:message</opt> - </option> - </param> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>FFT Size</name> - <key>fftsize</key> - <value>1024</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'none'#</hide> - </param> - - <param> - <name>Spectrum Width</name> - <key>freqhalf</key> - <value>True</value> - <type>enum</type> - <hide>#if $type() == "float" or $type() == "msg_float" then 'part' else 'all'#</hide> - <option> - <name>Full</name> - <key>True</key> - </option> - <option> - <name>Half</name> - <key>False</key> - </option> - </param> - - <param> - <name>Window Type</name> - <key>wintype</key> - <value>firdes.WIN_BLACKMAN_hARRIS</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Blackman-harris</name> - <key>firdes.WIN_BLACKMAN_hARRIS</key> - </option> - <option> - <name>Hamming</name> - <key>firdes.WIN_HAMMING</key> - </option> - <option> - <name>Hann</name> - <key>firdes.WIN_HANN</key> - </option> - <option> - <name>Blackman</name> - <key>firdes.WIN_BLACKMAN</key> - </option> - <option> - <name>Rectangular</name> - <key>firdes.WIN_RECTANGULAR</key> - </option> - <option> - <name>Kaiser</name> - <key>firdes.WIN_KAISER</key> - </option> - <option> - <name>Flat-top</name> - <key>firdes.WIN_FLATTOP</key> - </option> - </param> - - <param> - <name>Center Frequency (Hz)</name> - <key>fc</key> - <value>0</value> - <type>real</type> - </param> - - <param> - <name>Bandwidth (Hz)</name> - <key>bw</key> - <value>samp_rate</value> - <type>real</type> - </param> - - <param> - <name>Grid</name> - <key>grid</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Autoscale</name> - <key>autoscale</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Average</name> - <key>average</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>None</name> - <key>1.0</key> - </option> - <option> - <name>Low</name> - <key>0.2</key> - </option> - <option> - <name>Medium</name> - <key>0.1</key> - </option> - <option> - <name>High</name> - <key>0.05</key> - </option> - </param> - - <param> - <name>Y min</name> - <key>ymin</key> - <value>-140</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Y max</name> - <key>ymax</key> - <value>10</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Y label</name> - <key>label</key> - <value>Relative Gain</value> - <type>string</type> - <hide>part</hide> - </param> - - <param> - <name>Y units</name> - <key>units</key> - <value>dB</value> - <type>string</type> - <hide>part</hide> - </param> - - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'part'#</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <param> - <name>Show Msg Ports</name> - <key>showports</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>False</key> - </option> - <option> - <name>No</name> - <key>True</key> - </option> - </param> - - - <!-- Begin Trigger Tab items --> - <param> - <name>Trigger Mode</name> - <key>tr_mode</key> - <value>qtgui.TRIG_MODE_FREE</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Free</name> - <key>qtgui.TRIG_MODE_FREE</key> - </option> - <option> - <name>Auto</name> - <key>qtgui.TRIG_MODE_AUTO</key> - </option> - <option> - <name>Normal</name> - <key>qtgui.TRIG_MODE_NORM</key> - </option> - <option> - <name>Tag</name> - <key>qtgui.TRIG_MODE_TAG</key> - </option> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Level</name> - <key>tr_level</key> - <value>0.0</value> - <type>float</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Channel</name> - <key>tr_chan</key> - <value>0</value> - <type>int</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Tag Key</name> - <key>tr_tag</key> - <value>""</value> - <type>string</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - - - <!-- Begin Config Tab items --> - <param> - <name>Control Panel</name> - <key>ctrlpanel</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Legend</name> - <key>legend</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Axis Labels</name> - <key>axislabels</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Width</name> - <key>width1</key> - <value>1</value> - <type>int</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Blue</name> - <key>"blue"</key> - </option> - <option> - <name>Red</name> - <key>"red"</key> - </option> - <option> - <name>Green</name> - <key>"green"</key> - </option> - <option> - <name>Black</name> - <key>"black"</key> - </option> - <option> - <name>Cyan</name> - <key>"cyan"</key> - </option> - <option> - <name>Magenta</name> - <key>"magenta"</key> - </option> - <option> - <name>Yellow</name> - <key>"yellow"</key> - </option> - <option> - <name>Dark Red</name> - <key>"dark red"</key> - </option> - <option> - <name>Dark Green</name> - <key>"dark green"</key> - </option> - <option> - <name>Dark Blue</name> - <key>"dark blue"</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 2 Width</name> - <key>width2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 3 Width</name> - <key>width3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <value>"green"</value> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 4 Width</name> - <key>width4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <value>"black"</value> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 5 Width</name> - <key>width5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <value>"cyan"</value> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 6 Width</name> - <key>width6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <value>"magenta"</value> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 7 Width</name> - <key>width7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <value>"yellow"</value> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 8 Width</name> - <key>width8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <value>"dark red"</value> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 9 Width</name> - <key>width9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <value>"dark green"</value> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 10 Width</name> - <key>width10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <value>"dark blue"</value> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - - <sink> - <name>in</name> - <type>$type.t</type> - <nports>#if $type.t == 'message' then 0 else $nconnections#</nports> - <optional>1</optional> - </sink> - - <sink> - <name>freq</name> - <type>message</type> - <optional>1</optional> - <hide>$showports</hide> - </sink> - - <source> - <name>freq</name> - <type>message</type> - <optional>1</optional> - <hide>$showports</hide> - </source> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_histogram_sink_x.block.yml b/gr-qtgui/grc/qtgui_histogram_sink_x.block.yml new file mode 100644 index 0000000000..e1451144c2 --- /dev/null +++ b/gr-qtgui/grc/qtgui_histogram_sink_x.block.yml @@ -0,0 +1,419 @@ +id: qtgui_histogram_sink_x +label: QT GUI Histogram Sink + +parameters: +- id: type + label: Type + dtype: enum + default: float + options: [float, msg_float] + option_labels: [Float, Float Message] + option_attributes: + fcn: [histogram_sink_f, histogram_sink_f] + t: [float, message] + hide: part +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: size + label: Number of Points + dtype: int + default: '1024' + hide: ${ ('all' if type.startwith('msg') else 'none') } +- id: bins + label: Number of Bins + dtype: int + default: '100' +- id: grid + label: Grid + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: autoscale + label: Autoscale + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] +- id: accum + label: Accumulate + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] +- id: xmin + label: Min x-axis + dtype: real + default: '-1' +- id: xmax + label: Max x-axis + dtype: real + default: '1' +- id: nconnections + label: Number of Inputs + dtype: int + default: '1' + hide: ${ ('all' if type.startwith('msg') else 'part') } +- id: update_time + label: Update Period + dtype: float + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: legend + label: Legend + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: axislabels + label: Axis Labels + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: width1 + label: Line 1 Width + category: Config + dtype: int + default: '1' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['"blue"', '"red"', '"green"', '"black"', '"cyan"', '"magenta"', '"yellow"', + '"dark red"', '"dark green"', '"dark blue"'] + option_labels: [Blue, Red, Green, Black, Cyan, Magenta, Yellow, Dark Red, Dark + Green, Dark Blue] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: style1 + label: Line 1 Style + category: Config + dtype: enum + options: ['1', '2', '3', '4', '5', '0'] + option_labels: [Solid, Dash, Dots, Dash-Dot, Dash-Dot-Dot, None] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: marker1 + label: Line 1 Marker + category: Config + dtype: enum + options: ['-1', '0', '1', '2', '3', '4', '6', '7', '8', '9'] + option_labels: [None, Circle, Rectangle, Diamond, Triangle, Down Triangle, Left + Triangle, Right Triangle, Cross, X-Cross] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: width2 + label: Line 2 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: style2 + label: Line 2 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: marker2 + label: Line 2 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: width3 + label: Line 3 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + default: '"green"' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: style3 + label: Line 3 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: marker3 + label: Line 3 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: width4 + label: Line 4 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + default: '"black"' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: style4 + label: Line 4 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: marker4 + label: Line 4 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: width5 + label: Line 5 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + default: '"cyan"' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: style5 + label: Line 5 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: marker5 + label: Line 5 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: width6 + label: Line 6 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + default: '"magenta"' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: style6 + label: Line 6 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: marker6 + label: Line 6 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: width7 + label: Line 7 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + default: '"yellow"' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: style7 + label: Line 7 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: marker7 + label: Line 7 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: width8 + label: Line 8 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + default: '"dark red"' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: style8 + label: Line 8 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: marker8 + label: Line 8 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: width9 + label: Line 9 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + default: '"dark green"' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: style9 + label: Line 9 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: marker9 + label: Line 9 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: width10 + label: Line 10 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + default: '"dark blue"' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: style10 + label: Line 10 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: marker10 + label: Line 10 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: ${ type.t } + multiplicity: ${ (0 if type.startswith('msg') else nconnections) } + optional: true + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + import sip + callbacks: + - set_update_time(${update_time}) + - set_title(${which}, ${title}) + - set_color(${which}, ${color}) + - set_bins(${bins}) + - set_bins(${bins}) + - set_x_axis(${xmin}, ${xmax}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.histogram_sink_f( + $size, + $bins, + $xmin, + $xmax, + $name, + ${ 0 if type.startswith('msg') else nconnections} + ) + + self.${id}.set_update_time(${update_time}) + self.${id}.enable_autoscale(${autoscale}) + self.${id}.enable_accumulate(${accum}) + self.${id}.enable_grid(${grid}) + self.${id}.enable_axis_labels(${axislabels}) + + if not ${legend}: + self.${id}.disable_legend() + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + widths = [${width1}, ${width2}, ${width3}, ${width4}, ${width5}, + ${width6}, ${width7}, ${width8}, ${width9}, ${width10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + + for i in range(${1 if type.startswith('msg') else nconnections}): + if len(labels[i]) == 0: + self.${id}.set_line_label(i, "Data {0}".format(i)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id}.set_line_width(i, widths[i]) + self.${id}.set_line_color(i, colors[i]) + self.${id}.set_line_style(i, styles[i]) + self.${id}.set_line_marker(i, markers[i]) + self.${id}.set_line_alpha(i, alphas[i]) + + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint()(win)} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_histogram_sink_x.xml b/gr-qtgui/grc/qtgui_histogram_sink_x.xml deleted file mode 100644 index 9e3dcb104f..0000000000 --- a/gr-qtgui/grc/qtgui_histogram_sink_x.xml +++ /dev/null @@ -1,794 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Histogram Sink -################################################### - --> -<block> - <name>QT GUI Histogram Sink</name> - <key>qtgui_histogram_sink_x</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.histogram_sink_f( - $size, - $bins, - $xmin, - $xmax, - $name, - #if $type.t == 'message' then 0 else $nconnections# -) - -self.$(id).set_update_time($update_time) -self.$(id).enable_autoscale($autoscale) -self.$(id).enable_accumulate($accum) -self.$(id).enable_grid($grid) -self.$(id).enable_axis_labels($axislabels) - -if not $legend: - self.$(id).disable_legend() - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -widths = [$width1, $width2, $width3, $width4, $width5, - $width6, $width7, $width8, $width9, $width10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -styles = [$style1, $style2, $style3, $style4, $style5, - $style6, $style7, $style8, $style9, $style10] -markers = [$marker1, $marker2, $marker3, $marker4, $marker5, - $marker6, $marker7, $marker8, $marker9, $marker10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] -for i in xrange(#if $type.t == 'message' then 1 else $nconnections#): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_line_width(i, widths[i]) - self.$(id).set_line_color(i, colors[i]) - self.$(id).set_line_style(i, styles[i]) - self.$(id).set_line_marker(i, markers[i]) - self.$(id).set_line_alpha(i, alphas[i]) - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win)) - </make> - <callback>set_update_time($update_time)</callback> - <callback>set_title($which, $title)</callback> - <callback>set_color($which, $color)</callback> - <callback>set_bins($bins)</callback> - <callback>set_bins($bins)</callback> - <callback>set_x_axis($xmin, $xmax)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Type</name> - <key>type</key> - <value>float</value> - <type>enum</type> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:histogram_sink_f</opt> - <opt>t:float</opt> - </option> - <option> - <name>Float Message</name> - <key>msg_float</key> - <opt>fcn:histogram_sink_f</opt> - <opt>t:message</opt> - </option> - </param> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>Number of Points</name> - <key>size</key> - <value>1024</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'none'#</hide> - </param> - - <param> - <name>Number of Bins</name> - <key>bins</key> - <value>100</value> - <type>int</type> - </param> - - <param> - <name>Grid</name> - <key>grid</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Autoscale</name> - <key>autoscale</key> - <value>True</value> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Accumulate</name> - <key>accum</key> - <value>False</value> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Min x-axis</name> - <key>xmin</key> - <value>-1</value> - <type>real</type> - </param> - - <param> - <name>Max x-axis</name> - <key>xmax</key> - <value>1</value> - <type>real</type> - </param> - - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'part'#</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>float</type> - <hide>part</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <!-- Begin Config Tab items --> - <param> - <name>Legend</name> - <key>legend</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Axis Labels</name> - <key>axislabels</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Width</name> - <key>width1</key> - <value>1</value> - <type>int</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Blue</name> - <key>"blue"</key> - </option> - <option> - <name>Red</name> - <key>"red"</key> - </option> - <option> - <name>Green</name> - <key>"green"</key> - </option> - <option> - <name>Black</name> - <key>"black"</key> - </option> - <option> - <name>Cyan</name> - <key>"cyan"</key> - </option> - <option> - <name>Magenta</name> - <key>"magenta"</key> - </option> - <option> - <name>Yellow</name> - <key>"yellow"</key> - </option> - <option> - <name>Dark Red</name> - <key>"dark red"</key> - </option> - <option> - <name>Dark Green</name> - <key>"dark green"</key> - </option> - <option> - <name>Dark Blue</name> - <key>"dark blue"</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Style</name> - <key>style1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Solid</name> - <key>1</key> - </option> - <option> - <name>Dash</name> - <key>2</key> - </option> - <option> - <name>Dots</name> - <key>3</key> - </option> - <option> - <name>Dash-Dot</name> - <key>4</key> - </option> - <option> - <name>Dash-Dot-Dot</name> - <key>5</key> - </option> - <option> - <name>None</name> - <key>0</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Marker</name> - <key>marker1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>None</name> - <key>-1</key> - </option> - <option> - <name>Circle</name> - <key>0</key> - </option> - <option> - <name>Rectangle</name> - <key>1</key> - </option> - <option> - <name>Diamond</name> - <key>2</key> - </option> - <option> - <name>Triangle</name> - <key>3</key> - </option> - <option> - <name>Down Triangle</name> - <key>4</key> - </option> - <option> - <name>Left Triangle</name> - <key>6</key> - </option> - <option> - <name>Right Triangle</name> - <key>7</key> - </option> - <option> - <name>Cross</name> - <key>8</key> - </option> - <option> - <name>X-Cross</name> - <key>9</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 2 Width</name> - <key>width2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 2 Style</name> - <key>style2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 2 Marker</name> - <key>marker2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 3 Width</name> - <key>width3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <value>"green"</value> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 3 Style</name> - <key>style3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 3 Marker</name> - <key>marker3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 4 Width</name> - <key>width4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <value>"black"</value> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 4 Style</name> - <key>style4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 4 Marker</name> - <key>marker4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 5 Width</name> - <key>width5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <value>"cyan"</value> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 5 Style</name> - <key>style5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 5 Marker</name> - <key>marker5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 6 Width</name> - <key>width6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <value>"magenta"</value> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 6 Style</name> - <key>style6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 6 Marker</name> - <key>marker6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 7 Width</name> - <key>width7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <value>"yellow"</value> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 7 Style</name> - <key>style7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 7 Marker</name> - <key>marker7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 8 Width</name> - <key>width8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <value>"dark red"</value> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 8 Style</name> - <key>style8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 8 Marker</name> - <key>marker8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 9 Width</name> - <key>width9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <value>"dark green"</value> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 9 Style</name> - <key>style9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 9 Marker</name> - <key>marker9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 10 Width</name> - <key>width10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <value>"dark blue"</value> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 10 Style</name> - <key>style10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 10 Marker</name> - <key>marker10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - - <sink> - <name>in</name> - <type>$type.t</type> - <nports>#if $type.t == 'message' then 0 else $nconnections#</nports> - <optional>1</optional> - </sink> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_label.block.yml b/gr-qtgui/grc/qtgui_label.block.yml new file mode 100644 index 0000000000..68a46acb27 --- /dev/null +++ b/gr-qtgui/grc/qtgui_label.block.yml @@ -0,0 +1,66 @@ +id: variable_qtgui_label +label: QT GUI Label + +parameters: +- id: label + label: Label + dtype: string + hide: ${ ('none' if label else 'part') } +- id: type + label: Type + dtype: enum + default: int + options: [real, int, string, bool, raw] + option_labels: [Float, Integer, String, Boolean, Any] + option_attributes: + conv: [eng_notation.str_to_num, int, str, bool, eval] + str: [eng_notation.num_to_str, str, str, str, repr] + hide: part +- id: value + label: Default Value + dtype: ${ type } + default: '0' +- id: formatter + label: Formatter + dtype: raw + default: None + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +value: ${ value } + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import eng_notation + var_make: self.${id} = ${id} = ${value} + callbacks: + - self.set_${id}(self._${id}_formatter(${value})) + - Qt.QMetaObject.invokeMethod(self._${id}_label, "setText", Qt.Q_ARG("QString", + ${id})) + make: |- + <% + win = 'self._%s_win'%id + if not label: + label = 'self._%s_tool_bar'%id + %>\ + ${win} = Qt.QToolBar(self) + + if ${formatter}: + self._${id}_formatter = ${formatter} + else: + self._${id}_formatter = lambda x: ${type.str}(x) + + ${win}.addWidget(Qt.QLabel(${label}+": ")) + self._${id}_label = Qt.QLabel(str(self._${id}_formatter(self.${id}))) + self._${id}_tool_bar.addWidget(self._${id}_label) + ${gui_hint()(win)} + +documentation: |- + This block creates a variable with a label widget for text. Leave the label blank to use the variable id as the label. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_label.xml b/gr-qtgui/grc/qtgui_label.xml deleted file mode 100644 index 946cee36ab..0000000000 --- a/gr-qtgui/grc/qtgui_label.xml +++ /dev/null @@ -1,87 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Label Text: -## a gui static text form -################################################### - --> - -<block> - <name>QT GUI Label</name> - <key>variable_qtgui_label</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import eng_notation</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $win = 'self._%s_tool_bar'%$id -$win = Qt.QToolBar(self) -#if not $label() - #set $label = '"%s"'%$id -#end if - -if $(formatter): - self._$(id)_formatter = $formatter -else: - self._$(id)_formatter = lambda x: $(type.str)(x) - -$(win).addWidget(Qt.QLabel($label+": ")) -self._$(id)_label = Qt.QLabel(str(self._$(id)_formatter(self.$id))) -self._$(id)_tool_bar.addWidget(self._$(id)_label) -$(gui_hint()($win)) - </make> - - <callback>self.set_$(id)(self._$(id)_formatter($value))</callback> - <callback>Qt.QMetaObject.invokeMethod(self._$(id)_label, "setText", Qt.Q_ARG("QString", $id))</callback> - - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - - <param> - <name>Type</name> - <key>type</key> - <value>int</value> - <type>enum</type> - <hide>part</hide> - <option><name>Float</name><key>real</key><opt>conv:eng_notation.str_to_num</opt><opt>str:eng_notation.num_to_str</opt></option> - <option><name>Integer</name><key>int</key><opt>conv:int</opt><opt>str:str</opt></option> - <option><name>String</name><key>string</key><opt>conv:str</opt><opt>str:str</opt></option> - <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt><opt>str:str</opt></option> - <option><name>Any</name><key>raw</key><opt>conv:eval</opt><opt>str:repr</opt></option> - </param> - - <param> - <name>Default Value</name> - <key>value</key> - <value>0</value> - <type>$type</type> - </param> - - <param> - <name>Formatter</name> - <key>formatter</key> - <value>None</value> - <type>raw</type> - <hide>part</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <doc> -This block creates a variable with a label widget for text. \ -Leave the label blank to use the variable id as the label. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_number_sink.block.yml b/gr-qtgui/grc/qtgui_number_sink.block.yml new file mode 100644 index 0000000000..559958a9ae --- /dev/null +++ b/gr-qtgui/grc/qtgui_number_sink.block.yml @@ -0,0 +1,283 @@ +id: qtgui_number_sink +label: QT GUI Number Sink + +parameters: +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: type + label: Input Type + category: General + dtype: enum + options: [float, int, short, byte] + option_attributes: + size: [gr.sizeof_float, gr.sizeof_int, gr.sizeof_short, gr.sizeof_char] + hide: part +- id: autoscale + label: Autoscale + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] +- id: avg + label: Average + category: General + dtype: float + default: '0' +- id: graph_type + label: Graph Type + category: General + dtype: enum + options: [qtgui.NUM_GRAPH_HORIZ, qtgui.NUM_GRAPH_VERT, qtgui.NUM_GRAPH_NONE] + option_labels: [Horizontal, Vertical, None] +- id: nconnections + label: Number of Inputs + category: General + dtype: int + default: '1' + hide: part +- id: min + label: Min + dtype: float + default: '-1' + hide: part +- id: max + label: Max + dtype: float + default: '1' + hide: part +- id: update_time + label: Update Period + category: General + dtype: float + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + category: General + dtype: gui_hint + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: unit1 + label: Line 1 Unit + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['("black", "black")', '("blue", "red")', '("black", "white")', '("white", + "black")', '("black", "red")'] + option_labels: [Black, Blue-Red, White Hot, Black Hot, Black-Red] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: factor1 + label: Line 1 Factor + category: Config + dtype: float + default: '1' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: unit2 + label: Line 2 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: factor2 + label: Line 2 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: unit3 + label: Line 3 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: factor3 + label: Line 3 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: unit4 + label: Line 4 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: factor4 + label: Line 4 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: unit5 + label: Line 5 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: factor5 + label: Line 5 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: unit6 + label: Line 6 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: factor6 + label: Line 6 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: unit7 + label: Line 7 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: factor7 + label: Line 7 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: unit8 + label: Line 8 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: factor8 + label: Line 8 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: unit9 + label: Line 9 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: factor9 + label: Line 9 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: unit10 + label: Line 10 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: factor10 + label: Line 10 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: ${ type } + multiplicity: ${ nconnections } + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + import sip + callbacks: + - set_update_time(${update_time}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.number_sink( + ${type.size}, + ${avg}, + ${graph_type}, + ${nconnections} + ) + self.${id}.set_update_time(${update_time}) + self.${id}.set_title(${name}) + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + units = [${unit1}, ${unit2}, ${unit3}, ${unit4}, ${unit5}, + ${unit6}, ${unit7}, ${unit8}, ${unit9}, ${unit10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + factor = [${factor1}, ${factor2}, ${factor3}, ${factor4}, ${factor5}, + ${factor6}, ${factor7}, ${factor8}, ${factor9}, ${factor10}] + + for i in range(${nconnections}): + self.${id}.set_min(i, ${min}) + self.${id}.set_max(i, ${max}) + self.${id}.set_color(i, colors[i][0], colors[i][1]) + if len(labels[i]) == 0: + self.${id}.set_label(i, "Data {0}".format(i)) + else: + self.${id}.set_label(i, labels[i]) + self.${id}.set_unit(i, units[i]) + self.${id}.set_factor(i, factor[i]) + + self.${id}.enable_autoscale(${autoscale}) + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint()(win)} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_number_sink.xml b/gr-qtgui/grc/qtgui_number_sink.xml deleted file mode 100644 index 06837493c3..0000000000 --- a/gr-qtgui/grc/qtgui_number_sink.xml +++ /dev/null @@ -1,496 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Number Sink -################################################### - --> -<block> - <name>QT GUI Number Sink</name> - <key>qtgui_number_sink</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.number_sink( - $type.size, - $avg, - $graph_type, - $nconnections -) -self.$(id).set_update_time($update_time) -self.$(id).set_title($name) - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -units = [$unit1, $unit2, $unit3, $unit4, $unit5, - $unit6, $unit7, $unit8, $unit9, $unit10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -factor = [$factor1, $factor2, $factor3, $factor4, $factor5, - $factor6, $factor7, $factor8, $factor9, $factor10] -for i in xrange($nconnections): - self.$(id).set_min(i, $min) - self.$(id).set_max(i, $max) - self.$(id).set_color(i, colors[i][0], colors[i][1]) - if len(labels[i]) == 0: - self.$(id).set_label(i, "Data {0}".format(i)) - else: - self.$(id).set_label(i, labels[i]) - self.$(id).set_unit(i, units[i]) - self.$(id).set_factor(i, factor[i]) - -self.$(id).enable_autoscale($autoscale) -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - <callback>set_update_time($update_time)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>Input Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>size:gr.sizeof_int</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>size:gr.sizeof_short</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - <tab>General</tab> - </param> - - <param> - <name>Autoscale</name> - <key>autoscale</key> - <value>False</value> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Average</name> - <key>avg</key> - <value>0</value> - <type>float</type> - <tab>General</tab> - </param> - - <param> - <name>Graph Type</name> - <key>graph_type</key> - <type>enum</type> - <option> - <name>Horizontal</name> - <key>qtgui.NUM_GRAPH_HORIZ</key> - </option> - <option> - <name>Vertical</name> - <key>qtgui.NUM_GRAPH_VERT</key> - </option> - <option> - <name>None</name> - <key>qtgui.NUM_GRAPH_NONE</key> - </option> - <tab>General</tab> - </param> - - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>part</hide> - <tab>General</tab> - </param> - - <param> - <name>Min</name> - <key>min</key> - <value>-1</value> - <type>float</type> - <hide>part</hide> - </param> - <param> - <name>Max</name> - <key>max</key> - <value>1</value> - <type>float</type> - <hide>part</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>float</type> - <hide>part</hide> - <tab>General</tab> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - <tab>General</tab> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Unit</name> - <key>unit1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Black</name> - <key>("black", "black")</key> - </option> - <option> - <name>Blue-Red</name> - <key>("blue", "red")</key> - </option> - <option> - <name>White Hot</name> - <key>("black", "white")</key> - </option> - <option> - <name>Black Hot</name> - <key>("white", "black")</key> - </option> - <option> - <name>Black-Red</name> - <key>("black", "red")</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Factor</name> - <key>factor1</key> - <value>1</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 2 Unit</name> - <key>unit2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 2 Factor</name> - <key>factor2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 3 Unit</name> - <key>unit3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 3 Factor</name> - <key>factor3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 4 Unit</name> - <key>unit4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 4 Factor</name> - <key>factor4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 5 Unit</name> - <key>unit5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 5 Factor</name> - <key>factor5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 6 Unit</name> - <key>unit6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 6 Factor</name> - <key>factor6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 7 Unit</name> - <key>unit7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 7 Factor</name> - <key>factor7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 8 Unit</name> - <key>unit8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 8 Factor</name> - <key>factor8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 9 Unit</name> - <key>unit9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 9 Factor</name> - <key>factor9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 10 Unit</name> - <key>unit10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 10 Factor</name> - <key>factor10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - - <sink> - <name>in</name> - <type>$type</type> - <nports>$nconnections</nports> - </sink> - <doc> - The GUI hint can be used to position the widget within the application. \ - The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ - Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_push_button.block.yml b/gr-qtgui/grc/qtgui_push_button.block.yml new file mode 100644 index 0000000000..8c62e92f08 --- /dev/null +++ b/gr-qtgui/grc/qtgui_push_button.block.yml @@ -0,0 +1,60 @@ +id: variable_qtgui_push_button +label: QT GUI Push Button + +parameters: +- id: label + label: Label + dtype: string + hide: ${ ('none' if label else 'part') } +- id: type + label: Type + dtype: enum + default: int + options: [real, int, string, bool, raw] + option_labels: [Float, Integer, String, Boolean, Any] + option_attributes: + conv: [float, int, str, bool, eval] + hide: part +- id: value + label: Default Value + dtype: ${ type } + default: '0' +- id: pressed + label: Pressed + dtype: ${ type } + default: '1' +- id: released + label: Released + dtype: ${ type } + default: '0' +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +value: ${ value } + +templates: + imports: from PyQt5 import Qt + var_make: self.${id} = ${id} = ${value} + callbacks: + - self.set_${id}(${value}) + make: |- + <% + win = '_%s_push_button'%id + if not label: + label = '"%s"'%id + %>\ + ${win} = Qt.QPushButton(${label}) + self._${id}_choices = {'Pressed': ${pressed}, 'Released': ${released}} + ${win}.pressed.connect(lambda: self.set_${id}(self._${id}_choices['Pressed'])) + ${win}.released.connect(lambda: self.set_${id}(self._${id}_choices['Released'])) + ${gui_hint()(win)} + +documentation: |- + This block creates a variable push button. Leave the label blank to use the variable id as the label. + + A push button selects between two values of similar type. The variable will take on one value or the other depending on whether the button is pressed or released. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_push_button.xml b/gr-qtgui/grc/qtgui_push_button.xml deleted file mode 100644 index 49c2e9d6f0..0000000000 --- a/gr-qtgui/grc/qtgui_push_button.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Push Button: -## a gui push button form -################################################### - --> -<block> - <name>QT GUI Push Button</name> - <key>variable_qtgui_push_button</key> - <import>from PyQt5 import Qt</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $win = '_%s_push_button'%$id -#if not $label() - #set $label = '"%s"'%$id -#end if -$win = Qt.QPushButton($label) -self._$(id)_choices = {'Pressed': $pressed, 'Released': $released} -$(win).pressed.connect(lambda: self.set_$(id)(self._$(id)_choices['Pressed'])) -$(win).released.connect(lambda: self.set_$(id)(self._$(id)_choices['Released'])) -$(gui_hint()($win))</make> - <callback>self.set_$(id)($value)</callback> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Type</name> - <key>type</key> - <value>int</value> - <type>enum</type> - <hide>part</hide> - <option><name>Float</name><key>real</key><opt>conv:float</opt></option> - <option><name>Integer</name><key>int</key><opt>conv:int</opt></option> - <option><name>String</name><key>string</key><opt>conv:str</opt></option> - <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt></option> - <option><name>Any</name><key>raw</key><opt>conv:eval</opt></option> - </param> - <param> - <name>Default Value</name> - <key>value</key> - <value>0</value> - <type>$type</type> - </param> - <param> - <name>Pressed</name> - <key>pressed</key> - <value>1</value> - <type>$type</type> - </param> - <param> - <name>Released</name> - <key>released</key> - <value>0</value> - <type>$type</type> - </param> - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - <doc> -This block creates a variable push button. \ -Leave the label blank to use the variable id as the label. - -A push button selects between two values of similar type. \ -The variable will take on one value or the other depending \ -on whether the button is pressed or released. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_range.block.yml b/gr-qtgui/grc/qtgui_range.block.yml new file mode 100644 index 0000000000..0c75489533 --- /dev/null +++ b/gr-qtgui/grc/qtgui_range.block.yml @@ -0,0 +1,86 @@ +id: variable_qtgui_range +label: QT GUI Range + +parameters: +- id: label + label: Label + dtype: string + hide: ${ ('none' if label else 'part') } +- id: rangeType + label: Type + dtype: enum + default: '"float"' + options: [float, int] + option_attributes: + type: [float, int] + hide: part +- id: value + label: Default Value + dtype: ${ rangeType.type } + default: '50' +- id: start + label: Start + dtype: ${ rangeType.type } + default: '0' +- id: stop + label: Stop + dtype: ${ rangeType.type } + default: '100' +- id: step + label: Step + dtype: ${ rangeType.type } + default: '1' +- id: widget + label: Widget + dtype: enum + default: counter_slider + options: [counter_slider, counter, slider, dial] + option_labels: [Counter + Slider, Counter, Slider, Knob] + hide: part +- id: orient + label: Orientation + dtype: enum + default: Qt.Horizontal + options: [Qt.Horizontal, Qt.Vertical] + option_labels: [Horizontal, Vertical] + option_attributes: + minfcn: [setMinimumWidth, setMinimumHeight] + scalepos: [BottomScale, LeftScale] + hide: ${ ('part' if widget == "slider" else 'all') } +- id: min_len + label: Minimum Length + dtype: int + default: '200' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +value: ${ value } + +asserts: +- ${start <= value <= stop} +- ${start <= stop} + +templates: + imports: from gnuradio.qtgui import Range, RangeWidget + var_make: self.${id} = ${id} = ${value} + callbacks: + - self.set_${id}(${value}) + make: |- + <% + win = 'self._%s_win'%id + range = 'self._%s_range'%id + if not label: + label = '"%s"'%id + %>\ + ${range} = Range(${start}, ${stop}, ${step}, ${value}, ${min_len}) + ${win} = RangeWidget(${range}, self.set_${id}, ${label}, "${widget}", ${rangeType}) + ${gui_hint()(win)} + +documentation: |- + This block creates a variable with a slider. Leave the label blank to use the variable id as the label. The value must be a real number. The value must be between the start and the stop. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_range.xml b/gr-qtgui/grc/qtgui_range.xml deleted file mode 100644 index 71b614cc5e..0000000000 --- a/gr-qtgui/grc/qtgui_range.xml +++ /dev/null @@ -1,131 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Range: -## ranged widgets like a slider or a knob -################################################### - --> -<block> - <name>QT GUI Range</name> - <key>variable_qtgui_range</key> - <import>from gnuradio.qtgui import Range, RangeWidget</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $win = 'self._%s_win'%$id - #set $range = 'self._%s_range'%$id -#if not $label() - #set $label = '"%s"'%$id -#end if -$(range) = Range($start, $stop, $step, $value, $min_len) -$(win) = RangeWidget($range, self.set_$(id), $label, "$widget", $rangeType) -$(gui_hint()($win))</make> - <callback>self.set_$(id)($value)</callback> - - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - - <param> - <name>Type</name> - <key>rangeType</key> - <value>"float"</value> - <type>enum</type> - <hide>part</hide> - <option><name>Float</name><key>float</key><opt>type:float</opt></option> - <option><name>Int</name><key>int</key><opt>type:int</opt></option> - </param> - - <param> - <name>Default Value</name> - <key>value</key> - <value>50</value> - <type>$rangeType.type</type> - </param> - - <param> - <name>Start</name> - <key>start</key> - <value>0</value> - <type>$rangeType.type</type> - </param> - - <param> - <name>Stop</name> - <key>stop</key> - <value>100</value> - <type>$rangeType.type</type> - </param> - - <param> - <name>Step</name> - <key>step</key> - <value>1</value> - <type>$rangeType.type</type> - </param> - - <param> - <name>Widget</name> - <key>widget</key> - <value>counter_slider</value> - <type>enum</type> - <hide>part</hide> - <option><name>Counter + Slider</name><key>counter_slider</key></option> - <option><name>Counter</name><key>counter</key></option> - <option><name>Slider</name><key>slider</key></option> - <option><name>Knob</name><key>dial</key></option> - </param> - - <param> - <name>Orientation</name> - <key>orient</key> - <value>Qt.Horizontal</value> - <type>enum</type> - <hide>#if $widget() == "slider" then 'part' else 'all'#</hide> - <option> - <name>Horizontal</name> - <key>Qt.Horizontal</key> - <opt>scalepos:BottomScale</opt> - <opt>minfcn:setMinimumWidth</opt> - </option> - <option> - <name>Vertical</name> - <key>Qt.Vertical</key> - <opt>scalepos:LeftScale</opt> - <opt>minfcn:setMinimumHeight</opt> - </option> - </param> - - <param> - <name>Minimum Length</name> - <key>min_len</key> - <value>200</value> - <type>int</type> - <hide>part</hide> - </param> - <!-- from min_len <hide>#if $widget().split('_')[0] in ("slider", "counter") then 'part' else 'all'#</hide>--> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <check>$start <= $value <= $stop</check> - <check>$start < $stop</check> - - <doc> - This block creates a variable with a slider. \ - Leave the label blank to use the variable id as the label. \ - The value must be a real number. \ - The value must be between the start and the stop. - - The GUI hint can be used to position the widget within the application. \ - The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ - Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_sink_x.block.yml b/gr-qtgui/grc/qtgui_sink_x.block.yml new file mode 100644 index 0000000000..30194a7a57 --- /dev/null +++ b/gr-qtgui/grc/qtgui_sink_x.block.yml @@ -0,0 +1,148 @@ +id: qtgui_sink_x +label: QT GUI Sink +flags: has_python + +parameters: +- id: type + label: Type + dtype: enum + default: complex + options: [complex, float] + option_attributes: + fcn: [sink_c, sink_f] + hide: part +- id: name + label: Name + dtype: string + default: '""' +- id: fftsize + label: FFT Size + dtype: int + default: '1024' +- id: wintype + label: Window Type + dtype: int + default: firdes.WIN_BLACKMAN_hARRIS + options: [firdes.WIN_BLACKMAN_hARRIS, firdes.WIN_HAMMING, firdes.WIN_HANN, firdes.WIN_BLACKMAN, + firdes.WIN_RECTANGULAR, firdes.WIN_KAISER] + option_labels: [Blackman-harris, Hamming, Hann, Blackman, Rectangular, Kaiser] + hide: part +- id: fc + label: Center Frequency (Hz) + dtype: real + default: '0' +- id: bw + label: Bandwidth (Hz) + dtype: real + default: samp_rate +- id: rate + label: Update Rate + dtype: real + default: '10' +- id: showrf + label: Show RF Freq + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: plotfreq + label: Plot Frequency + dtype: bool + default: 'True' + options: ['True', 'False'] + option_labels: ['On', 'Off'] + hide: part +- id: plotwaterfall + label: Plot Waterfall + dtype: bool + default: 'True' + options: ['True', 'False'] + option_labels: ['On', 'Off'] + hide: part +- id: plottime + label: Plot Time + dtype: bool + default: 'True' + options: ['True', 'False'] + option_labels: ['On', 'Off'] + hide: part +- id: plotconst + label: Plot Const + dtype: bool + default: 'True' + options: ['True', 'False'] + option_labels: ['On', 'Off'] + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: freqchangevar + label: Clicked freq variable + dtype: raw + default: None + hide: part +- id: showports + label: Show Msg Ports + dtype: enum + default: 'True' + options: ['False', 'True'] + option_labels: ['Yes', 'No'] + hide: part + +inputs: +- domain: stream + dtype: ${ type } + multiplicity: ${ num_inputs } +- domain: message + id: freq + optional: true + hide: ${ showports } + +outputs: +- domain: message + id: freq + optional: true + hide: ${ showports } + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + from gnuradio.filter import firdes + import sip + callbacks: + - set_frequency_range(${fc}, ${bw}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.${type.fcn}( + ${fftsize}, #fftsize + ${wintype}, #wintype + ${fc}, #fc + ${bw}, #bw + ${name}, #name + ${plotfreq}, #plotfreq + ${plotwaterfall}, #plotwaterfall + ${plottime}, #plottime + ${plotconst} #plotconst + ) + self.${id}.set_update_time(1.0/${rate}) + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + + self.${id}.enable_rf_freq($showrf) + + % if freqchangevar is not None: + def ${id}_callback(p, num): + if num == 1 or num == 2: + self.set_${freqchangevar}(p.x()) + + Qt.QObject.connect(self._${id}_win, Qt.SIGNAL("plotPointSelected(QPointF, int)"), ${id}_callback) + % endif + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_sink_x.xml b/gr-qtgui/grc/qtgui_sink_x.xml deleted file mode 100644 index a9bc469cd2..0000000000 --- a/gr-qtgui/grc/qtgui_sink_x.xml +++ /dev/null @@ -1,232 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Sink</name> - <key>qtgui_sink_x</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>from gnuradio.filter import firdes</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.$(type.fcn)( - $fftsize, \#fftsize - $wintype, \#wintype - $fc, \#fc - $bw, \#bw - $name, \#name - $plotfreq, \#plotfreq - $plotwaterfall, \#plotwaterfall - $plottime, \#plottime - $plotconst, \#plotconst -) -self.$(id).set_update_time(1.0/$rate) -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win)) - -self.$(id).enable_rf_freq($showrf) - -#if $freqchangevar() is not None -def $(id)_callback(p, num): - if num == 1 or num == 2: self.set_$(freqchangevar)(p.x()) - -Qt.QObject.connect(self._$(id)_win, Qt.SIGNAL("plotPointSelected(QPointF, int)"), $(id)_callback ) -#end if - - </make> - <callback>set_frequency_range($fc, $bw)</callback> - - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option><name>Complex</name><key>complex</key><opt>fcn:sink_c</opt></option> - <option><name>Float</name><key>float</key><opt>fcn:sink_f</opt></option> - </param> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>FFT Size</name> - <key>fftsize</key> - <value>1024</value> - <type>int</type> - </param> - - <param> - <name>Window Type</name> - <key>wintype</key> - <value>firdes.WIN_BLACKMAN_hARRIS</value> - <type>int</type> - <hide>part</hide> - <option> - <name>Blackman-harris</name> - <key>firdes.WIN_BLACKMAN_hARRIS</key> - </option> - <option> - <name>Hamming</name> - <key>firdes.WIN_HAMMING</key> - </option> - <option> - <name>Hann</name> - <key>firdes.WIN_HANN</key> - </option> - <option> - <name>Blackman</name> - <key>firdes.WIN_BLACKMAN</key> - </option> - <option> - <name>Rectangular</name> - <key>firdes.WIN_RECTANGULAR</key> - </option> - <option> - <name>Kaiser</name> - <key>firdes.WIN_KAISER</key> - </option> - </param> - - <param> - <name>Center Frequency (Hz)</name> - <key>fc</key> - <value>0</value> - <type>real</type> - </param> - - <param> - <name>Bandwidth (Hz)</name> - <key>bw</key> - <value>samp_rate</value> - <type>real</type> - </param> - - <param> - <name>Update Rate</name> - <key>rate</key> - <value>10</value> - <type>real</type> - </param> - - <param> - <name>Show RF Freq</name> - <key>showrf</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Plot Frequency</name> - <key>plotfreq</key> - <value>True</value> - <type>bool</type> - <hide>part</hide> - <option><name>On</name><key>True</key></option> - <option><name>Off</name><key>False</key></option> - </param> - - <param> - <name>Plot Waterfall</name> - <key>plotwaterfall</key> - <value>True</value> - <type>bool</type> - <hide>part</hide> - <option><name>On</name><key>True</key></option> - <option><name>Off</name><key>False</key></option> - </param> - - <param> - <name>Plot Time</name> - <key>plottime</key> - <value>True</value> - <type>bool</type> - <hide>part</hide> - <option><name>On</name><key>True</key></option> - <option><name>Off</name><key>False</key></option> - </param> - - <param> - <name>Plot Const</name> - <key>plotconst</key> - <value>True</value> - <type>bool</type> - <hide>part</hide> - <option><name>On</name><key>True</key></option> - <option><name>Off</name><key>False</key></option> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <param> - <name>Clicked freq variable</name> - <key>freqchangevar</key> - <value>None</value> - <type>raw</type> - <hide>part</hide> - </param> - - <param> - <name>Show Msg Ports</name> - <key>showports</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>False</key> - </option> - <option> - <name>No</name> - <key>True</key> - </option> - </param> - - <sink> - <name>in</name> - <type>$type</type> - <nports>$num_inputs</nports> - </sink> - - <sink> - <name>freq</name> - <type>message</type> - <optional>1</optional> - <hide>$showports</hide> - </sink> - - <source> - <name>freq</name> - <type>message</type> - <optional>1</optional> - <hide>$showports</hide> - </source> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_tab_widget.block.yml b/gr-qtgui/grc/qtgui_tab_widget.block.yml new file mode 100644 index 0000000000..79cbf70cae --- /dev/null +++ b/gr-qtgui/grc/qtgui_tab_widget.block.yml @@ -0,0 +1,141 @@ +id: qtgui_tab_widget +label: QT GUI Tab Widget + +parameters: +- id: num_tabs + label: Num Tabs + dtype: enum + default: '1' + options: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', + '14', '15', '16', '17', '18', '19', '20'] +- id: label0 + label: Label 0 + dtype: string + default: Tab 0 + hide: ${ ('none' if int(num_tabs) > 0 else 'all') } +- id: label1 + label: Label 1 + dtype: string + default: Tab 1 + hide: ${ ('none' if int(num_tabs) > 1 else 'all') } +- id: label2 + label: Label 2 + dtype: string + default: Tab 2 + hide: ${ ('none' if int(num_tabs) > 2 else 'all') } +- id: label3 + label: Label 3 + dtype: string + default: Tab 3 + hide: ${ ('none' if int(num_tabs) > 3 else 'all') } +- id: label4 + label: Label 4 + dtype: string + default: Tab 4 + hide: ${ ('none' if int(num_tabs) > 4 else 'all') } +- id: label5 + label: Label 5 + dtype: string + default: Tab 5 + hide: ${ ('none' if int(num_tabs) > 5 else 'all') } +- id: label6 + label: Label 6 + dtype: string + default: Tab 6 + hide: ${ ('none' if int(num_tabs) > 6 else 'all') } +- id: label7 + label: Label 7 + dtype: string + default: Tab 7 + hide: ${ ('none' if int(num_tabs) > 7 else 'all') } +- id: label8 + label: Label 8 + dtype: string + default: Tab 8 + hide: ${ ('none' if int(num_tabs) > 8 else 'all') } +- id: label9 + label: Label 9 + dtype: string + default: Tab 9 + hide: ${ ('none' if int(num_tabs) > 9 else 'all') } +- id: label10 + label: Label 10 + dtype: string + default: Tab 10 + hide: ${ ('none' if int(num_tabs) > 10 else 'all') } +- id: label11 + label: Label 11 + dtype: string + default: Tab 11 + hide: ${ ('none' if int(num_tabs) > 11 else 'all') } +- id: label12 + label: Label 12 + dtype: string + default: Tab 12 + hide: ${ ('none' if int(num_tabs) > 12 else 'all') } +- id: label13 + label: Label 13 + dtype: string + default: Tab 13 + hide: ${ ('none' if int(num_tabs) > 13 else 'all') } +- id: label14 + label: Label 14 + dtype: string + default: Tab 14 + hide: ${ ('none' if int(num_tabs) > 14 else 'all') } +- id: label15 + label: Label 15 + dtype: string + default: Tab 15 + hide: ${ ('none' if int(num_tabs) > 15 else 'all') } +- id: label16 + label: Label 16 + dtype: string + default: Tab 16 + hide: ${ ('none' if int(num_tabs) > 16 else 'all') } +- id: label17 + label: Label 17 + dtype: string + default: Tab 17 + hide: ${ ('none' if int(num_tabs) > 17 else 'all') } +- id: label18 + label: Label 18 + dtype: string + default: Tab 18 + hide: ${ ('none' if int(num_tabs) > 18 else 'all') } +- id: label19 + label: Label 19 + dtype: string + default: Tab 19 + hide: ${ ('none' if int(num_tabs) > 19 else 'all') } +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part + +templates: + imports: from PyQt5 import Qt + make: |- + <% + win = 'self._%s_win'%id + all_labels = [label0, label1, label2, label3, label4, + label5, label6, label7, label8, label9, + label10, label11, label12, label13, label14, + label15, label16, label17, label18, label19][:int(num_tabs())] + %>\ + Qt.QTabWidget() + % for i, label in enumrate(all_labels): + self.${id}_widget_${i} = Qt.QWidget() + self.${id}_layout_${i} = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.${id}_widget_${i}) + self.${id}_grid_layout_${i} = Qt.QGridLayout() + self.${id}_layout_${i}.addLayout(self.${id}_grid_layout_${i}) + ${win}.addTab(self.${id}_widget_${i}, ${label}) + % endfor + ${gui_hint()(win)} + +documentation: |- + This block creates a tabbed widget to organize other widgets. The ID of this block can be used as the tab_id in the GUI hints of other widgets. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_tab_widget.xml b/gr-qtgui/grc/qtgui_tab_widget.xml deleted file mode 100644 index 805542cc8b..0000000000 --- a/gr-qtgui/grc/qtgui_tab_widget.xml +++ /dev/null @@ -1,206 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##WX GUI Notebook -################################################### - --> -<block> - <name>QT GUI Tab Widget</name> - <key>qtgui_tab_widget</key> - <import>from PyQt5 import Qt</import> - <make>#set $win = 'self.%s'%$id -Qt.QTabWidget() -#set $all_labels = [$label0, $label1, $label2, $label3, $label4, - $label5, $label6, $label7, $label8, $label9, - $label10, $label11, $label12, $label13, $label14, - $label15, $label16, $label17, $label18, $label19][:int($num_tabs())] -#for i, label in enumerate($all_labels) -self.$(id)_widget_$(i) = Qt.QWidget() -self.$(id)_layout_$(i) = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.$(id)_widget_$(i)) -self.$(id)_grid_layout_$(i) = Qt.QGridLayout() -self.$(id)_layout_$(i).addLayout(self.$(id)_grid_layout_$(i)) -$(win).addTab(self.$(id)_widget_$(i), $label) -#end for -$(gui_hint()($win))</make> - <param> - <name>Num Tabs</name> - <key>num_tabs</key> - <value>1</value> - <type>enum</type> - <option><name>1</name><key>1</key></option> - <option><name>2</name><key>2</key></option> - <option><name>3</name><key>3</key></option> - <option><name>4</name><key>4</key></option> - <option><name>5</name><key>5</key></option> - <option><name>6</name><key>6</key></option> - <option><name>7</name><key>7</key></option> - <option><name>8</name><key>8</key></option> - <option><name>9</name><key>9</key></option> - <option><name>10</name><key>10</key></option> - <option><name>11</name><key>11</key></option> - <option><name>12</name><key>12</key></option> - <option><name>13</name><key>13</key></option> - <option><name>14</name><key>14</key></option> - <option><name>15</name><key>15</key></option> - <option><name>16</name><key>16</key></option> - <option><name>17</name><key>17</key></option> - <option><name>18</name><key>18</key></option> - <option><name>19</name><key>19</key></option> - <option><name>20</name><key>20</key></option> - </param> - <param> - <name>Label 0</name> - <key>label0</key> - <value>Tab 0</value> - <type>string</type> - <hide>#if int($num_tabs()) > 0 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 1</name> - <key>label1</key> - <value>Tab 1</value> - <type>string</type> - <hide>#if int($num_tabs()) > 1 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 2</name> - <key>label2</key> - <value>Tab 2</value> - <type>string</type> - <hide>#if int($num_tabs()) > 2 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 3</name> - <key>label3</key> - <value>Tab 3</value> - <type>string</type> - <hide>#if int($num_tabs()) > 3 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 4</name> - <key>label4</key> - <value>Tab 4</value> - <type>string</type> - <hide>#if int($num_tabs()) > 4 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 5</name> - <key>label5</key> - <value>Tab 5</value> - <type>string</type> - <hide>#if int($num_tabs()) > 5 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 6</name> - <key>label6</key> - <value>Tab 6</value> - <type>string</type> - <hide>#if int($num_tabs()) > 6 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 7</name> - <key>label7</key> - <value>Tab 7</value> - <type>string</type> - <hide>#if int($num_tabs()) > 7 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 8</name> - <key>label8</key> - <value>Tab 8</value> - <type>string</type> - <hide>#if int($num_tabs()) > 8 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 9</name> - <key>label9</key> - <value>Tab 9</value> - <type>string</type> - <hide>#if int($num_tabs()) > 9 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 10</name> - <key>label10</key> - <value>Tab 10</value> - <type>string</type> - <hide>#if int($num_tabs()) > 10 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 11</name> - <key>label11</key> - <value>Tab 11</value> - <type>string</type> - <hide>#if int($num_tabs()) > 11 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 12</name> - <key>label12</key> - <value>Tab 12</value> - <type>string</type> - <hide>#if int($num_tabs()) > 12 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 13</name> - <key>label13</key> - <value>Tab 13</value> - <type>string</type> - <hide>#if int($num_tabs()) > 13 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 14</name> - <key>label14</key> - <value>Tab 14</value> - <type>string</type> - <hide>#if int($num_tabs()) > 14 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 15</name> - <key>label15</key> - <value>Tab 15</value> - <type>string</type> - <hide>#if int($num_tabs()) > 15 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 16</name> - <key>label16</key> - <value>Tab 16</value> - <type>string</type> - <hide>#if int($num_tabs()) > 16 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 17</name> - <key>label17</key> - <value>Tab 17</value> - <type>string</type> - <hide>#if int($num_tabs()) > 17 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 18</name> - <key>label18</key> - <value>Tab 18</value> - <type>string</type> - <hide>#if int($num_tabs()) > 18 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 19</name> - <key>label19</key> - <value>Tab 19</value> - <type>string</type> - <hide>#if int($num_tabs()) > 19 then 'none' else 'all'#</hide> - </param> - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - <doc> -This block creates a tabbed widget to organize other widgets. \ -The ID of this block can be used as the tab_id in the GUI hints of other widgets. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_time_raster_x.block.yml b/gr-qtgui/grc/qtgui_time_raster_x.block.yml new file mode 100644 index 0000000000..77ae0a4ad1 --- /dev/null +++ b/gr-qtgui/grc/qtgui_time_raster_x.block.yml @@ -0,0 +1,266 @@ +id: qtgui_time_raster_sink_x +label: QT GUI Time Raster Sink + +parameters: +- id: type + label: Type + dtype: enum + default: complex + options: [byte, float, msg_byte, msg_float] + option_labels: [Byte, Float, Byte Message, Float Message] + option_attributes: + fcn: [time_raster_sink_b, time_raster_sink_f, time_raster_sink_b, time_raster_sink_f] + t: [byte, float, message, message] + hide: part +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: samp_rate + label: Sample Rate + dtype: real + default: samp_rate +- id: nrows + label: Num. Rows + dtype: int + hide: ${ ('all' if type.startswith('msg') else 'none') } +- id: ncols + label: Num. Cols + dtype: int +- id: grid + label: Grid + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: zmin + label: Int. min + dtype: real + default: '-1' + hide: part +- id: zmax + label: Int. max + dtype: real + default: '1' + hide: part +- id: mult + label: Multiplier + dtype: real_vector + default: '[]' + hide: part +- id: offset + label: Offset + dtype: real_vector + default: '[]' + hide: part +- id: nconnections + label: Number of Inputs + dtype: int + default: '1' + hide: ${ ('all' if type.startswith('msg') else 'part') } +- id: update_time + label: Update Period + dtype: real + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: axislabels + label: Axis Labels + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['0', '1', '2', '3', '5', '6'] + option_labels: [Multi Color, White Hot, Black Hot, Incandescent, Sunset, Cool] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: ${ type.t } + multiplicity: ${ (0 if type.startswith('msg') else nconnections) } + optional: true + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + import sip + callbacks: + - set_num_rows(${nrows}) + - set_num_cols(${ncols}) + - set_multiplier(${mult}) + - set_offset(${offset}) + - set_update_time(${update_time}) + - set_title(${which}, ${title}) + - set_color(${which}, ${color}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.${type.fcn}( + ${samp_rate}, + ${nrows}, + ${ncols}, + ${mult}, + ${offset}, + ${name}, + ${0 if type.startswith('msg') else nconnections} + ) + + self.${id}.set_update_time(${update_time}) + self.${id}.set_intensity_range(${zmin}, ${zmax}) + self.${id}.enable_grid(${grid}) + self.${id}.enable_axis_labels(${axislabels}) + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + + for i in range(${1 if type.startswith('msg') else nconnections}): + if len(labels[i]) == 0: + self.${id}.set_line_label(i, "Data {0}".format(i)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id}.set_color_map(i, colors[i]) + self.${id}.set_line_alpha(i, alphas[i]) + + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint()(win)} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_time_raster_x.xml b/gr-qtgui/grc/qtgui_time_raster_x.xml deleted file mode 100644 index d458f67eb9..0000000000 --- a/gr-qtgui/grc/qtgui_time_raster_x.xml +++ /dev/null @@ -1,466 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Time Raster Sink</name> - <key>qtgui_time_raster_sink_x</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.$(type.fcn)( - $samp_rate, - $nrows, - $ncols, - $mult, - $offset, - $name, - #if $type.t == 'message' then 0 else $nconnections#, - ) - -self.$(id).set_update_time($update_time) -self.$(id).set_intensity_range($zmin, $zmax) -self.$(id).enable_grid($grid) -self.$(id).enable_axis_labels($axislabels) - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] -for i in xrange(#if $type.t == 'message' then 1 else $nconnections#): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_color_map(i, colors[i]) - self.$(id).set_line_alpha(i, alphas[i]) - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - <callback>set_num_rows($nrows)</callback> - <callback>set_num_cols($ncols)</callback> - <callback>set_multiplier($mult)</callback> - <callback>set_offset($offset)</callback> - <callback>set_update_time($update_time)</callback> - <callback>set_title($which, $title)</callback> - <callback>set_color($which, $color)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option> - <name>Byte</name> - <key>byte</key> - <opt>fcn:time_raster_sink_b</opt> - <opt>t:byte</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:time_raster_sink_f</opt> - <opt>t:float</opt> - </option> - <option> - <name>Byte Message</name> - <key>msg_byte</key> - <opt>fcn:time_raster_sink_b</opt> - <opt>t:message</opt> - </option> - <option> - <name>Float Message</name> - <key>msg_float</key> - <opt>fcn:time_raster_sink_f</opt> - <opt>t:message</opt> - </option> - </param> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>Sample Rate</name> - <key>samp_rate</key> - <value>samp_rate</value> - <type>real</type> - </param> - - <param> - <name>Num. Rows</name> - <key>nrows</key> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'none'#</hide> - </param> - - <param> - <name>Num. Cols</name> - <key>ncols</key> - <type>int</type> - </param> - - <param> - <name>Grid</name> - <key>grid</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Int. min</name> - <key>zmin</key> - <value>-1</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Int. max</name> - <key>zmax</key> - <value>1</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Multiplier</name> - <key>mult</key> - <value>[]</value> - <type>real_vector</type> - <hide>part</hide> - </param> - - <param> - <name>Offset</name> - <key>offset</key> - <value>[]</value> - <type>real_vector</type> - <hide>part</hide> - </param> - - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'part'#</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <param> - <name>Axis Labels</name> - <key>axislabels</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Multi Color</name> - <key>0</key> - </option> - <option> - <name>White Hot</name> - <key>1</key> - </option> - <option> - <name>Black Hot</name> - <key>2</key> - </option> - <option> - <name>Incandescent</name> - <key>3</key> - </option> - <option> - <name>Sunset</name> - <key>5</key> - </option> - <option> - <name>Cool</name> - <key>6</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - - <sink> - <name>in</name> - <type>$type.t</type> - <nports>#if $type.t == 'message' then 0 else $nconnections#</nports> - <optional>1</optional> - </sink> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_time_sink_x.block.yml b/gr-qtgui/grc/qtgui_time_sink_x.block.yml new file mode 100644 index 0000000000..dfe53527eb --- /dev/null +++ b/gr-qtgui/grc/qtgui_time_sink_x.block.yml @@ -0,0 +1,559 @@ +id: qtgui_time_sink_x +label: QT GUI Time Sink + +parameters: +- id: type + label: Type + dtype: enum + default: complex + options: [complex, float, msg_complex, msg_float] + option_labels: [Complex, Float, Complex Message, Float Message] + option_attributes: + fcn: [time_sink_c, time_sink_f, time_sink_c, time_sink_f] + t: [complex, float, message, message] + hide: part +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: ylabel + label: Y Axis Label + dtype: string + default: Amplitude + hide: part +- id: yunit + label: Y Axis Unit + dtype: string + default: '""' + hide: part +- id: size + label: Number of Points + dtype: int + default: '1024' + hide: ${ ('all' if type.startswith('msg') else 'none') } +- id: srate + label: Sample Rate + dtype: float + default: samp_rate +- id: grid + label: Grid + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: autoscale + label: Autoscale + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] +- id: ymin + label: Y min + dtype: float + default: '-1' + hide: part +- id: ymax + label: Y max + dtype: float + default: '1' + hide: part +- id: nconnections + label: Number of Inputs + dtype: int + default: '1' + hide: ${ ('all' if type.startswith('msg') else 'part') } +- id: update_time + label: Update Period + dtype: float + default: '0.10' + hide: part +- id: entags + label: Disp. Tags + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: ${ ('all' if type.startswith('msg') else 'part') } +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: tr_mode + label: Trigger Mode + category: Trigger + dtype: enum + default: qtgui.TRIG_MODE_FREE + options: [qtgui.TRIG_MODE_FREE, qtgui.TRIG_MODE_AUTO, qtgui.TRIG_MODE_NORM, qtgui.TRIG_MODE_TAG] + option_labels: [Free, Auto, Normal, Tag] + hide: part +- id: tr_slope + label: Trigger Slope + category: Trigger + dtype: enum + default: qtgui.TRIG_MODE_POS + options: [qtgui.TRIG_SLOPE_POS, qtgui.TRIG_SLOPE_NEG] + option_labels: [Positive, Negative] + hide: part +- id: tr_level + label: Trigger Level + category: Trigger + dtype: float + default: '0.0' + hide: part +- id: tr_delay + label: Trigger Delay + category: Trigger + dtype: float + default: '0' + hide: part +- id: tr_chan + label: Trigger Channel + category: Trigger + dtype: int + default: '0' + hide: part +- id: tr_tag + label: Trigger Tag Key + category: Trigger + dtype: string + default: '""' + hide: part +- id: ctrlpanel + label: Control Panel + category: Config + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: legend + label: Legend + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: axislabels + label: Axis Labels + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: width1 + label: Line 1 Width + category: Config + dtype: int + default: '1' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['"blue"', '"red"', '"green"', '"black"', '"cyan"', '"magenta"', '"yellow"', + '"dark red"', '"dark green"', '"Dark Blue"'] + option_labels: [Blue, Red, Green, Black, Cyan, Magenta, Yellow, Dark Red, Dark + Green, Dark Blue] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: style1 + label: Line 1 Style + category: Config + dtype: enum + options: ['1', '2', '3', '4', '5', '0'] + option_labels: [Solid, Dash, Dots, Dash-Dot, Dash-Dot-Dot, None] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: marker1 + label: Line 1 Marker + category: Config + dtype: enum + options: ['-1', '0', '1', '2', '3', '4', '6', '7', '8', '9'] + option_labels: [None, Circle, Rectangle, Diamond, Triangle, Down Triangle, Left + Triangle, Right Triangle, Cross, X-Cross] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if (int(nconnections) >= 2 or (type == "complex" and int(nconnections) + >= 1) or (type == "msg_complex")) and (not type == "msg_float") else 'all') + } +- id: width2 + label: Line 2 Width + dtype: '' + hide: ${ ('part' if (int(nconnections) >= 2 or (type == "complex" and int(nconnections) + >= 1) or (type == "msg_complex")) and (not type == "msg_float") else 'all') + } +- id: color2 + label: Line 2 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if (int(nconnections) >= 2 or (type == "complex" and int(nconnections) + >= 1) or (type == "msg_complex")) and (not type == "msg_float") else 'all') + } +- id: style2 + label: Line 2 Style + dtype: '' + hide: ${ ('part' if (int(nconnections) >= 2 or (type == "complex" and int(nconnections) + >= 1) or (type == "msg_complex")) and (not type == "msg_float") else 'all') + } +- id: marker2 + label: Line 2 Marker + dtype: '' + hide: ${ ('part' if (int(nconnections) >= 2 or (type == "complex" and int(nconnections) + >= 1) or (type == "msg_complex")) and (not type == "msg_float") else 'all') + } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + hide: ${ ('part' if (int(nconnections) >= 2 or (type == "complex" and int(nconnections) + >= 1) or (type == "msg_complex")) and (not type == "msg_float") else 'all') + } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 3 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: width3 + label: Line 3 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 3 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + default: '"green"' + hide: ${ ('part' if ((int(nconnections) >= 3 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: style3 + label: Line 3 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 3 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: marker3 + label: Line 3 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 3 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 3 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 4 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: width4 + label: Line 4 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 4 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + default: '"black"' + hide: ${ ('part' if ((int(nconnections) >= 4 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: style4 + label: Line 4 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 4 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: marker4 + label: Line 4 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 4 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 4 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 5 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: width5 + label: Line 5 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 5 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + default: '"cyan"' + hide: ${ ('part' if ((int(nconnections) >= 5 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: style5 + label: Line 5 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 5 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: marker5 + label: Line 5 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 5 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 5 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 6 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: width6 + label: Line 6 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 6 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + default: '"magenta"' + hide: ${ ('part' if ((int(nconnections) >= 6 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: style6 + label: Line 6 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 6 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: marker6 + label: Line 6 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 6 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 6 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 7 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: width7 + label: Line 7 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 7 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + default: '"yellow"' + hide: ${ ('part' if ((int(nconnections) >= 7 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: style7 + label: Line 7 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 7 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: marker7 + label: Line 7 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 7 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 7 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 8 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: width8 + label: Line 8 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 8 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + default: '"dark red"' + hide: ${ ('part' if ((int(nconnections) >= 8 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: style8 + label: Line 8 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 8 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: marker8 + label: Line 8 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 8 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 8 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 9 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: width9 + label: Line 9 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 9 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + default: '"dark green"' + hide: ${ ('part' if ((int(nconnections) >= 9 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: style9 + label: Line 9 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 9 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: marker9 + label: Line 9 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 9 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 9 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 10 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: width10 + label: Line 10 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 10 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + default: '"dark blue"' + hide: ${ ('part' if ((int(nconnections) >= 10 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: style10 + label: Line 10 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 10 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: marker10 + label: Line 10 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 10 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 10 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } + +asserts: +- ${nconnections <= (5 if type == 'complex' else 10)} + +inputs: +- domain: stream + dtype: ${ type.t } + multiplicity: ${ (0 if type.startswith('msg') else nconnections) } + optional: true + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + from gnuradio.filter import firdes + import sip + callbacks: + - set_time_domain_axis(${min}, ${max}) + - set_update_time(${update_time}) + - set_title(${which}, ${title}) + - set_color(${which}, ${color}) + - set_y_axis(${ymin}, ${ymax}) + - set_samp_rate(${srate}) + - self.${id}.set_trigger_mode(${tr_mode}, ${tr_slope}, ${tr_level}, ${tr_delay}, + ${tr_chan}, ${tr_tag}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.${type.fcn}( + ${size}, #size + ${srate}, #samp_rate + ${name}, #name + ${0 if type.startswith('msg') else nconnections} #number of inputs + ) + self.${id}.set_update_time(${update_time}) + self.${id}.set_y_axis(${ymin}, ${ymax}) + + self.${id}.set_y_label(${ylabel}, ${yunit}) + + self.${id}.enable_tags(-1, ${entags}) + self.${id}.set_trigger_mode(${tr_mode}, ${tr_slope}, ${tr_level}, ${tr_delay}, ${tr_chan}, ${tr_tag}) + self.${id}.enable_autoscale(${autoscale}) + self.${id}.enable_grid(${grid}) + self.${id}.enable_axis_labels(${axislabels}) + self.${id}.enable_control_panel(${ctrlpanel}) + + if not ${legend}: + self.${id}.disable_legend() + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + widths = [${width1}, ${width2}, ${width3}, ${width4}, ${width5}, + ${width6}, ${width7}, ${width8}, ${width9}, ${width10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + styles = [${style1}, ${style2}, ${style3}, ${style4}, ${style5}, + ${style6}, ${style7}, ${style8}, ${style9}, ${style10}] + markers = [${marker1}, ${marker2}, ${marker3}, ${marker4}, ${marker5}, + ${marker6}, ${marker7}, ${marker8}, ${marker9}, ${marker10}] + + + % if type.endswith('complex'): + for i in range(${2 if type.startswith('msg') else 2*nconnections}): + if len(labels[i]) == 0: + if (i % 2 == 0): + self.${id}.set_line_label(i, "Re{{Data {0}}}".format(i/2)) + else: + self.${id}.set_line_label(i, "Im{{Data {0}}}".format(i/2)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id].set_line_width(i, widths[i]) + self.${id].set_line_color(i, colors[i]) + self.${id].set_line_style(i, styles[i]) + self.${id].set_line_marker(i, markers[i]) + self.${id].set_line_alpha(i, alphas[i]) + % endif + + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint()(win)} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_time_sink_x.xml b/gr-qtgui/grc/qtgui_time_sink_x.xml deleted file mode 100644 index d4347950ea..0000000000 --- a/gr-qtgui/grc/qtgui_time_sink_x.xml +++ /dev/null @@ -1,948 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Time Sink</name> - <key>qtgui_time_sink_x</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>from gnuradio.filter import firdes</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.$(type.fcn)( - $size, \#size - $srate, \#samp_rate - $name, \#name - #if $type.t == 'message' then 0 else $nconnections# \#number of inputs -) -self.$(id).set_update_time($update_time) -self.$(id).set_y_axis($ymin, $ymax) - -self.$(id).set_y_label($ylabel, $yunit) - -self.$(id).enable_tags(-1, $entags) -self.$(id).set_trigger_mode($tr_mode, $tr_slope, $tr_level, $tr_delay, $tr_chan, $tr_tag) -self.$(id).enable_autoscale($autoscale) -self.$(id).enable_grid($grid) -self.$(id).enable_axis_labels($axislabels) -self.$(id).enable_control_panel($ctrlpanel) - -if not $legend: - self.$(id).disable_legend() - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -widths = [$width1, $width2, $width3, $width4, $width5, - $width6, $width7, $width8, $width9, $width10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -styles = [$style1, $style2, $style3, $style4, $style5, - $style6, $style7, $style8, $style9, $style10] -markers = [$marker1, $marker2, $marker3, $marker4, $marker5, - $marker6, $marker7, $marker8, $marker9, $marker10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] - -#if ($type() == 'complex' or $type() == 'msg_complex') -for i in xrange(#if $type.t == 'message' then 2 else 2*$nconnections()#): - if len(labels[i]) == 0: - if(i % 2 == 0): - self.$(id).set_line_label(i, "Re{{Data {0}}}".format(i/2)) - else: - self.$(id).set_line_label(i, "Im{{Data {0}}}".format(i/2)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_line_width(i, widths[i]) - self.$(id).set_line_color(i, colors[i]) - self.$(id).set_line_style(i, styles[i]) - self.$(id).set_line_marker(i, markers[i]) - self.$(id).set_line_alpha(i, alphas[i]) -#else -for i in xrange(#if $type.t == 'message' then 1 else $nconnections#): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_line_width(i, widths[i]) - self.$(id).set_line_color(i, colors[i]) - self.$(id).set_line_style(i, styles[i]) - self.$(id).set_line_marker(i, markers[i]) - self.$(id).set_line_alpha(i, alphas[i]) -#end if - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - <callback>set_time_domain_axis($min, $max)</callback> - <callback>set_update_time($update_time)</callback> - <callback>set_title($which, $title)</callback> - <callback>set_color($which, $color)</callback> - <callback>set_y_axis($ymin, $ymax)</callback> - <callback>set_samp_rate($srate)</callback> - <callback>self.$(id).set_trigger_mode($tr_mode, $tr_slope, $tr_level, $tr_delay, $tr_chan, $tr_tag)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Trigger</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:time_sink_c</opt> - <opt>t:complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:time_sink_f</opt> - <opt>t:float</opt> - </option> - <option> - <name>Complex Message</name> - <key>msg_complex</key> - <opt>fcn:time_sink_c</opt> - <opt>t:message</opt> - </option> - <option> - <name>Float Message</name> - <key>msg_float</key> - <opt>fcn:time_sink_f</opt> - <opt>t:message</opt> - </option> - </param> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>Y Axis Label</name> - <key>ylabel</key> - <value>Amplitude</value> - <type>string</type> - <hide>part</hide> - </param> - - <param> - <name>Y Axis Unit</name> - <key>yunit</key> - <value>""</value> - <type>string</type> - <hide>part</hide> - </param> - - <param> - <name>Number of Points</name> - <key>size</key> - <value>1024</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'none'#</hide> - </param> - - <param> - <name>Sample Rate</name> - <key>srate</key> - <value>samp_rate</value> - <type>float</type> - </param> - - <param> - <name>Grid</name> - <key>grid</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Autoscale</name> - <key>autoscale</key> - <value>False</value> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Y min</name> - <key>ymin</key> - <value>-1</value> - <type>float</type> - <hide>part</hide> - </param> - - <param> - <name>Y max</name> - <key>ymax</key> - <value>1</value> - <type>float</type> - <hide>part</hide> - </param> - - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'part'#</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>float</type> - <hide>part</hide> - </param> - - <param> - <name>Disp. Tags</name> - <key>entags</key> - <value>True</value> - <type>enum</type> - <hide>#if $type.t == 'message' then 'all' else 'part'#</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - - <param> - <name>Trigger Mode</name> - <key>tr_mode</key> - <value>qtgui.TRIG_MODE_FREE</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Free</name> - <key>qtgui.TRIG_MODE_FREE</key> - </option> - <option> - <name>Auto</name> - <key>qtgui.TRIG_MODE_AUTO</key> - </option> - <option> - <name>Normal</name> - <key>qtgui.TRIG_MODE_NORM</key> - </option> - <option> - <name>Tag</name> - <key>qtgui.TRIG_MODE_TAG</key> - </option> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Slope</name> - <key>tr_slope</key> - <value>qtgui.TRIG_MODE_POS</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Positive</name> - <key>qtgui.TRIG_SLOPE_POS</key> - </option> - <option> - <name>Negative</name> - <key>qtgui.TRIG_SLOPE_NEG</key> - </option> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Level</name> - <key>tr_level</key> - <value>0.0</value> - <type>float</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Delay</name> - <key>tr_delay</key> - <value>0</value> - <type>float</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Channel</name> - <key>tr_chan</key> - <value>0</value> - <type>int</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Tag Key</name> - <key>tr_tag</key> - <value>""</value> - <type>string</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - - - <!-- Begin Config Tab items --> - - <param> - <name>Control Panel</name> - <key>ctrlpanel</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Legend</name> - <key>legend</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Axis Labels</name> - <key>axislabels</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Width</name> - <key>width1</key> - <value>1</value> - <type>int</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Blue</name> - <key>"blue"</key> - </option> - <option> - <name>Red</name> - <key>"red"</key> - </option> - <option> - <name>Green</name> - <key>"green"</key> - </option> - <option> - <name>Black</name> - <key>"black"</key> - </option> - <option> - <name>Cyan</name> - <key>"cyan"</key> - </option> - <option> - <name>Magenta</name> - <key>"magenta"</key> - </option> - <option> - <name>Yellow</name> - <key>"yellow"</key> - </option> - <option> - <name>Dark Red</name> - <key>"dark red"</key> - </option> - <option> - <name>Dark Green</name> - <key>"dark green"</key> - </option> - <option> - <name>Dark Blue</name> - <key>"Dark Blue"</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Style</name> - <key>style1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Solid</name> - <key>1</key> - </option> - <option> - <name>Dash</name> - <key>2</key> - </option> - <option> - <name>Dots</name> - <key>3</key> - </option> - <option> - <name>Dash-Dot</name> - <key>4</key> - </option> - <option> - <name>Dash-Dot-Dot</name> - <key>5</key> - </option> - <option> - <name>None</name> - <key>0</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Marker</name> - <key>marker1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>None</name> - <key>-1</key> - </option> - <option> - <name>Circle</name> - <key>0</key> - </option> - <option> - <name>Rectangle</name> - <key>1</key> - </option> - <option> - <name>Diamond</name> - <key>2</key> - </option> - <option> - <name>Triangle</name> - <key>3</key> - </option> - <option> - <name>Down Triangle</name> - <key>4</key> - </option> - <option> - <name>Left Triangle</name> - <key>6</key> - </option> - <option> - <name>Right Triangle</name> - <key>7</key> - </option> - <option> - <name>Cross</name> - <key>8</key> - </option> - <option> - <name>X-Cross</name> - <key>9</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if (int($nconnections()) >= 2 or ($type() == "complex" and int($nconnections()) >= 1) or ($type() == "msg_complex")) and (not $type() == "msg_float") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 2 Width</name> - <key>width2</key> - <hide>#if (int($nconnections()) >= 2 or ($type() == "complex" and int($nconnections()) >= 1) or ($type() == "msg_complex")) and (not $type() == "msg_float") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <value>"red"</value> - <hide>#if (int($nconnections()) >= 2 or ($type() == "complex" and int($nconnections()) >= 1) or ($type() == "msg_complex")) and (not $type() == "msg_float") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 2 Style</name> - <key>style2</key> - <hide>#if (int($nconnections()) >= 2 or ($type() == "complex" and int($nconnections()) >= 1) or ($type() == "msg_complex")) and (not $type() == "msg_float") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 2 Marker</name> - <key>marker2</key> - <hide>#if (int($nconnections()) >= 2 or ($type() == "complex" and int($nconnections()) >= 1) or ($type() == "msg_complex")) and (not $type() == "msg_float") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if (int($nconnections()) >= 2 or ($type() == "complex" and int($nconnections()) >= 1) or ($type() == "msg_complex")) and (not $type() == "msg_float") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if ((int($nconnections()) >= 3 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 3 Width</name> - <key>width3</key> - <hide>#if ((int($nconnections()) >= 3 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <value>"green"</value> - <hide>#if ((int($nconnections()) >= 3 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 3 Style</name> - <key>style3</key> - <hide>#if ((int($nconnections()) >= 3 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 3 Marker</name> - <key>marker3</key> - <hide>#if ((int($nconnections()) >= 3 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if ((int($nconnections()) >= 3 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if ((int($nconnections()) >= 4 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 4 Width</name> - <key>width4</key> - <hide>#if ((int($nconnections()) >= 4 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <value>"black"</value> - <hide>#if ((int($nconnections()) >= 4 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 4 Style</name> - <key>style4</key> - <hide>#if ((int($nconnections()) >= 4 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 4 Marker</name> - <key>marker4</key> - <hide>#if ((int($nconnections()) >= 4 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if ((int($nconnections()) >= 4 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if ((int($nconnections()) >= 5 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 5 Width</name> - <key>width5</key> - <hide>#if ((int($nconnections()) >= 5 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <value>"cyan"</value> - <hide>#if ((int($nconnections()) >= 5 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 5 Style</name> - <key>style5</key> - <hide>#if ((int($nconnections()) >= 5 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 5 Marker</name> - <key>marker5</key> - <hide>#if ((int($nconnections()) >= 5 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if ((int($nconnections()) >= 5 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if ((int($nconnections()) >= 6 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 6 Width</name> - <key>width6</key> - <hide>#if ((int($nconnections()) >= 6 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <value>"magenta"</value> - <hide>#if ((int($nconnections()) >= 6 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 6 Style</name> - <key>style6</key> - <hide>#if ((int($nconnections()) >= 6 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 6 Marker</name> - <key>marker6</key> - <hide>#if ((int($nconnections()) >= 6 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if ((int($nconnections()) >= 6 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if ((int($nconnections()) >= 7 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 7 Width</name> - <key>width7</key> - <hide>#if ((int($nconnections()) >= 7 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <value>"yellow"</value> - <hide>#if ((int($nconnections()) >= 7 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 7 Style</name> - <key>style7</key> - <hide>#if ((int($nconnections()) >= 7 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 7 Marker</name> - <key>marker7</key> - <hide>#if ((int($nconnections()) >= 7 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if ((int($nconnections()) >= 7 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if ((int($nconnections()) >= 8 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 8 Width</name> - <key>width8</key> - <hide>#if ((int($nconnections()) >= 8 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <value>"dark red"</value> - <hide>#if ((int($nconnections()) >= 8 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 8 Style</name> - <key>style8</key> - <hide>#if ((int($nconnections()) >= 8 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 8 Marker</name> - <key>marker8</key> - <hide>#if ((int($nconnections()) >= 8 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if ((int($nconnections()) >= 8 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if ((int($nconnections()) >= 9 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 9 Width</name> - <key>width9</key> - <hide>#if ((int($nconnections()) >= 9 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <value>"dark green"</value> - <hide>#if ((int($nconnections()) >= 9 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 9 Style</name> - <key>style9</key> - <hide>#if ((int($nconnections()) >= 9 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 9 Marker</name> - <key>marker9</key> - <hide>#if ((int($nconnections()) >= 9 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if ((int($nconnections()) >= 9 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if ((int($nconnections()) >= 10 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 10 Width</name> - <key>width10</key> - <hide>#if ((int($nconnections()) >= 10 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <value>"dark blue"</value> - <hide>#if ((int($nconnections()) >= 10 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 10 Style</name> - <key>style10</key> - <hide>#if ((int($nconnections()) >= 10 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 10 Marker</name> - <key>marker10</key> - <hide>#if ((int($nconnections()) >= 10 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if ((int($nconnections()) >= 10 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <check>$nconnections <= #if $type() == "complex" then 5 else 10#</check> - - <sink> - <name>in</name> - <type>$type.t</type> - <nports>#if $type.t == 'message' then 0 else $nconnections#</nports> - <optional>1</optional> - </sink> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_vector_sink_f.block.yml b/gr-qtgui/grc/qtgui_vector_sink_f.block.yml new file mode 100644 index 0000000000..d30349dceb --- /dev/null +++ b/gr-qtgui/grc/qtgui_vector_sink_f.block.yml @@ -0,0 +1,352 @@ +id: qtgui_vector_sink_f +label: QT GUI Vector Sink + +parameters: +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: vlen + label: Vector Size + dtype: int + default: '1024' + hide: ${ 'part' if vlen == 1 else 'none' } +- id: x_start + label: X-Axis Start Value + dtype: real + default: '0' +- id: x_step + label: X-Axis Step Value + dtype: real + default: '1.0' +- id: x_axis_label + label: X-Axis Label + dtype: string + default: '"x-Axis"' + hide: ${ ('none' if (len(x_axis_label) > 0 and x_axis_label != "x-Axis") else + 'part') } +- id: y_axis_label + label: Y-Axis Label + dtype: string + default: '"y-Axis"' + hide: ${ ('none' if (len(y_axis_label) > 0 and y_axis_label != "y-Axis") else + 'part') } +- id: x_units + label: X-Axis Units + dtype: string + default: '""' + hide: '''part''' +- id: y_units + label: Y-Axis Units + dtype: string + default: '""' + hide: '''part''' +- id: ref_level + label: Ref Level + dtype: real + default: '0' +- id: grid + label: Grid + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: autoscale + label: Autoscale + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: average + label: Average + dtype: enum + default: 'False' + options: ['1.0', '0.2', '0.1', '0.05'] + option_labels: [None, Low, Medium, High] + hide: part +- id: ymin + label: Y min + dtype: real + default: '-140' + hide: part +- id: ymax + label: Y max + dtype: real + default: '10' + hide: part +- id: nconnections + label: Number of Inputs + dtype: int + default: '1' + hide: part +- id: update_time + label: Update Period + dtype: real + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: showports + label: Show Msg Ports + dtype: enum + default: 'True' + options: ['False', 'True'] + option_labels: ['Yes', 'No'] + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: width1 + label: Line 1 Width + category: Config + dtype: int + default: '1' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['"blue"', '"red"', '"green"', '"black"', '"cyan"', '"magenta"', '"yellow"', + '"dark red"', '"dark green"', '"dark blue"'] + option_labels: [Blue, Red, Green, Black, Cyan, Magenta, Yellow, Dark Red, Dark + Green, Dark Blue] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: width2 + label: Line 2 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: width3 + label: Line 3 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + default: '"green"' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: width4 + label: Line 4 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + default: '"black"' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: width5 + label: Line 5 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + default: '"cyan"' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: width6 + label: Line 6 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + default: '"magenta"' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: width7 + label: Line 7 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + default: '"yellow"' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: width8 + label: Line 8 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + default: '"dark red"' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: width9 + label: Line 9 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + default: '"dark green"' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: width10 + label: Line 10 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + default: '"dark blue"' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: float + vlen: ${ vlen } + multiplicity: ${ nconnections } + +outputs: +- domain: message + id: xval + optional: true + hide: ${ showports } + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + import sip + callbacks: + - set_update_time(${update_time}) + - set_title(${title}) + - set_color(${which}, ${color}) + - set_x_axis(${x_start}, ${x_step}) + - set_y_axis(${ymin}, ${ymax}) + - set_ref_level(${ref_level}) + - set_x_axis_units(${x_units}) + - set_y_axis_units(${y_units}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.vector_sink_f( + ${vlen}, + ${x_start}, + ${x_step}, + ${x_axis_label}, + ${y_axis_label}, + ${name}, + ${nconnections} # Number of inputs + ) + self.${id}.set_update_time(${update_time}) + self.${id}.set_y_axis(${ymin}, ${ymax}) + self.${id}.enable_autoscale(${autoscale}) + self.${id}.enable_grid(${grid}) + self.${id}.set_x_axis_units(${x_units}) + self.${id}.set_y_axis_units(${y_units}) + self.${id}.set_ref_level(${ref_level}) + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + widths = [${width1}, ${width2}, ${width3}, ${width4}, ${width5}, + ${width6}, ${width7}, ${width8}, ${width9}, ${width10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + + for i in range(${nconnections}): + if len(labels[i]) == 0: + self.${id}.set_line_label(i, "Data {0}".format(i)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id}.set_line_width(i, widths[i]) + self.${id}.set_line_color(i, colors[i]) + self.${id}.set_line_alpha(i, alphas[i]) + + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint()(win)} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_vector_sink_f.xml b/gr-qtgui/grc/qtgui_vector_sink_f.xml deleted file mode 100644 index 0f456323bf..0000000000 --- a/gr-qtgui/grc/qtgui_vector_sink_f.xml +++ /dev/null @@ -1,603 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Vector Sink</name> - <key>qtgui_vector_sink_f</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.vector_sink_f( - $vlen, - $x_start, - $x_step, - $x_axis_label, - $y_axis_label, - $name, - $nconnections \# Number of inputs -) -self.$(id).set_update_time($update_time) -self.$(id).set_y_axis($ymin, $ymax) -self.$(id).enable_autoscale($autoscale) -self.$(id).enable_grid($grid) -self.$(id).set_x_axis_units($x_units) -self.$(id).set_y_axis_units($y_units) -self.$(id).set_ref_level($ref_level) - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -widths = [$width1, $width2, $width3, $width4, $width5, - $width6, $width7, $width8, $width9, $width10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] -for i in xrange($nconnections): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_line_width(i, widths[i]) - self.$(id).set_line_color(i, colors[i]) - self.$(id).set_line_alpha(i, alphas[i]) - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - <callback>set_update_time($update_time)</callback> - <callback>set_title($title)</callback> - <callback>set_color($which, $color)</callback> - <callback>set_x_axis($x_start, $x_step)</callback> - <callback>set_y_axis($ymin, $ymax)</callback> - <callback>set_ref_level($ref_level)</callback> - <callback>set_x_axis_units($x_units)</callback> - <callback>set_y_axis_units($y_units)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>Vector Size</name> - <key>vlen</key> - <value>1024</value> - <type>int</type> - </param> - - <param> - <name>X-Axis Start Value</name> - <key>x_start</key> - <value>0</value> - <type>real</type> - </param> - - <param> - <name>X-Axis Step Value</name> - <key>x_step</key> - <value>1.0</value> - <type>real</type> - </param> - - <param> - <name>X-Axis Label</name> - <key>x_axis_label</key> - <value>"x-Axis"</value> - <type>string</type> - <hide>#if (len($x_axis_label()) > 0 and $x_axis_label != "x-Axis") then 'none' else 'part'#</hide> - </param> - - <param> - <name>Y-Axis Label</name> - <key>y_axis_label</key> - <value>"y-Axis"</value> - <type>string</type> - <hide>#if (len($y_axis_label()) > 0 and $y_axis_label != "y-Axis") then 'none' else 'part'#</hide> - </param> - - <param> - <name>X-Axis Units</name> - <key>x_units</key> - <value>""</value> - <type>string</type> - <hide>'part'</hide> - </param> - - <param> - <name>Y-Axis Units</name> - <key>y_units</key> - <value>""</value> - <type>string</type> - <hide>'part'</hide> - </param> - - <param> - <name>Ref Level</name> - <key>ref_level</key> - <value>0</value> - <type>real</type> - </param> - - <param> - <name>Grid</name> - <key>grid</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Autoscale</name> - <key>autoscale</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Average</name> - <key>average</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>None</name> - <key>1.0</key> - </option> - <option> - <name>Low</name> - <key>0.2</key> - </option> - <option> - <name>Medium</name> - <key>0.1</key> - </option> - <option> - <name>High</name> - <key>0.05</key> - </option> - </param> - - <param> - <name>Y min</name> - <key>ymin</key> - <value>-140</value> - <type>real</type> - <hide>part</hide> - </param> - <param> - <name>Y max</name> - <key>ymax</key> - <value>10</value> - <type>real</type> - <hide>part</hide> - </param> - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>part</hide> - </param> - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>real</type> - <hide>part</hide> - </param> - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <param> - <name>Show Msg Ports</name> - <key>showports</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>False</key> - </option> - <option> - <name>No</name> - <key>True</key> - </option> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Width</name> - <key>width1</key> - <value>1</value> - <type>int</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Blue</name> - <key>"blue"</key> - </option> - <option> - <name>Red</name> - <key>"red"</key> - </option> - <option> - <name>Green</name> - <key>"green"</key> - </option> - <option> - <name>Black</name> - <key>"black"</key> - </option> - <option> - <name>Cyan</name> - <key>"cyan"</key> - </option> - <option> - <name>Magenta</name> - <key>"magenta"</key> - </option> - <option> - <name>Yellow</name> - <key>"yellow"</key> - </option> - <option> - <name>Dark Red</name> - <key>"dark red"</key> - </option> - <option> - <name>Dark Green</name> - <key>"dark green"</key> - </option> - <option> - <name>Dark Blue</name> - <key>"dark blue"</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 2 Width</name> - <key>width2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 3 Width</name> - <key>width3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <value>"green"</value> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 4 Width</name> - <key>width4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <value>"black"</value> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 5 Width</name> - <key>width5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <value>"cyan"</value> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 6 Width</name> - <key>width6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <value>"magenta"</value> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 7 Width</name> - <key>width7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <value>"yellow"</value> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 8 Width</name> - <key>width8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <value>"dark red"</value> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 9 Width</name> - <key>width9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <value>"dark green"</value> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 10 Width</name> - <key>width10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <value>"dark blue"</value> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <sink> - <name>in</name> - <type>float</type> - <vlen>$vlen</vlen> - <nports>$nconnections</nports> - </sink> - - <source> - <name>xval</name> - <type>message</type> - <optional>1</optional> - <hide>$showports</hide> - </source> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_waterfall_sink_x.block.yml b/gr-qtgui/grc/qtgui_waterfall_sink_x.block.yml new file mode 100644 index 0000000000..4b1cc055bc --- /dev/null +++ b/gr-qtgui/grc/qtgui_waterfall_sink_x.block.yml @@ -0,0 +1,303 @@ +id: qtgui_waterfall_sink_x +label: QT GUI Waterfall Sink + +parameters: +- id: type + label: Type + dtype: enum + default: complex + options: [complex, float, msg_complex, msg_float] + option_labels: [Complex, Float, Complex Message, Float Message] + option_attributes: + fcn: [waterfall_sink_c, waterfall_sink_f, waterfall_sink_c, waterfall_sink_f] + t: [complex, float, message, message] + hide: part +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: fftsize + label: FFT Size + dtype: int + default: '1024' + hide: ${ ('all' if type.startswith('msg') else 'none') } +- id: freqhalf + label: Spectrum Width + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: [Full, Half] + hide: ${ ('part' if type == "float" or type == "msg_float" else 'all') } +- id: wintype + label: Window Type + dtype: int + default: firdes.WIN_BLACKMAN_hARRIS + options: [firdes.WIN_BLACKMAN_hARRIS, firdes.WIN_HAMMING, firdes.WIN_HANN, firdes.WIN_BLACKMAN, + firdes.WIN_RECTANGULAR, firdes.WIN_KAISER, firdes.WIN_FLATTOP] + option_labels: [Blackman-harris, Hamming, Hann, Blackman, Rectangular, Kaiser, + Flat-top] + hide: part +- id: fc + label: Center Frequency (Hz) + dtype: real + default: '0' +- id: bw + label: Bandwidth (Hz) + dtype: real + default: samp_rate +- id: int_min + label: Intensity Min + dtype: float + default: '-140' + hide: part +- id: int_max + label: Intensity Max + dtype: float + default: '10' + hide: part +- id: grid + label: Grid + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: nconnections + label: Number of Inputs + dtype: int + default: '1' + hide: ${ ('all' if type.startswith('msg') else 'part') } +- id: update_time + label: Update Period + dtype: real + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: showports + label: Show Msg Ports + dtype: enum + default: 'True' + options: ['False', 'True'] + option_labels: ['Yes', 'No'] + hide: part +- id: legend + label: Legend + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: axislabels + label: Axis Labels + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['0', '1', '2', '3', '5', '6'] + option_labels: [Multi Color, White Hot, Black Hot, Incandescent, Sunset, Cool] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: ${ type.t } + multiplicity: ${ (0 if type.startswith('msg') else nconnections) } + optional: true +- domain: message + id: freq + optional: true + hide: ${ showports } + +outputs: +- domain: message + id: freq + optional: true + hide: ${ showports } + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + from gnuradio.filter import firdes + import sip + callbacks: + - set_frequency_range(${fc}, ${bw}) + - set_update_time(${update_time}) + - set_title(${which}, ${title}) + - set_color(${which}, ${color}) + - set_intensity_range(${int_min}, ${int_max}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.${type.fcn}( + ${fftsize}, #size + ${wintype}, #wintype + ${fc}, #fc + ${bw}, #bw + ${name}, #name + ${ (0 if type.startswith('msg') else nconnections) } #number of inputs + ) + self.${id}.set_update_time(${update_time}) + self.${id}.enable_grid(${grid}) + self.${id}.enable_axis_labels(${axislabels}) + + if not ${legend}: + self.${id}.disable_legend() + + if "${type}" == "float" or "${type}" == "msg_float": + self.${id}.set_plot_pos_half(not ${freqhalf}) + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + + for i in range(${1 if type.startswith('msg') else nconnections}): + if len(labels[i]) == 0: + self.${id}.set_line_label(i, "Data {0}".format(i)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id}.set_color_map(i, colors[i]) + self.${id}.set_line_alpha(i, alphas[i]) + + self.${id}.set_intensity_range(${int_min}, ${int_max}) + + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint()(win)} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_waterfall_sink_x.xml b/gr-qtgui/grc/qtgui_waterfall_sink_x.xml deleted file mode 100644 index a684492246..0000000000 --- a/gr-qtgui/grc/qtgui_waterfall_sink_x.xml +++ /dev/null @@ -1,557 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Waterfall Sink</name> - <key>qtgui_waterfall_sink_x</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>from gnuradio.filter import firdes</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.$(type.fcn)( - $fftsize, \#size - $wintype, \#wintype - $fc, \#fc - $bw, \#bw - $name, \#name - #if $type.t == 'message' then 0 else $nconnections# \#number of inputs -) -self.$(id).set_update_time($update_time) -self.$(id).enable_grid($grid) -self.$(id).enable_axis_labels($axislabels) - -if not $legend: - self.$(id).disable_legend() - -if "$type" == "float" or "$type" == "msg_float": - self.$(id).set_plot_pos_half(not $freqhalf) - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] -for i in xrange(#if $type.t == 'message' then 1 else $nconnections#): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_color_map(i, colors[i]) - self.$(id).set_line_alpha(i, alphas[i]) - -self.$(id).set_intensity_range($int_min, $int_max) - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - <callback>set_frequency_range($fc, $bw)</callback> - <callback>set_update_time($update_time)</callback> - <callback>set_title($which, $title)</callback> - <callback>set_color($which, $color)</callback> - <callback>set_intensity_range($int_min, $int_max)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:waterfall_sink_c</opt> - <opt>t:complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:waterfall_sink_f</opt> - <opt>t:float</opt> - </option> - <option> - <name>Complex Message</name> - <key>msg_complex</key> - <opt>fcn:waterfall_sink_c</opt> - <opt>t:message</opt> - </option> - <option> - <name>Float Message</name> - <key>msg_float</key> - <opt>fcn:waterfall_sink_f</opt> - <opt>t:message</opt> - </option> - </param> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>FFT Size</name> - <key>fftsize</key> - <value>1024</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'none'#</hide> - </param> - - <param> - <name>Spectrum Width</name> - <key>freqhalf</key> - <value>True</value> - <type>enum</type> - <hide>#if $type() == "float" or $type() == "msg_float" then 'part' else 'all'#</hide> - <option> - <name>Full</name> - <key>True</key> - </option> - <option> - <name>Half</name> - <key>False</key> - </option> - </param> - - <param> - <name>Window Type</name> - <key>wintype</key> - <value>firdes.WIN_BLACKMAN_hARRIS</value> - <type>int</type> - <hide>part</hide> - <option> - <name>Blackman-harris</name> - <key>firdes.WIN_BLACKMAN_hARRIS</key> - </option> - <option> - <name>Hamming</name> - <key>firdes.WIN_HAMMING</key> - </option> - <option> - <name>Hann</name> - <key>firdes.WIN_HANN</key> - </option> - <option> - <name>Blackman</name> - <key>firdes.WIN_BLACKMAN</key> - </option> - <option> - <name>Rectangular</name> - <key>firdes.WIN_RECTANGULAR</key> - </option> - <option> - <name>Kaiser</name> - <key>firdes.WIN_KAISER</key> - </option> - <option> - <name>Flat-top</name> - <key>firdes.WIN_FLATTOP</key> - </option> - </param> - - <param> - <name>Center Frequency (Hz)</name> - <key>fc</key> - <value>0</value> - <type>real</type> - </param> - - <param> - <name>Bandwidth (Hz)</name> - <key>bw</key> - <value>samp_rate</value> - <type>real</type> - </param> - - <param> - <name>Intensity Min</name> - <key>int_min</key> - <value>-140</value> - <type>float</type> - <hide>part</hide> - </param> - - <param> - <name>Intensity Max</name> - <key>int_max</key> - <value>10</value> - <type>float</type> - <hide>part</hide> - </param> - - <param> - <name>Grid</name> - <key>grid</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'part'#</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <param> - <name>Show Msg Ports</name> - <key>showports</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>False</key> - </option> - <option> - <name>No</name> - <key>True</key> - </option> - </param> - - - <!-- Begin Config Tab items --> - <param> - <name>Legend</name> - <key>legend</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Axis Labels</name> - <key>axislabels</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Multi Color</name> - <key>0</key> - </option> - <option> - <name>White Hot</name> - <key>1</key> - </option> - <option> - <name>Black Hot</name> - <key>2</key> - </option> - <option> - <name>Incandescent</name> - <key>3</key> - </option> - <option> - <name>Sunset</name> - <key>5</key> - </option> - <option> - <name>Cool</name> - <key>6</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - - <sink> - <name>in</name> - <type>$type.t</type> - <nports>#if $type.t == 'message' then 0 else $nconnections#</nports> - <optional>1</optional> - </sink> - - <sink> - <name>freq</name> - <type>message</type> - <optional>1</optional> - <hide>$showports</hide> - </sink> - - <source> - <name>freq</name> - <type>message</type> - <optional>1</optional> - <hide>$showports</hide> - </source> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-uhd/grc/CMakeLists.txt b/gr-uhd/grc/CMakeLists.txt index d748bfacef..72a6543df3 100644 --- a/gr-uhd/grc/CMakeLists.txt +++ b/gr-uhd/grc/CMakeLists.txt @@ -18,28 +18,28 @@ # Boston, MA 02110-1301, USA. ######################################################################## -# Rules for generating the source and sink xml wrappers +# Rules for generating the source and sink yml wrappers ######################################################################## include(GrPython) -macro(GEN_BLOCK_XML _generator _xml_block) +macro(GEN_BLOCK_YML _generator _yml_block) set(generator ${CMAKE_CURRENT_SOURCE_DIR}/${_generator}) - set(xml_block ${CMAKE_CURRENT_BINARY_DIR}/${_xml_block}) - list(APPEND xml_blocks ${xml_block}) + set(yml_block ${CMAKE_CURRENT_BINARY_DIR}/${_yml_block}) + list(APPEND yml_blocks ${yml_block}) add_custom_command( - DEPENDS ${generator} OUTPUT ${xml_block} - COMMAND ${PYTHON_EXECUTABLE} ${generator} ${xml_block} + DEPENDS ${generator} OUTPUT ${yml_block} + COMMAND ${PYTHON_EXECUTABLE} ${generator} ${yml_block} ) -endmacro(GEN_BLOCK_XML) +endmacro(GEN_BLOCK_YML) -GEN_BLOCK_XML(gen_uhd_usrp_blocks.py uhd_usrp_source.xml) -GEN_BLOCK_XML(gen_uhd_usrp_blocks.py uhd_usrp_sink.xml) +GEN_BLOCK_YML(gen_uhd_usrp_blocks.py uhd_usrp_source.block.yml) +GEN_BLOCK_YML(gen_uhd_usrp_blocks.py uhd_usrp_sink.block.yml) -add_custom_target(uhd_grc_xml_blocks ALL DEPENDS ${xml_blocks}) +add_custom_target(uhd_grc_yml_blocks ALL DEPENDS ${yml_blocks}) install(FILES - ${xml_blocks} - uhd_amsg_source.xml - uhd_block_tree.xml + ${yml_blocks} + uhd_amsg_source.block.yml + uhd.tree.yml DESTINATION ${GRC_BLOCKS_DIR} ) diff --git a/gr-uhd/grc/gen_uhd_usrp_blocks.py b/gr-uhd/grc/gen_uhd_usrp_blocks.py index 1bba490a23..4a7b484f7d 100644 --- a/gr-uhd/grc/gen_uhd_usrp_blocks.py +++ b/gr-uhd/grc/gen_uhd_usrp_blocks.py @@ -19,669 +19,344 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA """ MAIN_TMPL = """\ -<?xml version="1.0"?> -<block> - <name>UHD: USRP $sourk.title()</name> - <key>uhd_usrp_$(sourk)</key> - <flags>throttle</flags> - <import>from gnuradio import uhd</import> - <import>import time</import> - <make>uhd.usrp_$(sourk)( - ",".join((\$dev_addr, \$dev_args)), - uhd.stream_args( - cpu_format="\$type", - \#if \$otw() - otw_format=\$otw, - \#end if - \#if \$stream_args() - args=\$stream_args, - \#end if - \#if \$stream_chans() - channels=\$stream_chans, - \#else - channels=range(\$nchan), - \#end if - ),$lentag_arg -) -\#if \$clock_rate() -self.\$(id).set_clock_rate(\$clock_rate, uhd.ALL_MBOARDS) -\#end if -#for $m in range($max_mboards) -######################################################################## -\#if \$num_mboards() > $m and \$clock_source$(m)() -self.\$(id).set_clock_source(\$clock_source$(m), $m) -\#end if -######################################################################## -\#if \$num_mboards() > $m and \$time_source$(m)() -self.\$(id).set_time_source(\$time_source$(m), $m) -\#end if -######################################################################## -\#if \$num_mboards() > $m and \$sd_spec$(m)() -self.\$(id).set_subdev_spec(\$sd_spec$(m), $m) -\#end if -######################################################################## -#end for -self.\$(id).set_samp_rate(\$samp_rate) -\#if \$sync() == 'sync' -self.\$(id).set_time_unknown_pps(uhd.time_spec()) -\#elif \$sync() == 'pc_clock' -self.\$(id).set_time_now(uhd.time_spec(time.time()), uhd.ALL_MBOARDS) -\#end if -#for $n in range($max_nchan) -\#if \$nchan() > $n -self.\$(id).set_center_freq(\$center_freq$(n), $n) -\#if \$norm_gain${n}() -self.\$(id).set_normalized_gain(\$gain$(n), $n) -\#else -self.\$(id).set_gain(\$gain$(n), $n) -\#end if - \#if \$ant$(n)() -self.\$(id).set_antenna(\$ant$(n), $n) - \#end if - \#if \$bw$(n)() -self.\$(id).set_bandwidth(\$bw$(n), $n) - \#end if -#if $sourk == 'source' - \#if \$lo_export$(n)() and not \$hide_lo_controls() -self.\$(id).set_lo_export_enabled(\$lo_export$(n), uhd.ALL_LOS, $n) - \#end if - \#if \$lo_source$(n)() and not \$hide_lo_controls() -self.\$(id).set_lo_source(\$lo_source$(n), uhd.ALL_LOS, $n) - \#end if - \#if \$dc_offs_enb$(n)() -self.\$(id).set_auto_dc_offset(\$dc_offs_enb$(n), $n) - \#end if - \#if \$iq_imbal_enb$(n)() -self.\$(id).set_auto_iq_balance(\$iq_imbal_enb$(n), $n) - \#end if -#end if -\#end if -#end for -</make> - <callback>set_samp_rate(\$samp_rate)</callback> - #for $n in range($max_nchan) - <callback>set_center_freq(\$center_freq$(n), $n)</callback> - <callback>\#if \$norm_gain${n}() -self.\$(id).set_normalized_gain(\$gain$(n), $n) -\#else -self.\$(id).set_gain(\$gain$(n), $n) -\#end if - </callback> - <callback>\#if not \$hide_lo_controls() -set_lo_source(\$lo_source$(n), uhd.ALL_LOS, $n) -\#end if - </callback> - <callback>\#if not \$hide_lo_controls() -set_lo_export_enabled(\$lo_export$(n), uhd.ALL_LOS, $n) -\#end if - </callback> - <callback>set_antenna(\$ant$(n), $n)</callback> - <callback>set_bandwidth(\$bw$(n), $n)</callback> - #end for - <param> - <name>$(direction.title())put Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex float32</name> - <key>fc32</key> - <opt>type:fc32</opt> - </option> - <option> - <name>Complex int16</name> - <key>sc16</key> - <opt>type:sc16</opt> - </option> - <option> - <name>VITA word32</name> - <key>item32</key> - <opt>type:s32</opt> - </option> - </param> - <param> - <name>Wire Format</name> - <key>otw</key> - <value></value> - <type>string</type> - <hide> - \#if \$otw() - none - \#else - part - \#end if - </hide> - <option> - <name>Automatic</name> - <key></key> - </option> - <option> - <name>Complex int16</name> - <key>sc16</key> - </option> - <option> - <name>Complex int12</name> - <key>sc12</key> - </option> - <option> - <name>Complex int8</name> - <key>sc8</key> - </option> - </param> - <param> - <name>Stream args</name> - <key>stream_args</key> - <value></value> - <type>string</type> - <hide> - \#if \$stream_args() - none - \#else - part - \#end if - </hide> - <option> - <name>peak=0.003906</name> - <key>peak=0.003906</key> - </option> - </param> - <param> - <name>Stream channels</name> - <key>stream_chans</key> - <value>[]</value> - <type>int_vector</type> - <hide> - \#if \$stream_chans() - none - \#else - part - \#end if - </hide> - </param> - <param> - <name>Device Address</name> - <key>dev_addr</key> - <value>""</value> - <type>string</type> - <hide> - \#if \$dev_addr() - none - \#else - part - \#end if - </hide> - </param> - <param> - <name>Device Arguments</name> - <key>dev_args</key> - <value>""</value> - <type>string</type> - <hide> - \#if \$dev_args() - none - \#else - part - \#end if - </hide> - </param> - <param> - <name>Sync</name> - <key>sync</key> - <value></value> - <type>enum</type> - <hide>\#if \$sync() then 'none' else 'part'#</hide> - <option> - <name>unknown PPS</name> - <key>sync</key> - </option> - <option> - <name>PC Clock</name> - <key>pc_clock</key> - </option> - <option> - <name>don't sync</name> - <key></key> - </option> - </param> - <param> - <name>Clock Rate (Hz)</name> - <key>clock_rate</key> - <value>0.0</value> - <type>real</type> - <hide>\#if \$clock_rate() then 'none' else 'part'#</hide> - <option> - <name>Default</name> - <key>0.0</key> - </option> - <option> - <name>200 MHz</name> - <key>200e6</key> - </option> - <option> - <name>184.32 MHz</name> - <key>184.32e6</key> - </option> - <option> - <name>120 MHz</name> - <key>120e6</key> - </option> - <option> - <name>30.72 MHz</name> - <key>30.72e6</key> - </option> - </param> - <param> - <name>Num Mboards</name> - <key>num_mboards</key> - <value>1</value> - <type>int</type> - <hide>part</hide> - #for $m in range(1, $max_mboards+1) - <option> - <name>$(m)</name> - <key>$m</key> - </option> - #end for - </param> - #for $m in range($max_mboards) - <param> - <name>Mb$(m): Clock Source</name> - <key>clock_source$(m)</key> - <value></value> - <type>string</type> - <hide> - \#if not \$num_mboards() > $m - all - \#elif \$clock_source$(m)() - none - \#else - part - \#end if - </hide> - <option><name>Default</name><key></key></option> - <option><name>Internal</name><key>internal</key></option> - <option><name>External</name><key>external</key></option> - <option><name>MIMO Cable</name><key>mimo</key></option> - <option><name>O/B GPSDO</name><key>gpsdo</key></option> - </param> - <param> - <name>Mb$(m): Time Source</name> - <key>time_source$(m)</key> - <value></value> - <type>string</type> - <hide> - \#if not \$num_mboards() > $m - all - \#elif \$time_source$(m)() - none - \#else - part - \#end if - </hide> - <option><name>Default</name><key></key></option> - <option><name>External</name><key>external</key></option> - <option><name>MIMO Cable</name><key>mimo</key></option> - <option><name>O/B GPSDO</name><key>gpsdo</key></option> - </param> - <param> - <name>Mb$(m): Subdev Spec</name> - <key>sd_spec$(m)</key> - <value></value> - <type>string</type> - <hide> - \#if not \$num_mboards() > $m - all - \#elif \$sd_spec$(m)() - none - \#else - part - \#end if - </hide> - </param> - #end for - <param> - <name>Num Channels</name> - <key>nchan</key> - <value>1</value> - <type>int</type> - #for $n in range(1, $max_nchan+1) - <option> - <name>$(n)</name> - <key>$n</key> - </option> - #end for - </param> - <param> - <name>Samp Rate (Sps)</name> - <key>samp_rate</key> - <value>samp_rate</value> - <type>real</type> - </param> - $params - <check>$max_nchan >= \$nchan</check> - <check>\$nchan > 0</check> - <check>$max_mboards >= \$num_mboards</check> - <check>\$num_mboards > 0</check> - <check>\$nchan >= \$num_mboards</check> - <check>(not \$stream_chans()) or (\$nchan == len(\$stream_chans))</check> - #for $n in range($max_nchan) - <check>(\$norm_gain${n} and \$gain${n} >= 0 and \$gain${n} <= 1) or not \$norm_gain${n}</check> - #end for - <sink> - <name>command</name> - <type>message</type> - <optional>1</optional> - <hide>\$hide_cmd_port</hide> - </sink> - <$sourk> - <name>$direction</name> - <type>\$type.type</type> - <nports>\$nchan</nports> - </$sourk> - <doc> -The UHD USRP $sourk.title() Block: - -Device Address: -The device address is a delimited string used to locate UHD devices on your system. \\ -If left blank, the first UHD device found will be used. \\ -Use the device address to specify a specific device or list of devices. -USRP1 Example: serial=12345678 -USRP2 Example: addr=192.168.10.2 -USRP2 Example: addr0=192.168.10.2, addr1=192.168.10.3 - -$(direction.title()) Type: -This parameter controls the data type of the stream in gnuradio. - -Wire Format: -This parameter controls the form of the data over the bus/network. \ -Complex bytes may be used to trade off precision for bandwidth. \ -Not all formats are supported on all devices. - -Stream Args: -Optional arguments to be passed in the UHD streamer object. \ -Streamer args is a list of key/value pairs; usage is determined by the implementation. -Ex: the scalar key affects the scaling between 16 and 8 bit integers in sc8 wire format. - -Num Motherboards: -Selects the number of USRP motherboards in this device configuration. - -Reference Source: -Where the motherboard should sync its time and clock references. -If source and sink blocks reference the same device, -it is only necessary to set the reference source on one of the blocks. - -Subdevice specification: -Each motherboard should have its own subdevice specification \\ -and all subdevice specifications should be the same length. \\ -Select the subdevice or subdevices for each channel using a markup string. \\ -The markup string consists of a list of dboard_slot:subdev_name pairs (one pair per channel). \\ -If left blank, the UHD will try to select the first subdevice on your system. \\ -See the application notes for further details. -Single channel example: :AB -Dual channel example: :A :B - -Num Channels: -Selects the total number of channels in this multi-USRP configuration. -Ex: 4 motherboards with 2 channels per board = 8 channels total - -Sample rate: -The sample rate is the number of samples per second input by this block. \\ -The UHD device driver will try its best to match the requested sample rate. \\ -If the requested rate is not possible, the UHD block will print an error at runtime. - -Center frequency: -The center frequency is the overall frequency of the RF chain. \\ -For greater control of how the UHD tunes elements in the RF chain, \\ +id: uhd_usrp_sink +label: 'UHD: USRP ${sourk.title()}' +flags: throttle + +parameters: +- id: type + label: ${'$'}{direction.title()}put Type + dtype: enum + options: [fc32, sc16, item32] + option_labels: [Complex float32, Complex int16, VITA word32] + option_attributes: + type: [fc32, sc16, s32] + hide: part +- id: otw + label: Wire Format + dtype: enum + options: ['', sc16, sc12, sc8] + option_labels: [Automatic, Complex int16, Complex int12, Complex int8] + hide: ${'$'}{ 'none' if otw else 'part'} +- id: stream_args + label: Stream args + dtype: string + options: [peak=0.003906] + option_labels: [peak=0.003906] + hide: ${'$'}{ 'none' if stream_args else 'part'} +- id: stream_chans + label: Stream channels + dtype: int_vector + default: '[]' + hide: ${'$'}{ 'none' if stream_chans else 'part'} +- id: dev_addr + label: Device Address + dtype: string + default: '""' + hide: ${'$'}{ 'none' if dev_addr else 'part'} +- id: dev_args + label: Device Arguments + dtype: string + default: '""' + hide: ${'$'}{ 'none' if dev_args else 'part'} +- id: sync + label: Sync + dtype: enum + options: [sync, pc_clock, ''] + option_labels: [unknown PPS, PC Clock, don't sync] + hide: ${'$'}{ 'none' if sync else 'part'} +- id: clock_rate + label: Clock Rate (Hz) + dtype: real + default: '0.0' + options: ['0.0', 200e6, 184.32e6, 120e6, 30.72e6] + option_labels: [Default, 200 MHz, 184.32 MHz, 120 MHz, 30.72 MHz] + hide: ${'$'}{ 'none' if clock_rate else 'part' } +- id: num_mboards + label: Num Mboards + dtype: int + default: '1' + options: ['1', '2', '3', '4', '5', '6', '7', '8'] + hide: part +% for m in range(max_mboards): +- id: clock_source${m} + label: 'Mb${m}: Clock Source' + dtype: string + options: ['', internal, external, mimo, gpsdo] + option_labels: [Default, Internal, External, MIMO Cable, O/B GPSDO] + hide: ${'$'}{ 'all' if not (num_mboards > ${m}) else ( 'none' if clock_source${m}) else 'part')} +- id: time_source${m} + label: 'Mb${m}: Time Source' + dtype: string + options: ['', external, mimo, gpsdo] + option_labels: [Default, External, MIMO Cable, O/B GPSDO] + hide: ${'$'}{ 'all' if not (num_mboards > ${m}) else ('none' if time_source${m}) else 'part')} +- id: sd_spec${m} + label: 'Mb${m}: Subdev Spec' + dtype: string + hide: ${'$'}{ 'all' if not (num_mboards > ${m}) else ('none' if sd_spec${m}) else 'part')} +% endfor +- id: nchan + label: Num Channels + dtype: int + default: 1 + options: [ ${", ".join([str(n) for n in range(1, max_nchan+1)])} ] + hide: part +- id: samp_rate + label: Smp rate (Sps) + dtype: real +${params} + + + +inputs: +- domain: message + id: command + optional: true + hide: ${'$'}{hide_cmd_port} +% if sourk == 'sink': +- domain: stream +% else: + +outputs: +- domain: stream +% endif + dtype: ${'$'}{type.type} + multiplicity: ${'$'}{nchan} + +templates: + imports: |- + from gnuradio import uhd + import time + make: | + uhd.usrp_sink( + ",".join((${'$'}{dev_addr}, ${'$'}{dev_args})), + uhd.stream_args( + cpu_format="${'$'}{type}", + ${'%'} if otw: + otw_format=${'$'}{otw}, + ${'%'} endif + ${'%'} if stream_args: + args=${'$'}{stream_args}, + ${'%'} endif + ${'%'} if stream_chans: + channels=${'$'}{stream_chans}, + ${'%'} else: + channels=range(${'$'}{nchan}), + ${'%'} endif + ), + ${'%'} if len_tag_name: + ${'$'}{len_tag_name}, + ${'%'} endif + ) + ${'%'} if clock_rate: + self.${'$'}{id}.set_clock_rate(${'$'}{clock_rate}, uhd.ALL_MBOARDS) + ${'%'} endif + self.${'$'}{id}.set_samp_rate(${'$'}{samp_rate}) + ${'%'} if sync == 'sync': + self.${'$'}{id}.set_time_unknown_pps(uhd.time_spec()) + #elif ${'$'}{sync} == 'pc_clock' + self.${'$'}{id}.set_time_now(uhd.time_spec(time.time()), uhd.ALL_MBOARDS) + ${'%'} endif + callbacks: + - set_samp_rate(${'$'}{samp_rate}) + % for n in range(max_nchan): + - set_center_freq(${'center_freq' + str(n)}, ${n}) + - self.${'$'}{id}.set_${'$'}{'normalized_' if eval('norm_gain' + str(n))}gain(gain${n}, ${n}) + - ${'$'}{'set_lo_source(lo_source${n}, uhd.ALL_LOS, ${n})' if not hide_lo_controls()} + - ${'$'}{'set_lo_export_enabled(lo_export${n}, uhd.ALL_LOS, ${n})' if not hide_lo_controls()} + - set_antenna(${'ant' + str(n)}, ${n}) + - set_bandwidth(${'bw' + str(n)}, ${n}) + % endfor + + +documentation: |- + The UHD USRP ${sourk.title()} Block: + + Device Address: + The device address is a delimited string used to locate UHD devices on your system. \\ + If left blank, the first UHD device found will be used. \\ + Use the device address to specify a specific device or list of devices. + USRP1 Example: serial=12345678 + USRP2 Example: addr=192.168.10.2 + USRP2 Example: addr0=192.168.10.2, addr1=192.168.10.3 + + ${direction.title()} Type: + This parameter controls the data type of the stream in gnuradio. + + Wire Format: + This parameter controls the form of the data over the bus/network. \ + Complex bytes may be used to trade off precision for bandwidth. \ + Not all formats are supported on all devices. + + Stream Args: + Optional arguments to be passed in the UHD streamer object. \ + Streamer args is a list of key/value pairs; usage is determined by the implementation. + Ex: the scalar key affects the scaling between 16 and 8 bit integers in sc8 wire format. + + Num Motherboards: + Selects the number of USRP motherboards in this device configuration. + + Reference Source: + Where the motherboard should sync its time and clock references. + If source and sink blocks reference the same device, + it is only necessary to set the reference source on one of the blocks. + + Subdevice specification: + Each motherboard should have its own subdevice specification \\ + and all subdevice specifications should be the same length. \\ + Select the subdevice or subdevices for each channel using a markup string. \\ + The markup string consists of a list of dboard_slot:subdev_name pairs (one pair per channel). \\ + If left blank, the UHD will try to select the first subdevice on your system. \\ + See the application notes for further details. + Single channel example: :AB + Dual channel example: :A :B + + Num Channels: + Selects the total number of channels in this multi-USRP configuration. + Ex: 4 motherboards with 2 channels per board = 8 channels total + + Sample rate: + The sample rate is the number of samples per second input by this block. \\ + The UHD device driver will try its best to match the requested sample rate. \\ + If the requested rate is not possible, the UHD block will print an error at runtime. + + Center frequency: + The center frequency is the overall frequency of the RF chain. \\ + For greater control of how the UHD tunes elements in the RF chain, \\ pass a tune_request object rather than a simple target frequency. -Tuning with an LO offset example: uhd.tune_request(freq, lo_off) -Tuning without DSP: uhd.tune_request(target_freq, dsp_freq=0, \\ + Tuning with an LO offset example: uhd.tune_request(freq, lo_off) + Tuning without DSP: uhd.tune_request(target_freq, dsp_freq=0, \\ dsp_freq_policy=uhd.tune_request.POLICY_MANUAL) -Antenna: -For subdevices with only one antenna, this may be left blank. \\ -Otherwise, the user should specify one of the possible antenna choices. \\ -See the daughterboard application notes for the possible antenna choices. + Antenna: + For subdevices with only one antenna, this may be left blank. \\ + Otherwise, the user should specify one of the possible antenna choices. \\ + See the daughterboard application notes for the possible antenna choices. + + Bandwidth: + To use the default bandwidth filter setting, this should be zero. \\ + Only certain subdevices have configurable bandwidth filters. \\ + See the daughterboard application notes for possible configurations. -Bandwidth: -To use the default bandwidth filter setting, this should be zero. \\ -Only certain subdevices have configurable bandwidth filters. \\ -See the daughterboard application notes for possible configurations. + Length tag key (Sink only): + When a nonempty string is given, the USRP sink will look for length tags \\ + to determine transmit burst lengths. -Length tag key (Sink only): -When a nonempty string is given, the USRP sink will look for length tags \\ -to determine transmit burst lengths. + See the UHD manual for more detailed documentation: + http://uhd.ettus.com -See the UHD manual for more detailed documentation: -http://uhd.ettus.com - </doc> -</block> +file_format: 1 """ -PARAMS_TMPL = """ <param> - <name>Ch$(n): Center Freq (Hz)</name> - <key>center_freq$(n)</key> - <value>0</value> - <type>real</type> - <hide>\#if \$nchan() > $n then 'none' else 'all'#</hide> - <tab>RF Options</tab> - </param> - <param> - <name>Ch$(n): Gain Value</name> - <key>gain$(n)</key> - <value>0</value> - <type>float</type> - <hide>\#if \$nchan() > $n then 'none' else 'all'#</hide> - <tab>RF Options</tab> - </param> - <param> - <name>Ch$(n): Gain Type</name> - <key>norm_gain$(n)</key> - <value>False</value> - <type>bool</type> - <hide>\#if \$nchan() <= $n - all - \#elif bool(\$norm_gain${n}()) - none - \#else - part - \#end if</hide> - <option> - <name>Absolute (dB)</name> - <key>False</key> - </option> - <option> - <name>Normalized</name> - <key>True</key> - </option> - <tab>RF Options</tab> - </param> - <param> - <name>Ch$(n): Antenna</name> - <key>ant$(n)</key> - <value></value> - <type>string</type> - <hide> - \#if not \$nchan() > $n - all - \#elif \$ant$(n)() - none - \#else - part - \#end if - </hide> - <option> - <name>TX/RX</name> - <key>TX/RX</key> - </option> -#if $sourk == 'source' - <option> - <name>RX2</name> - <key>RX2</key> - </option> - <option> - <name>RX1</name> - <key>RX1</key> - </option> -#end if - <tab>RF Options</tab> - </param> - <param> - <name>Ch$(n): Bandwidth (Hz)</name> - <key>bw$(n)</key> - <value>0</value> - <type>real</type> - <hide> - \#if not \$nchan() > $n - all - \#elif \$bw$(n)() - none - \#else - part - \#end if - </hide> - <tab>RF Options</tab> - </param> -#if $sourk == 'source' - <param> - <name>Ch$(n): LO Source</name> - <key>lo_source$(n)</key> - <value>internal</value> - <type>string</type> - <hide> - \#if not \$nchan() > $n - all - \#elif \$hide_lo_controls() - all - \#else - none - \#end if - </hide> - <option> - <name>Internal</name> - <key>internal</key> - </option> - <option> - <name>External</name> - <key>external</key> - </option> - <option> - <name>Companion</name> - <key>companion</key> - </option> - <tab>RF Options</tab> - </param> -#end if -#if $sourk == 'source' - <param> - <name>Ch$(n): LO Export</name> - <key>lo_export$(n)</key> - <value>False</value> - <type>bool</type> - <hide> - \#if not \$nchan() > $n - all - \#elif \$hide_lo_controls() - all - \#else - none - \#end if - </hide> - <option> - <name>True</name> - <key>True</key> - </option> - <option> - <name>False</name> - <key>False</key> - </option> - <tab>RF Options</tab> - </param> -#end if -#if $sourk == 'source' - <param> - <name>Ch$(n): Enable DC Offset Correction</name> - <key>dc_offs_enb$(n)</key> - <value>""</value> - <type>raw</type> - <hide> - \#if not \$nchan() > $n - all - \#else - part - \#end if - </hide> - <tab>FE Corrections</tab> - </param> - <param> - <name>Ch$(n): Enable IQ Imbalance Correction</name> - <key>iq_imbal_enb$(n)</key> - <value>""</value> - <type>raw</type> - <hide> - \#if not \$nchan() > $n - all - \#else - part - \#end if - </hide> - <tab>FE Corrections</tab> - </param> -#end if +PARAMS_TMPL = """ +- id: center_freq${n} + label: 'Ch${n}: Center Freq (Hz)' + category: RF Options + dtype: real + default: '0' + hide: ${'$'}{ 'none' if (nchan > ${n}) else 'all' } +- id: gain${n} + label: 'Ch${n}: Gain Value' + category: RF Options + dtype: float + default: '0' + hide: ${'$'}{ 'none' if nchan > ${n} else 'all' } +- id: norm_gain${n} + label: 'Ch${n}: Gain Type' + category: RF Options + dtype: bool + default: 'False' + options: ['False', 'True'] + option_labels: [Absolute (dB), Normalized] + hide: ${'$'}{ 'all' if nchan <= ${n} else ('none' if bool(eval('norm_gain' + str(n))) else 'part')} +- id: ant${n} + label: 'Ch${n}: Antenna' + category: RF Options + dtype: string +% if sourk == 'source': + options: [TX/RX, RX2, RX1] + option_labels: [TX/RX, RX2, RX1] +% else: + options: [TX/RX] + option_labels: [TX/RX] +% endif + hide: ${'$'}{ 'all' if not nchan > ${n} else ('none' if eval('ant' + str(n)) else 'part')} +- id: bw${n} + label: 'Ch${n}: Bandwidth (Hz)' + category: RF Options + dtype: real + default: '0' + hide: ${'$'}{ 'all' if not nchan > ${n} else ('none' if eval('bw' + str(n)) else 'part')} +% if sourk == 'source': +- id: lo_source${n} + label: 'Ch${n}: LO Source' + category: RF Options + dtype: string + default: internal + options: [internal, external, companion] + hide: ${'$'}{ 'all' if not nchan > ${n} else ('all' if hide_lo_controls else 'none')} +- id: lo_export + label: 'Ch${n}: LO Export' + category: RF Options + dtype: bool + default: 'False' + options: ['True', 'False'] + hide: ${'$'}{ 'all' if not nchan > ${n} else ('all' if hide_lo_controls else 'none')} +- id: dc_offs_enb${n} + label: 'Ch${n}: Enable DC Offset Correction' + category: FE Corrections + dtype: raw + default: '""' + hide: ${'$'}{ 'all' if not nchan > ${n} else 'part'} +- id: iq_imbal_enb${n} + label: 'Ch${n}: Enable IQ Imbalance Correction' + category: FE Corrections + dtype: raw + default: '""' + hide: ${'$'}{ 'all' if not nchan > ${n} else 'part'} +% endif """ SHOW_CMD_PORT_PARAM = """ - <param> - <name>Show Command Port</name> - <key>hide_cmd_port</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>False</key> - </option> - <option> - <name>No</name> - <key>True</key> - </option> - <tab>Advanced</tab> - </param> +- id: hide_cmd_port + label: Show Command Port + category: Advanced + dtype: enum + default: 'False' + options: ['False', 'True'] + option_labels: ['Yes', 'No'] + hide: part """ SHOW_LO_CONTROLS_PARAM = """ - <param> - <name>Show LO Controls</name> - <key>hide_lo_controls</key> - <value>True</value> - <type>bool</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>False</key> - </option> - <option> - <name>No</name> - <key>True</key> - </option> - <tab>Advanced</tab> - </param> +- id: hide_lo_controls + label: Show LO Controls + category: Advanced + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['Yes', 'No'] + hide: part """ -TSBTAG_PARAM = """ <param> - <name>TSB tag name</name> - <key>len_tag_name</key> - <value></value> - <type>string</type> - <hide>\#if len(str(\$len_tag_name())) then 'none' else 'part'#</hide> - </param>""" +TSBTAG_PARAM = """ +- id: len_tag_name + label: TSB tag name + dtype: string + hide: ${ 'none' if len(str(len_tag_name)) else 'part'} +""" TSBTAG_ARG = """ - #if $len_tag_name() - $len_tag_name, - #end if""" +${'%'} if len_tag_name(): +${'$'}{len_tag_name}, +${'%'} endif +""" def parse_tmpl(_tmpl, **kwargs): - from Cheetah import Template - return str(Template.Template(_tmpl, kwargs)) + from mako.template import Template + block_template = Template(_tmpl) + return str(block_template.render(**kwargs)) max_num_mboards = 8 max_num_channels = max_num_mboards*4 @@ -689,13 +364,13 @@ max_num_channels = max_num_mboards*4 if __name__ == '__main__': import sys for file in sys.argv[1:]: - if file.endswith ('source.xml'): + if file.endswith ('source.block.yml'): sourk = 'source' direction = 'out' - elif file.endswith ('sink.xml'): + elif file.endswith ('sink.block.yml'): sourk = 'sink' direction = 'in' - else: raise Exception('is %s a source or sink?'%file) + else: raise Exception('is % a source or sink?'%file) params = ''.join([parse_tmpl(PARAMS_TMPL, n=n, sourk=sourk) for n in range(max_num_channels)]) params += SHOW_CMD_PORT_PARAM @@ -704,6 +379,7 @@ if __name__ == '__main__': params += TSBTAG_PARAM lentag_arg = TSBTAG_ARG else: lentag_arg = '' + open(file, 'w').write(parse_tmpl(MAIN_TMPL, lentag_arg=lentag_arg, max_nchan=max_num_channels, diff --git a/gr-uhd/grc/uhd.tree.yml b/gr-uhd/grc/uhd.tree.yml new file mode 100644 index 0000000000..a4d140d779 --- /dev/null +++ b/gr-uhd/grc/uhd.tree.yml @@ -0,0 +1,5 @@ +'[Core]': +- UHD: + - uhd_usrp_source + - uhd_usrp_sink + - uhd_amsg_source diff --git a/gr-uhd/grc/uhd_amsg_source.block.yml b/gr-uhd/grc/uhd_amsg_source.block.yml new file mode 100644 index 0000000000..b07ab77913 --- /dev/null +++ b/gr-uhd/grc/uhd_amsg_source.block.yml @@ -0,0 +1,18 @@ +id: uhd_amsg_source +label: 'UHD: USRP Async Msg Source' + +parameters: +- id: dev_addr + label: Device Addr + dtype: string + hide: ${ 'none' if dev_addr else 'part' } + +outputs: +- domain: stream + dtype: msg + +templates: + imports: from gnuradio import uhd + make: uhd.amsg_source(device_addr=${dev_addr}, msgq=${id}_msgq_out) + +file_format: 1 diff --git a/gr-uhd/grc/uhd_amsg_source.xml b/gr-uhd/grc/uhd_amsg_source.xml deleted file mode 100644 index 78c9d7b58e..0000000000 --- a/gr-uhd/grc/uhd_amsg_source.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>UHD: USRP Async Msg Source</name> - <key>uhd_amsg_source</key> - <import>from gnuradio import uhd</import> - <make>uhd.amsg_source(device_addr=$dev_addr, msgq=$(id)_msgq_out)</make> - <param> - <name>Device Addr</name> - <key>dev_addr</key> - <value></value> - <type>string</type> - <hide> - #if $dev_addr() - none - #else - part - #end if - </hide> - </param> - <source> - <name>out</name> - <type>msg</type> - </source> -</block> diff --git a/gr-uhd/grc/uhd_block_tree.xml b/gr-uhd/grc/uhd_block_tree.xml deleted file mode 100644 index c598645526..0000000000 --- a/gr-uhd/grc/uhd_block_tree.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Block Tree for uhd blocks. -################################################### - --> -<cat> - <name>[Core]</name> <!-- Blank for Root Name --> - <cat> - <name>UHD</name> - <block>uhd_usrp_source</block> - <block>uhd_usrp_sink</block> - <block>uhd_amsg_source</block> - </cat> -</cat> diff --git a/grc/blocks/CMakeLists.txt b/grc/blocks/CMakeLists.txt index 2dbc7c6d0d..f5ec6dd214 100644 --- a/grc/blocks/CMakeLists.txt +++ b/grc/blocks/CMakeLists.txt @@ -21,40 +21,39 @@ include(GrPython) file(GLOB yml_files "*.yml") -file(GLOB xml_files "*.xml") -macro(REPLACE_IN_FILE _xml_block match replace) - set(xml_block_src "${CMAKE_CURRENT_SOURCE_DIR}/${_xml_block}") - set(xml_block "${CMAKE_CURRENT_BINARY_DIR}/${_xml_block}") +macro(REPLACE_IN_FILE _yml_block match replace) + set(yml_block_src "${CMAKE_CURRENT_SOURCE_DIR}/${_yml_block}") + set(yml_block "${CMAKE_CURRENT_BINARY_DIR}/${_yml_block}") - list(REMOVE_ITEM xml_files "${xml_block_src}") - file(READ "${xml_block_src}" xml_block_src_text) + list(REMOVE_ITEM yml_files "${yml_block_src}") + file(READ "${yml_block_src}" yml_block_src_text) string(REPLACE "${match}" "${replace}" - xml_block_text "${xml_block_src_text}") - file(WRITE "${xml_block}" "${xml_block_text}") + yml_block_text "${yml_block_src_text}") + file(WRITE "${yml_block}" "${yml_block_text}") - list(APPEND generated_xml_files "${xml_block}") + list(APPEND generated_yml_files "${yml_block}") endmacro() -macro(GEN_BLOCK_XML _generator _xml_block) +macro(GEN_BLOCK_YML _generator _yml_block) set(generator ${CMAKE_CURRENT_SOURCE_DIR}/${_generator}) - set(xml_block ${CMAKE_CURRENT_BINARY_DIR}/${_xml_block}) - list(APPEND generated_xml_files ${xml_block}) + set(yml_block ${CMAKE_CURRENT_BINARY_DIR}/${_yml_block}) + list(APPEND generated_yml_files ${yml_block}) add_custom_command( - DEPENDS ${generator} OUTPUT ${xml_block} - COMMAND ${PYTHON_EXECUTABLE} ${generator} ${xml_block} + DEPENDS ${generator} OUTPUT ${yml_block} + COMMAND ${PYTHON_EXECUTABLE} ${generator} ${yml_block} ) endmacro() -GEN_BLOCK_XML(variable_struct.xml.py variable_struct.xml) +GEN_BLOCK_YML(variable_struct.block.yml.py variable_struct.block.yml) if(DESIRED_QT_VERSION EQUAL 4) - REPLACE_IN_FILE(options.xml PyQt5 PyQt4) + REPLACE_IN_FILE(options.yml PyQt5 PyQt4) endif() -add_custom_target(grc_generated_xml ALL DEPENDS ${generated_xml_files}) +add_custom_target(grc_generated_yml ALL DEPENDS ${generated_yml_files}) install( - FILES ${yml_files} ${xml_files} ${generated_xml_files} + FILES ${yml_files} ${generated_yml_files} DESTINATION ${GRC_BLOCKS_DIR} ) diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml deleted file mode 100644 index 2a063f1f60..0000000000 --- a/grc/blocks/block_tree.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0"?> -<cat> - <name>[Core]</name> - <cat> - <name>Misc</name> - <block>pad_source</block> - <block>pad_sink</block> - <block>virtual_source</block> - <block>virtual_sink</block> - - <block>epy_module</block> - - <block>note</block> - <block>import</block> - </cat> - <cat> - <name>Variables</name> - <block>variable</block> - <block>variable_struct</block> - <block>variable_config</block> - <block>variable_function_probe</block> - <block>parameter</block> - </cat> -</cat> diff --git a/grc/blocks/grc.tree.yml b/grc/blocks/grc.tree.yml new file mode 100644 index 0000000000..c84a6dc478 --- /dev/null +++ b/grc/blocks/grc.tree.yml @@ -0,0 +1,15 @@ +'[Core]': +- Misc: + - pad_source + - pad_sink + - virtual_source + - virtual_sink + - epy_module + - note + - import +- Variables: + - variable + - variable_struct + - variable_config + - variable_function_probe + - parameter diff --git a/grc/blocks/import.block.yml b/grc/blocks/import.block.yml new file mode 100644 index 0000000000..2d36b7396d --- /dev/null +++ b/grc/blocks/import.block.yml @@ -0,0 +1,20 @@ +id: import_ +label: Import + +parameters: +- id: imports + label: Import + dtype: import + +templates: + imports: ${imports} + +documentation: |- + Import additional python modules into the namespace. + + Examples: + from gnuradio.filter import firdes + import math,cmath + from math import pi + +file_format: 1 diff --git a/grc/blocks/import.xml b/grc/blocks/import.xml deleted file mode 100644 index 58e99a2d01..0000000000 --- a/grc/blocks/import.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Import python modules into the namespace -################################################### - --> -<block> - <name>Import</name> - <key>import</key> - <import>$imports</import> - <make></make> - <param> - <name>Import</name> - <key>imports</key> - <value></value> - <type>import</type> - </param> - <doc> -Import additional python modules into the namespace. - -Examples: -from gnuradio.filter import firdes -import math,cmath -from math import pi - </doc> -</block> diff --git a/grc/blocks/note.block.yml b/grc/blocks/note.block.yml new file mode 100644 index 0000000000..3f21a75ceb --- /dev/null +++ b/grc/blocks/note.block.yml @@ -0,0 +1,9 @@ +id: note +label: Note + +parameters: +- id: note + label: Note + dtype: string + +file_format: 1 diff --git a/grc/blocks/note.xml b/grc/blocks/note.xml deleted file mode 100644 index db6687c033..0000000000 --- a/grc/blocks/note.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Note Block (dummy) -################################################### - --> -<block> - <name>Note</name> - <key>note</key> - <make></make> - <param> - <name>Note</name> - <key>note</key> - <value></value> - <type>string</type> - </param> -</block> diff --git a/grc/blocks/options.block.yml b/grc/blocks/options.block.yml new file mode 100644 index 0000000000..ab18f8ae5f --- /dev/null +++ b/grc/blocks/options.block.yml @@ -0,0 +1,146 @@ +id: options +label: Options + +parameters: +- id: title + label: Title + dtype: string + hide: ${ ('none' if title else 'part') } +- id: author + label: Author + dtype: string + hide: ${ ('none' if author else 'part') } +- id: description + label: Description + dtype: string + hide: ${ ('none' if description else 'part') } +- id: window_size + label: Canvas Size + dtype: int_vector + hide: part +- id: generate_options + label: Generate Options + dtype: enum + default: qt_gui + options: [qt_gui, bokeh_gui, no_gui, hb, hb_qt_gui] + option_labels: [QT GUI, Bokeh GUI, No GUI, Hier Block, Hier Block (QT GUI)] +- id: category + label: Category + dtype: string + default: '[GRC Hier Blocks]' + hide: ${ ('none' if generate_options.startswith('hb') else 'all') } +- id: run_options + label: Run Options + dtype: enum + default: prompt + options: [run, prompt] + option_labels: [Run to Completion, Prompt for Exit] + hide: ${ ('none' if generate_options == 'no_gui' else 'all') } +- id: placement + label: Widget Placement + dtype: int_vector + default: (0,0) + hide: ${ ('part' if generate_options == 'bokeh_gui' else 'all') } +- id: sizing_mode + label: Sizing Mode + dtype: enum + default: fixed + options: [fixed, stretch_both, scale_width, scale_height, scale_both] + option_labels: [Fixed, Stretch Both, Scale Width, Scale Height, Scale Both] + hide: ${ ('part' if generate_options == 'bokeh_gui' else 'all') } +- id: run + label: Run + dtype: bool + default: 'True' + options: ['True', 'False'] + option_labels: [Autostart, 'Off'] + hide: ${ ('all' if generate_options not in ('qt_gui', 'bokeh_gui') else ('part' + if run else 'none')) } +- id: max_nouts + label: Max Number of Output + dtype: int + default: '0' + hide: ${ ('all' if generate_options.startswith('hb') else ('none' if max_nouts + else 'part')) } +- id: realtime_scheduling + label: Realtime Scheduling + dtype: enum + options: ['', '1'] + option_labels: ['Off', 'On'] + hide: ${ ('all' if generate_options.startswith('hb') else ('none' if realtime_scheduling + else 'part')) } +- id: qt_qss_theme + label: QSS Theme + dtype: file_open + hide: ${ ('all' if generate_options != 'qt_gui' else ('none' if qt_qss_theme else + 'part')) } +- id: thread_safe_setters + label: Thread-safe setters + category: Advanced + dtype: enum + options: ['', '1'] + option_labels: ['Off', 'On'] + hide: part +- id: run_command + label: Run Command + category: Advanced + dtype: string + default: '{python} -u {filename}' + hide: ${ ('all' if generate_options.startswith('hb') else 'part') } +- id: hier_block_src_path + label: Hier Block Source Path + category: Advanced + dtype: string + default: '.:' + hide: part + +asserts: +- ${ not window_size or len(window_size) == 2 } +- ${ not window_size or 300 <= window_size[0] <= 4096 } +- ${ not window_size or 300 <= window_size[1] <= 4096 } +- ${ len(placement) == 4 or len(placement) == 2 } +- ${ all(i >= 0 for i in placement) } + +templates: + imports: |- + from gnuradio import gr + from gnuradio.filter import firdes + % if generate_options == 'qt_gui': + from PyQt5 import Qt + import sys + % endif + % if generate_options == 'bokeh_gui': + import time + import signal + import functools + from bokeh.client import push_session + from bokeh.plotting import curdoc + % endif + % if not generate_options.startswith('hb'): + from argparse import ArgumentParser + from gnuradio.eng_arg import eng_float, intx + from gnuradio import eng_notation + % endif + callbacks: + - 'if ${run}: self.start() + + else: self.stop(); self.wait()' + +documentation: |- + The options block sets special parameters for the flow graph. Only one option block is allowed per flow graph. + + Title, author, and description parameters are for identification purposes. + + The window size controls the dimensions of the flow graph editor. The window size (width, height) must be between (300, 300) and (4096, 4096). + + The generate options controls the type of code generated. Non-graphical flow graphs should avoid using graphical sinks or graphical variable controls. + + In a graphical application, run can be controlled by a variable to start and stop the flowgraph at runtime. + + The id of this block determines the name of the generated file and the name of the class. For example, an id of my_block will generate the file my_block.py and class my_block(gr.... + + The category parameter determines the placement of the block in the block selection window. The category only applies when creating hier blocks. To put hier blocks into the root category, enter / for the category. + + The Max Number of Output is the maximum number of output items allowed for any block in the flowgraph; to disable this set the max_nouts equal to 0.Use this to adjust the maximum latency a flowgraph can exhibit. + +file_format: 1 diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml deleted file mode 100644 index 21d1c9ddee..0000000000 --- a/grc/blocks/options.xml +++ /dev/null @@ -1,250 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Options Block: -## options for window size, -## and flow graph building. -################################################### - --> -<block> - <name>Options</name> - <key>options</key> - <import>from gnuradio import gr</import> - <import>from gnuradio.filter import firdes</import> - <import>#if $generate_options() == 'qt_gui' -from PyQt5 import Qt -import sys -#end if -#if $generate_options() == 'bokeh_gui' -import time -import signal -import functools -from bokeh.client import push_session -from bokeh.plotting import curdoc -#end if -#if not $generate_options().startswith('hb') -from argparse import ArgumentParser -from gnuradio.eng_arg import eng_float, intx -from gnuradio import eng_notation -#end if</import> - <make></make> - <callback>if $run: self.start() -else: self.stop(); self.wait()</callback> - <param> - <name>Title</name> - <key>title</key> - <value></value> - <type>string</type> - <hide>#if $title() then 'none' else 'part'#</hide> - </param> - <param> - <name>Author</name> - <key>author</key> - <value></value> - <type>string</type> - <hide>#if $author() then 'none' else 'part'#</hide> - </param> - <param> - <name>Description</name> - <key>description</key> - <value></value> - <type>string</type> - <hide>#if $description() then 'none' else 'part'#</hide> - </param> - <param> - <name>Canvas Size</name> - <key>window_size</key> - <value></value> - <type>int_vector</type> - <hide>part</hide> - </param> - <param> - <name>Generate Options</name> - <key>generate_options</key> - <value>qt_gui</value> - <type>enum</type> - <option> - <name>Bokeh GUI</name> - <key>bokeh_gui</key> - </option> - <option> - <name>QT GUI</name> - <key>qt_gui</key> - </option> - <option> - <name>No GUI</name> - <key>no_gui</key> - </option> - <option> - <name>Hier Block</name> - <key>hb</key> - </option> - <option> - <name>Hier Block (QT GUI)</name> - <key>hb_qt_gui</key> - </option> - </param> - <param> - <name>Category</name> - <key>category</key> - <value>[GRC Hier Blocks]</value> - <type>string</type> - <hide>#if $generate_options().startswith('hb') then 'none' else 'all'#</hide> - </param> - <param> - <name>Run Options</name> - <key>run_options</key> - <value>prompt</value> - <type>enum</type> - <hide>#if $generate_options() == 'no_gui' then 'none' else 'all'#</hide> - <option> - <name>Run to Completion</name> - <key>run</key> - </option> - <option> - <name>Prompt for Exit</name> - <key>prompt</key> - </option> - </param> - <param> - <name>Widget Placement</name> - <key>placement</key> - <value>(0,0)</value> - <type>int_vector</type> - <hide>#if $generate_options() == 'bokeh_gui' then 'part' else 'all'#</hide> - </param> - <param> - <name>Sizing Mode</name> - <key>sizing_mode</key> - <value>fixed</value> - <type>enum</type> - <hide>#if $generate_options() == 'bokeh_gui' then 'part' else 'all'#</hide> - <option> - <name>Fixed</name> - <key>fixed</key> - </option> - <option> - <name>Stretch Both</name> - <key>stretch_both</key> - </option> - <option> - <name>Scale Width</name> - <key>scale_width</key> - </option> - <option> - <name>Scale Height</name> - <key>scale_height</key> - </option> - <option> - <name>Scale Both</name> - <key>scale_both</key> - </option> - </param> - <param> - <name>Run</name> - <key>run</key> - <value>True</value> - <type>bool</type> - <hide>#if $generate_options() not in ('qt_gui', 'bokeh_gui') then 'all' else ('part' if $run() else 'none')#</hide> - <option> - <name>Autostart</name> - <key>True</key> - </option> - <option> - <name>Off</name> - <key>False</key> - </option> - </param> - <param> - <name>Max Number of Output</name> - <key>max_nouts</key> - <value>0</value> - <type>int</type> - <hide>#if $generate_options().startswith('hb') then 'all' else ('none' if $max_nouts() else 'part')#</hide> - </param> - <param> - <name>Realtime Scheduling</name> - <key>realtime_scheduling</key> - <value></value> - <type>enum</type> - <hide>#if $generate_options().startswith('hb') then 'all' else ('none' if $realtime_scheduling() else 'part')#</hide> - <option> - <name>Off</name> - <key></key> - </option> - <option> - <name>On</name> - <key>1</key> - </option> - </param> - <param> - <name>QSS Theme</name> - <key>qt_qss_theme</key> - <value></value> - <type>file_open</type> - <hide>#if $generate_options() != 'qt_gui' then 'all' else ('none' if $qt_qss_theme() else 'part')#</hide> - </param> - <param> - <name>Thread-safe setters</name> - <key>thread_safe_setters</key> - <value></value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Off</name> - <key></key> - </option> - <option> - <name>On</name> - <key>1</key> - </option> - <tab>Advanced</tab> - </param> - <param> - <name>Run Command</name> - <key>run_command</key> - <value>{python} -u {filename}</value> - <type>string</type> - <hide>#if $generate_options().startswith('hb') then 'all' else 'part'</hide> - <tab>Advanced</tab> - </param> - <param> - <name>Hier Block Source Path</name> - <key>hier_block_src_path</key> - <value>.:</value> - <type>string</type> - <hide>part</hide> - <tab>Advanced</tab> - </param> - <check>not $window_size or len($window_size) == 2</check> - <check>not $window_size or 300 <= $(window_size)[0] <= 4096</check> - <check>not $window_size or 300 <= $(window_size)[1] <= 4096</check> - <check>len($placement) == 4 or len($placement) == 2</check> - <check>all(i >= 0 for i in $(placement))</check> - <doc> -The options block sets special parameters for the flow graph. \ -Only one option block is allowed per flow graph. - -Title, author, and description parameters are for identification purposes. - -The window size controls the dimensions of the flow graph editor. \ -The window size (width, height) must be between (300, 300) and (4096, 4096). - -The generate options controls the type of code generated. \ -Non-graphical flow graphs should avoid using graphical sinks or graphical variable controls. - -In a graphical application, \ -run can be controlled by a variable to start and stop the flowgraph at runtime. - -The id of this block determines the name of the generated file and the name of the class. \ -For example, an id of my_block will generate the file my_block.py and class my_block(gr.... - -The category parameter determines the placement of the block in the block selection window. \ -The category only applies when creating hier blocks. \ -To put hier blocks into the root category, enter / for the category. - -The Max Number of Output is the maximum number of output items allowed for any block \ -in the flowgraph; to disable this set the max_nouts equal to 0.\ -Use this to adjust the maximum latency a flowgraph can exhibit. - </doc> -</block> diff --git a/grc/blocks/pad_sink.block.yml b/grc/blocks/pad_sink.block.yml new file mode 100644 index 0000000000..d304a998b4 --- /dev/null +++ b/grc/blocks/pad_sink.block.yml @@ -0,0 +1,51 @@ +id: pad_sink +label: Pad Sink + +parameters: +- id: label + label: Label + dtype: string + default: out +- id: type + label: Input Type + dtype: enum + options: [complex, float, int, short, byte, bit, message, ''] + option_labels: [Complex, Float, Int, Short, Byte, Bits, Message, Wildcard] + option_attributes: + size: [gr.sizeof_gr_complex, gr.sizeof_float, gr.sizeof_int, gr.sizeof_short, + gr.sizeof_char, gr.sizeof_char, '0', '0'] + hide: part +- id: vlen + label: Vec Length + dtype: int + default: '1' + hide: ${ 'part' if vlen == 1 else 'none' } +- id: num_streams + label: Num Streams + dtype: int + default: '1' + hide: part +- id: optional + label: Optional + dtype: bool + default: 'False' + options: ['True', 'False'] + option_labels: [Optional, Required] + hide: part + +inputs: +- domain: stream + dtype: ${ type } + vlen: ${ vlen } + multiplicity: ${ num_streams } + +asserts: +- ${ vlen > 0 } +- ${ num_streams > 0 } + +documentation: |- + The inputs of this block will become the outputs to this flow graph when it is instantiated as a hierarchical block. + + Pad sink will be ordered alphabetically by their ids. The first pad sink will have an index of 0. + +file_format: 1 diff --git a/grc/blocks/pad_sink.xml b/grc/blocks/pad_sink.xml deleted file mode 100644 index 8ea8871d2e..0000000000 --- a/grc/blocks/pad_sink.xml +++ /dev/null @@ -1,103 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Pad Sink: IO Pads -################################################### - --> -<block> - <name>Pad Sink</name> - <key>pad_sink</key> - <make></make> - <param> - <name>Label</name> - <key>label</key> - <value>out</value> - <type>string</type> - </param> - <param> - <name>Input Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>size:gr.sizeof_gr_complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>size:gr.sizeof_int</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>size:gr.sizeof_short</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - <option> - <name>Bits</name> - <key>bit</key> - <opt>size:gr.sizeof_char</opt> - </option> - <option> - <name>Message</name> - <key>message</key> - <opt>size:0</opt> - </option> - <option> - <name>Wildcard</name> - <key></key> - <opt>size:0</opt> - </option> - </param> - <param> - <name>Vec Length</name> - <key>vlen</key> - <value>1</value> - <type>int</type> - </param> - - <param> - <name>Num Streams</name> - <key>num_streams</key> - <value>1</value> - <type>int</type> - </param> - <param> - <name>Optional</name> - <key>optional</key> - <value>False</value> - <type>bool</type> - <hide>part</hide> - <option> - <name>Optional</name> - <key>True</key> - </option> - <option> - <name>Required</name> - <key>False</key> - </option> - </param> - <check>$vlen > 0</check> - <check>$num_streams > 0</check> - <sink> - <name>in</name> - <type>$type</type> - <vlen>$vlen</vlen> - <nports>$num_streams</nports> - </sink> - <doc> -The inputs of this block will become the outputs to this flow graph when it is instantiated as a hierarchical block. - -Pad sink will be ordered alphabetically by their ids. The first pad sink will have an index of 0. - </doc> -</block> diff --git a/grc/blocks/pad_source.block.yml b/grc/blocks/pad_source.block.yml new file mode 100644 index 0000000000..92f7a8b822 --- /dev/null +++ b/grc/blocks/pad_source.block.yml @@ -0,0 +1,51 @@ +id: pad_source +label: Pad Source + +parameters: +- id: label + label: Label + dtype: string + default: in +- id: type + label: Output Type + dtype: enum + options: [complex, float, int, short, byte, bit, message, ''] + option_labels: [Complex, Float, Int, Short, Byte, Bits, Message, Wildcard] + option_attributes: + size: [gr.sizeof_gr_complex, gr.sizeof_float, gr.sizeof_int, gr.sizeof_short, + gr.sizeof_char, gr.sizeof_char, '0', '0'] + hide: part +- id: vlen + label: Vec Length + dtype: int + default: '1' + hide: ${ 'part' if vlen == 1 else 'none' } +- id: num_streams + label: Num Streams + dtype: int + default: '1' + hide: part +- id: optional + label: Optional + dtype: bool + default: 'False' + options: ['True', 'False'] + option_labels: [Optional, Required] + hide: part + +outputs: +- domain: stream + dtype: ${ type } + vlen: ${ vlen } + multiplicity: ${ num_streams } + +asserts: +- ${ vlen > 0 } +- ${ num_streams > 0 } + +documentation: |- + The outputs of this block will become the inputs to this flow graph when it is instantiated as a hierarchical block. + + Pad sources will be ordered alphabetically by their ids. The first pad source will have an index of 0. + +file_format: 1 diff --git a/grc/blocks/pad_source.xml b/grc/blocks/pad_source.xml deleted file mode 100644 index 3d8ccbed6a..0000000000 --- a/grc/blocks/pad_source.xml +++ /dev/null @@ -1,104 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Pad Source: IO Pads -################################################### - --> -<block> - <name>Pad Source</name> - <key>pad_source</key> - <make></make> - <param> - <name>Label</name> - <key>label</key> - <value>in</value> - <type>string</type> - </param> - <param> - <name>Output Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>size:gr.sizeof_gr_complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>size:gr.sizeof_int</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>size:gr.sizeof_short</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - <option> - <name>Bits</name> - <key>bit</key> - <opt>size:gr.sizeof_char</opt> - </option> - <option> - <name>Message</name> - <key>message</key> - <opt>size:0</opt> - </option> - <option> - <name>Wildcard</name> - <key></key> - <opt>size:0</opt> - </option> - </param> - <param> - <name>Vec Length</name> - <key>vlen</key> - <value>1</value> - <type>int</type> - </param> - - <param> - <name>Num Streams</name> - <key>num_streams</key> - <value>1</value> - <type>int</type> - </param> - - <param> - <name>Optional</name> - <key>optional</key> - <value>False</value> - <type>bool</type> - <hide>part</hide> - <option> - <name>Optional</name> - <key>True</key> - </option> - <option> - <name>Required</name> - <key>False</key> - </option> - </param> - <check>$vlen > 0</check> - <check>$num_streams > 0</check> - <source> - <name>out</name> - <type>$type</type> - <vlen>$vlen</vlen> - <nports>$num_streams</nports> - </source> - <doc> -The outputs of this block will become the inputs to this flow graph when it is instantiated as a hierarchical block. - -Pad sources will be ordered alphabetically by their ids. The first pad source will have an index of 0. - </doc> -</block> diff --git a/grc/blocks/parameter.block.yml b/grc/blocks/parameter.block.yml new file mode 100644 index 0000000000..ac97c7d319 --- /dev/null +++ b/grc/blocks/parameter.block.yml @@ -0,0 +1,55 @@ +id: parameter +label: Parameter + +parameters: +- id: label + label: Label + dtype: string + hide: ${ ('none' if label else 'part') } +- id: value + label: Value + dtype: ${ type.type } + default: '0' +- id: type + label: Type + dtype: enum + options: ['', complex, eng_float, intx, long, str] + option_labels: [None, Complex, Float, Int, Long, String] + option_attributes: + type: [raw, complex, real, int, int, string] + hide: ${ ('none' if type else 'part') } +- id: short_id + label: Short ID + dtype: string + hide: ${ 'all' if not type else ('none' if short_id else 'part') } +- id: hide + label: Show + dtype: enum + options: [none, part] + option_labels: [Always, Only in Properties] + hide: part + +asserts: +- ${ len(short_id) in (0, 1) } +- ${ short_id == '' or short_id.isalpha() } + +templates: + var_make: self.${id} = ${id} + make: ${value} + +documentation: |- + This block represents a parameter to the flow graph. A parameter can be used to pass command line arguments into a top block. Or, parameters can pass arguments into an instantiated hierarchical block. + + The paramater value cannot depend on any variables. + + Leave the label blank to use the parameter id as the label. + + When type is not None, this parameter also becomes a command line option of the form: + + -[short_id] --[id] [value] + + The Short ID field may be left blank. + + To disable showing the parameter on the hierarchical block in GRC, use Only in Properties option in the Show field. + +file_format: 1 diff --git a/grc/blocks/parameter.xml b/grc/blocks/parameter.xml deleted file mode 100644 index f01527acb0..0000000000 --- a/grc/blocks/parameter.xml +++ /dev/null @@ -1,118 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Parameter block: a grc variable with key, value -################################################### - --> -<block> - <name>Parameter</name> - <key>parameter</key> - <var_make>self.$(id) = $(id)</var_make> - <make>$value</make> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Value</name> - <key>value</key> - <value>0</value> - <type>$type.type</type> - </param> - <param> - <name>Type</name> - <key>type</key> - <value></value> - <type>enum</type> - <hide>#if $type() then 'none' else 'part'#</hide> - <option> - <name>None</name> - <key></key> - <opt>type:raw</opt> - </option> - <option> - <name>Complex</name> - <key>complex</key> - <opt>type:complex</opt> - </option> - <option> - <name>Float</name> - <key>eng_float</key> - <opt>type:real</opt> - </option> - <option> - <name>Int</name> - <key>intx</key> - <opt>type:int</opt> - </option> - <option> - <name>Long</name> - <key>long</key> - <opt>type:int</opt> - </option> - <option> - <name>String</name> - <key>str</key> - <opt>type:string</opt> - </option> - <!-- Do not forget to add option value type handler import into - grc/python/flow_graph.tmpl for each new type. --> - <!-- not supported yet in tmpl - <option> - <name>Boolean</name> - <key>bool</key> - <opt>type:bool</opt> - </option> - --> - </param> - <param> - <name>Short ID</name> - <key>short_id</key> - <value></value> - <type>string</type> - <hide>#if not $type() -all#slurp -#elif $short_id() -none#slurp -#else -part#slurp -#end if</hide> - </param> - <param> - <name>Show</name> - <key>hide</key> - <value></value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Always</name> - <key>none</key> <!--## Do not hide the parameter value--> - </option> - <option> - <name>Only in Properties</name> - <key>part</key> <!--## Partially hide the parameter value--> - </option> - </param> - <check>len($short_id) in (0, 1)</check> - <check>$short_id == '' or $(short_id).isalpha()</check> - <doc> -This block represents a parameter to the flow graph. \ -A parameter can be used to pass command line arguments into a top block. \ -Or, parameters can pass arguments into an instantiated hierarchical block. - -The paramater value cannot depend on any variables. - -Leave the label blank to use the parameter id as the label. - -When type is not None, this parameter also becomes a command line option of the form: - --[short_id] --[id] [value] - -The Short ID field may be left blank. - -To disable showing the parameter on the hierarchical block in GRC, use Only in Properties option in the Show field. - </doc> -</block> diff --git a/grc/blocks/variable.block.yml b/grc/blocks/variable.block.yml new file mode 100644 index 0000000000..fa62dabe87 --- /dev/null +++ b/grc/blocks/variable.block.yml @@ -0,0 +1,19 @@ +id: variable +label: Variable + +parameters: +- id: value + label: Value + dtype: raw + default: '0' +value: ${ value } + +templates: + var_make: self.${id} = ${id} = ${value} + callbacks: + - self.set_${id}(${value}) + +documentation: |- + This block maps a value to a unique variable. This variable block has no graphical representation. + +file_format: 1 diff --git a/grc/blocks/variable.xml b/grc/blocks/variable.xml deleted file mode 100644 index afee0f5d4a..0000000000 --- a/grc/blocks/variable.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable block: a grc variable with key, value -################################################### - --> -<block> - <name>Variable</name> - <key>variable</key> - <var_make>self.$(id) = $(id) = $value</var_make> - <make></make> - <callback>self.set_$(id)($value)</callback> - <param> - <name>Value</name> - <key>value</key> - <value>0</value> - <type>raw</type> - </param> - <doc> -This block maps a value to a unique variable. \ -This variable block has no graphical representation. - </doc> -</block> diff --git a/grc/blocks/variable_config.block.yml b/grc/blocks/variable_config.block.yml new file mode 100644 index 0000000000..bb64ea2a8f --- /dev/null +++ b/grc/blocks/variable_config.block.yml @@ -0,0 +1,58 @@ +id: variable_config +label: Variable Config + +parameters: +- id: value + label: Default Value + dtype: ${ type } + default: '0' +- id: type + label: Type + dtype: enum + default: real + options: [real, int, bool, string] + option_labels: [Float, Int, Bool, String] + option_attributes: + get: [getfloat, getint, getboolean, get] +- id: config_file + label: Config File + dtype: file_open + default: default +- id: section + label: Section + dtype: string + default: main +- id: option + label: Option + dtype: string + default: key +- id: writeback + label: WriteBack + dtype: raw + default: None +value: ${ value } + +templates: + imports: import ConfigParser + var_make: 'self._${id}_config = ConfigParser.ConfigParser() + + self._${id}_config.read(${config_file}) + + try: ${id} = self._${id}_config.${type.get}(${section}, ${option}) + + except: ${id} = ${value} + + self.${id} = ${id}' + callbacks: + - self.set_${id}(${value}) + - "self._${id}_config = ConfigParser.ConfigParser()\nself._${id}_config.read(${config_file})\n\ + if not self._${id}_config.has_section(${section}):\n\tself._${id}_config.add_section(${section})\n\ + self._${id}_config.set(${section}, ${option}, str(${writeback}))\nself._${id}_config.write(open(${config_file},\ + \ 'w'))" + +documentation: |- + This block represents a variable that can be read from a config file. + + To save the value back into the config file: enter the name of another variable into the writeback param. When the other variable is changed at runtime, the config file will be re-written. + +file_format: 1 diff --git a/grc/blocks/variable_config.xml b/grc/blocks/variable_config.xml deleted file mode 100644 index 11bff9edc2..0000000000 --- a/grc/blocks/variable_config.xml +++ /dev/null @@ -1,88 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Config block: -## a variable that reads and writes to a config file -################################################### - --> -<block> - <name>Variable Config</name> - <key>variable_config</key> - <import>import ConfigParser</import> - <var_make>self._$(id)_config = ConfigParser.ConfigParser() -self._$(id)_config.read($config_file) -try: $(id) = self._$(id)_config.$(type.get)($section, $option) -except: $(id) = $value -self.$(id) = $(id)</var_make> - <make></make> - <callback>self.set_$(id)($value)</callback> - <callback>self._$(id)_config = ConfigParser.ConfigParser() -self._$(id)_config.read($config_file) -if not self._$(id)_config.has_section($section): - self._$(id)_config.add_section($section) -self._$(id)_config.set($section, $option, str($writeback)) -self._$(id)_config.write(open($config_file, 'w'))</callback> - <param> - <name>Default Value</name> - <key>value</key> - <value>0</value> - <type>$type</type> - </param> - <param> - <name>Type</name> - <key>type</key> - <value>real</value> - <type>enum</type> - <option> - <name>Float</name> - <key>real</key> - <opt>get:getfloat</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>get:getint</opt> - </option> - <option> - <name>Bool</name> - <key>bool</key> - <opt>get:getboolean</opt> - </option> - <option> - <name>String</name> - <key>string</key> - <opt>get:get</opt> - </option> - </param> - <param> - <name>Config File</name> - <key>config_file</key> - <value>default</value> - <type>file_open</type> - </param> - <param> - <name>Section</name> - <key>section</key> - <value>main</value> - <type>string</type> - </param> - <param> - <name>Option</name> - <key>option</key> - <value>key</value> - <type>string</type> - </param> - <param> - <name>WriteBack</name> - <key>writeback</key> - <value>None</value> - <type>raw</type> - </param> - <doc> -This block represents a variable that can be read from a config file. - -To save the value back into the config file: \ -enter the name of another variable into the writeback param. \ -When the other variable is changed at runtime, the config file will be re-written. - </doc> -</block> diff --git a/grc/blocks/variable_function_probe.block.yml b/grc/blocks/variable_function_probe.block.yml new file mode 100644 index 0000000000..702ab5d60e --- /dev/null +++ b/grc/blocks/variable_function_probe.block.yml @@ -0,0 +1,54 @@ +id: variable_function_probe +label: Function Probe + +parameters: +- id: block_id + label: Block ID + dtype: string + default: my_block_0 +- id: function_name + label: Function Name + dtype: string + default: get_number +- id: function_args + label: Function Args + dtype: string + hide: ${ ('none' if function_args else 'part') } +- id: poll_rate + label: Poll Rate (Hz) + dtype: real + default: '10' +- id: value + label: Initial Value + dtype: raw + default: '0' + hide: part +value: ${ value } + +templates: + imports: |- + import time + import threading + var_make: self.${id} = ${id} = ${value} + make: "\ndef _${id}_probe():\n while True:\n <% obj = 'self' + ('.'\ + \ + block_id if block_id else '') %>\n val = ${obj}.${function_name}(${function_args})\n\ + \ try:\n self.set_${id}(val)\n except AttributeError:\n\ + \ pass\n time.sleep(1.0 / (${poll_rate}))\n_${id}_thread\ + \ = threading.Thread(target=_${id}_probe)\n_${id}_thread.daemon = True\n_${id}_thread.start()\n\ + \ " + callbacks: + - self.set_${id}(${value}) + +documentation: |- + Periodically probe a function and set its value to this variable. + + Set the values for block ID, function name, and function args appropriately: Block ID should be the ID of another block in this flow graph. An empty Block ID references the flow graph itself. Function name should be the name of a class method on that block. Function args are the parameters passed into that function. For a function with no arguments, leave function args blank. When passing a string for the function arguments, quote the string literal: '"arg"'. + + The values will used literally, and generated into the following form: + self.block_id.function_name(function_args) + or, if the Block ID is empty, + self.function_name(function_args) + + To poll a stream for a level, use this with the probe signal block. + +file_format: 1 diff --git a/grc/blocks/variable_function_probe.xml b/grc/blocks/variable_function_probe.xml deleted file mode 100644 index 47c11b29fe..0000000000 --- a/grc/blocks/variable_function_probe.xml +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable function probe -################################################### - --> -<block> - <name>Function Probe</name> - <key>variable_function_probe</key> - <import>import time</import> - <import>import threading</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make> -def _$(id)_probe(): - while True: - #set $obj = 'self' + ('.' + $block_id() if $block_id() else '') - val = $(obj).$(function_name())($(function_args())) - try: - self.set_$(id)(val) - except AttributeError: - pass - time.sleep(1.0 / ($poll_rate)) -_$(id)_thread = threading.Thread(target=_$(id)_probe) -_$(id)_thread.daemon = True -_$(id)_thread.start() - </make> - <callback>self.set_$(id)($value)</callback> - <param> - <name>Block ID</name> - <key>block_id</key> - <value>my_block_0</value> - <type>string</type> - </param> - <param> - <name>Function Name</name> - <key>function_name</key> - <value>get_number</value> - <type>string</type> - </param> - <param> - <name>Function Args</name> - <key>function_args</key> - <value></value> - <type>string</type> - <hide>#if $function_args() then 'none' else 'part'#</hide> - </param> - <param> - <name>Poll Rate (Hz)</name> - <key>poll_rate</key> - <value>10</value> - <type>real</type> - </param> - <param> - <name>Initial Value</name> - <key>value</key> - <value>0</value> - <type>raw</type> - <hide>part</hide> - </param> - <doc> -Periodically probe a function and set its value to this variable. - -Set the values for block ID, function name, and function args appropriately: \ -Block ID should be the ID of another block in this flow graph. \ -An empty Block ID references the flow graph itself. \ -Function name should be the name of a class method on that block. \ -Function args are the parameters passed into that function. \ -For a function with no arguments, leave function args blank. \ -When passing a string for the function arguments, quote the string literal: '"arg"'. - -The values will used literally, and generated into the following form: - self.block_id.function_name(function_args) -or, if the Block ID is empty, - self.function_name(function_args) - -To poll a stream for a level, use this with the probe signal block. - </doc> -</block> diff --git a/grc/blocks/variable_struct.block.yml.py b/grc/blocks/variable_struct.block.yml.py new file mode 100644 index 0000000000..19b29982e7 --- /dev/null +++ b/grc/blocks/variable_struct.block.yml.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python + +MAX_NUM_FIELDS = 20 + +HEADER = """\ +id: variable_struct +label: Struct Variable + +parameters: +""" + +TEMPLATES = """\ + +templates: + imports: "def struct(data): return type('Struct', (object,), data)()" + var_make: |- + self.${{id}} = ${{id}} = struct({{ + % for i in range({0}): + <% + field = getVar('field' + str(i)) + %> + % if len(str(field)) > 2: + ${{field}}: getVar('value' + str(i)), + % endif + % endfor + }}) + var_value: |- + struct({{ + % for i in range({0}): + <% + field = getVar('field' + str(i)) + %> + % if len(str(field)) > 2: + ${{field}}: getVar('field' + str(i)), + % endif + % endfor + }}) +""" + +FIELD0 = """\ +- id: field0 + label: Field 0 + category: Fields + dtype: string + default: ${field0} + hide: part +""" + +FIELDS = """\ +- id: field{0} + label: Field {0} + category: Fields + dtype: string + hide: part +""" + +VALUES = """\ +- id: value{0} + label: ${{field{0}}} + dtype: raw + default: '0' + hide: ${{ 'none' if field{0} else 'all' }} +""" + +ASSERTS = """\ +- ${{ (str(field{0}) or "a")[0].isalpha() }} +- ${{ (str(field{0}) or "a").isalnum() }} +""" + +FOOTER = """\ + +documentation: |- + This is a simple struct/record like variable. + + Attribute/field names can be specified in the tab 'Fields'. + For each non-empty field a parameter with type raw is shown. + Value access via the dot operator, e.g. "variable_struct_0.field0" + +file_format: 1 +""" + + +def make_yml(num_fields): + return ''.join(( + HEADER.format(num_fields), + FIELD0, ''.join(FIELDS.format(i) for i in range(1, num_fields)), + ''.join(VALUES.format(i) for i in range(num_fields)), + 'value: ${value}\n\nasserts:\n', + ''.join(ASSERTS.format(i) for i in range(num_fields)), + ''.join(TEMPLATES.format(num_fields)), + FOOTER + )) + + +if __name__ == '__main__': + import sys + try: + filename = sys.argv[1] + except IndexError: + filename = __file__[:-3] + + data = make_yml(MAX_NUM_FIELDS) + + with open(filename, 'wb') as fp: + fp.write(data.encode()) diff --git a/grc/blocks/variable_struct.xml.py b/grc/blocks/variable_struct.xml.py deleted file mode 100644 index c0d3dac355..0000000000 --- a/grc/blocks/variable_struct.xml.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python - -MAX_NUM_FIELDS = 20 - -HEADER = """\ -<block> - <name>Struct Variable</name> - <key>variable_struct</key> - <import>def struct(data): return type('Struct', (object,), data)()</import> - <var_make>self.$id = $id = struct({{#slurp -#for $i in range({0}): -#set $field = $getVar('field' + str(i)) -#if len(str($field)) > 2 -$field: $getVar('value' + str(i)), #slurp -#end if -#end for -}})</var_make> - <var_value>struct({{#slurp -#for $i in range({0}): -#set $field = $getVar('field' + str(i)) -#if len(str($field)) > 2 -$field: $getVar('value' + str(i)), #slurp -#end if -#end for -}})</var_value> - <make></make> -""" - -FIELD0 = """\ - <param> - <name>Field 0</name> - <key>field0</key> - <value>field0</value> - <type>string</type> - <hide>part</hide> - <tab>Fields</tab> - </param> -""" - -FIELDS = """\ - <param> - <name>Field {0}</name> - <key>field{0}</key> - <value></value> - <type>string</type> - <hide>part</hide> - <tab>Fields</tab> - </param> -""" - -VALUES = """\ - <param> - <name>$field{0}()</name> - <key>value{0}</key> - <value>0</value> - <type>raw</type> - <hide>#if $field{0}() then 'none' else 'all'#</hide> - </param> -""" - -CHECKS = """\ - <check>($str($field{0}) or "a")[0].isalpha()</check> - <check>($str($field{0}) or "a").isalnum()</check> -""" - -FOOTER = """\ - <doc>This is a simple struct/record like variable. - -Attribute/field names can be specified in the tab 'Fields'. -For each non-empty field a parameter with type raw is shown. -Value access via the dot operator, e.g. "variable_struct_0.field0" - </doc> -</block> -""" - - -def make_xml(num_fields): - return ''.join(( - HEADER.format(num_fields), - FIELD0, ''.join(FIELDS.format(i) for i in range(1, num_fields)), - ''.join(VALUES.format(i) for i in range(num_fields)), - ''.join(CHECKS.format(i) for i in range(num_fields)), - FOOTER - )) - - -if __name__ == '__main__': - import sys - try: - filename = sys.argv[1] - except IndexError: - filename = __file__[:-3] - - data = make_xml(MAX_NUM_FIELDS) - - with open(filename, 'wb') as fp: - fp.write(data.encode()) diff --git a/grc/blocks/virtual_sink.block.yml b/grc/blocks/virtual_sink.block.yml new file mode 100644 index 0000000000..4a2fd0108e --- /dev/null +++ b/grc/blocks/virtual_sink.block.yml @@ -0,0 +1,13 @@ +id: virtual_sink +label: Virtual Sink + +parameters: +- id: stream_id + label: Stream ID + dtype: stream_id + +inputs: +- domain: stream + dtype: '' + +file_format: 1 diff --git a/grc/blocks/virtual_sink.xml b/grc/blocks/virtual_sink.xml deleted file mode 100644 index 35fb27e67c..0000000000 --- a/grc/blocks/virtual_sink.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Virtual Sink -################################################### - --> -<block> - <name>Virtual Sink</name> - <key>virtual_sink</key> - <make></make> - <param> - <name>Stream ID</name> - <key>stream_id</key> - <value></value> - <type>stream_id</type> - </param> - <sink> - <name>in</name> - <type></type> - </sink> -</block> diff --git a/grc/blocks/virtual_source.block.yml b/grc/blocks/virtual_source.block.yml new file mode 100644 index 0000000000..cec987702a --- /dev/null +++ b/grc/blocks/virtual_source.block.yml @@ -0,0 +1,13 @@ +id: virtual_source +label: Virtual Source + +parameters: +- id: stream_id + label: Stream ID + dtype: stream_id + +outputs: +- domain: stream + dtype: '' + +file_format: 1 diff --git a/grc/blocks/virtual_source.xml b/grc/blocks/virtual_source.xml deleted file mode 100644 index e0c7754492..0000000000 --- a/grc/blocks/virtual_source.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Virtual Source -################################################### - --> -<block> - <name>Virtual Source</name> - <key>virtual_source</key> - <make></make> - <param> - <name>Stream ID</name> - <key>stream_id</key> - <value></value> - <type>stream_id</type> - </param> - <source> - <name>out</name> - <type></type> - </source> -</block> diff --git a/grc/tests/resources/file1.block.yml b/grc/tests/resources/file1.block.yml new file mode 100644 index 0000000000..f486c89ea8 --- /dev/null +++ b/grc/tests/resources/file1.block.yml @@ -0,0 +1,38 @@ +id: block_key +label: testname + +parameters: +- id: vlen + label: Vec Length + category: test + dtype: int + default: '1' + hide: ${ 'part' if vlen == 1 else 'none' } +- id: out_type + label: Vec Length + dtype: string + default: complex + hide: part +- id: a + label: Alpha + dtype: ${ (out_type) } + default: '0' + +inputs: +- domain: stream + dtype: complex + vlen: ${ 2 * vlen } +- domain: message + id: in2 + +outputs: +- domain: stream + dtype: ${ out_type } + vlen: ${ vlen } +asserts: +- ${ vlen > 0 } + +templates: + make: blocks.complex_to_mag_squared(${vlen}) + +file_format: 1 diff --git a/grc/tests/resources/file1.xml b/grc/tests/resources/file1.xml deleted file mode 100644 index f03288b85d..0000000000 --- a/grc/tests/resources/file1.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0"?> -<!-- -Copyright 2014 Free Software Foundation, Inc. -This file is part of GNU Radio - -GNU Radio Companion is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2 of the License, or (at your -option) any later version. - -GNU Radio Companion is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ---> -<block> - <name>testname</name> - <key>block_key</key> - <make>blocks.complex_to_mag_squared($(vlen))</make> - <param> - <name>Vec Length</name> - <key>vlen</key> - <value>1</value> - <type>int</type> - <tab>test</tab> - </param> - <param> - <name>Vec Length</name> - <key>out_type</key> - <value>complex</value> - <type>string</type> - </param> - <param> - <name>Alpha</name> - <key>a</key> - <value>0</value> - <type>($out_type)</type> - </param> - <check>$vlen > 0</check> - <sink> - <name>in</name> - <type>complex</type> - <vlen>2 * $vlen</vlen> - </sink> - <sink> - <name>in2</name> - <type>message</type> - </sink> - <source> - <name>out</name> - <type>$out_type</type> - <vlen>$vlen</vlen> - </source> -</block> diff --git a/grc/tests/resources/file2.block.yml b/grc/tests/resources/file2.block.yml new file mode 100644 index 0000000000..459527260c --- /dev/null +++ b/grc/tests/resources/file2.block.yml @@ -0,0 +1,31 @@ +id: blocks_and_const_xx +label: And Const + +parameters: +- id: type + label: IO Type + dtype: enum + options: [int, short, byte] + option_attributes: + fcn: [ii, ss, bb] + hide: part +- id: const + label: Constant + dtype: int + default: '0' + +inputs: +- domain: stream + dtype: ${ type } + +outputs: +- domain: stream + dtype: ${ type } + +templates: + imports: from gnuradio import blocks + make: blocks.and_const_${type.fcn}(${const}) + callbacks: + - set_k(${const}) + +file_format: 1 diff --git a/grc/tests/resources/file2.xml b/grc/tests/resources/file2.xml deleted file mode 100644 index 1300c7f5a1..0000000000 --- a/grc/tests/resources/file2.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0"?> -<!-- -Copyright 2014 Free Software Foundation, Inc. -This file is part of GNU Radio - -GNU Radio Companion is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2 of the License, or (at your -option) any later version. - -GNU Radio Companion is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ---> -<!-- -################################################### -## And Const Block: -## all types, 1 output, 1 input & const -################################################### - --> -<block> - <name>And Const</name> - <key>blocks_and_const_xx</key> - <category>test</category> - <throttle>1</throttle> - <import>from gnuradio import blocks</import> - <make>blocks.and_const_$(type.fcn)($const)</make> - <callback>set_k($const)</callback> - <param> - <name>IO Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Int</name> - <key>int</key> - <opt>fcn:ii</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:ss</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>fcn:bb</opt> - </option> - </param> - <param> - <name>Constant</name> - <key>const</key> - <value>0</value> - <type>${type}</type> - <hide>#if $log then 'none' else 'part'#</hide> - </param> - <sink> - <name>in</name> - <type>$type</type> - </sink> - <source> - <name>out</name> - <type>$(type.fcn)</type> - </source> - <doc> -This block creates a variable check box. \ -Leave the label blank to use the variable id as the label. - -A check box selects between two values of similar type. \ -Te values do not necessarily need to be of boolean type. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/grc/tests/resources/file3.block.yml b/grc/tests/resources/file3.block.yml new file mode 100644 index 0000000000..e53515d134 --- /dev/null +++ b/grc/tests/resources/file3.block.yml @@ -0,0 +1,66 @@ +id: variable_qtgui_check_box +label: QT GUI Check Box + +parameters: +- id: label + label: Label + dtype: string + hide: ${ ('none' if label else 'part') } +- id: type + label: Type + dtype: enum + default: int + options: [real, int, string, bool, raw] + option_labels: [Float, Integer, String, Boolean, Any] + option_attributes: + conv: [float, int, str, bool, eval] + hide: part +- id: value + label: Default Value + dtype: ${ type } + default: 'True' +- id: 'true' + label: 'True' + dtype: ${ type } + default: 'True' +- id: 'false' + label: 'False' + dtype: ${ type } + default: 'False' +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +value: ${ value } + +asserts: +- ${value in (true, false)} + +templates: + imports: from PyQt4 import Qt + var_make: self.${id} = ${id} = ${value} + callbacks: + - self.set_${id}(${value}) + - self._${id}_callback(${id}) + make: |- + <% + win = '_%s_check_box'%id + if not label: + label = id + %> + ${win} = Qt.QCheckBox(${label}) + self._${id}_choices = {True: ${true}, False: ${false}} + self._${id}_choices_inv = dict((v,k) for k,v in self._${id}_choices.iteritems()) + self._${id}_callback = lambda i: Qt.QMetaObject.invokeMethod(${win}, "setChecked", Qt.Q_ARG("bool", self._${id}_choices_inv[i])) + self._${id}_callback(self.${id}) + ${win}.stateChanged.connect(lambda i: self.set_${id}(self._${id}_choices[bool(i)])) + ${gui_hint()(win)} + +documentation: |- + This block creates a variable check box. Leave the label blank to use the variable id as the label. + + A check box selects between two values of similar type. Te values do not necessarily need to be of boolean type. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/grc/tests/resources/file3.xml b/grc/tests/resources/file3.xml deleted file mode 100644 index 71753badb1..0000000000 --- a/grc/tests/resources/file3.xml +++ /dev/null @@ -1,100 +0,0 @@ -<?xml version="1.0"?> -<!-- -Copyright 2014 Free Software Foundation, Inc. -This file is part of GNU Radio - -GNU Radio Companion is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2 of the License, or (at your -option) any later version. - -GNU Radio Companion is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ---> -<!-- -################################################### -##Variable Check Box: -## a gui check box form -################################################### - --> -<block> - <name>QT GUI Check Box</name> - <key>variable_qtgui_check_box</key> - <import>from PyQt4 import Qt</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $win = '_%s_check_box'%$id -#if not $label() - #set $label = '"%s"'%$id -#end if -$win = Qt.QCheckBox($label) -self._$(id)_choices = {True: $true, False: $false} -self._$(id)_choices_inv = dict((v,k) for k,v in self._$(id)_choices.iteritems()) -self._$(id)_callback = lambda i: Qt.QMetaObject.invokeMethod($(win), "setChecked", Qt.Q_ARG("bool", self._$(id)_choices_inv[i])) -self._$(id)_callback(self.$id) -$(win).stateChanged.connect(lambda i: self.set_$(id)(self._$(id)_choices[bool(i)])) -$(gui_hint()($win))</make> - <callback>self.set_$(id)($value)</callback> - <callback>self._$(id)_callback($id)</callback> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Type</name> - <key>type</key> - <value>int</value> - <type>enum</type> - <hide>part</hide> - <option><name>Float</name><key>real</key><opt>conv:float</opt></option> - <option><name>Integer</name><key>int</key><opt>conv:int</opt></option> - <option><name>String</name><key>string</key><opt>conv:str</opt></option> - <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt></option> - <option><name>Any</name><key>raw</key><opt>conv:eval</opt></option> - </param> - <param> - <name>Default Value</name> - <key>value</key> - <value>True</value> - <type>$type</type> - </param> - <param> - <name>True</name> - <key>true</key> - <value>True</value> - <type>$type</type> - </param> - <param> - <name>False</name> - <key>false</key> - <value>False</value> - <type>$type</type> - </param> - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - <check>$value in ($true, $false)</check> - <doc> -This block creates a variable check box. \ -Leave the label blank to use the variable id as the label. - -A check box selects between two values of similar type. \ -Te values do not necessarily need to be of boolean type. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> -- cgit v1.2.3