scope.grc 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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: scope
  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: Arduino Voltmeter / Oscilloscope
  25. window_size: ''
  26. states:
  27. bus_sink: false
  28. bus_source: false
  29. bus_structure: null
  30. coordinate: [20, 20]
  31. rotation: 0
  32. state: enabled
  33. blocks:
  34. - name: sample_rate_hz
  35. id: variable
  36. parameters:
  37. comment: ''
  38. value: '1203.47'
  39. states:
  40. bus_sink: false
  41. bus_source: false
  42. bus_structure: null
  43. coordinate: [408, 37]
  44. rotation: 0
  45. state: enabled
  46. - name: blocks_message_debug_0
  47. id: blocks_message_debug
  48. parameters:
  49. affinity: ''
  50. alias: ''
  51. comment: ''
  52. states:
  53. bus_sink: false
  54. bus_source: false
  55. bus_structure: null
  56. coordinate: [1130, 378]
  57. rotation: 0
  58. state: true
  59. - name: blocks_probe_rate_0
  60. id: blocks_probe_rate
  61. parameters:
  62. affinity: ''
  63. alias: ''
  64. alpha: '0.15'
  65. comment: ''
  66. maxoutbuf: '0'
  67. minoutbuf: '0'
  68. mintime: '10000.0'
  69. type: byte
  70. vlen: '1'
  71. states:
  72. bus_sink: false
  73. bus_source: false
  74. bus_structure: null
  75. coordinate: [530, 342]
  76. rotation: 0
  77. state: true
  78. - name: blocks_uchar_to_float_0
  79. id: blocks_uchar_to_float
  80. parameters:
  81. affinity: ''
  82. alias: ''
  83. comment: ''
  84. maxoutbuf: '0'
  85. minoutbuf: '0'
  86. states:
  87. bus_sink: false
  88. bus_source: false
  89. bus_structure: null
  90. coordinate: [659, 234]
  91. rotation: 0
  92. state: true
  93. - name: qtgui_time_sink_x_0
  94. id: qtgui_time_sink_x
  95. parameters:
  96. affinity: ''
  97. alias: ''
  98. alpha1: '1.0'
  99. alpha10: '1.0'
  100. alpha2: '1.0'
  101. alpha3: '1.0'
  102. alpha4: '1.0'
  103. alpha5: '1.0'
  104. alpha6: '1.0'
  105. alpha7: '1.0'
  106. alpha8: '1.0'
  107. alpha9: '1.0'
  108. autoscale: 'False'
  109. axislabels: 'True'
  110. color1: blue
  111. color10: dark blue
  112. color2: red
  113. color3: green
  114. color4: black
  115. color5: cyan
  116. color6: magenta
  117. color7: yellow
  118. color8: dark red
  119. color9: dark green
  120. comment: ''
  121. ctrlpanel: 'False'
  122. entags: 'True'
  123. grid: 'False'
  124. gui_hint: ''
  125. label1: Signal 1
  126. label10: Signal 10
  127. label2: Signal 2
  128. label3: Signal 3
  129. label4: Signal 4
  130. label5: Signal 5
  131. label6: Signal 6
  132. label7: Signal 7
  133. label8: Signal 8
  134. label9: Signal 9
  135. legend: 'False'
  136. marker1: '-1'
  137. marker10: '-1'
  138. marker2: '-1'
  139. marker3: '-1'
  140. marker4: '-1'
  141. marker5: '-1'
  142. marker6: '-1'
  143. marker7: '-1'
  144. marker8: '-1'
  145. marker9: '-1'
  146. name: '""'
  147. nconnections: '1'
  148. size: int(sample_rate_hz*2)
  149. srate: sample_rate_hz
  150. stemplot: 'False'
  151. style1: '1'
  152. style10: '1'
  153. style2: '1'
  154. style3: '1'
  155. style4: '1'
  156. style5: '1'
  157. style6: '1'
  158. style7: '1'
  159. style8: '1'
  160. style9: '1'
  161. tr_chan: '0'
  162. tr_delay: '0'
  163. tr_level: '0.0'
  164. tr_mode: qtgui.TRIG_MODE_FREE
  165. tr_slope: qtgui.TRIG_SLOPE_POS
  166. tr_tag: '""'
  167. type: float
  168. update_time: '0.10'
  169. width1: '2'
  170. width10: '1'
  171. width2: '1'
  172. width3: '1'
  173. width4: '1'
  174. width5: '1'
  175. width6: '1'
  176. width7: '1'
  177. width8: '1'
  178. width9: '1'
  179. ylabel: Signal
  180. ymax: '1'
  181. ymin: '0'
  182. yunit: '""'
  183. states:
  184. bus_sink: false
  185. bus_source: false
  186. bus_structure: null
  187. coordinate: [959, 186]
  188. rotation: 0
  189. state: enabled
  190. - name: serial_source_block
  191. id: epy_block
  192. parameters:
  193. _source_code: "import gnuradio\nimport numpy\nimport serial\n\n\nclass SerialSourceBlock(gnuradio.gr.sync_block):\n\
  194. \ def __init__(\n self, port=\"/dev/ttyUSB0\", baud_rate=115200, buffer_max_length=10,\
  195. \ timeout=2\n ):\n gnuradio.gr.sync_block.__init__(\n self,\
  196. \ name=\"Serial Source Block\", in_sig=None, out_sig=[numpy.uint8]\n \
  197. \ )\n self._serial_port = serial.Serial(\n port=port, baudrate=baud_rate,\
  198. \ bytesize=serial.EIGHTBITS, timeout=timeout\n )\n self._buffer_max_length\
  199. \ = buffer_max_length\n\n def work(self, input_items, output_items):\n \
  200. \ # pylint: disable=unused-argument\n buffer = self._serial_port.read(\n\
  201. \ min(len(output_items[0]), self._buffer_max_length)\n )\n\
  202. \ output_items[0][: len(buffer)] = numpy.frombuffer(buffer, dtype=\"\
  203. u1\")\n assert output_items[0][: len(buffer)].max() <= 1, \"invalid value\"\
  204. \n return len(buffer)\n"
  205. affinity: ''
  206. alias: ''
  207. baud_rate: '115200'
  208. buffer_max_length: int(sample_rate_hz/4)
  209. comment: ''
  210. maxoutbuf: '0'
  211. minoutbuf: '0'
  212. port: '''/dev/ttyUSB0'''
  213. timeout: '2'
  214. states:
  215. _io_cache: ('Serial Source Block', 'SerialSourceBlock', [('port', "'/dev/ttyUSB0'"),
  216. ('baud_rate', '115200'), ('buffer_max_length', '10'), ('timeout', '2')], [],
  217. [('0', 'byte', 1)], '', [])
  218. bus_sink: false
  219. bus_source: false
  220. bus_structure: null
  221. coordinate: [28, 170]
  222. rotation: 0
  223. state: true
  224. connections:
  225. - [blocks_probe_rate_0, rate, blocks_message_debug_0, print]
  226. - [blocks_uchar_to_float_0, '0', qtgui_time_sink_x_0, '0']
  227. - [serial_source_block, '0', blocks_probe_rate_0, '0']
  228. - [serial_source_block, '0', blocks_uchar_to_float_0, '0']
  229. metadata:
  230. file_format: 1