scope.grc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  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: 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: [457, 222]
  44. rotation: 0
  45. state: true
  46. - name: sample_rate_hz
  47. id: variable
  48. parameters:
  49. comment: ''
  50. value: '1044.4'
  51. states:
  52. bus_sink: false
  53. bus_source: false
  54. bus_structure: null
  55. coordinate: [58, 173]
  56. rotation: 0
  57. state: enabled
  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: [991, 817]
  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: short
  82. vlen: '1'
  83. states:
  84. bus_sink: false
  85. bus_source: false
  86. bus_structure: null
  87. coordinate: [391, 781]
  88. rotation: 0
  89. state: true
  90. - name: blocks_short_to_float_0
  91. id: blocks_short_to_float
  92. parameters:
  93. affinity: ''
  94. alias: ''
  95. comment: ''
  96. maxoutbuf: '0'
  97. minoutbuf: '0'
  98. scale: 1024 / reference_voltage
  99. vlen: '1'
  100. states:
  101. bus_sink: false
  102. bus_source: false
  103. bus_structure: null
  104. coordinate: [483, 324]
  105. rotation: 0
  106. state: true
  107. - name: qtgui_freq_sink_x_0
  108. id: qtgui_freq_sink_x
  109. parameters:
  110. affinity: ''
  111. alias: ''
  112. alpha1: '1.0'
  113. alpha10: '1.0'
  114. alpha2: '1.0'
  115. alpha3: '1.0'
  116. alpha4: '1.0'
  117. alpha5: '1.0'
  118. alpha6: '1.0'
  119. alpha7: '1.0'
  120. alpha8: '1.0'
  121. alpha9: '1.0'
  122. autoscale: 'False'
  123. average: '1.0'
  124. axislabels: 'True'
  125. bw: sample_rate_hz
  126. color1: '"blue"'
  127. color10: '"dark blue"'
  128. color2: '"red"'
  129. color3: '"green"'
  130. color4: '"black"'
  131. color5: '"cyan"'
  132. color6: '"magenta"'
  133. color7: '"yellow"'
  134. color8: '"dark red"'
  135. color9: '"dark green"'
  136. comment: ''
  137. ctrlpanel: 'False'
  138. fc: '0'
  139. fftsize: '1024'
  140. freqhalf: 'False'
  141. grid: 'False'
  142. gui_hint: ''
  143. label: Relative Gain
  144. label1: ''
  145. label10: ''''''
  146. label2: ''''''
  147. label3: ''''''
  148. label4: ''''''
  149. label5: ''''''
  150. label6: ''''''
  151. label7: ''''''
  152. label8: ''''''
  153. label9: ''''''
  154. legend: 'False'
  155. maxoutbuf: '0'
  156. minoutbuf: '0'
  157. name: '""'
  158. nconnections: '1'
  159. showports: 'False'
  160. tr_chan: '0'
  161. tr_level: '0.0'
  162. tr_mode: qtgui.TRIG_MODE_FREE
  163. tr_tag: '""'
  164. type: float
  165. units: dB
  166. update_time: '0.10'
  167. width1: '2'
  168. width10: '1'
  169. width2: '1'
  170. width3: '1'
  171. width4: '1'
  172. width5: '1'
  173. width6: '1'
  174. width7: '1'
  175. width8: '1'
  176. width9: '1'
  177. wintype: firdes.WIN_BLACKMAN_hARRIS
  178. ymax: '0'
  179. ymin: '-100'
  180. states:
  181. bus_sink: false
  182. bus_source: false
  183. bus_structure: null
  184. coordinate: [898, 435]
  185. rotation: 0
  186. state: enabled
  187. - name: qtgui_number_sink_0
  188. id: qtgui_number_sink
  189. parameters:
  190. affinity: ''
  191. alias: ''
  192. autoscale: 'False'
  193. avg: '0'
  194. color1: ("black", "black")
  195. color10: ("black", "black")
  196. color2: ("black", "black")
  197. color3: ("black", "black")
  198. color4: ("black", "black")
  199. color5: ("black", "black")
  200. color6: ("black", "black")
  201. color7: ("black", "black")
  202. color8: ("black", "black")
  203. color9: ("black", "black")
  204. comment: ''
  205. factor1: '1'
  206. factor10: '1'
  207. factor2: '1'
  208. factor3: '1'
  209. factor4: '1'
  210. factor5: '1'
  211. factor6: '1'
  212. factor7: '1'
  213. factor8: '1'
  214. factor9: '1'
  215. graph_type: qtgui.NUM_GRAPH_HORIZ
  216. gui_hint: ''
  217. label1: Voltage
  218. label10: ''
  219. label2: ''
  220. label3: ''
  221. label4: ''
  222. label5: ''
  223. label6: ''
  224. label7: ''
  225. label8: ''
  226. label9: ''
  227. max: reference_voltage
  228. min: '0'
  229. name: '""'
  230. nconnections: '1'
  231. type: float
  232. unit1: V
  233. unit10: ''
  234. unit2: ''
  235. unit3: ''
  236. unit4: ''
  237. unit5: ''
  238. unit6: ''
  239. unit7: ''
  240. unit8: ''
  241. unit9: ''
  242. update_time: '0.10'
  243. states:
  244. bus_sink: false
  245. bus_source: false
  246. bus_structure: null
  247. coordinate: [922, 150]
  248. rotation: 0
  249. state: enabled
  250. - name: qtgui_number_sink_0_0
  251. id: qtgui_number_sink
  252. parameters:
  253. affinity: ''
  254. alias: ''
  255. autoscale: 'False'
  256. avg: '0'
  257. color1: ("black", "black")
  258. color10: ("black", "black")
  259. color2: ("black", "black")
  260. color3: ("black", "black")
  261. color4: ("black", "black")
  262. color5: ("black", "black")
  263. color6: ("black", "black")
  264. color7: ("black", "black")
  265. color8: ("black", "black")
  266. color9: ("black", "black")
  267. comment: ''
  268. factor1: '1'
  269. factor10: '1'
  270. factor2: '1'
  271. factor3: '1'
  272. factor4: '1'
  273. factor5: '1'
  274. factor6: '1'
  275. factor7: '1'
  276. factor8: '1'
  277. factor9: '1'
  278. graph_type: qtgui.NUM_GRAPH_HORIZ
  279. gui_hint: ''
  280. label1: ''
  281. label10: ''
  282. label2: ''
  283. label3: ''
  284. label4: ''
  285. label5: ''
  286. label6: ''
  287. label7: ''
  288. label8: ''
  289. label9: ''
  290. max: '1024'
  291. min: '0'
  292. name: '"Arduino Reading"'
  293. nconnections: '1'
  294. type: short
  295. unit1: ''
  296. unit10: ''
  297. unit2: ''
  298. unit3: ''
  299. unit4: ''
  300. unit5: ''
  301. unit6: ''
  302. unit7: ''
  303. unit8: ''
  304. unit9: ''
  305. update_time: '0.10'
  306. states:
  307. bus_sink: false
  308. bus_source: false
  309. bus_structure: null
  310. coordinate: [452, 503]
  311. rotation: 0
  312. state: disabled
  313. - name: qtgui_time_sink_x_0
  314. id: qtgui_time_sink_x
  315. parameters:
  316. affinity: ''
  317. alias: ''
  318. alpha1: '1.0'
  319. alpha10: '1.0'
  320. alpha2: '1.0'
  321. alpha3: '1.0'
  322. alpha4: '1.0'
  323. alpha5: '1.0'
  324. alpha6: '1.0'
  325. alpha7: '1.0'
  326. alpha8: '1.0'
  327. alpha9: '1.0'
  328. autoscale: 'False'
  329. axislabels: 'True'
  330. color1: blue
  331. color10: dark blue
  332. color2: red
  333. color3: green
  334. color4: black
  335. color5: cyan
  336. color6: magenta
  337. color7: yellow
  338. color8: dark red
  339. color9: dark green
  340. comment: ''
  341. ctrlpanel: 'False'
  342. entags: 'True'
  343. grid: 'False'
  344. gui_hint: ''
  345. label1: Signal 1
  346. label10: Signal 10
  347. label2: Signal 2
  348. label3: Signal 3
  349. label4: Signal 4
  350. label5: Signal 5
  351. label6: Signal 6
  352. label7: Signal 7
  353. label8: Signal 8
  354. label9: Signal 9
  355. legend: 'False'
  356. marker1: '-1'
  357. marker10: '-1'
  358. marker2: '-1'
  359. marker3: '-1'
  360. marker4: '-1'
  361. marker5: '-1'
  362. marker6: '-1'
  363. marker7: '-1'
  364. marker8: '-1'
  365. marker9: '-1'
  366. name: '""'
  367. nconnections: '1'
  368. size: int(sample_rate_hz*2)
  369. srate: sample_rate_hz
  370. stemplot: 'False'
  371. style1: '1'
  372. style10: '1'
  373. style2: '1'
  374. style3: '1'
  375. style4: '1'
  376. style5: '1'
  377. style6: '1'
  378. style7: '1'
  379. style8: '1'
  380. style9: '1'
  381. tr_chan: '0'
  382. tr_delay: '0'
  383. tr_level: '0.0'
  384. tr_mode: qtgui.TRIG_MODE_FREE
  385. tr_slope: qtgui.TRIG_SLOPE_POS
  386. tr_tag: '""'
  387. type: float
  388. update_time: '0.10'
  389. width1: '2'
  390. width10: '1'
  391. width2: '1'
  392. width3: '1'
  393. width4: '1'
  394. width5: '1'
  395. width6: '1'
  396. width7: '1'
  397. width8: '1'
  398. width9: '1'
  399. ylabel: Voltage
  400. ymax: reference_voltage
  401. ymin: '0'
  402. yunit: '"V"'
  403. states:
  404. bus_sink: false
  405. bus_source: false
  406. bus_structure: null
  407. coordinate: [897, 292]
  408. rotation: 0
  409. state: enabled
  410. - name: serial_source_block
  411. id: epy_block
  412. parameters:
  413. _source_code: "import gnuradio\nimport numpy\nimport serial\n\n\nclass SerialSourceBlock(gnuradio.gr.sync_block):\n\
  414. \ def __init__(\n self, port=\"/dev/ttyUSB0\", baud_rate=115200, buffer_max_length=10,\
  415. \ timeout=2\n ):\n gnuradio.gr.sync_block.__init__(\n self,\
  416. \ name=\"Serial Source Block\", in_sig=None, out_sig=[numpy.int16]\n \
  417. \ )\n self._serial_port = serial.Serial(\n port=port, baudrate=baud_rate,\
  418. \ bytesize=serial.EIGHTBITS, timeout=timeout\n )\n self._buffer_max_length\
  419. \ = buffer_max_length\n\n def work(self, input_items, output_items):\n \
  420. \ # pylint: disable=unused-argument\n buffer = self._serial_port.read(\n\
  421. \ 2 * min(len(output_items[0]), self._buffer_max_length)\n \
  422. \ )\n assert len(buffer) % 2 == 0\n buffer_samples_count = len(buffer)\
  423. \ // 2\n output_items[0][:buffer_samples_count] = numpy.frombuffer(buffer,\
  424. \ dtype=\">u2\")\n assert output_items[0][:buffer_samples_count].max()\
  425. \ < 1024, \"lost sync?\"\n return buffer_samples_count\n"
  426. affinity: ''
  427. alias: ''
  428. baud_rate: '115200'
  429. buffer_max_length: int(sample_rate_hz/4)
  430. comment: ''
  431. maxoutbuf: '0'
  432. minoutbuf: '0'
  433. port: '''/dev/ttyUSB0'''
  434. timeout: '2'
  435. states:
  436. _io_cache: ('Serial Source Block', 'SerialSourceBlock', [('port', "'/dev/ttyUSB0'"),
  437. ('baud_rate', '115200'), ('buffer_max_length', '10'), ('timeout', '2')], [],
  438. [('0', 'short', 1)], '', [])
  439. bus_sink: false
  440. bus_source: false
  441. bus_structure: null
  442. coordinate: [15, 276]
  443. rotation: 0
  444. state: true
  445. connections:
  446. - [blocks_probe_rate_0, rate, blocks_message_debug_0, print]
  447. - [blocks_short_to_float_0, '0', qtgui_freq_sink_x_0, '0']
  448. - [blocks_short_to_float_0, '0', qtgui_number_sink_0, '0']
  449. - [blocks_short_to_float_0, '0', qtgui_time_sink_x_0, '0']
  450. - [serial_source_block, '0', blocks_probe_rate_0, '0']
  451. - [serial_source_block, '0', blocks_short_to_float_0, '0']
  452. - [serial_source_block, '0', qtgui_number_sink_0_0, '0']
  453. metadata:
  454. file_format: 1