plot.grc 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. options:
  2. parameters:
  3. author: ''
  4. category: '[GRC Hier Blocks]'
  5. cmake_opt: ''
  6. comment: ''
  7. copyright: ''
  8. description: ''
  9. gen_cmake: 'On'
  10. gen_linking: dynamic
  11. generate_options: qt_gui
  12. hier_block_src_path: '.:'
  13. id: plot
  14. max_nouts: '0'
  15. output_language: python
  16. placement: (0,0)
  17. qt_qss_theme: ''
  18. realtime_scheduling: ''
  19. run: 'True'
  20. run_command: '{python} -u {filename}'
  21. run_options: prompt
  22. sizing_mode: fixed
  23. thread_safe_setters: ''
  24. title: BAUMAX 13-26006/20 Xmas Tree Lights Remote Control Receiver
  25. window_size: ''
  26. states:
  27. bus_sink: false
  28. bus_source: false
  29. bus_structure: null
  30. coordinate: [40, 27]
  31. rotation: 0
  32. state: enabled
  33. blocks:
  34. - name: sample_rate_hz
  35. id: variable
  36. parameters:
  37. comment: ''
  38. value: '11678.3'
  39. states:
  40. bus_sink: false
  41. bus_source: false
  42. bus_structure: null
  43. coordinate: [485, 40]
  44. rotation: 0
  45. state: enabled
  46. - name: symbol_rate_hz
  47. id: variable
  48. parameters:
  49. comment: ''
  50. value: 1/0.0008361370370370364
  51. states:
  52. bus_sink: false
  53. bus_source: false
  54. bus_structure: null
  55. coordinate: [784, 41]
  56. rotation: 0
  57. state: true
  58. - name: blocks_message_debug_0
  59. id: blocks_message_debug
  60. parameters:
  61. affinity: ''
  62. alias: ''
  63. comment: ''
  64. states:
  65. bus_sink: false
  66. bus_source: false
  67. bus_structure: null
  68. coordinate: [1158, 622]
  69. rotation: 0
  70. state: true
  71. - name: blocks_probe_rate_0
  72. id: blocks_probe_rate
  73. parameters:
  74. affinity: ''
  75. alias: ''
  76. alpha: '0.15'
  77. comment: ''
  78. maxoutbuf: '0'
  79. minoutbuf: '0'
  80. mintime: '10000.0'
  81. type: byte
  82. vlen: '1'
  83. states:
  84. bus_sink: false
  85. bus_source: false
  86. bus_structure: null
  87. coordinate: [565, 586]
  88. rotation: 0
  89. state: true
  90. - name: blocks_uchar_to_float_0
  91. id: blocks_uchar_to_float
  92. parameters:
  93. affinity: ''
  94. alias: ''
  95. comment: ''
  96. maxoutbuf: '0'
  97. minoutbuf: '0'
  98. states:
  99. bus_sink: false
  100. bus_source: false
  101. bus_structure: null
  102. coordinate: [629, 408]
  103. rotation: 0
  104. state: enabled
  105. - name: digital_symbol_sync_xx_0
  106. id: digital_symbol_sync_xx
  107. parameters:
  108. affinity: ''
  109. alias: ''
  110. comment: ''
  111. constellation: digital.constellation_bpsk().base()
  112. damping: '1.0'
  113. loop_bw: '0.045'
  114. max_dev: '1.5'
  115. maxoutbuf: '0'
  116. minoutbuf: '0'
  117. nfilters: '128'
  118. osps: '1'
  119. pfb_mf_taps: '[]'
  120. resamp_type: digital.IR_MMSE_8TAP
  121. sps: sample_rate_hz * 0.0008361370370370364
  122. ted_gain: '1.0'
  123. ted_type: digital.TED_MUELLER_AND_MULLER
  124. type: ff
  125. states:
  126. bus_sink: false
  127. bus_source: false
  128. bus_structure: null
  129. coordinate: [893, 284]
  130. rotation: 0
  131. state: enabled
  132. - name: qtgui_time_raster_sink_x_0
  133. id: qtgui_time_raster_sink_x
  134. parameters:
  135. affinity: ''
  136. alias: ''
  137. alpha1: '1.0'
  138. alpha10: '1.0'
  139. alpha2: '1.0'
  140. alpha3: '1.0'
  141. alpha4: '1.0'
  142. alpha5: '1.0'
  143. alpha6: '1.0'
  144. alpha7: '1.0'
  145. alpha8: '1.0'
  146. alpha9: '1.0'
  147. axislabels: 'True'
  148. color1: '2'
  149. color10: '0'
  150. color2: '0'
  151. color3: '0'
  152. color4: '0'
  153. color5: '0'
  154. color6: '0'
  155. color7: '0'
  156. color8: '0'
  157. color9: '0'
  158. comment: ''
  159. grid: 'True'
  160. gui_hint: ''
  161. label1: ''
  162. label10: ''
  163. label2: ''
  164. label3: ''
  165. label4: ''
  166. label5: ''
  167. label6: ''
  168. label7: ''
  169. label8: ''
  170. label9: ''
  171. mult: '[]'
  172. name: '"Signal"'
  173. ncols: int(sample_rate_hz)
  174. nconnections: '1'
  175. nrows: '60'
  176. offset: '[]'
  177. samp_rate: sample_rate_hz
  178. type: byte
  179. update_time: '0.10'
  180. zmax: '1'
  181. zmin: '0'
  182. states:
  183. bus_sink: false
  184. bus_source: false
  185. bus_structure: null
  186. coordinate: [557, 186]
  187. rotation: 0
  188. state: enabled
  189. - name: qtgui_time_raster_sink_x_0_0
  190. id: qtgui_time_raster_sink_x
  191. parameters:
  192. affinity: ''
  193. alias: ''
  194. alpha1: '1.0'
  195. alpha10: '1.0'
  196. alpha2: '1.0'
  197. alpha3: '1.0'
  198. alpha4: '1.0'
  199. alpha5: '1.0'
  200. alpha6: '1.0'
  201. alpha7: '1.0'
  202. alpha8: '1.0'
  203. alpha9: '1.0'
  204. axislabels: 'True'
  205. color1: '2'
  206. color10: '0'
  207. color2: '0'
  208. color3: '0'
  209. color4: '0'
  210. color5: '0'
  211. color6: '0'
  212. color7: '0'
  213. color8: '0'
  214. color9: '0'
  215. comment: ''
  216. grid: 'True'
  217. gui_hint: ''
  218. label1: ''
  219. label10: ''
  220. label2: ''
  221. label3: ''
  222. label4: ''
  223. label5: ''
  224. label6: ''
  225. label7: ''
  226. label8: ''
  227. label9: ''
  228. mult: '[]'
  229. name: '"Data"'
  230. ncols: int(symbol_rate_hz)
  231. nconnections: '1'
  232. nrows: '60'
  233. offset: '[]'
  234. samp_rate: symbol_rate_hz
  235. type: float
  236. update_time: '0.10'
  237. zmax: '1'
  238. zmin: '0'
  239. states:
  240. bus_sink: false
  241. bus_source: false
  242. bus_structure: null
  243. coordinate: [1587, 296]
  244. rotation: 0
  245. state: enabled
  246. - name: serial_source_block
  247. id: epy_block
  248. parameters:
  249. _source_code: "import gnuradio\nimport numpy\nimport serial\n\n\nclass SerialSourceBlock(gnuradio.gr.sync_block):\n\
  250. \ def __init__(\n self,\n port=\"/dev/ttyUSB1\",\n baud_rate=115200,\n\
  251. \ buffer_max_length=10,\n timeout=2,\n invert=False,\n\
  252. \ ):\n # pylint: disable=too-many-arguments\n gnuradio.gr.sync_block.__init__(\n\
  253. \ self, name=\"Serial Source Block\", in_sig=None, out_sig=[numpy.uint8]\n\
  254. \ )\n self._serial_port = serial.Serial(\n port=port,\
  255. \ baudrate=baud_rate, bytesize=serial.EIGHTBITS, timeout=timeout\n )\n\
  256. \ # remove first bytes that may have unexpected values > 1, unclear why\n\
  257. \ # seen [0b110000000, 0] and [0, 0b11111110] so far\n self._serial_port.read(2)\n\
  258. \ self._buffer_max_length = buffer_max_length\n self._invert =\
  259. \ invert\n\n def work(self, input_items, output_items):\n # pylint:\
  260. \ disable=unused-argument\n buffer = self._serial_port.read(\n \
  261. \ min(len(output_items[0]), self._buffer_max_length)\n )\n \
  262. \ output_items[0][: len(buffer)] = numpy.frombuffer(buffer, dtype=\"u1\")\n\
  263. \ if output_items[0][: len(buffer)].max() > 1:\n raise ValueError(output_items[0][:\
  264. \ len(buffer)])\n if self._invert:\n output_items[0] ^= 1\n\
  265. \ return len(buffer)\n"
  266. affinity: ''
  267. alias: ''
  268. baud_rate: '115200'
  269. buffer_max_length: int(sample_rate_hz/4)
  270. comment: ''
  271. invert: 'True'
  272. maxoutbuf: '0'
  273. minoutbuf: '0'
  274. port: '''/dev/ttyUSB1'''
  275. timeout: '2'
  276. states:
  277. _io_cache: ('Serial Source Block', 'SerialSourceBlock', [('port', "'/dev/ttyUSB1'"),
  278. ('baud_rate', '115200'), ('buffer_max_length', '10'), ('timeout', '2'), ('invert',
  279. 'False')], [], [('0', 'byte', 1)], '', [])
  280. bus_sink: false
  281. bus_source: false
  282. bus_structure: null
  283. coordinate: [28, 170]
  284. rotation: 0
  285. state: true
  286. connections:
  287. - [blocks_probe_rate_0, rate, blocks_message_debug_0, print]
  288. - [blocks_uchar_to_float_0, '0', digital_symbol_sync_xx_0, '0']
  289. - [digital_symbol_sync_xx_0, '0', qtgui_time_raster_sink_x_0_0, '0']
  290. - [serial_source_block, '0', blocks_probe_rate_0, '0']
  291. - [serial_source_block, '0', blocks_uchar_to_float_0, '0']
  292. - [serial_source_block, '0', qtgui_time_raster_sink_x_0, '0']
  293. metadata:
  294. file_format: 1