|
@@ -44,47 +44,53 @@ blocks:
|
|
coordinate: [670, 313]
|
|
coordinate: [670, 313]
|
|
rotation: 0
|
|
rotation: 0
|
|
state: enabled
|
|
state: enabled
|
|
-- name: analog_sig_source_x_0
|
|
+- name: blocks_throttle_0
|
|
- id: analog_sig_source_x
|
|
+ id: blocks_throttle
|
|
parameters:
|
|
parameters:
|
|
affinity: ''
|
|
affinity: ''
|
|
alias: ''
|
|
alias: ''
|
|
- amp: '1'
|
|
|
|
comment: ''
|
|
comment: ''
|
|
- freq: '10'
|
|
+ ignoretag: 'True'
|
|
maxoutbuf: '0'
|
|
maxoutbuf: '0'
|
|
minoutbuf: '0'
|
|
minoutbuf: '0'
|
|
- offset: '0'
|
|
+ samples_per_second: sample_rate_hz
|
|
- phase: '0'
|
|
|
|
- samp_rate: sample_rate_hz
|
|
|
|
type: byte
|
|
type: byte
|
|
- waveform: analog.GR_SQR_WAVE
|
|
+ vlen: '1'
|
|
states:
|
|
states:
|
|
bus_sink: false
|
|
bus_sink: false
|
|
bus_source: false
|
|
bus_source: false
|
|
bus_structure: null
|
|
bus_structure: null
|
|
- coordinate: [70, 187]
|
|
+ coordinate: [649, 177]
|
|
rotation: 0
|
|
rotation: 0
|
|
- state: true
|
|
+ state: bypassed
|
|
-- name: blocks_throttle_0
|
|
+- name: message_generator_block
|
|
- id: blocks_throttle
|
|
+ id: epy_block
|
|
parameters:
|
|
parameters:
|
|
|
|
+ _source_code: "import json\nimport pathlib\n\nimport gnuradio.gr\nimport numpy\n\
|
|
|
|
+ \n\nclass MessageGeneratorBlock(gnuradio.gr.basic_block):\n def __init__(self):\n\
|
|
|
|
+ \ gnuradio.gr.basic_block.__init__(\n self, name=\"Message\
|
|
|
|
+ \ Generator\", in_sig=None, out_sig=[numpy.uint8]\n )\n # __file__\
|
|
|
|
+ \ is not available\n self._messages = json.loads(\n pathlib.Path().resolve().parent.joinpath(\"\
|
|
|
|
+ messages.json\").read_text()\n )\n\n def general_work(self, input_items,\
|
|
|
|
+ \ output_items) -> int:\n # pylint: disable=unused-argument\n \
|
|
|
|
+ \ message = self._messages[\"ON0\"] + [0] * 128\n if len(output_items[0])\
|
|
|
|
+ \ < len(message):\n print(\"output buffer too short\", len(output_items[0]))\n\
|
|
|
|
+ \ output_items[0][:] = 0\n return len(output_items[0])\n\
|
|
|
|
+ \ output_items[0][: len(message)] = message\n return len(message)\n"
|
|
affinity: ''
|
|
affinity: ''
|
|
alias: ''
|
|
alias: ''
|
|
comment: ''
|
|
comment: ''
|
|
- ignoretag: 'True'
|
|
|
|
maxoutbuf: '0'
|
|
maxoutbuf: '0'
|
|
minoutbuf: '0'
|
|
minoutbuf: '0'
|
|
- samples_per_second: sample_rate_hz
|
|
|
|
- type: byte
|
|
|
|
- vlen: '1'
|
|
|
|
states:
|
|
states:
|
|
|
|
+ _io_cache: ('Message Generator', 'MessageGeneratorBlock', [], [], [('0', 'byte',
|
|
|
|
+ 1)], '', [])
|
|
bus_sink: false
|
|
bus_sink: false
|
|
bus_source: false
|
|
bus_source: false
|
|
bus_structure: null
|
|
bus_structure: null
|
|
- coordinate: [649, 177]
|
|
+ coordinate: [286, 318]
|
|
rotation: 0
|
|
rotation: 0
|
|
- state: bypassed
|
|
+ state: true
|
|
- name: qtgui_time_raster_sink_x_0
|
|
- name: qtgui_time_raster_sink_x_0
|
|
id: qtgui_time_raster_sink_x
|
|
id: qtgui_time_raster_sink_x
|
|
parameters:
|
|
parameters:
|
|
@@ -199,9 +205,9 @@ blocks:
|
|
state: enabled
|
|
state: enabled
|
|
|
|
|
|
connections:
|
|
connections:
|
|
-- [analog_sig_source_x_0, '0', blocks_throttle_0, '0']
|
|
|
|
-- [analog_sig_source_x_0, '0', serial_sink_block, '0']
|
|
|
|
- [blocks_throttle_0, '0', qtgui_time_raster_sink_x_0, '0']
|
|
- [blocks_throttle_0, '0', qtgui_time_raster_sink_x_0, '0']
|
|
|
|
+- [message_generator_block, '0', blocks_throttle_0, '0']
|
|
|
|
+- [message_generator_block, '0', serial_sink_block, '0']
|
|
|
|
|
|
metadata:
|
|
metadata:
|
|
file_format: 1
|
|
file_format: 1
|