scope.grc 7.6 KB

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