scope.grc 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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: [9, 19]
  31. rotation: 0
  32. state: enabled
  33. blocks:
  34. - name: reference_voltage
  35. id: variable
  36. parameters:
  37. comment: ''
  38. value: '4.11'
  39. states:
  40. bus_sink: false
  41. bus_source: false
  42. bus_structure: null
  43. coordinate: [730, 64]
  44. rotation: 0
  45. state: true
  46. - name: sample_rate_hz
  47. id: variable
  48. parameters:
  49. comment: ''
  50. value: 1e6 / 2500
  51. states:
  52. bus_sink: false
  53. bus_source: false
  54. bus_structure: null
  55. coordinate: [437, 63]
  56. rotation: 0
  57. state: enabled
  58. - name: blocks_short_to_float_0
  59. id: blocks_short_to_float
  60. parameters:
  61. affinity: ''
  62. alias: ''
  63. comment: ''
  64. maxoutbuf: '0'
  65. minoutbuf: '0'
  66. scale: 1024 / reference_voltage
  67. vlen: '1'
  68. states:
  69. bus_sink: false
  70. bus_source: false
  71. bus_structure: null
  72. coordinate: [409, 253]
  73. rotation: 0
  74. state: true
  75. - name: epy_block_0
  76. id: epy_block
  77. parameters:
  78. _source_code: "import struct\nimport time\n\nimport gnuradio\nimport numpy\nimport\
  79. \ serial\n\n\nclass ArduinoAnalogReadings(gnuradio.gr.sync_block):\n def\
  80. \ __init__(self, port=\"/dev/ttyUSB0\", baud_rate=115200, timeout=2):\n \
  81. \ gnuradio.gr.sync_block.__init__(\n self, name=\"Arduino Analog\
  82. \ Readings\", in_sig=[], out_sig=[numpy.int16]\n )\n self._serial_port\
  83. \ = serial.Serial(port, baud_rate, timeout=timeout)\n self._readings_counter\
  84. \ = 0\n self._start_timestamp = None\n\n def work(self, input_items,\
  85. \ output_items):\n # pylint: disable=unused-argument\n if not\
  86. \ self._start_timestamp:\n self._start_timestamp = time.time()\n\
  87. \ output_items[0][0] = struct.unpack(\">H\", self._serial_port.read(2))[0]\n\
  88. \ self._readings_counter += 1\n if self._readings_counter % 1000\
  89. \ == 0:\n print(self._readings_counter / (time.time() - self._start_timestamp),\
  90. \ \"Hz\")\n return 1\n"
  91. affinity: ''
  92. alias: ''
  93. baud_rate: '115200'
  94. comment: ''
  95. maxoutbuf: '0'
  96. minoutbuf: '0'
  97. port: '''/dev/ttyUSB0'''
  98. timeout: '2'
  99. states:
  100. _io_cache: ('Arduino Analog Readings', 'ArduinoAnalogReadings', [('port', "'/dev/ttyUSB0'"),
  101. ('baud_rate', '115200'), ('timeout', '2')], [], [('0', 'short', 1)], '', [])
  102. bus_sink: false
  103. bus_source: false
  104. bus_structure: null
  105. coordinate: [22, 221]
  106. rotation: 0
  107. state: true
  108. - name: qtgui_freq_sink_x_0
  109. id: qtgui_freq_sink_x
  110. parameters:
  111. affinity: ''
  112. alias: ''
  113. alpha1: '1.0'
  114. alpha10: '1.0'
  115. alpha2: '1.0'
  116. alpha3: '1.0'
  117. alpha4: '1.0'
  118. alpha5: '1.0'
  119. alpha6: '1.0'
  120. alpha7: '1.0'
  121. alpha8: '1.0'
  122. alpha9: '1.0'
  123. autoscale: 'False'
  124. average: '1.0'
  125. axislabels: 'True'
  126. bw: sample_rate_hz
  127. color1: '"blue"'
  128. color10: '"dark blue"'
  129. color2: '"red"'
  130. color3: '"green"'
  131. color4: '"black"'
  132. color5: '"cyan"'
  133. color6: '"magenta"'
  134. color7: '"yellow"'
  135. color8: '"dark red"'
  136. color9: '"dark green"'
  137. comment: ''
  138. ctrlpanel: 'False'
  139. fc: '0'
  140. fftsize: '1024'
  141. freqhalf: 'True'
  142. grid: 'False'
  143. gui_hint: ''
  144. label: Relative Gain
  145. label1: ''
  146. label10: ''''''
  147. label2: ''''''
  148. label3: ''''''
  149. label4: ''''''
  150. label5: ''''''
  151. label6: ''''''
  152. label7: ''''''
  153. label8: ''''''
  154. label9: ''''''
  155. legend: 'False'
  156. maxoutbuf: '0'
  157. minoutbuf: '0'
  158. name: '""'
  159. nconnections: '1'
  160. showports: 'False'
  161. tr_chan: '0'
  162. tr_level: '0.0'
  163. tr_mode: qtgui.TRIG_MODE_FREE
  164. tr_tag: '""'
  165. type: float
  166. units: dB
  167. update_time: '0.10'
  168. width1: '2'
  169. width10: '1'
  170. width2: '1'
  171. width3: '1'
  172. width4: '1'
  173. width5: '1'
  174. width6: '1'
  175. width7: '1'
  176. width8: '1'
  177. width9: '1'
  178. wintype: firdes.WIN_BLACKMAN_hARRIS
  179. ymax: '10'
  180. ymin: '-140'
  181. states:
  182. bus_sink: false
  183. bus_source: false
  184. bus_structure: null
  185. coordinate: [768, 356]
  186. rotation: 0
  187. state: true
  188. - name: qtgui_time_sink_x_0
  189. id: qtgui_time_sink_x
  190. parameters:
  191. affinity: ''
  192. alias: ''
  193. alpha1: '1.0'
  194. alpha10: '1.0'
  195. alpha2: '1.0'
  196. alpha3: '1.0'
  197. alpha4: '1.0'
  198. alpha5: '1.0'
  199. alpha6: '1.0'
  200. alpha7: '1.0'
  201. alpha8: '1.0'
  202. alpha9: '1.0'
  203. autoscale: 'False'
  204. axislabels: 'True'
  205. color1: blue
  206. color10: dark blue
  207. color2: red
  208. color3: green
  209. color4: black
  210. color5: cyan
  211. color6: magenta
  212. color7: yellow
  213. color8: dark red
  214. color9: dark green
  215. comment: ''
  216. ctrlpanel: 'False'
  217. entags: 'True'
  218. grid: 'False'
  219. gui_hint: ''
  220. label1: Signal 1
  221. label10: Signal 10
  222. label2: Signal 2
  223. label3: Signal 3
  224. label4: Signal 4
  225. label5: Signal 5
  226. label6: Signal 6
  227. label7: Signal 7
  228. label8: Signal 8
  229. label9: Signal 9
  230. legend: 'False'
  231. marker1: '-1'
  232. marker10: '-1'
  233. marker2: '-1'
  234. marker3: '-1'
  235. marker4: '-1'
  236. marker5: '-1'
  237. marker6: '-1'
  238. marker7: '-1'
  239. marker8: '-1'
  240. marker9: '-1'
  241. name: '""'
  242. nconnections: '1'
  243. size: int(sample_rate_hz*2)
  244. srate: sample_rate_hz
  245. stemplot: 'False'
  246. style1: '1'
  247. style10: '1'
  248. style2: '1'
  249. style3: '1'
  250. style4: '1'
  251. style5: '1'
  252. style6: '1'
  253. style7: '1'
  254. style8: '1'
  255. style9: '1'
  256. tr_chan: '0'
  257. tr_delay: '0'
  258. tr_level: '0.0'
  259. tr_mode: qtgui.TRIG_MODE_FREE
  260. tr_slope: qtgui.TRIG_SLOPE_POS
  261. tr_tag: '""'
  262. type: float
  263. update_time: '0.10'
  264. width1: '2'
  265. width10: '1'
  266. width2: '1'
  267. width3: '1'
  268. width4: '1'
  269. width5: '1'
  270. width6: '1'
  271. width7: '1'
  272. width8: '1'
  273. width9: '1'
  274. ylabel: Voltage
  275. ymax: reference_voltage
  276. ymin: '0'
  277. yunit: '"V"'
  278. states:
  279. bus_sink: false
  280. bus_source: false
  281. bus_structure: null
  282. coordinate: [768, 221]
  283. rotation: 0
  284. state: true
  285. connections:
  286. - [blocks_short_to_float_0, '0', qtgui_freq_sink_x_0, '0']
  287. - [blocks_short_to_float_0, '0', qtgui_time_sink_x_0, '0']
  288. - [epy_block_0, '0', blocks_short_to_float_0, '0']
  289. metadata:
  290. file_format: 1